shop.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php
  2. session_start();
  3. if (isset($_SESSION["account"])) {
  4. include_once("../untils/conn.php");
  5. mysqli_query($con, "set names utf8");
  6. // 获取当前正在登录的账号信息的代理
  7. $proxy_acc = $_SESSION["account"];
  8. // echo $proxy_acc ;
  9. // 防止 SQL 注入攻击
  10. $proxy_acc = mysqli_real_escape_string($con, $proxy_acc);
  11. // 查询proxy表,找到符合条件的数据并输出给前端
  12. $sql = "SELECT * FROM proxy WHERE proxy_acc = '$proxy_acc'";
  13. $result = mysqli_query($con, $sql);
  14. if ($result) {
  15. $rows = mysqli_fetch_assoc($result);
  16. $puid = $rows["proxy_id"];
  17. // echo $puid ;
  18. $sql = "SELECT * FROM shopsy WHERE puid = '$puid'";
  19. $result = mysqli_query($con, $sql);
  20. if ($result) {
  21. $row = mysqli_fetch_assoc($result);
  22. $link = $row["link"];
  23. $link_one = $row["link_one"];
  24. $link_two = $row["link_two"];
  25. $kefutime = $row["kefutime"];
  26. $shop_name = $row["shop_name"];
  27. }
  28. }
  29. ?>
  30. <?php require_once('common/header.php'); ?>
  31. <?php require_once('common/sidebar.php'); ?>
  32. <div class="main-content app-content mt-0">
  33. <div class="side-app">
  34. <div class="main-container container-fluid">
  35. <div class="card"></div>
  36. <div class="row row-sm">
  37. <div class="col-lg-12">
  38. <div class="card">
  39. <div class="card-body">
  40. <form class="was-validated" method="POST" enctype="multipart/form-data" action="Doshop.php">
  41. <label for="validationTextarea">店铺昵称</label>
  42. <div class="form-row">
  43. <div class="form-group col-md-6 mb-0">
  44. <div class="form-group">
  45. <input type="text" class="form-control" name="shop_name" id="shop_name" placeholder="店铺名称(显示于标题)" value="<?php echo $shop_name ?>">
  46. </div>
  47. </div>
  48. </div>
  49. <div class="mb-3">
  50. <label for="validationTextarea">客服在线时间</label>
  51. <textarea class="form-control is-invalid" name="kefutime" id="kefutime"
  52. placeholder="请输入客服在线时间列如:客服在线时间:8:00-20:00" ><?php echo $kefutime ?></textarea>
  53. <div class="invalid-feedback"></div>
  54. </div>
  55. <div class="input-group is-invalid">
  56. <div class="form-file">
  57. <input type="file" class="form-control" name="kefuurl"
  58. id="kefuurl" >
  59. <label for="validatedInputGroupCustomFile"></label>
  60. </div>
  61. </div>
  62. <div class="invalid-feedback">客服页的二维码</div>
  63. <div class="input-group is-invalid">
  64. <div class="form-file">
  65. <input type="file" class="form-control" name="banner"
  66. id="banner" >
  67. <label for="validatedInputGroupCustomFile"></label>
  68. </div>
  69. </div>
  70. <div class="invalid-feedback">上传店铺主页轮播图这是第一张</div>
  71. <div class="form-row">
  72. <div class="form-group col-md-6 mb-0">
  73. <div class="form-group">
  74. <input type="text" class="form-control" name="link" id="link" placeholder="跳转链接" value="<?php echo $link ?>">
  75. </div>
  76. </div>
  77. </div>
  78. <div class="input-group is-invalid">
  79. <div class="form-file">
  80. <input type="file" class="form-control" name="banner_one"
  81. id="banner_one" >
  82. <label for="validatedInputGroupCustomFile"></label>
  83. </div>
  84. </div>
  85. <div class="invalid-feedback">上传店铺主页轮播图这是第二张</div>
  86. <div class="form-row">
  87. <div class="form-group col-md-6 mb-0">
  88. <div class="form-group">
  89. <input type="text" class="form-control" name="link_one" id="link_one" placeholder="跳转链接2" value="<?php echo $link_one ?>">
  90. </div>
  91. </div>
  92. </div>
  93. <div class="input-group is-invalid">
  94. <div class="form-file">
  95. <input type="file" class="form-control" name="banner_two"
  96. id="banner_two" >
  97. <label for="validatedInputGroupCustomFile"></label>
  98. </div>
  99. </div>
  100. <div class="invalid-feedback">上传店铺主页轮播图这是第三张</div>
  101. <div class="form-row">
  102. <div class="form-group col-md-6 mb-0">
  103. <div class="form-group">
  104. <input type="text" class="form-control" name="link_two" id="link_two" placeholder="跳转链接3" value="<?php echo $link_two ?>">
  105. </div>
  106. </div>
  107. </div>
  108. <input type="hidden" name="puid" value="<?php echo $puid ?>">
  109. <div class="form-footer mt-2">
  110. <button type="submit" class="btn btn-primary" style=" padding-left: 80px;padding-right: 80px;">提交</button>
  111. </div>
  112. </form>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <?php require_once('common/footer.php'); ?>
  121. <?php
  122. } else {
  123. echo "<script>alert('登录过过期,没有权限访问该页面');location.href='login.html';</script>";
  124. }