group.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. <div class="toolbar-btn-action">
  14. <!--弹窗开始-->
  15. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo"><i class="mdi mdi-plus"></i>添加分组</button>
  16. <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
  17. <div class="modal-dialog" role="document">
  18. <div class="modal-content">
  19. <div class="modal-header">
  20. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  21. <h4 class="modal-title" id="exampleModalLabel">添加分组</h4>
  22. </div>
  23. <div class="modal-body">
  24. <form action="controller/Addgroup.php" method="post">
  25. <div class="form-group">
  26. <label for="group_name" class="control-label">代理等级:</label>
  27. <input type="text" class="form-control" id="group_name" name="group_name" placeholder="输入代理等级">
  28. </div>
  29. <div class="form-group">
  30. <label for="group_portion" class="control-label">扣除金额:<p style="color:red;">假设100元,想让代理只拿80的佣金则填写20</p></label>
  31. <input type="text" class="form-control" id="group_portion" name="group_portion" placeholder="一级代理请设置100,因为数据是以代理佣金计算,一级代理平台已扣部分金额">
  32. </div>
  33. <!--时间戳-->
  34. <input type="hidden" name="group_crtime" value="<?php echo time(); ?>">
  35. <input type="hidden" name="group_uptime" value="<?php echo time(); ?>">
  36. </div>
  37. <div class="modal-footer">
  38. <button type="submit" class="btn btn-primary">提交</button>
  39. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  40. </div>
  41. </form>
  42. </div>
  43. </div>
  44. </div>
  45. <!--这是弹窗结束-->
  46. </div>
  47. </div>
  48. <div class="card-body">
  49. <div class="table-responsive">
  50. <form name="form1" id="form1" method="post" action="controller/doSort.php">
  51. <table class="table table-bordered">
  52. <thead>
  53. <tr>
  54. <th>组ID</th>
  55. <th>名称</th>
  56. <th>扣除金额</th>
  57. <th>创建时间</th>
  58. <th>修改时间</th>
  59. <th>操作</th>
  60. </tr>
  61. </thead>
  62. <tbody>
  63. <?php
  64. include_once("../untils/conn.php");
  65. mysqli_query($con, "set names utf8");
  66. if ($con && $db) {
  67. // 获取数据总行数
  68. $sortsql = "SELECT * FROM proxy_group";
  69. $sortdata = mysqli_query($con, $sortsql);
  70. while ($sortrow = mysqli_fetch_array($sortdata)) {
  71. ?>
  72. <tr>
  73. <td><?php echo $sortrow["group_id"] ?></td>
  74. <td><?php echo $sortrow["group_name"] ?></td>
  75. <td>¥<?php echo $sortrow["group_portion"] ?></td>
  76. <td><?php echo date("Y-m-d H:i:s", $sortrow["group_crtime"]) ?></td>
  77. <td><?php echo date("Y-m-d H:i:s", $sortrow["group_uptime"]); ?></td>
  78. <td>
  79. <a class="btn btn-success btn-sm" href="upGroup.php?group_id=<?php echo $sortrow['group_id'] ?>">修改</a>
  80. <a class="btn btn-danger btn-sm" href="controller/deGroup.php?group_id=<?php echo $sortrow['group_id'] ?>" onclick="return del()">删除</a>
  81. </td>
  82. </tr>
  83. <?php
  84. }
  85. }
  86. ?>
  87. </tbody>
  88. </table>
  89. </form>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <script language="javascript">
  96. //删除弹出确认框
  97. function del() {
  98. if (confirm("确认删除吗?")) {
  99. return true;
  100. } else {
  101. return false;
  102. }
  103. }
  104. function chek() {
  105. var leng = this.form1.chk.length;
  106. if (leng == undefined) {
  107. leng = 1;
  108. if (!form1.chk.checked)
  109. document.chk.checked = true;
  110. else
  111. document.form1.chk.checked = false;
  112. } else {
  113. for (var i = 0; i < leng; i++) {
  114. if (!form1.chk[i].checked)
  115. document.form1.chk[i].checked = true;
  116. else
  117. document.form1.chk[i].checked = false;
  118. }
  119. }
  120. return false;
  121. }
  122. </script>
  123. </div>
  124. </main>
  125. <!--End 页面主要内容-->
  126. <?php require_once('common/footer.php'); ?>
  127. <?php
  128. } else {
  129. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.php';</script>";
  130. }
  131. ?>