comparison show.php @ 139:75cf14ee99a7

More work on party information system.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 22 Oct 2013 23:58:41 +0300
parents aeebfedb5709
children d2e9285b69ad
comparison
equal deleted inserted replaced
138:e04f6e3c04f7 139:75cf14ee99a7
9 require "mcommon.inc.php"; 9 require "mcommon.inc.php";
10 require "majax.php"; 10 require "majax.php";
11 11
12 stSetupCacheControl(); 12 stSetupCacheControl();
13 13
14 // Initiate SQL database connection 14 cmPrintPageHeader("PARTY INFORMATION DISPLAY SYSTEM", "", FALSE);
15 if (!stConnectSQLDB())
16 die("Could not connect to SQL database.");
17
18 // Fetch non-"hardcoded" settings from SQL database
19 stReloadSettings();
20
21 cmPrintPageHeader("PARTY DISPLAY", "", FALSE);
22 stCommonAJAX("showajax.php", "show.php", TRUE); 15 stCommonAJAX("showajax.php", "show.php", TRUE);
23 ?> 16 ?>
24 17
25 <!-- ========================== --> 18 <!-- ========================== -->
26 19
33 <a href="#">Please enable Javascript and reload this page</a>. 26 <a href="#">Please enable Javascript and reload this page</a>.
34 </p> 27 </p>
35 </div> 28 </div>
36 </noscript> 29 </noscript>
37 30
38 <div class="showView" id="mainView0"> 31 <div class="showView" id="mainView0"></div>
39 <div class="showHeader"> 32 <div class="showView" id="mainView1"></div>
40 <img src="img/fapsm.png" />
41 </div>
42 <div class="showText">
43 <h1>Next up</h1>
44 <h2>4k intro competition</h2>
45 </div>
46 </div>
47
48 <div class="showView" id="mainView1">
49 </div>
50 33
51 <!-- ========================== --> 34 <!-- ========================== -->
52 35
53 <script type="text/javascript"> 36 <script type="text/javascript">
54 37
90 failCount = 0; 73 failCount = 0;
91 errorView = false; 74 errorView = false;
92 updateView(txt); 75 updateView(txt);
93 } 76 }
94 77
95 sendPOSTRequest("mode=get", msuccess, displayError); 78 sendPOSTRequest("action=get", msuccess, displayError);
96 } 79 }
97 80
98 81
99 // 82 //
100 // Main tick function, check for updates from server 83 // Main tick function, check for updates from server
103 { 86 {
104 var msuccess = function(txt) 87 var msuccess = function(txt)
105 { 88 {
106 failCount = 0; 89 failCount = 0;
107 if (txt == "changed") 90 if (txt == "changed")
91 {
108 viewChanged(); 92 viewChanged();
93 setTimeout("tickMain();", 500);
94 }
95 else
96 {
97 setTimeout("tickMain();", 2000);
98 }
99 }
100
101 var mfail = function(txt)
102 {
103 displayError();
104 setTimeout("tickMain();", 5000);
109 } 105 }
110 106
111 sendPOSTRequest("mode=check", msuccess, displayError); 107 sendPOSTRequest("action=check", msuccess, mfail);
112 } 108 }
113 109
114 110
115 setTimeout("tickMain();", 500); 111 setTimeout("tickMain();", 1000);
116 setTimeout("tickAnim();", 20); 112 setInterval("tickAnim();", 25);
117 113
118 </script> 114 </script>
119 <? 115 <?
120 cmPrintPageFooter(FALSE); 116 cmPrintPageFooter(FALSE);
121 ?> 117 ?>