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 $name = substr($name, 0, 12);
62 if (($user = &add_user(&$bri, &$sess, &$idx, $name)) != FALSE) {
65 setcookie ("sess", "", time() + 180);
66 standup_update(&$bri,&$user);
68 if (save_data(&$bri) == FALSE) {
69 echo "ERRORE SALVATAGGIO\n";
76 $body .= '<div class="urgmsg"><b>Spiacenti, non ci sono più posti liberi. Riprova più tardi.</b></div>';
78 $body .= '<div class="urgmsg"><b>Il tuo nickname è già in uso.</b></div>';
85 if ($ACTION == "table") {
86 $tables .= '<table align="center" valign="center" border=1 cellpadding="12" cellspacing="0">';
87 for ($i = 0 ; $i < TABLES_N ; $i++) {
90 $tables .= '<td valign="top" align="center" class="room_td"><b>Tavolo '.$i.'</b><br><br>';
91 $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
92 $tables .= sprintf('<div class="proxhr" id="table_act%d"></div>', $i);
97 $tables .= '<tr><td colspan="4">';
98 $tables .= '<div class="room_ex_standup">';
99 $tables .= '<b>Giocatori in piedi</b><br><br>';
101 $tables .= sprintf('<div id="standup"></div>');
103 $tables .= '</td></tr>';
105 $tables .= '</table>';
109 if ($ACTION == 'login') {
114 <link rel="shortcut icon" href="img/brisk_ico.png">
115 <script type="text/javascript" src="dnd.js"></script>
116 <script type="text/javascript" src="dom-drag.js"></script>
117 <script type="text/javascript" src="commons.js"></script>
118 <script type="text/javascript" src="xhr.js"></script>
119 <script type="text/javascript" src="preload_img.js"></script>
120 <link rel="stylesheet" type="text/css" href="brisk.css">
123 <SCRIPT type="text/javascript">
124 window.onload = function() {
128 <img class="nobo" src="img/brisk_logo64.png">
129 <div style="text-align: center; font-size: 12px;">briscola chiamata in salsa ajax</div>
130 <div class="topmenu"><a target="_blank" href="/briskhome.php"><img class="nobo" src="img/brisk_homebutt.png"></a></div>
131 <?php echo "$body"; ?>
134 <div style="text-align: center;">
136 Digita il tuo nickname per accedere ai tavoli della briscola.<br><br>
137 <form method="post" action="">
138 <input id="nameid" name="name" type="text" maxlength="12" value="">
143 <div id="imgct"></div>
144 <div id="logz"></div>
145 <div id="sandbox"></div>
146 <div id="sandbox2"></div>
147 <div id="response"></div>
148 <div id="xhrstart"></div>
150 <div id="xhrlog"></div>
152 <div id="xhrdeltalog"></div>
157 else if ($ACTION == 'table') {
162 <link rel="shortcut icon" href="img/brisk_ico.png">
163 <script type="text/javascript" src="dnd.js"></script>
164 <script type="text/javascript" src="dom-drag.js"></script>
165 <script type="text/javascript" src="commons.js"></script>
166 <script type="text/javascript" src="xhr.js"></script>
167 <script type="text/javascript" src="preload_img.js"></script>
168 <link rel="stylesheet" type="text/css" href="brisk.css">
171 <SCRIPT type="text/javascript">
175 var gst = new globst();
178 var g_imgtot = g_preload_img_arr.length;
179 var myfrom = "index_php";
180 window.onload = function() {
181 // alert("INDEX START");
182 xhr_rd = createXMLHttpRequest();
183 sess = "<?php echo "$sess"; ?>";
185 window.onunload = onunload_cb;
187 setTimeout(xhr_rd_poll, 0, sess);
188 // alert("ARR LENGTH "+g_preload_img_arr.length);
189 setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
193 <img class="nobo" src="img/brisk_logo64.png">
194 <div style="text-align: center; font-size: 12px;">briscola chiamata in salsa ajax</div><br>
195 <div class="topmenu"><a target="_blank" href="/briskhome.php"><img class="nobo" src="img/brisk_homebutt.png"></a></div>
196 <!-- <div><input name="logout" value="Esco." onclick="window.onunload = null; act_logout();" type="button"></div> -->
197 <input name="sess" type="hidden" value="<?php echo "$user->sess"; ?>">
198 <?php echo "$tables"; ?>
201 <div id="txt" class="chatt"></div>
203 <!-- onchange="act_chatt();" -->
204 <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>
207 <div id="heartbit"></div>
209 <div id="imgct"></div>
210 <div id="logz"></div>
211 <div id="sandbox"></div>
212 <div id="sandbox2"></div>
213 <div id="response"></div>
214 <div id="remark"></div>
215 <div id="xhrstart"></div>
217 <div id="xhrlog"></div>
219 <div id="xhrdeltalog"></div>