add.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. <div class="card">
  10. <div class="card-header bg-primary">
  11. <h4>添加产品</h4>
  12. </div>
  13. <div class="card-body">
  14. <form class="form-horizontal" action="controller/tianjia.php" method="POST">
  15. <div class="form-group">
  16. <label class="col-xs-12">名称:</label>
  17. <div class="col-xs-12">
  18. <input type="text" class="form-control" name="name" placeholder="请输入产品名称" required>
  19. </div>
  20. </div>
  21. <div class="form-group">
  22. <label class="col-xs-12">提单接口:</label>
  23. <div class="col-xs-12">
  24. <select class="form-control" id="provider" onchange="toggleInput()" name = "api_type">
  25. <option value="yqrapi" selected>172系统</option>
  26. <option value="yidong">移动</option>
  27. <option value="hnhklt">海南联通</option>
  28. <option value="zgdx">电信</option>
  29. <option value="gantanhao">感探号</option>
  30. <option value="haokeyun">号氪云</option>
  31. </select>
  32. </div>
  33. </div>
  34. <div class="form-group" id="haokaidGroup" style="display: none;" >
  35. <label class="col-xs-12">172号卡商品id:</label>
  36. <div class="col-xs-12">
  37. <input type="text" class="form-control" name="yqrid" placeholder="没有可填0" >
  38. </div>
  39. </div>
  40. <div class="form-group" id="ltGroup" style="display: none;" >
  41. <label class="col-xs-12">联通产品类型:</label>
  42. <div class="col-xs-12">
  43. <input type="text" class="form-control" name="productType" placeholder="联通产品类型ID" >
  44. </div>
  45. </div>
  46. <div class="form-group" id="xhGroup" style="display: none;" >
  47. <label class="col-xs-12">是否支持选号:</label>
  48. <div class="col-xs-12">
  49. <select class="form-control" name ="se_num">
  50. <option value="0" selected>不支持</option>
  51. <option value="1">支持</option>
  52. </select>
  53. </div>
  54. </div>
  55. <div class="form-group" id="haoke" style="display: none;" >
  56. <label class="col-xs-12">号氪产品编号:</label>
  57. <div class="col-xs-12">
  58. <input type="text" class="form-control" name="goodsCode" placeholder="号氪产品编号" >
  59. </div>
  60. </div>
  61. <div class="form-group" id="gantan" style="display: none;" >
  62. <label class="col-xs-12">感叹号产品编号:</label>
  63. <div class="col-xs-12">
  64. <input type="text" class="form-control" name="sku" placeholder="感叹号产品编号" >
  65. </div>
  66. </div>
  67. <div class="form-group">
  68. <label class="col-xs-12">下单模版:</label>
  69. <div class="col-xs-12">
  70. <select class="form-control" name = "downtel">
  71. <option value="one" selected>默认模板-系统平台模版</option>
  72. <option value="two">蓝色互动模版-不支持选号</option>
  73. </select>
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <label class="col-xs-12">介绍:</label>
  78. <div class="col-xs-12">
  79. <input type="text" class="form-control" name="jieshao" placeholder="请输入产品简短介绍" >
  80. </div>
  81. </div>
  82. <div class="form-group">
  83. <label class="col-xs-12">时长:</label>
  84. <div class="col-xs-12">
  85. <input type="text" class="form-control" name="ltime" placeholder="套餐时长,建议四个字" >
  86. </div>
  87. </div>
  88. <div class="form-group">
  89. <?php
  90. include_once("../untils/conn.php");
  91. mysqli_query($con, "set names utf8");
  92. if ($con) {
  93. //选择数据库
  94. if ($db) {
  95. //获取数据总行数
  96. $sortsql = "select * from sort";
  97. $sortdata = mysqli_query($con, $sortsql);
  98. ?>
  99. <label class="col-xs-12">运营商:</label>
  100. <div class="col-xs-12">
  101. <select name="yys" id="yys" class="form-control">
  102. <?php
  103. while ($sortrow = mysqli_fetch_array($sortdata)) {
  104. ?>
  105. <option value="<?php echo $sortrow["yys"] ?>" name="<?php echo $sortrow["yys"] ?>"><?php echo $sortrow["yys"] ?></option>
  106. <?php
  107. }
  108. ?>
  109. </select>
  110. </div>
  111. <?php
  112. }
  113. }
  114. ?>
  115. </div>
  116. <div class="form-group">
  117. <label class="col-xs-12">限龄:</label>
  118. <div class="col-xs-12">
  119. <input type="text" class="form-control" name="other" placeholder="可以写限龄,或其他,用于显示前台,可为空" >
  120. </div>
  121. </div>
  122. <div class="form-group">
  123. <label class="col-xs-12">归属地:</label>
  124. <div class="col-xs-12">
  125. <input type="text" class="form-control" name="gsd" placeholder="请输入号卡归属地" required>
  126. </div>
  127. </div>
  128. <div class="form-group">
  129. <label class="col-xs-12">商品标签:</label>
  130. <div class="col-xs-12">
  131. <input type="text" class="form-control" name="xuanhao" placeholder="商品标签" required>
  132. </div>
  133. </div>
  134. <div class="form-group">
  135. <label class="col-xs-12">包邮方式:</label>
  136. <div class="col-xs-12">
  137. <input type="text" class="form-control" name="baoyou" placeholder="可输入全国免费包邮/京东物流等" required>
  138. </div>
  139. </div>
  140. <div class="form-group">
  141. <label class="col-xs-12">主图链接:</label>
  142. <div class="col-xs-12">
  143. <input type="url" class="form-control" name="zhutu" placeholder="主图URL地址" required>
  144. </div>
  145. </div>
  146. <div class="form-group">
  147. <label class="col-xs-12">详情图</label>
  148. <div class="col-xs-12">
  149. <input type="url" class="form-control" name="link" placeholder="请输入详情图地址" required>
  150. </div>
  151. </div>
  152. <div class="form-group">
  153. <label class="col-xs-12">商品真实佣金(填写真实佣金用于数据计算)</label>
  154. <div class="col-xs-12">
  155. <input type="text" class="form-control" name="price" placeholder="商品佣金" required>
  156. </div>
  157. </div>
  158. <div class="form-group">
  159. <label class="col-xs-12">代理佣金(用于结算代理的佣金,请用商品说明一致)</label>
  160. <div class="col-xs-12">
  161. <input type="text" class="form-control" name="proxy_price" placeholder="商品佣金" required>
  162. </div>
  163. </div>
  164. <div class="form-group">
  165. <label class="col-xs-12" for="notes">商品说明(代理看到的佣金说明)</label>
  166. <div class="col-xs-12">
  167. <textarea class="form-control" name="notes" placeholder="商品代理说明"></textarea>
  168. </div>
  169. </div>
  170. <div class="form-group">
  171. <div class="offset-2 col-xs-12">
  172. <button class="btn btn-success" type="submit" value="添加">添加</button>
  173. <button class="btn btn-danger ml-3" type="reset" value="重置">重置</button>
  174. </div>
  175. </div>
  176. </form>
  177. </div>
  178. </div>
  179. </div>
  180. </main>
  181. <script>
  182. window.onload = function() {
  183. toggleInput();
  184. };
  185. function toggleInput() {
  186. var provider = document.getElementById("provider").value;
  187. var haokaidGroup = document.getElementById("haokaidGroup");
  188. var ltGroup = document.getElementById("ltGroup");
  189. var xhGroup = document.getElementById("xhGroup");
  190. var haoke = document.getElementById("haoke");
  191. var gantan = document.getElementById("gantan");
  192. if (provider === "yqrapi") {
  193. haokaidGroup.style.display = "block";
  194. ltGroup.style.display = "none";
  195. xhGroup.style.display = "none";
  196. haoke.style.display = "none";
  197. gantan.style.display = "none";
  198. } else if (provider === "hnhklt") {
  199. haokaidGroup.style.display = "none";
  200. ltGroup.style.display = "block";
  201. xhGroup.style.display = "block";
  202. haoke.style.display = "none";
  203. gantan.style.display = "none";
  204. } else if (provider === "haokeyun") {
  205. haokaidGroup.style.display = "none";
  206. ltGroup.style.display = "none";
  207. xhGroup.style.display = "none";
  208. haoke.style.display = "block";
  209. gantan.style.display = "none";
  210. } else if (provider === "gantanhao") {
  211. haokaidGroup.style.display = "none";
  212. ltGroup.style.display = "none";
  213. xhGroup.style.display = "none";
  214. haoke.style.display = "none";
  215. gantan.style.display = "block";
  216. } else {
  217. haokaidGroup.style.display = "none";
  218. ltGroup.style.display = "none";
  219. xhGroup.style.display = "none";
  220. haoke.style.display = "none";
  221. gantan.style.display = "none";
  222. }
  223. }
  224. </script>
  225. <!--End 页面主要内容-->
  226. <?php require_once('common/footer.php'); ?>
  227. <?php
  228. } else {
  229. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.php';</script>";
  230. }
  231. ?>