GetOrder.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. $phone = $_GET['phone']; //获取传递过来的手机号码参数值
  3. //连接数据库,设置编码等
  4. include_once("../untils/conn.php");
  5. //查询oder表中手机号为$phone的订单信息,并将status和beizhu存为变量
  6. $sql = "SELECT * FROM oder WHERE phone='$phone'";
  7. $result = mysqli_query($con, $sql);
  8. //判断是否查询到数据
  9. if(mysqli_num_rows($result) > 0){
  10. ?>
  11. <html>
  12. <head>
  13. <meta charset="utf-8">
  14. <title>订单查询</title>
  15. <meta charset="utf-8" />
  16. <meta content="no-cache,must-revalidate" http-equiv="Cache-Control" />
  17. <meta content="no-cache" http-equiv="pragma" />
  18. <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=2.0,minimum-scale=1.0,user-scalable=no;" />
  19. <meta name="apple-mobile-web-app-capable" content="yes" />
  20. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  21. <meta name="format-detection" content="telephone=no" />
  22. <link rel="stylesheet" href="/other/odersearch/cx.css">
  23. <script type="text/javascript" src="/other/odersearch/rem.js"></script>
  24. </head>
  25. <body>
  26. <div class="orderlist_tit">订单信息</div>
  27. <ul class="orderlist_ul" id="orderlist">
  28. <?php
  29. while($row = mysqli_fetch_assoc($result)){
  30. $goods = $row['goods'];
  31. $status = $row['status'];
  32. $beizhu = $row['beizhu'];
  33. $name = $row['name'];
  34. $phone = $row['phone'];
  35. $sf = $row['sf'];
  36. $city = $row['city'];
  37. $xian = $row['xian'];
  38. $dizhi = $row['dizhi'];
  39. $time = $row['time'];
  40. $address = $sf . $city . $xian . $dizhi;
  41. ?>
  42. <li>
  43. <dt>
  44. <h1><i><?php echo $goods; ?></i><span>星级服务</span></h1>
  45. <h2>
  46. <?php if($status == 0) { ?>
  47. <h2>订单状态:未处理</h2>
  48. <?php } elseif($status == 1) { ?>
  49. <h2>订单状态:已下单</h2>
  50. <?php } elseif($status == 2) { ?>
  51. <h2>订单状态:已发货</h2>
  52. <?php } elseif($status == 3) { ?>
  53. <h2>订单状态:已完成</h2>
  54. <?php } elseif($status == 4) { ?>
  55. <h2>订单状态:开卡失败</h2>
  56. <?php } ?>
  57. </h2>
  58. <h2>订单说明:<?php echo $beizhu; ?></h2>
  59. <h2>收货人:<?php echo $name; ?></h2>
  60. <h2>收货号码:<?php echo $phone; ?></h2>
  61. <h2>收货地址:<?php echo $address; ?></h2>
  62. <h3>下单时间:<?php
  63. $timestamp = $time;
  64. $date = date('Y-m-d H:i:s', $timestamp);
  65. echo $date; // 输出:2021-07-22 16:52:07
  66. ?></h3>
  67. </dt>
  68. </li>
  69. <?php
  70. }
  71. ?>
  72. </ul>
  73. </body>
  74. </html>
  75. <?php
  76. } else {
  77. ?>
  78. <html>
  79. <head>
  80. <meta charset="utf-8">
  81. <title>订单查询</title>
  82. <meta charset="utf-8" />
  83. <meta content="no-cache,must-revalidate" http-equiv="Cache-Control" />
  84. <meta content="no-cache" http-equiv="pragma" />
  85. <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=2.0,minimum-scale=1.0,user-scalable=no;" />
  86. <meta name="apple-mobile-web-app-capable" content="yes" />
  87. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  88. <meta name="format-detection" content="telephone=no" />
  89. <link rel="stylesheet" href="/other/odersearch/cx.css">
  90. <script type="text/javascript" src="/other/odersearch/rem.js"></script>
  91. </head>
  92. <body>
  93. <div class="orderlist_tit">订单信息</div>
  94. <ul class="orderlist_ul" id="orderlist">
  95. <li style="text-align: center;padding-bottom: 10px;padding-top: 10px;">
  96. 没有您的订单信息
  97. </li>
  98. </ul>
  99. </body>
  100. </html>
  101. <?php
  102. }
  103. ?>