-
Notifications
You must be signed in to change notification settings - Fork 1
/
shinningMissionViewer.php
304 lines (242 loc) · 9.29 KB
/
shinningMissionViewer.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
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<?php session_start(); ?>
<html>
<head>
<title>首页</title>
<link rel="stylesheet" href="./fonts/font-awesome/css/font-awesome.min.css">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link href="./css/bootstrap.css" rel="stylesheet">
<link href="./css/bootstrap-treeview.css" rel="stylesheet">
<!-- Required Javascript -->
<script src="./js/jquery-3.1.1.js"></script>
<script src="./js/bootstrap-treeview.min.js"></script>
<style type="text/css">
#content {
float: center;
margin-left: 50px;
margin-right: 20px;
}
* {
margin: 0;
padding: 0;
}
body {
font: 14px Verdana, Arial, Geneva, sans-serif;
color: #404040;
background: #fff;
}
img {
border-style: none;
}
.box {
position: relative;
float: left;
}
input.uploadFile {
position: absolute;
right: 0px;
top: 0px;
opacity: 0;
filter: alpha(opacity=0);
cursor: pointer;
width: 276px;
height: 36px;
overflow: hidden;
}
input.textbox {
float: left;
padding: 5px;
color: #999;
height: 24px;
line-height: 24px;
border: 1px #ccc solid;
width: 200px;
margin-right: 4px;
}
a.link {
float: left;
display: inline-block;
padding: 4px 16px;
color: #fff;
font: 14px "Microsoft YaHei", Verdana, Geneva, sans-serif;
cursor: pointer;
background-color: #ff9933;
line-height: 28px;
text-decoration: none;
}
.button {
color: #fef4e9;
border: solid 1px #da7c0c;
background: #f78d1d;
background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20));
background: -moz-linear-gradient(top, #faa51a, #f47a20);
/*filter: progid:DXImageTransform.Microsoft.gradient(start Colorstr='#faa51a', end Colorstr='#f47a20');*/
display: inline-block;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
padding: .5em 2em .55em;
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
border-radius: .5em;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.button:hover {
background: #f47c20;
background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015));
background: -moz-linear-gradient(top, #f88e11, #f06015);
/*filter: progid:DXImageTransform.Microsoft.gradient(start Colorstr='#f88e11', end Colorstr='#f06015');*/
text-decoration: none;
}
.button:active {
color: #fcd3a5;
background: -webkit-gradient(linear, left top, left bottom, from(#f47a20), to(#faa51a));
background: -moz-linear-gradient(top, #f47a20, #faa51a);
/*filter: progid:DXImageTransform.Microsoft.gradient(start Colorstr='#f47a20', end Colorstr='#faa51a');*/
position: relative;
top: 1px;
}
.file input {
position: absolute;
font-size: 100px;
right: 0;
top: 0;
opacity: 0;
}
</style>
</head>
<body>
<?php
if (isset($_SESSION['username'])) {
$username = $_SESSION['username'];
$authorityCode = $_SESSION['authorityCode'];
} else {
echo "<script>alert('先登陆。。。!');location.href='index.php';</script>";
}
$title = isset($_GET['title']) ? $_GET['title'] : NULL; // 获取任务名称
$branch = isset($_GET['branch']) ? $_GET['branch'] : NULL; // 获取支部名称
require_once './db_login.php';
$conn = new mysqli($db_hostname, $db_username, $db_password, $db_database);
if ($conn->connect_error) die($conn->connect_error);
mysqli_set_charset($conn, 'utf8');
$query = "SELECT * FROM `missionlog` WHERE `title`='" . $title . "' AND `branch`='" . $branch . "' ";
$result = $conn->query($query);
if (!$result) die($conn->connect_error);
$rows = $result->fetch_array();
?>
<div id="container">
<div id="content">
<form action="scoreTheMission.php?title=<?php echo $rows['title'] ?>&branch=<?php echo $branch ?>"
method="post">
<h2><i class="fa fa-wpforms"></i> 查看任务</h2>
<hr>
<div class="row">
<div class="col-xs-4">
<p>发布人:<?php echo $rows['publisher'] ?></p>
</div>
</div>
<br>
<div class="row">
<div class="col-xs-4">
任务名称:<input type="text" name="title" value="<?php echo $rows['title'] ?>" readonly="readonly">
</div>
</div>
<br>
<div class="row">
<div class="col-xs-8">
<div style="float: left;">
相关文件:
</div>
<div class="box">
<a href="./Files/<?php echo iconv('UTF-8//IGNORE', 'UTF-8//IGNORE', $rows['annix']) ?>"><?php echo $rows['annix'] ?></a>
</div>
</div>
</div>
<br>
<br>
<div class="row">
<div class="col-xs-10">
任务内容:<input type="text" name="rwnr" maxlength="70" size="70" style="height: 50px"
value="<?php echo $rows['details'] ?>" readonly="readonly">
</div>
</div>
<br>
<div class="row">
<?php
if ($rows['status'] == '已上传' && ($authorityCode <= 1)) {
echo <<<SCORE
<div class="col-xs-8">
得分:<input type="text" name="score" value="{$rows['score']}">
</div>
<div class="col-xs-4">
<button class="button orange" type="submit">党委秘书赋分</button>
</div><br><br><br>
SCORE;
}
$result->close();
$conn->close();
?>
</div>
<br>
<div class="row">
<div class="col-xs-4">
完成时限:<?php echo $rows['timeLimit'] ?>
</div>
<div class="col-xs-8">
</div>
</div>
<br>
<!--<div class="row">
<div class="col-xs-8">
<div style="float: left;">
查看附件:
</div>
<div class="box">
<a href="./Files/<?php /*echo iconv('UTF-8//IGNORE', 'UTF-8//IGNORE', $rows['annixSubmit']) */?>">浏览支部上传附件</a>
</div>
</div>
<div class="col-xs-8">
</div>
</div>
<br>-->
</form>
<?php
/* require_once './db_login.php';
$conn = new mysqli($db_hostname, $db_username, $db_password, $db_database);
if ($conn->connect_error) die($conn->connect_error);
mysqli_set_charset($conn, 'utf8');
$query = "SELECT * FROM `person` WHERE `name`='" . $username . "' AND `branch`='" . $branch . "' ";
$result = $conn->query($query);
if (!$result) die($conn->connect_error);
$person = $result->fetch_array();
if ($rows['status'] == '已发布' && $person['authorityCode'] <= 20) {
echo <<<UPDATE
<form action="updateFile.php?title={$title}&branch={$branch}" method="post" enctype="multipart/form-data">
<br><br>
<div class="row">
<div class="col-xs-8">
<div style="float: left;">
上传附件:
</div>
<div class="box">
<input type="file" name="file" id="file"/>
</div>
<input type="hidden" name="flag" value="update"/>
</div>
<div class="col-xs-4">
<button class="button orange" type="submit">支部上传</button>
</div>
</form>
UPDATE;
}
$result->close();
$conn->close();
*/?>
</div>
</div>
</body>