-
Notifications
You must be signed in to change notification settings - Fork 0
/
addpush.php
375 lines (312 loc) · 8.79 KB
/
addpush.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
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
374
375
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>推免系统信息</title>
</head>
<script src="js/jquery.min.js"></script>
<body>
<p align="center">
</p>
<?php
include("connection.php");
$str1 = "select num from num2";
$result = mysql_query($str1,$conn); //查询
$rst = mysql_fetch_array($result);
?>
<form id="form1" name="form1" method="post" action="pushdeal.php" onSubmit="return check()">
<p align="center">推免系统信息</p>
<p align="center">———————————————————————————————————————————— </p>
<p align="center">推免系统页面访问次数:<?php echo $rst['num'] ?>次</p>
<p align="center">————————————————————————————————————————————</p>
<p align="center">增加推免系统信息</p>
<p align="center">类型:
<label for="ty"></label>
<select name="ty" id="ty" onChange="F_Select(this);">
<option value="1" selected="selected" >推免系统</option>
<option value="2">推免介绍</option>
</select>
</p>
<p align="center">标题:
<label for="title"></label>
<input type="text" name="title" id="title" />
</p>
<p align="center">链接:
<input type="text" name="link" id="link" placeholder="必须有http://" />
</p>
<p align="center">大学:
<input type="text" name="university" id="university" />
</p>
<div id="jss" name="jss">
<p align="center">报名截止日期:
<input name="radio" type="radio" id="c1" value="1" checked="checked" />
<label for="c1"></label>
<input type="date" name="deadline" id="deadline" />
<label for="type"></label>
<input type="radio" name="radio" id="c2" value="2" />
不确定
</p>
<p align="center">面试开始时间:
<input name="radio2" type="radio" id="c3" value="1" checked="checked" />
<input type="date" name="startime" id="startime" />
<input type="radio" name="radio2" id="c4" value="2" />
不确定
</p>
</div>
<p align="center">知名度:
<input name="popularity" type="text" id="popularity" placeholder="数字,看下方表格" />
</p>
<p align="center">注:知名度越高排序越靠前,同一学校要保证知名度相同。</p>
<p align="center">
<input type="submit" name="submit" id="submit" value="提交" />
<input type="reset" name="reset" id="reset" value="重置" />
</p>
</form>
<script>
function F_Select(select)
{
for(iIndex=0;iIndex < select.length;iIndex++)
{
if(select.options[iIndex].selected)
{
if(select.options[iIndex].value=="1")
{
document.getElementById('jss').style.display="";
}
else
{
document.getElementById('jss').style.display="none";
}
}
}
}
function check() //注册提交检测
{
if (document.getElementById('title').value == "") {
alert("请输入标题")
return false;
}
ss = document.getElementById('link').value;
re = /^http:\/\/.*$/
if (re.test(ss)) {} else {
alert("请输入正确的链接格式");
return false;
}
if (document.getElementById('university').value == "") {
alert("请输入大学")
return false;
}
if( document.getElementById('jss').style.display=="")
{
var radios = document.getElementsByName("radio");
var planid;
var result = false;
for ( var i = 0; i < radios.length; i++) {
if (radios[i].checked) {
planid = radios[i].value;
result = true;
break;
}
}
// alert(planid);
if (!result) {
alert("单选框不能为空!")
} else {
if (planid == "1") {
if (document.getElementById('deadline').value == "") {
alert("请输入报名截止时间");
return false;
}
}
}
var radios = document.getElementsByName("radio2");
var planid;
var result = false;
for ( var i = 0; i < radios.length; i++) {
if (radios[i].checked) {
planid = radios[i].value;
result = true;
break;
}
}
// alert(planid);
if (!result) {
alert("单选框不能为空!")
} else {
if (planid == "1") {
if (document.getElementById('startime').value == "") {
alert("请输入面试开始时间");
return false;
}
}
}
var radios = document.getElementsByName("radio");
var planid;
var result = false;
for ( var i = 0; i < radios.length; i++) {
if (radios[i].checked) {
planid = radios[i].value;
result = true;
break;
}
}
// alert(planid);
if (!result) {
alert("单选框不能为空!")
} else {
if (planid == "1") {
var radios = document.getElementsByName("radio2");
var planid;
var result = false;
for ( var i = 0; i < radios.length; i++) {
if (radios[i].checked) {
planid = radios[i].value;
result = true;
break;
}
}
// alert(planid);
if (!result) {
alert("单选框不能为空!")
} else {
if (planid == "1") {
if (document.getElementById('startime').value <=document.getElementById('deadline').value) {
alert("面试开始时间应在报名截止时间之后");
return false;
}
}
}
}
}
}
ss = document.getElementById('popularity').value;
re = /^\d{1,}$/
if (re.test(ss)) {} else {
alert("请输入正确的知名度格式");
return false;
}
if(confirm("是否确认提交推免信息?"))
{
return true;
}
else
{
return false;
}
}
</script>
<p>
</p>
<div align="center"class="bs-example bs-example-tabs" role="tabpanel" data-example-id="togglable-tabs">
<p> </p>
<p>最近访问推免页面行为</p>
<?php
$sql = "select * from recordtm order by ID desc";
$result = mysql_query($sql,$conn); //查询
$n1 = 0;
?>
<div align="center" style="overflow:scroll; height:500px; width: 600px;">
<table width="495" border="1">
<tr align="center">
<td height="24">ID</td>
<td>IP</td>
<td>记录</td>
<td>行为</td>
</tr>
<?
while($rst = mysql_fetch_array($result))
{
if($n1 <300)
{
?>
<tr align="center">
<td height="24"><?php print $rst['ID'] ?></td>
<td><?php print $rst['IP'] ?></td>
<td><?php print $rst['time'] ?></td>
<td><?php print $rst['type'] ?></td>
</tr>
<?php
}
$n1++;
}
?>
</table>
</div>
<p>已发布推免信息</p>
<table class="datatable">
<thead>
<tr >
<th>ID</th>
<th>标题</th>
<th>大学</th>
<th>类型</th>
<th>报名截止时间</th>
<th>面试开始时间</th>
<th>知名度</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody id = "mainbody">
<?php
$str1 = "select * from pushfree order by popularity desc";
$result = mysql_query($str1,$conn); //查询
$i = 1;
while($rst = mysql_fetch_array($result))
{
?>
<tr id = "delCell">
<td><?php echo $i?></td>
<td style="text-align:left"><a href="<?php echo $rst['link']?>" target="_blank"><?php echo $rst['title']?></a></td>
<td><?php echo $rst['University']?></td>
<td><?php echo $rst['type']?></td>
<?php if($rst['identity'] == 1){ ?>
<td><?php echo $rst['deadline']?></td>
<?php } else{?>
<td > 不确定 </td>
<?php } ?>
<?php if($rst['identity2'] == 1){ ?>
<td><?php echo $rst['startime']?></td>
<?php } else{?>
<td > 不确定 </td>
<?php } ?>
<td><?php echo $rst['popularity']?></td>
<?php if ($rst['states'] == "进行中")
{ ?>
<td style="color:#00F"><?php echo $rst['states']?></td>
<?php }
elseif($rst['states'] == "即将截止")
{
?>
<td style="color:#F00"><?php echo $rst['states']?></td>
<?php
}
else{ ?>
<td style="color:#666"><?php echo $rst['states']?></td>
<?php
}
?>
<td><a href="deletepush.php?ID=<?php echo $rst['ID']?>" onclick="return con()" >删除</a></td>
</tr>
<?php
$i = $i + 1;
} ?>
</tbody>
</table>
</div>
<script>
function con()
{
if(confirm("是否确认要删除?"))
{
return true;
}
else
{
return false;
}
}
</script>
<p align="center"> </p>
</body>
</html>