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");
45 $bri->garbage_manager(TRUE);
46 if (($user = &get_user(&$bri, $sess, &$idx)) != FALSE) {
47 if ($user->stat == "table") {
48 header ("Location: table.php");
55 setcookie ("sess", "", time() - 3600);
58 else if (isset($name)) {
59 $bri->garbage_manager(TRUE);
61 if (($user = &add_user(&$bri, &$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 ($ACTION == "table") {
85 $tables .= '<table align="center" valign="center" border=1 cellpadding="12" cellspacing="0">';
86 for ($i = 0 ; $i < TABLES_N ; $i++) {
89 $tables .= '<td valign="top" align="center" class="room_td"><b>Tavolo '.$i.'</b><br><br>';
90 $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
91 $tables .= sprintf('<div class="proxhr" id="table_act%d"></div>', $i);
96 $tables .= '<tr><td colspan="4">';
97 $tables .= '<div class="room_ex_standup">';
98 $tables .= '<b>Giocatori in piedi</b><br><br>';
100 $tables .= sprintf('<div id="standup"></div>');
102 $tables .= '</td></tr>';
104 $tables .= '</table>';
108 if ($ACTION == 'login') {
113 <link rel="shortcut icon" href="img/brisk_ico.png">
114 <script type="text/javascript" src="dnd.js"></script>
115 <script type="text/javascript" src="dom-drag.js"></script>
116 <script type="text/javascript" src="commons.js"></script>
117 <script type="text/javascript" src="xhr.js"></script>
118 <script type="text/javascript" src="preload_img.js"></script>
119 <link rel="stylesheet" type="text/css" href="brisk.css">
122 <SCRIPT type="text/javascript">
123 window.onload = function() {
127 <img class="nobo" src="img/brisk_logo64.png">
128 <div style="text-align: center; font-size: 12px;">briscola chiamata in salsa ajax</div>
129 <div class="topmenu"><a href="/briskhome.php"><img class="nobo" src="img/brisk_homebutt.png"></a></div>
130 <?php echo "$body"; ?>
133 <div style="text-align: center;">
134 Digita il tuo nickname per accedere ai tavoli della briscola.<br><br>
135 <form method="post" action="">
136 <input id="nameid" name="name" type="text" maxlength="12" value="">
141 <div id="imgct"></div>
142 <div id="logz"></div>
143 <div id="sandbox"></div>
144 <div id="sandbox2"></div>
145 <div id="response"></div>
146 <div id="xhrstart"></div>
148 <div id="xhrlog"></div>
150 <div id="xhrdeltalog"></div>
155 else if ($ACTION == 'table') {
160 <link rel="shortcut icon" href="img/brisk_ico.png">
161 <script type="text/javascript" src="dnd.js"></script>
162 <script type="text/javascript" src="dom-drag.js"></script>
163 <script type="text/javascript" src="commons.js"></script>
164 <script type="text/javascript" src="xhr.js"></script>
165 <script type="text/javascript" src="preload_img.js"></script>
166 <link rel="stylesheet" type="text/css" href="brisk.css">
169 <SCRIPT type="text/javascript">
173 var gst = new globst();
176 var g_imgtot = g_preload_img_arr.length;
177 var myfrom = "index_php";
178 window.onload = function() {
179 // alert("INDEX START");
180 xhr_rd = createXMLHttpRequest();
181 sess = "<?php echo "$sess"; ?>";
183 setTimeout(xhr_rd_poll, 0, sess);
184 // alert("ARR LENGTH "+g_preload_img_arr.length);
185 setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
188 <img class="nobo" src="img/brisk_logo64.png">
189 <div style="text-align: center; font-size: 12px;">briscola chiamata in salsa ajax</div><br>
190 <div class="topmenu"><a href="/briskhome.php"><img class="nobo" src="img/brisk_homebutt.png"></a></div>
191 <!-- <div><input name="logout" value="Esco." onclick="act_logout();" type="button"></div> -->
192 <input name="sess" type="hidden" value="<?php echo "$user->sess"; ?>">
193 <?php echo "$tables"; ?>
196 <div id="txt" class="chatt"></div>
198 <!-- onchange="act_chatt();" -->
199 <table><tr><td><div id="myname" class="txtt"></div></td><td><input id="txt_in" type="text" size="80" maxlength="256" onkeypress="chatt_checksend(this,event);" class="txtt"></td></tr></table>
202 <div id="imgct"></div>
203 <div id="logz"></div>
204 <div id="sandbox"></div>
205 <div id="sandbox2"></div>
206 <div id="response"></div>
207 <div id="xhrstart"></div>
209 <div id="xhrlog"></div>
211 <div id="xhrdeltalog"></div>