-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsubmit.php
More file actions
373 lines (364 loc) · 12.1 KB
/
submit.php
File metadata and controls
373 lines (364 loc) · 12.1 KB
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
<?php
require 'config.php';
//mysqli连接
$mysqli = new mysqli($mysql_host,$mysql_user,$mysql_pwd,$mysql_db);
if($mysqli->connect_errno){
die('Connect Error:'.$mysqli->connect_error);
}
//设置编码
$mysqli->set_charset('utf8');
$verify_request = @$_COOKIE['verify_request'];
$postStr = pack("H*", $verify_request);
$postInfo = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, '这里改为AppSecret', $postStr, MCRYPT_MODE_CBC, '这里改为AppID');
$postInfo = rtrim($postInfo);
$postArr = json_decode($postInfo,true);
if($postArr['visit_user']['username'] == false){
die("<script>alert('请登录!');self.location = 'index.php';</script>");
}
$dealing = $mysqli->query('select * from dorm_house where ybuid = '.$postArr['visit_user']['userid']);
$result = $dealing->fetch_all(MYSQLI_ASSOC);
if($result == false){
echo '<script>alert("请先设置你的寝室");self.location="myhouse.php";</script>';
}
?>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>宿舍在线报修系统</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
p{
text-indent:2em;
}
.panel-primary>.panel-heading{
color:#fff;
background-color: #00a65a;
border-color:#00a65a;
}
.navbar-inverse .navbar-nav >li>a:focus, .navbar-inverse .navbar-nav>li>a:hover{
background-color:transparent;
color: #fff;
}
.navbar-inverse{
background-color:#3c8dbc;
border-color:#3c8dbc;
color: #fff;
}
.navbar-inverse .navbar-nav>li>a{
color:#fff;
}
.navbar-inverse .navbar-toggle:focus, .navbar-inverse .navbar-toggle:hover{
background-color: #3c8dbc;
}
.navbar-inverse .navbar-toggle {
border-color: #fff;
}
.col-md-8,.col-md-4{
padding-right:5px;
padding-left:5px;
}
.navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a:focus, .navbar-inverse .navbar-nav>.open>a:hover {
color: #fff;
background-color: rgba(40, 98, 130, 0.32);
}
.navbar-inverse .navbar-nav>.active>a, .navbar-inverse .navbar-nav>.active>a:focus, .navbar-inverse .navbar-nav>.active>a:hover {
color: #fff;
background-color: rgba(40, 98, 130, 0.32);
}
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a {
color: #c0dcd8;
}
.panel{
margin:0 auto;
max-width:700px;
}
.alert{
margin:0 auto;
margin-top:5px;
max-width:700px;
height:80px;
}
.div-img{
background-color: rgba(255, 255, 255, 0.3);
display: block;
padding: 10px;
}
.box-text {
border: 1px solid white;
color: blue;
font-style: italic;
width: 100%;
height: 100%;
}
.title-text {
font-size: 3.8em;
padding-top: 20px;
padding-bottom: 25px;
text-align: center;
}
.btn_form{
width:100%;
margin-top:4px;
}
.panel-title{
text-align:center;
}
.warning{
color: #8a6d3b;
border-radius:3px;
background-color: #fcf8e3;
border-color: #faebcc;
padding:13px;
}
.alert {
margin: 0 auto;
margin-top: 5px;
max-width: 700px;
height: auto;
}
*{
font-size:13px;
}
</style>
</head>
<body scrollTop="0">
<nav class="navbar navbar-inverse">
<div class="navbar-header">
<a href="index.php" class="navbar-brand">
<img src="./logo.png" height="20px" width="20px">
</a>
<button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#mynavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="mynavbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="index.php"><span class="glyphicon glyphicon-calendar"></span> 我的报修</a></li>
<li class="active"><a href="submit.php"><span class="glyphicon glyphicon-edit"></span> 申请报修</a></li>
<li><a href="myhouse.php"><span class="glyphicon glyphicon-tags"></span> 我的宿舍</a></li>
<li><a href="question.php"><span class="glyphicon glyphicon-envelope"></span> 问题反馈</a></li>
</ul>
<!-- 导航条中的下拉菜单 -->
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span> <?php echo $postArr['visit_user']['username'].'(uid:'.$postArr['visit_user']['userid'].')';?></a>
<ul class="dropdown-menu">
<li><a href="index.php?act=login">登录</a></li> </ul>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="panel-title">
填写报修信息
</div>
</div>
<div class="panel-body">
<div class="alert alert-warning">
特别注意!!!本系统目前只支持贵州民族大学<u>新校区</u>的宿舍报修,老校区的报修系统暂未上线!
</div>
<br />
<form class="form-horizontal" action="order.php" method="POST" onSubmit="return check();">
<div class="form-group">
<label class="col-md-2 control-label">联系电话:</label>
<div class="col-md-10">
<input class="form-control" name="tel" type="text" value="" placeholder="请填写你的电话号码" required="required" >
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">房间号:</label>
<div class="col-md-5">
<input class="form-control" name="floor" type="text" value="<?php echo $result[0]['floor']?>" required="required" readonly>
<!--<select class="form-control" name="floor" id="select" readonly>
<option value="A1">A1</option>
<option value="A2">A2</option>
<option value="A3">A3</option>
<option value="A4">A4</option>
<option value="A5">A5</option>
<option value="B1">B1</option>
<option value="B2">B2</option>
</select>-->
</div>
<div class="col-md-5">
<input class="form-control" name="room_no" type="text" value="<?php echo $result[0]['room']?>" required="required" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">故障类型:</label>
<div class="col-md-10">
<div class="checkbox">
<label>
<input type="checkbox" name="type[]" value="漏水">漏水 
</label>
<label>
<input type="checkbox" name="type[]" value="插座">插座 
</label>
<label>
<input type="checkbox" name="type[]" value="水龙头">水龙头 
</label>
<label>
<input type="checkbox" name="type[]" value="厕所灯">厕所灯 
</label>
<label>
<input type="checkbox" name="type[]" value="厕所蓄水桶">厕所蓄水桶 
</label>
<label>
<input type="checkbox" name="type[]" value="顶灯">顶灯 
</label>
<label>
<input type="checkbox" name="type[]" value="宿舍门锁">宿舍门锁 
</label>
<label>
<input type="checkbox" name="type[]" value="进门灯">进门灯 
</label>
<label>
<input type="checkbox" name="type[]" value="洗手台水龙头">洗手台水龙头 
</label>
<label>
<input type="checkbox" name="type[]" value="洗手台下水阀">洗手台下水阀 
</label>
<label>
<input type="checkbox" name="type[]" value="电控盒">电控盒 
</label>
<label>
<input type="checkbox" name="type[]" value="阳台门">阳台门 
</label>
<label>
<input type="checkbox" name="type[]" value="阳台门把手">阳台门把手 
</label>
<label>
<input type="checkbox" name="type[]" value="阳台门合叶">阳台门合叶 
</label>
<label>
<input type="checkbox" name="type[]" value="阳台灯">阳台灯 
</label>
<label>
<input type="checkbox" name="type[]" value="阳台地漏">阳台地漏 
</label>
<label>
<input type="checkbox" name="type[]" value="床板">床板 
</label>
<label>
<input type="checkbox" name="type[]" value="床柜">床柜 
</label>
<label>
<input type="checkbox" name="type[]" value="床梯">床梯 
</label>
<label>
<input type="checkbox" name="type[]" value="椅子">椅子 
</label>
<label>
<input type="checkbox" name="type[]" value="墙上插座">墙上插座 
</label>
<label>
<input type="checkbox" name="type[]" value="下水道堵塞">下水道堵塞 
</label>
<label>
<input type="checkbox" name="type[]" value="玻璃">玻璃 
</label>
<label>
<input type="checkbox" name="type[]" value="卫生间下水">卫生间下水 
</label>
<label>
<input type="checkbox" name="type[]" value="卫生间灯">卫生间灯 
</label>
<label>
<input type="checkbox" name="type[]" value="卫生间合叶">卫生间合叶 
</label>
<label>
<input type="checkbox" name="type[]" value="卫生间门">卫生间门 
</label>
<label>
<input type="checkbox" name="type[]" value="卫生间门把手">卫生间门把手 
</label>
<label>
<input type="checkbox" name="type[]" value="浴室门">浴室门 
</label>
<label>
<input type="checkbox" name="type[]" value="浴室门把手">浴室门把手 
</label>
<label>
<input type="checkbox" name="type[]" value="浴室灯">浴室灯 
</label>
<label>
<input type="checkbox" name="type[]" value="门插销">门插销 
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">故障描述:</label>
<div class="col-md-10">
<textarea name="description" class="form-control" required="required" placeholder="请详细描述故障信息,方便维修师傅携带工具"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">无人时维修:</label>
<div class="col-md-10">
<div class="radio">
<label>
<input type="radio" name="nobody" value="1" checked>允许 
</label>
<label>
<input type="radio" name="nobody" value="0">不允许 
</label>
</div>
</div>
</div>
<div class="col-md-10 col-md-offset-2">
<label>
<center><strong>
<input type="checkbox" name="" id="accept"> <font color="red">我确认所填写信息无误,并申请报修!</font> 
</center></strong>
</label>
</div>
<div class="form-group">
<div class="col-md-12">
<div class="col-md-6"><input id="submit" type="submit" name="submit" class="btn btn_form btn-primary" value="提交报修" disabled="disabled"> </div>
<div class="col-md-6"><input type="reset" class="btn btn_form btn-danger" value="重新填写"> </div>
</div>
</div>
</form>
</div>
<div class="panel-footer">
Copyright © 2018 Powered By Rains
</div>
</div>
</div>
</body>
<script>
$(function(){
$("#accept").change(function(){
if($("#accept").is(':checked') == true ){
$("#submit").removeAttr("disabled");
}else{
$("#submit").attr({"disabled":"disabled"});
}
});
});
//检查复选框必须选择一个
function check(){
var cbs = document.getElementsByName("type[]");
var checkNum = 0;
for (var i = 0; i < cbs.length; i++) {
if (cbs[i].checked) {
checkNum++;
}
}
//alert("选中数量=" + checkNum);
if (checkNum > 0) {
return true;
}else{
alert("故障类型必须选择一个,不在列表中的不支持报修");
return false;
}
}
</script>
</html>