reduced log
[brisk.git] / web / briskin5 / index.php
1 <?php
2 /*
3  *  brisk - briskin5/index.php
4  *
5  *  Copyright (C) 2006-2012 Matteo Nastasi
6  *                          mailto: nastasi@alternativeoutput.it 
7  *                                  matteo.nastasi@milug.org
8  *                          web: http://www.alternativeoutput.it
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * General Public License for more details. You should have received a
19  * copy of the GNU General Public License along with this program; if
20  * not, write to the Free Software Foundation, Inc, 59 Temple Place -
21  * Suite 330, Boston, MA 02111-1307, USA.
22  *
23  */
24
25 /* MLANG: le img dell'asta */
26
27 $G_base = "../";
28
29 require_once("../Obj/brisk.phh");
30 require_once("Obj/briskin5.phh");
31
32 $mlang_bin5_index = array( 'aucwin' => array( 'it' => 'Hai vinto l\'asta.<br> Scegli il seme:',
33                                               'en' => 'You win the auction.<br> Choose the seed:' ),
34                            'tit_info'    => array( 'it' => 'Info',
35                                                    'en' => 'Info'),
36                            'tit_relo'    => array( 'it' => 'Reload',
37                                                    'en' => 'Reload'),
38                            'tit_out'     => array( 'it' => 'Fuori',
39                                                    'en' => 'Out'),
40                            'tit_pref'    => array( 'it' => 'Prefs',
41                                                    'en' => 'Prefs'),
42                            'itm_ringauc' => array('it' => 'riproduci un suono di notifica alla fine dell\' asta',
43                                                   'en' => 'play a sound at the end of the auction'),
44                            'btn_update'  => array('it' => 'Aggiorna.',
45                                                   'en' => 'Update.' )
46                            );
47
48
49 function bin5_index_main($transp_type, $header, &$header_out, $addr, $get, $post, $cookie)
50 {
51     GLOBAL $G_lang, $mlang_bin5_index;
52
53     $transp_port = ((array_key_exists("X-Forwarded-Proto", $header) &&
54                      $header["X-Forwarded-Proto"] == "https") ? 443 : 80);
55
56     if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
57         unset ($table_idx);
58     if (($laststate = gpcs_var('laststate', $get, $post, $cookie)) === FALSE)
59         unset ($laststate);
60     if (($sess = gpcs_var('sess', $get, $post, $cookie)) === FALSE)
61         unset ($sess);
62
63 // header('Content-type: text/html; charset="utf-8"',true);
64     ?>
65 <html>
66 <head>
67 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
68 <title>Brisk - Tavolo <?php echo "$table_idx";?></title>
69 <link rel="shortcut icon" href="../img/brisk_ico.png">
70 <script type="text/javascript" src="../commons.js"></script> 
71 <script type="text/javascript" src="../heartbit.js"></script>
72 <script type="text/javascript" src="../xynt-streaming.js"></script>
73 <script type="text/javascript" src="dnd.js"></script>
74 <script type="text/javascript" src="dom-drag.js"></script>
75 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js"></script>
76 <script type="text/javascript" src="briskin5.js"></script>
77 <link rel="stylesheet" type="text/css" href="../brisk.css">
78 <link rel="stylesheet" type="text/css" href="briskin5.css">
79 </head>
80 <body>
81 <SCRIPT type="text/javascript">
82    var sess = "not_connected";
83    var xstm = null;
84    var g_lang = "<?php echo "$G_lang"; ?>";
85    var stat = "table";
86    var subst = "none";
87    var table_pos = "";
88    var g_jukebox = null;
89
90    var asta_ptr;
91    var area_ptr;
92
93    var gst  = new globst();
94    gst.st = <?php 
95    log_load("bin5/index.php");
96
97    if (isset($laststate) == false) {
98        $laststate = -1;
99    }
100    echo $laststate;
101    ?>;
102 var g_is_spawn=1;
103 // var g_table_idx=<?php echo "$table_idx";?>;
104
105 var g_imgct= 0;
106 var g_imgtot = g_preload_img_arr.length;
107 var g_exitlock = 0;
108
109 window.onload = function() {
110   g_jukebox = new jukebox([{'name': 'cow', 'file': 'cow.mp3'},
111                            {'name': 'rooster', 'file': 'rooster.mp3'},
112                            {'name': 'ringbell', 'file': 'ringbell.mp3'}]);
113   remark_off();
114
115   preferences_init();
116   preferences_update();
117
118   sess = "<?php echo "$sess"; ?>";
119   xstm = new xynt_streaming(window, <?php printf("\"%s\", %d", $transp_type, $transp_port); ?>,  2, null /* console */, gst, 'table_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
120   xstm.hbit_set(heartbit);
121   
122   window.onbeforeunload = onbeforeunload_cb;  
123   window.onunload = onunload_cb;  
124
125   xstm.start();
126
127   addEvent($('select_rules'), "change", function() { act_select_rules(this.value); } );
128   // FIXME: add this setTimeout(preload_images into data stream to avoid
129   // race on opened socket
130   // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
131 }
132 </SCRIPT>
133 <div id="bg" class="area">
134
135 <div id="remark" class="remark0"></div>
136 <img id="card0" src="img/00.png" class="card">
137 <img id="card1" src="img/01.png" class="card">
138 <img id="card2" src="img/02.png" class="card">
139 <img id="card3" src="img/03.png" class="card">
140 <img id="card4" src="img/04.png" class="card">
141 <img id="card5" src="img/05.png" class="card">
142 <img id="card6" src="img/06.png" class="card">
143 <img id="card7" src="img/07.png" class="card">
144 <img id="takes" src="img/cover.png" class="cover">
145 <img id="card_ne0" src="img/cover.png" class="cover">
146 <img id="card_ne1" src="img/cover.png" class="cover">
147 <img id="card_ne2" src="img/cover.png" class="cover">
148 <img id="card_ne3" src="img/cover.png" class="cover">
149 <img id="card_ne4" src="img/cover.png" class="cover">
150 <img id="card_ne5" src="img/cover.png" class="cover">
151 <img id="card_ne6" src="img/cover.png" class="cover">
152 <img id="card_ne7" src="img/cover.png" class="cover">
153 <img id="takes_ne" src="img/cover.png" class="cover">
154 <img id="card_nw0" src="img/cover.png" class="cover">
155 <img id="card_nw1" src="img/cover.png" class="cover">
156 <img id="card_nw2" src="img/cover.png" class="cover">
157 <img id="card_nw3" src="img/cover.png" class="cover">
158 <img id="card_nw4" src="img/cover.png" class="cover">
159 <img id="card_nw5" src="img/cover.png" class="cover">
160 <img id="card_nw6" src="img/cover.png" class="cover">
161 <img id="card_nw7" src="img/cover.png" class="cover">
162 <img id="takes_nw" src="img/cover.png" class="cover">
163 <img id="card_ea0" src="img/cover_ea.png" class="cover">
164 <img id="card_ea1" src="img/cover_ea.png" class="cover">
165 <img id="card_ea2" src="img/cover_ea.png" class="cover">
166 <img id="card_ea3" src="img/cover_ea.png" class="cover">
167 <img id="card_ea4" src="img/cover_ea.png" class="cover">
168 <img id="card_ea5" src="img/cover_ea.png" class="cover">
169 <img id="card_ea6" src="img/cover_ea.png" class="cover">
170 <img id="card_ea7" src="img/cover_ea.png" class="cover">
171 <img id="takes_ea" src="img/cover_ea.png" class="cover">
172 <img id="card_we0" src="img/cover_we.png" class="cover">
173 <img id="card_we1" src="img/cover_we.png" class="cover">
174 <img id="card_we2" src="img/cover_we.png" class="cover">
175 <img id="card_we3" src="img/cover_we.png" class="cover">
176 <img id="card_we4" src="img/cover_we.png" class="cover">
177 <img id="card_we5" src="img/cover_we.png" class="cover">
178 <img id="card_we6" src="img/cover_we.png" class="cover">
179 <img id="card_we7" src="img/cover_we.png" class="cover">
180 <img id="takes_we" src="img/cover_we.png" class="cover">
181 <div id="asta" class="asta">
182   <img id="asta0" src="img/asta0.png" class="astacard">
183   <img id="asta1" src="img/asta1.png" class="astacard">
184   <img id="asta2" src="img/asta2.png" class="astacard">
185   <img id="asta3" src="img/asta3.png" class="astacard">
186   <img id="asta4" src="img/asta4.png" class="astacard">
187   <img id="asta5" src="img/asta5.png" class="astacard">
188   <img id="asta6" src="img/asta6.png" class="astacard">
189   <img id="asta7" src="img/asta7.png" class="astacard">
190   <img id="asta8" src="img/asta8.png" class="astacard">
191   <img id="asta9" src="img/asta9.png" class="astacard">
192   <div id="astaptdiv" class="punti">
193     <input class="puntifield" id="astapt" name="astapt" type="text" maxsize="3" size="3" value="61"> 
194   </div>
195   <img  id="astaptsub" src="img/astaptsub_ro.png" class="astacard">
196   <img  id="astapasso" src="img/astapasso_ro.png" class="astacard"> 
197   <img  id="astalascio" src="img/astalascio_ro.png" class="astacard"> 
198 </div>
199 <div id="name" class="pubinfo"></div>
200 <div id="public" class="public">
201    <div class="vert_midfloat">
202        <div id="pubasta" class="vert_innfloat_so">
203            <img id="pubacard" src="img/astapasso_ro.png" class="pubacard"> 
204            <div id="pubapnt"></div>
205        </div>
206    </div>
207 </div>
208 <div id="name_ea" class="pubinfo_ea"></div>
209 <div id="public_ea" class="public_ea">
210    <div class="vert_midfloat">
211       <div id="pubasta_ea" class="vert_innfloat">
212          <img id="pubacard_ea" src="img/astapasso_ro.png" class="pubacard_ea">  
213          <div id="pubapnt_ea"></div>
214       </div>
215    </div>
216 </div>
217 <div id="name_ne" class="pubinfo_ne"></div>
218 <div id="public_ne" class="public_ne">
219    <div class="vert_midfloat">
220       <div id="pubasta_ne" class="vert_innfloat">
221          <img id="pubacard_ne" src="img/astapasso_ro.png" class="pubacard_ne">  
222          <div id="pubapnt_ne"></div>
223       </div>
224    </div>
225 </div>
226 <div id="name_nw" class="pubinfo_nw"></div>
227 <div id="public_nw" class="public_nw">
228    <div class="vert_midfloat">
229       <div id="pubasta_nw" class="vert_innfloat">
230          <img id="pubacard_nw" src="img/astapasso_ro.png" class="pubacard_nw">  
231          <div id="pubapnt_nw"></div>
232       </div>
233    </div>
234 </div>
235 <div id="name_we" class="pubinfo_we"></div>
236 <div id="public_we" class="public_we">
237    <div class="vert_midfloat">
238       <div id="pubasta_we" class="vert_innfloat">
239          <img id="pubacard_we" src="img/astapasso_ro.png" class="pubacard_we">  
240          <div id="pubapnt_we"></div>
241       </div>
242    </div>
243 </div>
244 <div id="chooseed" class="chooseed">
245                            <?php echo $mlang_bin5_index['aucwin'][$G_lang]; ?>
246 <img id="seed0" src="img/00.png" class="seed0">
247 <img id="seed1" src="img/10.png" class="seed1">
248 <img id="seed2" src="img/20.png" class="seed2">
249 <img id="seed3" src="img/30.png" class="seed3">
250 </div>
251 <div id="caller" class="caller">
252 <div id="callerinfo" class="callerinfo">Info</div>
253 <img id="callerimg" src="img/noimg.png" class="callerimg">
254 </div>
255 <div class="table_commands">
256 <table>
257 <tr>
258 <td style="text-align: center;"><input type="button" class="button" name="xinfo"  value="<?php echo $mlang_bin5_index['tit_info'][$G_lang]; ?>" onclick="act_tableinfo();"></td>
259 <td style="text-align: center;"><input type="button" class="button" name="xreload"  value="<?php echo $mlang_bin5_index['tit_relo'][$G_lang]; ?>" onclick="act_reload();"></td>
260 <td style="text-align: center;"><input type="button" class="button" name="xout"  value="<?php echo $mlang_bin5_index['tit_out'][$G_lang]; ?>" onclick="safelogout();"></td>
261 </tr><tr>
262 <td style="text-align: center;"><img id="stm_stat" class="nobo" src="img/line-status_b.png"></td>
263 <td style="text-align: center;"><input type="button" class="button" name="xpref"  value="<?php echo $mlang_bin5_index['tit_pref'][$G_lang]; ?>" onclick="preferences_showhide();"></td>
264 </td>
265 <td style="text-align: center;"><img id="exitlock" class="button" style="visibility: hidden; border: 0px; display: inline; position: relative;" onclick="act_exitlock();"></td>
266 </tr>
267 </table>
268 </div>
269 <!--
270 <div class="table_commands">
271 <input type="button" class="button" name="xinfo"  value="Info." onclick="act_tableinfo();">
272 <input type="button" class="button" name="xreload"  value="Reload." onclick="act_reload();">
273 <div style="vertical-align: top;">
274 <img id="exitlock" class="button" style="visibility: hidden; border: 0px; display: inline; position: relative;" onclick="act_exitlock();"><input type="button" class="button" name="xout"  value="Out." onclick="safelogout();">
275 </div>
276 </div>
277 -->
278
279 </div>
280
281
282 <div class="subarea">
283 <div id="txt" class="chattshort"></div>
284     <table class="chattshort_table"><tr><td style="width:1%; text-align: right;">
285     <div id="myname"></div>
286     </td><td>
287     <input id="txt_in" maxlength="128" type="text" style="width: 100%;" onkeypress="chatt_checksend(this,event);">
288     </td></tr></table>
289
290 <div id="flasou" style="text-align: left;"></div>
291 <hr>
292 <div id="heartbit" style="text-align: left;"></div>
293 <hr>
294 <div id="imgct" style="text-align: left;">HERE</div>
295 <hr>
296 <div id="sandbox" style="text-align: left;"></div>
297 <div id="sandbox2" style="text-align: left;"></div>
298 <div id="sandbox3" style="text-align: left;"></div>
299 <pre>
300 <div id="xhrlog" style="text-align: left;"></div>
301 </pre>
302 <div id="xhrdeltalog" style="text-align: left;"></div>
303 </div>
304
305 <div id="preferences" class="notify" style="z-index: 200; width: 400px; margin-left: -200px; height: 200px; top: 126px; visibility: hidden;">
306 <div id="preferences_child" style="border-bottom: 1px solid gray; overflow: auto; height: 170px;">
307
308 <h2><?php echo $mlang_bin5_index['tit_pref'][$G_lang]; ?></h2>
309 <div style="width: 95%; /* background-color: red; */ margin: auto; text-align: left;">
310 <br><br>
311 <input type="checkbox" name="pref_ring_endauct" id="pref_ring_endauct" onclick="pref_ring_endauct_set(this);"><?php echo $mlang_bin5_index['itm_ringauc'][$G_lang] ?>
312     <div>
313         <label>Regole:</label><?php dom_select_rules();?>
314     </div>
315 </div>
316
317
318 </div>
319 <div class="notify_clo"><input type="submit" class="input_sub" style="bottom: 4px;" onclick="act_preferences_update();" value="<?php echo $mlang_bin5_index['btn_update'][$G_lang]; ?>"/></div>
320 </div>
321
322
323 </body>
324 </html>
325 <?php
326 }
327 ?>