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.
22 require_once("brisk.phh");
23 if (DEBUGGING == "local" && $_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
24 echo "Debugging time!";
28 log_load($sess, "LOAD: index.php");
43 $bri->garbage_manager(TRUE);
44 if (($user = &get_user(&$bri, $sess, &$idx)) != FALSE) {
45 if ($user->stat == "table") {
46 header ("Location: table.php");
53 setcookie ("sess", "", time() - 3600);
56 else if (isset($name)) {
57 $bri->garbage_manager(TRUE);
59 if (($user = &add_user(&$bri, &$sess, &$idx, $name)) != FALSE) {
62 setcookie ("sess", "", time() + 180);
63 standup_update(&$bri,&$user);
65 if (save_data(&$bri) == FALSE) {
66 echo "ERRORE SALVATAGGIO\n";
73 $body .= '<div class="urgmsg"><b>Spiacenti, non ci sono più posti liberi. Riprova più tardi.</b></div>';
75 $body .= '<div class="urgmsg"><b>Il tuo nickname è già in uso.</b></div>';
82 if ($ACTION == "table") {
83 $tables .= '<table align="center" valign="center" border=1 cellpadding="12" cellspacing="0">';
84 for ($i = 0 ; $i < TABLES_N ; $i++) {
87 $tables .= '<td valign="top" align="center" class="room_td"><b>Tavolo '.$i.'</b><br><br>';
88 $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
89 $tables .= sprintf('<div class="proxhr" id="table_act%d"></div>', $i);
94 $tables .= '<tr><td colspan="4">';
95 $tables .= '<div class="room_ex_standup">';
96 $tables .= '<b>Giocatori in piedi</b><br><br>';
98 $tables .= sprintf('<div id="standup"></div>');
100 $tables .= '</td></tr>';
102 $tables .= '</table>';
106 if ($ACTION == 'login') {
111 <link rel="shortcut icon" href="img/brisk_ico.png">
112 <script type="text/javascript" src="dnd.js"></script>
113 <script type="text/javascript" src="dom-drag.js"></script>
114 <script type="text/javascript" src="commons.js"></script>
115 <script type="text/javascript" src="xhr.js"></script>
116 <script type="text/javascript" src="preload_img.js"></script>
117 <link rel="stylesheet" type="text/css" href="brisk.css">
120 <SCRIPT type="text/javascript">
121 window.onload = function() {
125 <img class="nobo" src="img/brisk_logo64.png">
126 <div style="text-align: center; font-size: 12px;">briscola chiamata in salsa ajax</div>
128 <?php echo "$body"; ?>
131 <div style="text-align: center;">
132 Digita il tuo nickname per accedere ai tavoli della briscola.<br><br>
133 <form method="post" action="">
134 <input id="nameid" name="name" type="text" maxlength="12" value="">
139 <div id="imgct"></div>
140 <div id="logz"></div>
141 <div id="sandbox"></div>
142 <div id="sandbox2"></div>
143 <div id="response"></div>
144 <div id="xhrstart"></div>
146 <div id="xhrlog"></div>
148 <div id="xhrdeltalog"></div>
153 else if ($ACTION == 'table') {
158 <link rel="shortcut icon" href="img/brisk_ico.png">
159 <script type="text/javascript" src="dnd.js"></script>
160 <script type="text/javascript" src="dom-drag.js"></script>
161 <script type="text/javascript" src="commons.js"></script>
162 <script type="text/javascript" src="xhr.js"></script>
163 <script type="text/javascript" src="preload_img.js"></script>
164 <link rel="stylesheet" type="text/css" href="brisk.css">
167 <SCRIPT type="text/javascript">
171 var gst = new globst();
174 var g_imgtot = g_preload_img_arr.length;
175 var myfrom = "index_php";
176 window.onload = function() {
177 // alert("INDEX START");
178 xhr_rd = createXMLHttpRequest();
179 sess = "<?php echo "$sess"; ?>";
181 setTimeout(xhr_rd_poll, 0, sess);
182 // alert("ARR LENGTH "+g_preload_img_arr.length);
183 setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
186 <img class="nobo" src="img/brisk_logo64.png">
187 <div style="text-align: center; font-size: 12px;">briscola chiamata in salsa ajax</div><br>
188 <!-- <div><input name="logout" value="Esco." onclick="act_logout();" type="button"></div> -->
189 <input name="sess" type="hidden" value="<?php echo "$user->sess"; ?>">
190 <?php echo "$tables"; ?>
193 <div id="txt" class="chatt"></div>
195 <table><tr><td><div id="myname" class="txtt"></div></td><td><input id="txt_in" type="text" size="80" maxlength="256" onchange="act_chatt();" class="txtt"></td></tr></table>
198 <div id="imgct"></div>
199 <div id="logz"></div>
200 <div id="sandbox"></div>
201 <div id="sandbox2"></div>
202 <div id="response"></div>
203 <div id="xhrstart"></div>
205 <div id="xhrlog"></div>
207 <div id="xhrdeltalog"></div>