add 'rules_change' functionality
[brisk.git] / web / briskin5 / index.php
index 7142f46..deeeba5 100644 (file)
 $G_base = "../";
 
 require_once("../Obj/brisk.phh");
-require_once("../Obj/proxyscan.phh");
 require_once("Obj/briskin5.phh");
 
 $mlang_bin5_index = array( 'aucwin' => array( 'it' => 'Hai vinto l\'asta.<br> Scegli il seme:',
                                               'en' => 'You win the auction.<br> Choose the seed:' ),
-                           'tit_pref'=>array( 'it' => 'Preferenze.',
-                                              'en' => 'Preferences.'),
+                           'tit_info'    => array( 'it' => 'Info',
+                                                   'en' => 'Info'),
+                           'tit_relo'    => array( 'it' => 'Reload',
+                                                   'en' => 'Reload'),
+                           'tit_out'     => array( 'it' => 'Fuori',
+                                                   'en' => 'Out'),
+                           'tit_pref'    => array( 'it' => 'Prefs',
+                                                   'en' => 'Prefs'),
                            'itm_ringauc' => array('it' => 'riproduci un suono di notifica alla fine dell\' asta',
                                                   'en' => 'play a sound at the end of the auction'),
                            'btn_update'  => array('it' => 'Aggiorna.',
@@ -41,7 +46,7 @@ $mlang_bin5_index = array( 'aucwin' => array( 'it' => 'Hai vinto l\'asta.<br> Sc
                            );
 
 
-function bin5_index_main(&$header_out, $addr, $get, $post, $cookie)
+function bin5_index_main($transp_type, &$header_out, $addr, $get, $post, $cookie)
 {
     GLOBAL $G_lang, $mlang_bin5_index;
     if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
@@ -51,11 +56,6 @@ function bin5_index_main(&$header_out, $addr, $get, $post, $cookie)
     if (($sess = gpcs_var('sess', $get, $post, $cookie)) === FALSE)
         unset ($sess);
 
-    // Use of proxies isn't allowed.
-    // if (is_proxy()) {
-    // return (FALSE);
-    // }
-    
 // header('Content-type: text/html; charset="utf-8"',true);
     ?>
 <html>
@@ -88,7 +88,7 @@ function bin5_index_main(&$header_out, $addr, $get, $post, $cookie)
 
    var gst  = new globst();
    gst.st = <?php 
-       log_load("bin5/index.php");
+   log_load("bin5/index.php");
 
    if (isset($laststate) == false) {
        $laststate = -1;
@@ -110,13 +110,15 @@ window.onload = function() {
   preferences_update();
 
   sess = "<?php echo "$sess"; ?>";
-  xstm = new xynt_streaming(window, null /* console */, gst, 'table_php', 'sess', sess, $('sandbox'), 'index_rd_ifra.php', function(com){eval(com);});
+  xstm = new xynt_streaming(window, "<?php echo "$transp_type"; ?>", 80, 2, null /* console */, gst, 'table_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
   xstm.hbit_set(heartbit);
   
   window.onbeforeunload = onbeforeunload_cb;  
   window.onunload = onunload_cb;  
 
   xstm.start();
+
+  addEvent($('select_rules'), "change", function() { act_select_rules(this.value); } );
   // FIXME: add this setTimeout(preload_images into data stream to avoid
   // race on opened socket
   // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
@@ -247,11 +249,13 @@ window.onload = function() {
 <div class="table_commands">
 <table>
 <tr>
-<td style="text-align: center;"><input type="button" class="button" name="xinfo"  value="Info." onclick="act_tableinfo();"></td>
-<td style="text-align: center;"><input type="button" class="button" name="xreload"  value="Reload." onclick="act_reload();"></td>
-<td style="text-align: center;"><input type="button" class="button" name="xout"  value="Out." onclick="safelogout();"></td>
+<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>
+<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>
+<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>
 </tr><tr>
-<td style="text-align: center;" colspan="2"><input type="button" class="button" name="xpref"  value="<?php echo $mlang_bin5_index['tit_pref'][$G_lang]; ?>" onclick="preferences_showhide();"></td>
+<td style="text-align: center;"><img id="stm_stat" class="nobo" src="img/line-status_b.png"></td>
+<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>
+</td>
 <td style="text-align: center;"><img id="exitlock" class="button" style="visibility: hidden; border: 0px; display: inline; position: relative;" onclick="act_exitlock();"></td>
 </tr>
 </table>
@@ -299,6 +303,9 @@ window.onload = function() {
 <div style="width: 95%; /* background-color: red; */ margin: auto; text-align: left;">
 <br><br>
 <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] ?>
+    <div>
+        <label>Regole:</label><?php dom_select_rules();?>
+    </div>
 </div>