rename.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <?php
  2. session_start();
  3. if (isset($_SESSION["username"])) {
  4. ?>
  5. <?php require_once('common/header.php'); ?>
  6. <!--页面主要内容-->
  7. <main class="lyear-layout-content">
  8. <div class="container-fluid">
  9. <div class="row">
  10. <div class="col-lg-12">
  11. <div class="card">
  12. <div class="card-toolbar clearfix">
  13. <form class="pull-right search-bar" method="get" action="" role="form">
  14. <div class="input-group">
  15. <div class="input-group-btn">
  16. <input type="hidden" name="search" id="search" value="renname">
  17. <button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
  18. 姓名 <span class="caret"></span>
  19. </button>
  20. <ul class="dropdown-menu">
  21. <li> <a tabindex="-1" href="javascript:void(0)" data-field="renname">姓名</a> </li>
  22. <li> <a tabindex="-1" href="javascript:void(0)" data-field="proxy_acc">账号</a> </li>
  23. </ul>
  24. </div>
  25. <input type="text" class="form-control" value="" name="keyword" placeholder="请输入查询信息">
  26. </div>
  27. </form>
  28. <div class="toolbar-btn-action">
  29. </div>
  30. </div>
  31. <div class="card-body">
  32. <div class="table-responsive">
  33. <form name="form1" id="form1" method="post" action="controller/deleteall.php">
  34. <table class="table table-bordered">
  35. <?php
  36. include_once("../untils/conn.php");
  37. mysqli_query($con, "set names utf8");
  38. if ($con) {
  39. if ($db) {
  40. // 获取搜索关键词和字段
  41. $keyword = $_GET['keyword'];
  42. $field = $_GET['search'];
  43. // 构建查询语句
  44. $sql = "SELECT * FROM rename_table";
  45. if ($keyword != "") {
  46. $sql .= " WHERE $field LIKE '%$keyword%'";
  47. }
  48. // 获取数据总行数
  49. $data = mysqli_query($con, $sql);
  50. $maxrows = mysqli_num_rows($data);
  51. // 计算总页数
  52. $page_size = 10; // 每页显示数
  53. if ($maxrows % $page_size == 0) {
  54. $maxpage = (int)($maxrows / $page_size);
  55. } else {
  56. $maxpage = (int)($maxrows / $page_size) + 1;
  57. }
  58. // 获取当前页
  59. if (isset($_GET['curpage'])) {
  60. $page = $_GET['curpage'];
  61. } else {
  62. $page = 1;
  63. }
  64. // 分段取出数据
  65. $start = $page_size * ($page - 1);
  66. $get_sql = "$sql ORDER BY id DESC LIMIT $start, $page_size";
  67. // 获取数据显示
  68. $data = mysqli_query($con, $get_sql);
  69. ?>
  70. <thead>
  71. <tr>
  72. <th>ID</th>
  73. <th>账号</th>
  74. <th>真实姓名</th>
  75. <th>身份证号</th>
  76. <th>手机号</th>
  77. <th>申请时间</th>
  78. <th>审核时间</th>
  79. <th>状态</th>
  80. <th>说明</th>
  81. <th>操作</th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. <?php
  86. $id = null; // 定义变量
  87. $proxy_acc = null ;
  88. $rename = null;
  89. $reuid = null;
  90. $phone = null ;
  91. while ($row = mysqli_fetch_array($data)) {
  92. $id = $row["id"]; // 将$row['id']赋值给$id变量
  93. $proxy_acc = $row["proxy_acc"];
  94. $rename = $row["rename"];
  95. $reuid = $row["reuid"];
  96. $phone = $row["phone"] ;
  97. ?>
  98. <tr>
  99. <td style="width:3%;">
  100. <?php echo $row["id"] ?>
  101. </td>
  102. <td style="width:5%;">
  103. <?php echo $row["proxy_acc"] ?>
  104. </td>
  105. <td style="width:5%;">
  106. <?php echo $row["rename"] ?>
  107. </td>
  108. <td style="width:5%;">
  109. <?php echo $row["reuid"] ?>
  110. </td>
  111. <td style="width:5%;">
  112. <?php echo $row["phone"] ?>
  113. </td>
  114. <td style="width:6%;">
  115. <?php echo $date = date('Y-m-d H:i:s', $row["sutime"]); ?>
  116. </td>
  117. <td style="width:6%;">
  118. <?php echo $date = date('Y-m-d H:i:s', $row["uptime"]); ?>
  119. </td>
  120. <td style="width:5%;">
  121. <?php
  122. if($row["status"] == 0){
  123. echo "待审核";
  124. }elseif($row["status"] == 1){
  125. echo "已审核";
  126. }elseif($row["status"] == 2){
  127. echo "审核失败";
  128. }
  129. ?>
  130. </td>
  131. <td style="width:6%;">
  132. <?php echo $row["notes"] ?>
  133. </td>
  134. <td style="width:15%;">
  135. <?php
  136. switch($row["status"]) {
  137. case 0:
  138. echo '<button type="button" class="btn btn-success btn-sm" data-toggle="modal" data-target="#banModal" data-whatever="@mdo">操作审核</button>';
  139. break;
  140. case 1:
  141. echo '<span class="btn btn-warning btn-sm">已审核</span>';
  142. break;
  143. case 2:
  144. echo '<span class="btn btn-info btn-sm">审核失败</span>';
  145. break;
  146. default:
  147. echo '<span class="btn btn-danger btn-sm">状态错误</span>';
  148. break;
  149. }
  150. ?>
  151. </td>
  152. </tr>
  153. <?php
  154. }
  155. ?>
  156. </tbody>
  157. <tfoot>
  158. <tr>
  159. <td colspan="12" style="text-align: right;">
  160. <?php
  161. echo "<p>共 $maxpage 页&nbsp;&nbsp;";
  162. echo "每页 $page_size 项&nbsp;&nbsp;";
  163. //设置上一页
  164. if ($page > 1) {
  165. $prepage = $page - 1;
  166. echo "<a href='?curpage=$prepage'>上一页</a>&nbsp;&nbsp;";
  167. }
  168. //设置下一页
  169. if ($page < $maxpage) {
  170. $nextpage = $page + 1;
  171. echo "<a href='?curpage=$nextpage'>下一页</a>&nbsp;&nbsp;";
  172. }
  173. echo "&nbsp;&nbsp;第 $page 页</p>";
  174. }
  175. }
  176. ?>
  177. </td>
  178. </tr>
  179. </tfoot>
  180. </table>
  181. </form>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <!--这是操作审核-->
  190. <div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalLabel">
  191. <div class="modal-dialog" role="document">
  192. <div class="modal-content">
  193. <div class="modal-header">
  194. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  195. <h4 class="modal-title" id="banModalLabel">操作审核</h4>
  196. </div>
  197. <div class="modal-body">
  198. <form action="controller/Dorename.php" method="POST">
  199. <div class="form-group">
  200. <label for="proxy_type">审核状态</label>
  201. <div >
  202. <select class="form-control" id="status" name="status" size="1">
  203. <option value="1">审核通过</option>
  204. <option value="2">审核失败</option>
  205. </select>
  206. </div>
  207. </div>
  208. <div class="form-group">
  209. <label for="message-text" class="control-label">失败说明:</label>
  210. <textarea class="form-control" id="message-text" name="notes" placeholder="审核通过时,可为空,审核失败时请输入原因,代理在后台提示!" ></textarea>
  211. </div>
  212. <!--id-->
  213. <input type="hidden" name="id" value="<?php echo $id ?>">
  214. <input type="hidden" name="proxy_acc" value="<?php echo $proxy_acc ?>">
  215. <input type="hidden" name="rename" value="<?php echo $rename ?>">
  216. <input type="hidden" name="reuid" value="<?php echo $reuid ?>">
  217. <input type="hidden" name="phone" value="<?php echo $phone ?>">
  218. </div>
  219. <div class="modal-footer">
  220. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  221. <button type="submit" class="btn btn-primary">确认提交</button>
  222. </div>
  223. </form>
  224. </div>
  225. </div>
  226. </div>
  227. <!--这里操作结束了-->
  228. </main>
  229. <script src="../merchant/assets/js/jquery.min.js"></script>
  230. <script>
  231. $(document).ready(function() {
  232. $('.dropdown-menu a').click(function(e) {
  233. e.preventDefault();
  234. var field = $(this).data('field');
  235. var buttonText = $(this).text();
  236. $('#search').val(field);
  237. $('#search-btn').html(buttonText + ' <span class="caret"></span>');
  238. });
  239. });
  240. </script>
  241. <!--End 页面主要内容-->
  242. <?php require_once('common/footer.php'); ?>
  243. <?php
  244. } else {
  245. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.php';</script>";
  246. }