-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.php
210 lines (186 loc) · 6.21 KB
/
setup.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<?php
/**
* Short description for setup.php
*
* Copyright (C) 2013 KuoE0 <[email protected]>
*
* Distributed under terms of the MIT license.
*
* @package setup
* @author KuoE0 <[email protected]>
* @version 0.1
* @copyright (C) 2013 KuoE0 <[email protected]>
*/
include_once 'db_con.php';
include_once 'global.php';
include_once 'function.php';
try {
$sql = "SELECT `value` FROM `attributes` WHERE `attr` = 'setup'";
$stmt = $db->prepare($sql);
$stmt->execute();
$setup = $stmt->fetch()['value'];
if ($setup == 'yes') {
echo "<h1>It has already setuped. Direct after 5 sec...</h1>";
$sql = "SELECT `value` FROM `attributes` WHERE `attr` = 'url'";
$stmt = $db->prepare($sql);
$stmt->execute();
$url = $stmt->fetch()['value'];
header("Refresh: 5; URL=" . $url);
die;
}
}
catch (PDOException $e) {
echo $e->getMessage();
}
?>
<html>
<head>
<title>Setup for ScheDemo</title>
<link href="static/components/normalize-css/normalize.css" rel="stylesheet" />
<script src="static/components/jquery/dist/jquery.min.js"></script>
<link href="static/components/semantic/build/packaged/css/semantic.min.css" rel="stylesheet" />
<script src="static/components/semantic/build/packaged/javascript/semantic.min.js"></script>
<script src="static/js/main.js"></script>
<link href="static/css/style.css" rel="stylesheet" />
</head>
<body>
<div class="wrap">
<div class="content">
<div class="ui one column page grid">
<div class="column">
<h1 id="title" class="ui center aligned header">Setup</h1>
<form name="setup" class="ui form" action="setup-ing.php" method="POST" enctype="multipart/form-data">
<legend>Basic Info</legend>
<div class="two fields">
<div class="field">
<label>Site Name</label>
<div class="ui left icon input">
<input type="text" name="title" placeholder="Type the title for this site..." />
<i class="bookmark icon"></i>
<span class="help-block">The title of this site, e.g. the name of course.</span>
</div>
</div>
<div class="field">
<label>URL</label>
<div class="ui left icon input">
<input type="url" name="url" value=<?php echo '"' . dirname(getURL()) . '"'; ?> />
<i class="url icon"></i>
<span class="help-block">If you don't have some special reason, you don't need to modify this column.</span>
</div>
</div>
</div>
<legend>Opening Time</legend>
<div class="four fields">
<div class="field">
<label>From</label>
<div class="ui left icon input">
<input type="date" name="start-opening-date" />
<i class="calendar icon"></i>
</div>
</div>
<div class="parallel field">
<div class="ui left icon input">
<input type="time" name="start-opening-time" />
<i class="time icon"></i>
</div>
</div>
<div class="field">
<label>To</label>
<div class="ui left icon input">
<input type="date" name="end-opening-date" />
<i class="calendar icon"></i>
</div>
</div>
<div class="parallel field">
<div class="ui left icon input">
<input type="time" name="end-opening-time" />
<i class="time icon"></i>
</div>
</div>
</div>
<legend>Administrator</legend>
<div class="two fields">
<div class="field">
<label>Username</label>
<div class="ui left icon input">
<input type="text" name="username" placeholder="username" />
<i class="user icon"></i>
</div>
</div>
<div class="field">
<label>Password</label>
<div class="ui left icon input">
<input type="password" name="password" placeholder="password" />
<i class="key icon"></i>
</div>
</div>
</div>
<legend>File Importing</legend>
<div class="four fields">
<div class="field">
<label>Presenter(s)</label>
<div class="ui icon input">
<input id="presenter-list-filename" type="text" placeholder="filename" disabled/>
<i id="remove-presenter-list" class="delete basic icon"></i>
</div>
<span class="help-block">Upload file of presenters list.</span>
</div>
<div class="parallel field">
<div class="ui upload blue button">
<i class="upload basic icon"></i>
upload
<input type="file" name="presenter-list" />
</div>
</div>
<div class="field">
<label>Time</label>
<div class="ui icon input">
<input id="time-list-filename" type="text" placeholder="filename" disabled/>
<i id="remove-time-list" class="delete basic icon"></i>
</div>
<span class="help-block">Upload file of time list.</span>
</div>
<div class="parallel field">
<div class="ui upload blue button">
<i class="upload basic icon"></i>
upload
<input type="file" name="time-list" />
</div>
</div>
</div>
<div>
<div id="btn-add-time" class="ui mini right floated blue button">
<i class="add icon"></i>
Time
</div>
<legend>Manual Time Importing</legend>
<div id="time-list" class="ui two column grid">
</div>
</div>
<div>
<div id="btn-add-presenter" class="ui mini right floated blue button">
<i class="add icon"></i>
Presenter
</div>
<legend>Manual Presenter(s) Importing</legend>
<div id="presenter-list" class="ui two column grid">
</div>
</div>
<input type="hidden" name="time-cnt" value="0" />
<input type="hidden" name="presenter-cnt" value="0" />
<div class="ui divider"></div>
<input class="ui green button" type="submit" name="submit" value="Confirm" />
</form>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="ui one column page grid">
<div class="column">
<p>Powered by <a href="https://github.com/KuoE0/ScheDemo/">ScheDemo</a>.</p>
</div>
</div>
</div>
</body>
</html>