postapi.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. $goods = $rows[1];
  15. $sql = "SELECT haokaid FROM list WHERE name='$goods'";
  16. $res = mysqli_query($con, $sql);
  17. if(mysqli_num_rows($res) > 0){
  18. $row = mysqli_fetch_assoc($res);
  19. $haokaid = $row['haokaid'];
  20. }
  21. $sql = "SELECT * FROM kefu";
  22. $res = mysqli_query($con, $sql);
  23. if(mysqli_num_rows($res) > 0){
  24. $row = mysqli_fetch_assoc($res);
  25. $user_id = $row['appid'];
  26. $secret = $row['key'];
  27. }
  28. //替换计算签名中的秘钥
  29. $user_sign = md5("Address=".$rows[8]."&Area=".$rows[7]."&City=".$rows[6]."&DownOrderID=".$rows[11]."&IDCard=".$rows[3]."&Name=".$rows[2]."&Phone=".$rows[4]."&ProductID=".$haokaid."&Province=".$rows[5]."&ThirdPhone=&Timestamp=".time()."&user_id=".$user_id.$secret);
  30. // echo $user_sign;
  31. // exit;
  32. ?>
  33. <div class="card">
  34. <div class="card-header bg-primary">
  35. <h4>提交审核</h4>
  36. </div>
  37. <div class="card-body">
  38. <form class="form-horizontal" action="https://haokaopenapi.lot-ml.com/api/order/ApiToOrder" method="POST">
  39. <div class="form-group">
  40. <label for="title" class="col-xs-12">172商品id:</label>
  41. <div class="col-xs-12">
  42. <input type="text" class="form-control" name="ProductID" placeholder="" value="<?php echo $haokaid ?>" required>
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label for="title" class="col-xs-12">姓名:</label>
  47. <div class="col-xs-12">
  48. <input type="text" class="form-control" name="Name" placeholder="" value="<?php echo $rows[2] ?>" required>
  49. </div>
  50. </div>
  51. <div class="form-group">
  52. <label for="title" class="col-xs-12">身份证号:</label>
  53. <div class="col-xs-12">
  54. <input type="text" class="form-control" name="IDCard" placeholder="" value="<?php echo $rows[3] ?>" required>
  55. </div>
  56. </div>
  57. <div class="form-group">
  58. <label for="title" class="col-xs-12">手机号码:</label>
  59. <div class="col-xs-12">
  60. <input type="text" class="form-control" name="Phone" placeholder="" value="<?php echo $rows[4] ?>" required>
  61. </div>
  62. </div>
  63. <div class="form-group">
  64. <label for="title" class="col-xs-12">省份:</label>
  65. <div class="col-xs-12">
  66. <input type="text" class="form-control" name="Province" placeholder="" value="<?php echo $rows[5] ?>" required>
  67. </div>
  68. </div>
  69. <div class="form-group">
  70. <label for="title" class="col-xs-12">城市:</label>
  71. <div class="col-xs-12">
  72. <input type="text" class="form-control" name="City" placeholder="" value="<?php echo $rows[6] ?>" required>
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <label for="title" class="col-xs-12">县区:</label>
  77. <div class="col-xs-12">
  78. <input type="text" class="form-control" name="Area" placeholder="" value="<?php echo $rows[7] ?>" required>
  79. </div>
  80. </div>
  81. <div class="form-group">
  82. <label for="title" class="col-xs-12">地址:</label>
  83. <div class="col-xs-12">
  84. <input type="text" class="form-control" name="Address" placeholder="" value="<?php echo $rows[8] ?>" required>
  85. </div>
  86. </div>
  87. <div class="form-group">
  88. <label for="title" class="col-xs-12">我方订单id:</label>
  89. <div class="col-xs-12">
  90. <input type="text" class="form-control" name="DownOrderID" value="<?php echo $rows[11] ?>" placeholder="" required>
  91. </div>
  92. </div>
  93. <div class="form-group">
  94. <label for="title" class="col-xs-12">计算签名:</label>
  95. <div class="col-xs-12">
  96. <input type="text" class="form-control" name="user_sign" value="<?php echo $user_sign ?>" placeholder="md5签名" required>
  97. </div>
  98. </div>
  99. <div class="form-group">
  100. <input type="hidden" name="user_id" value="<?php echo $user_id ?>">
  101. <input type="hidden" name="ThirdPhone" value="">
  102. <input type="hidden" name="Timestamp" value="<?php echo time();?>">
  103. <input type="hidden" name="secret" value="<?php echo $secret ?>">
  104. <div class="offset-2 col-xs-12">
  105. <button class="btn btn-success" type="submit" value="添加">提交审核</button>
  106. </div>
  107. </div>
  108. </form>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </main>
  118. <!--End 页面主要内容-->
  119. <?php require_once('common/footer.php'); ?>
  120. <?php
  121. } else {
  122. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.php';</script>";
  123. }