oderse.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. <div class="row">
  15. <div class="col-sm-12 col-md-12">
  16. <div class="card">
  17. <div class="card-body pb-0">
  18. <div class="input-group mb-2">
  19. <input type="text" class="form-control" id="search-input" placeholder="请输入订单号/号码/身份证号……">
  20. <span class="input-group-text btn btn-primary" id="search-btn">立即查询</span>
  21. </div>
  22. </div>
  23. <div class="card-body p-5">
  24. <!--<p class="text-muted mb-0 ps-3">共查询1条数据 (耗时0.04秒)</p>-->
  25. </div>
  26. </div>
  27. <div class="panel-body tabs-menu-body p-0 border-0">
  28. <div class="tab-content">
  29. <div class="tab-pane active" id="tab5">
  30. <div class="card">
  31. <div class="card-body">
  32. <div class="mb-2 h4 text-dark " >
  33. 订单信息
  34. </div>
  35. <p>订单号:<t id = "oderid"></t></p>
  36. <p>联系方式:<t id = "phones"></t></p>
  37. <p>身份证号:<t id = "uid"></t></p>
  38. <p>订单状态:<t id = "status"></t></p>
  39. <p>下单时间:<t id = "time"></t></p>
  40. </div>
  41. </div>
  42. <div class="card">
  43. <div class="card-body">
  44. <div class="mb-2 h4 text-dark " >
  45. 其他信息
  46. </div>
  47. <p>推广人:<t id = "tgaccount"></t></p>
  48. <p>产品名称:<t id = "goods"></t></p>
  49. <p>办理号码:<t id = "thirdphone"></t></p>
  50. <p>办理ICCID:</p>
  51. <p>订单备注:<t id = "notes"></t></p>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <!-- End Row -->
  59. </div>
  60. <!-- CONTAINER CLOSE -->
  61. <script src="assets/js/jquery.min.js"></script>
  62. <script>
  63. $(document).ready(function () {
  64. $('#search-btn').click(function () {
  65. var searchValue = $('#search-input').val();
  66. $.ajax({
  67. url: 'controller/OrderSearch.php',
  68. type: 'POST',
  69. data: {searchValue: searchValue},
  70. success: function (response) {
  71. var data = JSON.parse(response);
  72. // console.log(data);
  73. if (data.status === 'error') {
  74. // 处理错误情况
  75. alert(data.msg);
  76. } else {
  77. // 将 status 转换为文字描述
  78. var statusText = '';
  79. switch (data.status) {
  80. case '0':
  81. statusText = '未处理';
  82. break;
  83. case '1':
  84. statusText = '已下单';
  85. break;
  86. case '2':
  87. statusText = '已发货';
  88. break;
  89. case '3':
  90. statusText = '已完成';
  91. break;
  92. case '4':
  93. statusText = '开卡失败';
  94. break;
  95. default:
  96. statusText = '未知状态';
  97. }
  98. // 渲染数据到页面上
  99. $('#oderid').text(data.oderid);
  100. $('#phones').text(data.phones);
  101. $('#uid').text(data.uid);
  102. $('#status').text(statusText);
  103. $('#name').text(data.name);
  104. $('#time').text(data.time);
  105. $('#tgaccount').text(data.tgaccount);
  106. $('#goods').text(data.goods);
  107. $('#thirdphone').text(data.thirdphone);
  108. $('#iccid').text(data.iccid);
  109. $('#notes').text(data.notes);
  110. }
  111. }
  112. });
  113. });
  114. });
  115. </script>
  116. <?php require_once('common/footer.php'); ?>
  117. <?php
  118. } else {
  119. echo "<script>alert('登录过过期,没有权限访问该页面');location.href='login.html';</script>";
  120. }