report.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. // by 请勿倒卖,已申请软著,否则追究法律责任
  3. namespace app\admin;
  4. class report extends Base
  5. {
  6. public function initialize()
  7. {
  8. parent::initialize();
  9. $this->Administrator(4);
  10. $this->header();
  11. }
  12. public function __destruct()
  13. {
  14. $this->footer();
  15. }
  16. function index($_var_0 = [])
  17. {
  18. $_var_1 = SafeRequest("page", "get");
  19. $this->search = SafeRequest("search", "get");
  20. $this->search && ($_var_0[] = ["appname", "like", "%" . $this->search . "%"]);
  21. $this->reason = SafeRequest("reason", "get");
  22. $this->reason && ($_var_0[] = ["reason", "=", $this->reason]);
  23. $this->mapTime("addtime", false, $_var_0);
  24. $_var_2 = db("report")->alias("r")->join("appid a", "r.appid=a.in_id", "left")->join("user u", "r.app_uid=u.in_userid", "left")->field("r.*,a.in_uname,a.in_uid,a.in_applock,u.in_username")->where($_var_0)->order("id desc")->paginate(["page" => $_var_1]);
  25. $_var_3 = $_var_2->items();
  26. $_var_4 = $_var_2->total();
  27. $_var_5 = getRender($_var_2, $_var_1);
  28. ?><script src="static/pack/layer/jquery.js"></script>
  29. <script src="static/pack/layer/lib.js"></script>
  30. <div class="container"><?php
  31. $this->nav3();
  32. $this->searchForm("", "", function () {
  33. ?> <select name="reason" onchange="document.btnsearch.submit();">
  34. <option value="">全部类型</option>
  35. <?php
  36. foreach (["盗版", "黄色", "欺诈", "其他"] as $_var_6) {
  37. ?> <option value="<?php echo $_var_6;?>" <?php echo $this->reason == $_var_6 ? "selected=\"selected\"" : "";?>>
  38. <?php echo $_var_6;?> </option>
  39. <?php
  40. }
  41. ?> </select>
  42. <?php
  43. });
  44. ?><table class="tb tb2">
  45. <tr><th class="partition">应用举报列表</th></tr>
  46. </table>
  47. <form name="form" method="post" action="?c=report&a=allsave">
  48. <table class="tb tb2">
  49. <tr class="header">
  50. <th>编号</th>
  51. <th>应用ID</th>
  52. <th>应用名称</th>
  53. <th>所属用户</th>
  54. <th>应用状态</th>
  55. <th>举报类型</th>
  56. <th width="20%">举报内容</th>
  57. <th>联系邮箱</th>
  58. <th>举报时间</th>
  59. </tr><?php
  60. if ($_var_4 == 0) {
  61. ?><tr><td colspan="2" class="td27">没有应用举报信息</td></tr><?php
  62. }
  63. if ($_var_3) {
  64. foreach ($_var_3 as $_var_7) {
  65. ?><td><input class="checkbox" type="checkbox" name="in_id[]" id="in_id" value="<?php echo $_var_7["id"];?>"><?php echo $_var_7["id"];?></td>
  66. <td><?php echo $_var_7["appid"];?></td>
  67. <td><a href="?c=app&a=index&app_id=<?php echo $_var_7["appid"];?>"><?php echo $_var_7["appname"];?></a></td>
  68. <td><a href="?c=user&a=index&user_id=<?php echo $_var_7["in_uid"] ?: $_var_7["app_uid"];?>"><?php echo $_var_7["in_uname"] ?: $_var_7["in_username"];?></a></td>
  69. <td><?php echo $_var_7["in_applock"] == 1 ? "锁定" : ($_var_7["in_applock"] === 0 ? "正常" : "已删除");?></td>
  70. <td><?php echo $_var_7["reason"];?></td>
  71. <td><?php echo $_var_7["note"];?></td>
  72. <td><?php echo $_var_7["email"];?></td>
  73. <td><?php echo $_var_7["addtime"];?></td>
  74. <td>
  75. </tr>
  76. <?php
  77. }
  78. }
  79. ?></table>
  80. <?php echo $this->render($_var_5);?>
  81. <table class="tb tb2">
  82. <tbody>
  83. <tr><td><input type="checkbox" id="chkall" class="checkbox" onclick="CheckAll(this.form);">
  84. <label for="chkall">全选</label> &nbsp;&nbsp;
  85. <select id="in_allsave" name="in_allsave" onchange="all_save(this.form);">
  86. <option value="3">删除举报</option>
  87. </select> &nbsp;&nbsp;
  88. <input type="submit" name="allsave" class="btn" value="批量操作"></td></tr>
  89. </tbody>
  90. </table>
  91. </form>
  92. </div>
  93. </div>
  94. <?php
  95. }
  96. function allsave()
  97. {
  98. if (!submitcheck("allsave")) {
  99. $this->ShowMessage("表单验证不符,无法提交!", $_SERVER["PHP_SELF"], "infotitle3", 3000, 1);
  100. }
  101. $_var_8 = RequestBox("in_id");
  102. $_var_9 = SafeRequest("in_allsave", "post");
  103. if ($_var_8 == 0) {
  104. $this->ShowMessage("批量操作失败,请先勾选要删除的应用!", $_SERVER["HTTP_REFERER"], "infotitle3", 3000, 1);
  105. } else {
  106. if ($_var_9 == 3) {
  107. db("report")->where("id", "in", $_var_8)->delete();
  108. $this->ShowMessage("恭喜您,举报批量删除成功!", $_SERVER["HTTP_REFERER"], "infotitle2", 1000, 1);
  109. }
  110. }
  111. }
  112. }