-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistNews.php
106 lines (106 loc) · 3.34 KB
/
listNews.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
<?php
require_once '../include.php';
$rows=getAllNews();
if(!$rows){
alertMes("No news.","addNews.php");
exit;
}
?>
<!--表格-->
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>新闻列表</title>
<link rel="stylesheet" href="style/backstage.css">
</head>
<body>
<div class="details">
<div class="details_operation clearfix">
<div class="bui_select">
<input type="button" value="添 加" class="add" onclick="addNews()">
</div>
<div class="fr">
<div class="text">
<span>新闻名称:</span>
<div class="bui_select">
<select name="" id="" class="select">
<option value="1">测试内容</option>
<option value="1">测试内容</option>
<option value="1">测试内容</option>
</select>
</div>
</div>
<div class="text">
<span>发布时间:</span>
<div class="bui_select">
<select name="" id="" class="select">
<option value="1">测试内容</option>
<option value="1">测试内容</option>
<option value="1">测试内容</option>
</select>
</div>
</div>
<div class="text">
<span>搜索</span>
<input type="text" value="" class="search">
</div>
</div>
</div>
<table class="table" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th width="7%">序号</th>
<th width="7%">ID</th>
<th width="18%">标题</th>
<th width="10%">作者</th>
<th width="20%">新闻地址</th>
<th width="18%">发布时间</th>
<th width="20%">操作</th>
</tr>
</thead>
<tbody>
<?php $i=1; foreach ($rows as $row): ?>
<tr>
<!-- loop -->
<td align="center">
<?php echo $i; ?>
</td>
<td align="center">
<label for="c1" class="label"><?php echo $row['news_id']; ?></label>
</td>
<td align="center">
<?php echo $row['news_title']; ?>
</td>
<td align="center">
<?php echo $row['news_author']; ?>
</td>
<td align="center">
<a href="..//<?php echo $row['news_link']; ?>">..//<?php echo $row['news_link']; ?></a>
</td>
<td align="center">
<?php echo date("Y-m-d h:i:s ", $row['news_time']); ?>
</td>
<td align="center">
<input type="button" value="修改" class="btn" onclick="editNews(<?php echo $row['news_id']; ?>)" />
<input type="button" value="删除" class="btn" onclick="deleteNews(<?php echo $row['news_id']; ?>)" />
</td>
</tr>
<?php $i++; endforeach ?>
</tbody>
</table>
</body>
<script type="text/javascript">
function addNews(){
window.location="addNews.php";
}
function editNews(id){
window.location="editNews.php?id="+id;
}
function deleteNews(id){
if(window.confirm("不可逆的操作,继续吗?")){
window.location="doAdminAction.php?act=deleteNews&id="+id;
}
}
</script>
</html>