5 * Copyright (C) 2006 matteo.nastasi@milug.org
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details. You should have received a
16 * copy of the GNU General Public License along with this program; if
17 * not, write to the Free Software Foundation, Inc, 59 Temple Place -
18 * Suite 330, Boston, MA 02111-1307, USA.
24 require_once("brisk.phh");
25 if (DEBUGGING == "local" && $_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
26 echo "Debugging time!";
30 log_load($sess, "LOAD: index.php");
34 GLOBAL $sess, $name, $BRISK_DEBUG;
39 if (isset($BRISK_DEBUG) == FALSE) {
45 if (validate_sess($sess)) {
46 $bri->garbage_manager(TRUE);
47 if (($user = &$bri->get_user($sess, &$idx)) != FALSE) {
48 if ($user->stat == "table") {
49 header ("Location: table.php");
57 if ($ACTION == "login" && isset($name)) {
58 $bri->garbage_manager(TRUE);
60 $name = substr($name, 0, 12);
61 if (($user = &$bri->add_user(&$sess, &$idx, $name)) != FALSE) {
64 // setcookie ("sess", "", time() + 180);
65 standup_update(&$bri,&$user);
67 if (save_data(&$bri) == FALSE) {
68 echo "ERRORE SALVATAGGIO\n";
75 $body .= '<div class="urgmsg"><b>Spiacenti, non ci sono più posti liberi. Riprova più tardi.</b></div>';
77 $body .= '<div class="urgmsg"><b>Il tuo nickname è già in uso.</b></div>';
84 if ($BRISK_DEBUG == "debugtable") {
87 else if ($BRISK_DEBUG == "debuglogin") {
91 if ($ACTION == "room") {
92 $tables .= '<table class="room_tab" align="center">';
93 for ($i = 0 ; $i < TABLES_N ; $i++) {
96 $tables .= '<td valign="top" align="center" class="room_td"><div class="room_div"><b>Tavolo '.$i.'</b><br><br>';
97 $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
98 $tables .= sprintf('<div class="table_act" id="table_act%d"></div>', $i);
99 $tables .= '</div></td>'."\n";
103 $tables .= '<tr><td colspan="4">';
104 $tables .= '<div class="room_ex_standup">';
105 $tables .= '<b>Giocatori in piedi</b><br><br>';
107 $tables .= sprintf('<div id="standup" class="room_standup"></div>');
108 $tables .= '<div id="esco" class="esco"></div>';
109 $tables .= '</td></tr>';
111 $tables .= '</table>';
114 $brisk_header = '<div class="container">
115 <!-- =========== header =========== -->
117 <img class="nobo" src="img/brisk_logo64.png">
118 briscola chiamata in salsa ajax<br><br>
121 <!-- =========== vertical menu =========== -->
122 <div class="topmenu">
123 <a target="_blank" href="/briskhome.php"><img class="nobo" src="img/brisk_homebutt.png"></a>
125 sponsored by:<br><br>
126 <a target="_blank" href="http://www.alternativeoutput.it"><img class="nobo" src="img/altout80x15.png"></a><br>
127 <a target="_blank" href="http://www.dynamica.it"><img class="nobo" src="img/dynamica.png"></a><br><br>
128 supported by:<br><br>
129 <a target="_blank" href="http://www.briscolachiamata.it"><img class="nobo" src="img/brichi.png"></a><br><br>
133 if ($ACTION == 'login') {
138 <link rel="shortcut icon" href="img/brisk_ico.png">
139 <script type="text/javascript" src="dnd.js"></script>
140 <script type="text/javascript" src="dom-drag.js"></script>
141 <script type="text/javascript" src="commons.js"></script>
142 <script type="text/javascript" src="xhr.js"></script>
143 <script type="text/javascript" src="preload_img.js"></script>
144 <link rel="stylesheet" type="text/css" href="room.css">
147 <SCRIPT type="text/javascript">
148 window.onload = function() {
153 echo "$brisk_header";
156 <!-- =========== tables =========== -->
158 <?php echo "$body"; ?>
161 <div style="text-align: center;">
163 Digita il tuo nickname per accedere ai tavoli della briscola.<br><br>
164 <form method="post" action="">
165 <input id="nameid" name="name" type="text" size="24" maxlength="12" value="">
171 <div id="imgct"></div>
172 <div id="logz"></div>
173 <div id="sandbox"></div>
174 <div id="sandbox2"></div>
175 <div id="response"></div>
176 <div id="xhrstart"></div>
178 <div id="xhrlog"></div>
180 <div id="xhrdeltalog"></div>
185 else if ($ACTION == 'room') {
190 <link rel="shortcut icon" href="img/brisk_ico.png">
191 <script type="text/javascript" src="dnd.js"></script>
192 <script type="text/javascript" src="dom-drag.js"></script>
193 <script type="text/javascript" src="commons.js"></script>
194 <script type="text/javascript" src="xhr.js"></script>
195 <script type="text/javascript" src="preload_img.js"></script>
196 <link rel="stylesheet" type="text/css" href="room.css">
199 <SCRIPT type="text/javascript">
203 var gst = new globst();
206 var g_imgtot = g_preload_img_arr.length;
207 var myfrom = "index_php";
208 window.onload = function() {
210 if ($BRISK_DEBUG == "debugtable") {
212 room_checkspace(12,8,50);
217 // alert("INDEX START");
218 xhr_rd = createXMLHttpRequest();
219 sess = "<?php echo "$sess"; ?>";
221 window.onunload = onunload_cb;
223 setTimeout(xhr_rd_poll, 0, sess);
224 // alert("ARR LENGTH "+g_preload_img_arr.length);
225 // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
234 echo "$brisk_header";
236 <!-- =========== tables =========== -->
238 <input name="sess" type="hidden" value="<?php echo "$user->sess"; ?>">
239 <?php echo "$tables"; ?>
242 <!-- =========== bottom =========== -->
245 <div id="txt" class="chatt">
247 <table><tr><td><div id="myname" class="txtt"></div></td><td><input id="txt_in" type="text" size="90" maxlength="256" onkeypress="chatt_checksend(this,event);" class="txtt"></td></tr></table>
249 <div id="heartbit"></div>
250 <div id="sandbox"></div>
251 <div id="imgct"></div>
252 <div id="logz"></div>
253 <div id="sandbox2"></div>
254 <div id="response"></div>
255 <div id="remark"></div>
256 <div id="xhrstart"></div>
257 <div id="xhrlog"></div>
258 <div id="xhrdeltalog"></div>