updatesta.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. <?php
  10. include_once("../untils/conn.php");
  11. $id = $_GET['id'];
  12. $data = mysqli_query($con, "select * from oder where id=" . $id);
  13. $rows = mysqli_fetch_row($data);
  14. ?>
  15. <div class="card">
  16. <div class="card-header bg-primary">
  17. <h4>处理订单状态</h4>
  18. </div>
  19. <div class="card-body">
  20. <form class="form-horizontal" action="controller/doUpdatesta.php" method="POST">
  21. <div class="form-group">
  22. <label class="col-xs-12">订单处理状态:</label>
  23. <div class="col-xs-12">
  24. <select name="status" id="status" class="form-control">
  25. <option value="">请选择状态</option>
  26. <?php
  27. include_once("../untils/conn.php");
  28. mysqli_query($con, "set names utf8");
  29. // 获取订单状态
  30. $status_sql = "SELECT DISTINCT `status` FROM `order`";
  31. $status_data = mysqli_query($con, $status_sql);
  32. $statuses = [
  33. ['id' => 0, 'text' => '未处理'],
  34. ['id' => 1, 'text' => '已下单'],
  35. ['id' => 2, 'text' => '已发货'],
  36. ['id' => 3, 'text' => '已完成'],
  37. ['id' => 4, 'text' => '开卡失败']
  38. ];
  39. foreach($statuses as $status) {
  40. $selected = '';
  41. if ($status['id'] == $rows[9]) {
  42. $selected = 'selected';
  43. }
  44. echo "<option value='{$status['id']}' {$selected}>{$status['text']}</option>";
  45. }
  46. ?>
  47. </select>
  48. </div>
  49. </div>
  50. <div class="form-group">
  51. <label class="col-xs-12">号码状态:</label>
  52. <div class="col-xs-12">
  53. <select name="card_sta" id="status" class="form-control">
  54. <option value="">请选择状态</option>
  55. <?php
  56. include_once("../untils/conn.php");
  57. mysqli_query($con, "set names utf8");
  58. // 获取订单状态
  59. $card_sta_sql = "SELECT DISTINCT `card_sta` FROM `order`";
  60. $status_data = mysqli_query($con, $card_sta_sql);
  61. $statuses = [
  62. ['id' => 0, 'text' => '未激活'],
  63. ['id' => 1, 'text' => '已激活'],
  64. ];
  65. foreach($statuses as $status) {
  66. $selected = '';
  67. if ($status['id'] == $rows[9]) {
  68. $selected = 'selected';
  69. }
  70. echo "<option value='{$status['id']}' {$selected}>{$status['text']}</option>";
  71. }
  72. ?>
  73. </select>
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <label for="title" class="col-xs-12">备注:</label>
  78. <div class="col-xs-12">
  79. <input type="text" class="form-control" name="beizhu" placeholder="请输入备注" value="<?php echo $rows[10] ?>" required>
  80. </div>
  81. </div>
  82. <div class="form-group">
  83. <input type="hidden" name="id" value="<?php echo $id ?>">
  84. <input type="hidden" name="oderid" value="<?php echo $rows[11] ?>">
  85. <div class="offset-2 col-xs-12">
  86. <button class="btn btn-success" type="submit" value="添加">确认修改</button>
  87. </div>
  88. </div>
  89. </form>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </main>
  99. <!--End 页面主要内容-->
  100. <?php require_once('common/footer.php'); ?>
  101. <?php
  102. } else {
  103. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.php';</script>";
  104. }