Commit ccff7bdcbf4c0ca9b3e120ecfb9799957ef03b07
1 parent
04797bb4
【留言板】管理端 页面实现
Showing
6 changed files
with
327 additions
and
0 deletions
trunk/www/apidocassets/javascript/mess_admin.js
0 → 100644
1 | +/** | |
2 | + * Created by Dell on 2018/9/5. | |
3 | + */ | |
4 | + | |
5 | +function jumpDel(mid){ | |
6 | + alert("确认删除该条留言?"); | |
7 | + $.ajax({ | |
8 | + url:'http://lys.com/wx5019b9c455ea9c81/Message/Apicp/Message/MessDel/Del/?mid='+mid, | |
9 | + type:'post', | |
10 | + data:{ | |
11 | + 'mid':mid | |
12 | + }, | |
13 | + dataType:'json', | |
14 | + success:function(data){ | |
15 | + | |
16 | + }, | |
17 | + error:function(e){ | |
18 | + alert("删除失败。"); | |
19 | + console.log("error:"+e); | |
20 | + } | |
21 | + }); | |
22 | +} | |
0 | 23 | \ No newline at end of file | ... | ... |
trunk/www/mess_admin/audit.php
0 → 100644
trunk/www/mess_admin/del.php
0 → 100644
trunk/www/mess_admin/detail.php
0 → 100644
1 | +<?php | |
2 | +/** | |
3 | + * Created by PhpStorm. | |
4 | + * User: Dell | |
5 | + * Date: 2018/9/5 | |
6 | + * Time: 15:34 | |
7 | + */ | |
8 | + | |
9 | +error_reporting(0); | |
10 | +$mid = (isset($_GET['mid'])) ? $_GET['mid'] : null; | |
11 | + | |
12 | +$mess_detail = []; | |
13 | +if ($mid !== null) { | |
14 | + $mess_res = file_get_contents("http://lys.com/wx5019b9c455ea9c81/Message/Apicp/Message/MessDetail/getDetail/?mid={$mid}"); | |
15 | + if ($mess_res) { | |
16 | + $mess_detail = json_decode($mess_res,true)['result']; | |
17 | + } | |
18 | +} | |
19 | +?> | |
20 | + | |
21 | +<!doctype html> | |
22 | +<html lang="en"> | |
23 | +<head> | |
24 | + <meta charset="UTF-8"> | |
25 | + <title>留言详细</title> | |
26 | + <link href="../apidocassets/css/mess_front.css" type="text/css" rel="stylesheet" > | |
27 | + <script type="text/javascript" src="../apidocassets/javascript/jquery.min.js"></script> | |
28 | + <script type="text/javascript" src="../apidocassets/javascript/mess_admin.js"></script> | |
29 | + <style type="text/css"> | |
30 | + .con table { | |
31 | + font-size: 14px; | |
32 | + } | |
33 | + .con table td{ | |
34 | + vertical-align: top; | |
35 | + } | |
36 | + label,input{ | |
37 | + font-size: 10px;; | |
38 | + } | |
39 | + button{ | |
40 | + padding: 5px 10px; | |
41 | + margin-left: 50px; | |
42 | + } | |
43 | + </style> | |
44 | +</head> | |
45 | +<body> | |
46 | + <!-- 无数据提示 --> | |
47 | + <?php if($mess_detail == null) { ?> | |
48 | + <script type="text/javascript"> alert("暂无数据。"); window.location.href="./list.php";</script> | |
49 | + <?php } ?> | |
50 | + | |
51 | + <div class="con"> | |
52 | + <table> | |
53 | + <caption><h4>留言详细内容</h4></caption> | |
54 | + <tr></tr> | |
55 | + <tr> | |
56 | + <td><h5>用户信息</h5></td> | |
57 | + </tr> | |
58 | + <tr> | |
59 | + <td> | |
60 | + | |
61 | + <label>用户昵称:</label> | |
62 | + <label><strong><?php echo $mess_detail['u_name']; ?></strong></label> | |
63 | + </td> | |
64 | + </tr> | |
65 | + <tr> | |
66 | + <td> | |
67 | + | |
68 | + <label>性别:</label> | |
69 | + <label> | |
70 | + <input type="radio" value="1" disabled <?php if ($mess_detail['u_sex'] == 1) echo "checked"; ?> > 男 | |
71 | + <input type="radio" value="2" disabled <?php if ($mess_detail['u_sex'] == 2) echo "checked"; ?> > 女 | |
72 | + </label> | |
73 | + </td> | |
74 | + </tr> | |
75 | + <?php | |
76 | + if ($mess_detail['u_mail'] != null) { | |
77 | + ?> | |
78 | + <tr> | |
79 | + <td> | |
80 | + | |
81 | + <label>邮箱:</label> | |
82 | + <label><strong><?php echo $mess_detail['u_mail']; ?></strong></label> | |
83 | + </td> | |
84 | + </tr> | |
85 | + <?php } ?> | |
86 | + | |
87 | + <?php | |
88 | + if ($mess_detail['u_tel'] !=null) { | |
89 | + ?> | |
90 | + <tr> | |
91 | + <td> | |
92 | + | |
93 | + <label>电话:</label> | |
94 | + <label><strong><?php echo $mess_detail['u_tel']; ?></strong></label> | |
95 | + </td> | |
96 | + </tr> | |
97 | + <?php } ?> | |
98 | + <tr> | |
99 | + <td><h5>留言信息</h5></td> | |
100 | + </tr> | |
101 | + <tr> | |
102 | + <td> | |
103 | + | |
104 | + <label>标题:</label> | |
105 | + <label> | |
106 | + <input type="text" readonly value="<?php echo $mess_detail['m_title']; ?>" > | |
107 | + </label> | |
108 | + </td> | |
109 | + </tr> | |
110 | + <tr> | |
111 | + <td> | |
112 | + | |
113 | + <label>内容:</label> | |
114 | + <label> | |
115 | + <textarea readonly cols="40" style="resize: none;"><?php echo $mess_detail['m_content'];?></textarea> | |
116 | + </label> | |
117 | + </td> | |
118 | + </tr> | |
119 | + <?php if ($mess_detail['m_imgs'] !='') { ?> | |
120 | + <tr> | |
121 | + <td> | |
122 | + | |
123 | + <label>图片:</label> | |
124 | + <label> | |
125 | + <img src="<?php echo $mess_detail['m_imgs']; ?>" height="200px" > | |
126 | + </label> | |
127 | + </td> | |
128 | + </tr> | |
129 | + <?php } ?> | |
130 | + <tr> | |
131 | + <td> | |
132 | + | |
133 | + <label>用户IP:</label> | |
134 | + <label><strong><?php echo $mess_detail['m_ip']; ?></strong></label> | |
135 | + </td> | |
136 | + </tr> | |
137 | + <tr> | |
138 | + <td> | |
139 | + | |
140 | + <label>留言状态:</label> | |
141 | + <label><strong> | |
142 | + <?php | |
143 | + if ($mess_detail['m_status'] == 1) { | |
144 | + echo "未审核"; | |
145 | + } else if ($mess_detail['m_status'] == 2) { | |
146 | + echo "审核未通过"; | |
147 | + } else if ($mess_detail['m_status'] == 3) { | |
148 | + echo "审核通过"; | |
149 | + } else if ($mess_detail['m_status'] == 4) { | |
150 | + echo "已删除"; | |
151 | + } | |
152 | + ?> | |
153 | + </strong></label> | |
154 | + </td> | |
155 | + </tr> | |
156 | + <tr> | |
157 | + <td> | |
158 | + | |
159 | + <label>留言时间:</label> | |
160 | + <label><strong><?php echo $mess_detail['ins_date']; ?></strong></label> | |
161 | + </td> | |
162 | + </tr> | |
163 | + <tr></tr> | |
164 | + <tr> | |
165 | + <td> | |
166 | + | |
167 | + <button value="返回" onclick="javascript:history.back();">返回</button> | |
168 | + <button value="删除" onclick="javascript:jumpDel(<?php echo $mess_detail['m_id']; ?>);">删除</button> | |
169 | + </td> | |
170 | + </tr> | |
171 | + </table> | |
172 | + </div> | |
173 | +</body> | |
174 | +</html> | ... | ... |
trunk/www/mess_admin/list.php
0 → 100644
1 | +<?php | |
2 | + $page = isset($_GET['page']) ? $_GET['page'] : 0 ; | |
3 | + $prePage = ($page - 1)<0 ? 0 : ($page - 1); | |
4 | + $nextPage = ($page + 1); | |
5 | + $mess_list = []; | |
6 | + $mess_res = file_get_contents("http://lys.com/wx5019b9c455ea9c81/Message/Apicp/Message/MessList/getList/?page={$page}"); | |
7 | + if ($mess_res) { | |
8 | + $mess_list = json_decode($mess_res,true)['result']; | |
9 | + } | |
10 | + | |
11 | + | |
12 | + | |
13 | +?> | |
14 | + | |
15 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
16 | + "http://www.w3.org/TR/html4/loose.dtd"> | |
17 | +<html> | |
18 | +<head> | |
19 | + <title>留言管理</title> | |
20 | + <meta charset="utf-8"> | |
21 | + <link type="text/css" rel="stylesheet" href="../apidocassets/css/mess_front.css" > | |
22 | + <style type="text/css"> | |
23 | + .list table{ | |
24 | + width:100%; | |
25 | + border-collapse: collapse; | |
26 | + } | |
27 | + .list tr th,td{ | |
28 | + font-size: 14px; | |
29 | + font-weight: normal; | |
30 | + border: 1px solid; | |
31 | + } | |
32 | + .list a{ | |
33 | + text-decoration: none; | |
34 | + color: #0000cc; | |
35 | + cursor: pointer; | |
36 | + } | |
37 | + </style> | |
38 | +</head> | |
39 | +<body> | |
40 | + | |
41 | +<div class="con list"> | |
42 | + <table> | |
43 | + <caption><h3>留言管理</h3></caption> | |
44 | + <tr> | |
45 | + <th>留言标题</th> | |
46 | + <th>用户昵称</th> | |
47 | + <th>用户IP</th> | |
48 | + <th>留言时间</th> | |
49 | + <th>状态</th> | |
50 | + <th>操作</th> | |
51 | + </tr> | |
52 | + <?php | |
53 | + foreach ( $mess_list as $item=>$value) { | |
54 | + ?> | |
55 | + <tr> | |
56 | + <td><label> | |
57 | + <?php echo $value['m_title'] ?> | |
58 | + </label></td> | |
59 | + <td><label> | |
60 | + <?php echo $value['u_name']; ?> | |
61 | + </label></td> | |
62 | + <td> | |
63 | + <?php echo $value['m_ip']; ?> | |
64 | + </td> | |
65 | + <td> | |
66 | + <?php echo $value['ins_date']; ?> | |
67 | + </td> | |
68 | + <td> | |
69 | + <?php | |
70 | + if ($value['m_status'] == 1) { | |
71 | + echo '未审核'; | |
72 | + } else if ($value['m_status'] == 2) { | |
73 | + echo '审核未通过'; | |
74 | + } else if ($value['m_status'] == 3) { | |
75 | + echo '审核已通过'; | |
76 | + } | |
77 | + ?> | |
78 | + </td> | |
79 | + <td> | |
80 | + <a href="detail.php?mid=<?php echo $value['m_id']; ?>">详细内容</a> | |
81 | + <?php | |
82 | + if ($value['m_status'] == 1) { | |
83 | + echo "<a href=audit.php?mid={$value['m_id']}>审核</a> "; | |
84 | + } else if($value['m_status'] == 2) { | |
85 | + echo "<a href='##'>再次审核</a> "; | |
86 | + echo "<a href=del.php?mid={$value['m_id']}>删除</a> "; | |
87 | + } else if($value['m_status'] == 3) { | |
88 | + echo "<a href={$value['m_id']}>删除</a> "; | |
89 | + } | |
90 | + ?> | |
91 | + </td> | |
92 | + </tr> | |
93 | + <?php | |
94 | + } | |
95 | + ?> | |
96 | + <tr> | |
97 | + <td colspan="6"> | |
98 | + <!--<label> | |
99 | + <a href="input.php" target="_blank">在线留言</a> | |
100 | + </label>--> | |
101 | + <span style="width: 300px; display: inline-block;"></span> | |
102 | + <label> | |
103 | + <a href="?page=<?php echo $prePage; ?>">上一页</a> | |
104 | + <a href="?page=<?php echo $nextPage; ?>" >下一页</a> | |
105 | + </label> | |
106 | + </td> | |
107 | + </tr> | |
108 | + </table> | |
109 | +</div> | |
110 | + | |
111 | +</body> | |
112 | +</html> | |
113 | + | ... | ... |
trunk/www/mess_front/list.php
... | ... | @@ -4,6 +4,7 @@ $page = isset($_GET['page']) ? $_GET['page'] : 0; |
4 | 4 | $prePage = ($page - 1)<0 ? 0 : ($page - 1); |
5 | 5 | $nextPage = $page + 1; |
6 | 6 | |
7 | +$mess_list = []; | |
7 | 8 | $mess_res = file_get_contents("http://lys.com/wx5019b9c455ea9c81/Message/Api/Message/MessList/getList/?page={$page}"); |
8 | 9 | if ($mess_res) { |
9 | 10 | $mess_list = json_decode($mess_res,true)['result']; | ... | ... |