Mercurial > hg > fapweb
comparison show.php @ 126:71c35d5302c2
More work on cleanups, and AJAX modularization.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 22 Oct 2013 17:00:49 +0300 |
parents | f364b50e07f7 |
children | 0436079bcf46 |
comparison
equal
deleted
inserted
replaced
125:f364b50e07f7 | 126:71c35d5302c2 |
---|---|
1 <? | 1 <? |
2 // | 2 // |
3 // Entry display / show helper module | 3 // Entry display / show helper module |
4 // | 4 // |
5 $sessionType = "admin"; | |
6 require "mconfig.inc.php"; | 5 require "mconfig.inc.php"; |
7 require "msite.inc.php"; | 6 require "msite.inc.php"; |
8 require "mcommon.inc.php"; | 7 require "mcommon.inc.php"; |
9 require "msession.inc.php"; | 8 require "majax.php"; |
10 | |
11 // Check if we are allowed to execute | |
12 if (!stCheckHTTPS() || !stAdmSessionAuth(TRUE)) | |
13 { | |
14 stSetupCacheControl(); | |
15 | |
16 stSessionEnd(SESS_ADMIN); | |
17 | |
18 stSetStatus(404, "Not Found"); | |
19 | |
20 cmPrintPageHeader("Error"); | |
21 echo "<div class=\"notice\">". | |
22 "<h1>Permission denied</h1>\n". | |
23 "<p>You need to be logged in as administrator to access this data.</p>\n". | |
24 "<p><a href=\"admin\">Click here for login form</a></p>\n". | |
25 "</div>\n"; | |
26 cmPrintPageFooter(); | |
27 exit; | |
28 } | |
29 | 9 |
30 stSetupCacheControl(); | 10 stSetupCacheControl(); |
31 | 11 |
32 // Initiate SQL database connection | 12 // Initiate SQL database connection |
33 if (!stConnectSQLDB()) | 13 if (!stConnectSQLDB()) |
34 die("Could not connect to SQL database."); | 14 die("Could not connect to SQL database."); |
35 | 15 |
36 // Fetch non-"hardcoded" settings from SQL database | 16 // Fetch non-"hardcoded" settings from SQL database |
37 stReloadSettings(); | 17 stReloadSettings(); |
38 | 18 |
39 cmPrintPageHeader("SHOW DISPLAY", "", FALSE); | 19 cmPrintPageHeader("PARTY DISPLAY", "", FALSE); |
20 stCommonAJAX("showajax.php", "show.php", TRUE); | |
40 ?> | 21 ?> |
22 | |
23 <!-- ========================== --> | |
24 | |
25 <div id="contents"> | |
26 | |
27 <noscript> | |
28 <div class="notice"> | |
29 <h1>Javascript required</h1> | |
30 <p> | |
31 The compo system page requires Javascript to be enabled for the AJAX functionality. | |
32 <br /> | |
33 <a href="#">Please enable Javascript and reload this page</a>. | |
34 </p> | |
35 </div> | |
36 </noscript> | |
37 | |
38 <div class="showView" id="view1"></div> | |
39 <div class="showView" id="view2"></div> | |
40 <div class="showView" id="view3"></div> | |
41 | |
42 </div> | |
43 | |
44 <!-- ========================== --> | |
45 | |
41 <script type="text/javascript"> | 46 <script type="text/javascript"> |
42 // <? echo "\n"; include "ajax.js"; ?> | |
43 | 47 |
44 </script> | 48 function tick() |
45 <div id="contents"> | 49 { |
46 <noscript> | 50 var nitem = document.getElementById("view1"); |
47 <div class="notice"> | 51 nitem.innerHTML = "<div class=\"notice\">Hello!</div>"; |
48 <h1>Javascript required</h1> | 52 } |
49 <p> | 53 |
50 The compo system page requires Javascript to be enabled for the AJAX functionality. | 54 //setTimeout("tick();", 100); |
51 <br /> | 55 |
52 <a href="#">Please enable Javascript and reload this page</a>. | |
53 </p> | |
54 </div> | |
55 </noscript> | |
56 </div> | |
57 <script type="text/javascript"> | |
58 </script> | 56 </script> |
59 <? | 57 <? |
60 cmPrintPageFooter(FALSE); | 58 cmPrintPageFooter(FALSE); |
61 ?> | 59 ?> |