oder.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <?php
  2. session_start();
  3. if (isset($_SESSION["account"])) {
  4. ?>
  5. <?php require_once('common/header.php'); ?>
  6. <?php require_once('common/sidebar.php'); ?>
  7. <div class="main-content app-content mt-0">
  8. <div class="side-app">
  9. <!--占位-->
  10. <div class="card"> </div>
  11. <!--占位-->
  12. <!-- CONTAINER -->
  13. <div class="main-container container-fluid">
  14. <!-- PAGE-HEADER -->
  15. <div class="row row-sm">
  16. <div class="col-lg-12">
  17. <div class="card">
  18. <div class="card-header">
  19. <h3 class="card-title">订单列表</h3></h3>
  20. </div>
  21. <div class="card-body">
  22. <div class="table-responsive">
  23. <table class="table table-bordered text-nowrap border-bottom" id="responsive-datatable">
  24. <thead>
  25. <tr>
  26. <th class="wd-10p border-bottom-0">订单号</th>
  27. <th class="wd-10p border-bottom-0">商品名称</th>
  28. <th class="wd-10p border-bottom-0">推广人</th>
  29. <th class="wd-10p border-bottom-0">姓名</th>
  30. <th class="wd-10p border-bottom-0">手机号</th>
  31. <th class="wd-10p border-bottom-0">号码状态</th>
  32. <th class="wd-10p border-bottom-0">订单状态</th>
  33. <th class="wd-10p border-bottom-0">订单说明</th>
  34. <th class="wd-10p border-bottom-0">下单时间</th>
  35. </tr>
  36. </thead>
  37. <tbody id="odertbody">
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <!-- CONTAINER CLOSED -->
  47. </div>
  48. </div>
  49. <?php
  50. session_start();
  51. include_once("../untils/conn.php");
  52. mysqli_query($con, "set names utf8");
  53. // 获取当前正在登录的账号信息的代理
  54. $proxy_acc = $_SESSION["account"];
  55. // 查询proxy表中的数据
  56. $query = "SELECT proxy_rename_sta FROM proxy WHERE proxy_acc = '$proxy_acc'";
  57. $result = mysqli_query($con, $query);
  58. $row = mysqli_fetch_assoc($result);
  59. if ($row) {
  60. $proxy_rename_sta = $row['proxy_rename_sta'];
  61. ?>
  62. <div class="modal fade" id="modaldemo5" data-bs-backdrop="static" data-bs-keyboard="false">
  63. <div class="modal-dialog modal-dialog-centered text-center" role="document">
  64. <div class="modal-content tx-size-sm">
  65. <div class="modal-body text-center p-4 pb-5">
  66. <i class="icon icon-close fs-70 text-danger lh-1 my-5 d-inline-block"></i>
  67. <h4 class="text-danger">警告: 您的账号未实名!</h4>
  68. <p class="mg-b-20 mg-x-20">平台要求所有代理商必须实名!否则无法使用平台功能!</p>
  69. <a href="profile.php" class="btn btn-primary pd-x-25">去实名</a>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <!--/div-->
  75. <script src="assets/js/jquery.min.js"></script>
  76. <script>
  77. $(document).ready(function() {
  78. // 发送 Ajax 请求获取订单数据
  79. $.ajax({
  80. url: 'controller/Order.php',
  81. type: 'POST',
  82. dataType: 'json',
  83. success: function(data) {
  84. // 渲染数据到表格中
  85. var tableHtml = '';
  86. for (var i = 0; i < data.length; i++) {
  87. tableHtml += '<tr>';
  88. tableHtml += '<td>' + data[i].order_id + '</td>';
  89. tableHtml += '<td>' + data[i].goods_name + '</td>';
  90. tableHtml += '<td>' + data[i].account + '</td>';
  91. tableHtml += '<td>' + data[i].name + '</td>';
  92. tableHtml += '<td>' + data[i].phone + '</td>';
  93. // 根据 card_sta 显示文本
  94. var cardStatus = '';
  95. if (data[i].card_sta === '0') {
  96. cardStatus = '未激活';
  97. } else if (data[i].card_sta === '1') {
  98. cardStatus = '已激活';
  99. }
  100. tableHtml += '<td>' + cardStatus + '</td>';
  101. // 根据 order_sta 显示文本
  102. var orderStatus = '';
  103. if (data[i].order_sta === '0') {
  104. orderStatus = '未处理';
  105. } else if (data[i].order_sta === '1') {
  106. orderStatus = '已下单';
  107. } else if (data[i].order_sta === '2') {
  108. orderStatus = '已发货';
  109. } else if (data[i].order_sta === '3') {
  110. orderStatus = '已完成';
  111. }else if (data[i].order_sta === '4') {
  112. orderStatus = '开卡失败';
  113. }
  114. tableHtml += '<td>' + orderStatus + '</td>';
  115. tableHtml += '<td>' + data[i].notes + '</td>';
  116. tableHtml += '<td>' + data[i].order_time + '</td>';
  117. tableHtml += '</tr>';
  118. }
  119. $('#odertbody').html(tableHtml);
  120. },
  121. error: function(xhr, status, error) {
  122. console.log(error);
  123. }
  124. });
  125. });
  126. </script>
  127. <script>
  128. $(document).ready(function() {
  129. <?php
  130. if ($proxy_rename_sta == 0) {
  131. // 未实名认证
  132. echo '$("#modaldemo5").modal("show");';
  133. echo '$("#modaldemo5").modal({backdrop: "static", keyboard: false});';
  134. } elseif ($proxy_rename_sta == 1) {
  135. // 已实名认证
  136. echo '$("#modaldemo5").modal("hide");';
  137. }
  138. ?>
  139. });
  140. </script>
  141. <?php
  142. } else {
  143. // 未找到相关数据
  144. // echo '数据不存在';
  145. }
  146. ?>
  147. <?php require_once('common/footer.php'); ?>
  148. <?php
  149. } else {
  150. echo "<script>alert('登录过过期,没有权限访问该页面');location.href='login.html';</script>";
  151. }