forked from metacoder-bgy/bookmeal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
138 lines (122 loc) · 4.95 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
define('SITE_ROOT', substr(dirname(__FILE__), 0, -14));
include_once(SITE_ROOT.'source/class/class_core.php');
$discuz = & discuz_core::instance();
$discuz->init_cron = false;
$discuz->init_session = false;
$discuz->init();
//print_r($_G);
$forum_username = $_G['username'];
$forum_uid = $_G['uid'];
$forum_formhash = $_G['formhash'];
$forum_is_login = ( $forum_uid > 0 );
//var_dump($forum_uid, $forum_username, $forum_is_login);
function detect_ie(){
if(isset($_SERVER['HTTP_USER_AGENT']) &&
(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) &&
(!strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 9')))
return true;
else
return false;
}
if (detect_ie()){
?>
<!DOCTYPE html>
<html>
<head>
<title>Internet Explorer is not supported.</title>
</head>
<body>
<h1>Choose browsers below for better experience.</h1>
<hr />
<p>
<ul>
<li><a href="http://www.google.com/chrome/">Google Chrome</a></li>
<li><a href="http://www.mozilla.org/en-US/firefox/new/">Firefox</a></li>
</ul>
</p>
<hr />
<p>
<a href="http://robertnyman.com/2009/09/09/fuck-ie-gently/">Why not IE?</a>
</p>
</body>
</html>
<?php
exit();
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="Author" content="bgy.xxx" />
<meta name="viewport" content="width=1024" />
<link id="global-stylesheet" rel="stylesheet" href="css/style.css" type="text/css" />
<title>Meal System - CGS Tools</title>
<meta name="Keywords" content="订餐 碧桂园 学校 Meal System CSG BGY" />
<meta name="Description" content="学生自助一键订餐系统,方便碧桂园学校学生集体订餐。" />
<link rel="home" href="http://bgy.xxx/" />
<script type="text/javascript" src="js/jquery-1.8.2.js"></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="js/script.js" charset="utf-8"></script>
</head>
<body>
<script type="text/javascript">
forum_uid = <?php echo($forum_uid); ?>;
forum_username = '<?php echo($forum_username); ?>';
</script>
<div id="wrap">
<h1>Meal System - CGS Tools</h1>
<?php if($forum_is_login){?>
<div id="welcome_panel">
<p>Welcome, <?php echo($forum_username);?>!</p>
</div>
<?php }else{ ?>
<div id="login_panel">
<form method="post" autocomplete="off" id="forum_login_form" action="/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes">
<input type="text" name="username" id="forum_username" placeholder="Forum ID"/>
<input type="password" name="password" id="forum_password" placeholder="Password"/>
<input type="submit" name="submit" id="forum_submit" value="Login"/>
</form>
</div>
<?php };?>
<div id="ctrl_panel">
<div id="ctrl_panel_help" style="display:none;">
<h2>How to use</h2>
<p>We recommend to use this tool with your forum account, because only the forum users can store their cards info. So please login the forum if you can.</p>
<p>Please enter card number and password. If you want to add more cards, please click on the latest input box.</p>
<p>Click "Save" to store your cards info into your forum account. So that you can directly reuse them without typing them next time. Otherwise if you don't save them, you have to enter them every time and the cards info won't be saved in our server.</p>
<p>Click "Book Meal" to start the booking process.</p>
<p>If you want to delete a card, just click on the "Delete" button next to the card info.</p>
<p style="font-style: italic;">Did you know? This tool is an <a href="https://github.com/shouya/bookmeal">open source project.</a></p>
<p style="border-top: 1px dotted gray; padding-top: 5px;">
<small>Client by <a href="//rixtox.com/">RixTox</a> •
Server by <a href="//github.com/shouya">Shou Ya</a></small>
</p>
</div>
<ul>
<?php if($forum_is_login){?>
<li><a href="javascript:void(0)" class="btn_save">Save</a></li><?php }else{ ?>
<li><a href="/member.php?mod=register" class="btn_register">Register</a></li>
<?php }?>
<li><a href="javascript:void(0);" class="btn_book">Book Meal</a></li>
<?php if($forum_is_login){?>
<li><a href="/member.php?mod=logging&action=logout&formhash=<?php echo($forum_formhash);?>" class="btn_logout">Logout</a></li>
<?php };?>
<li><a href="javascript:void(0);" class="btn_help">Show Help</a></li>
</ul>
</div>
<table id="card_table">
<tr>
<th class="cln_id">##</th>
<th class="cln_no">Card Number</th>
<th class="cln_psw">Password</th>
<th class="cln_ctrl"></th>
</tr>
</table>
</div>
<div id="footer">
<p>Copyright © 2012, Shou & Rix</p>
</div>
</body>
</html>