provider.amount.control.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  2. <!--<link rel="stylesheet" type="text/css" href="--><?php //echo RESOURCE_SITE_URL;?><!--/js/jquery-ui/themes/ui-lightness/jquery.ui.css" />-->
  3. <!--<link href="--><?php //echo SHOP_SITE_URL;?><!--/templates/default/css/seller_center.css" rel="stylesheet" type="text/css"/>-->
  4. <style>
  5. .spec_table .batch {
  6. vertical-align: middle;
  7. display: inline-block;
  8. *display: inline /*IE7*/;
  9. margin-left: 4px;
  10. /* position: relative; */
  11. z-index: 1;
  12. *zoom: 1 /*IE7*/;
  13. }
  14. .spec_table .batch i {
  15. cursor: pointer;
  16. }
  17. .spec_table .batch-td {
  18. position: relative;
  19. }
  20. .spec_table .batch-input {
  21. background-color: #FFF;
  22. white-space: nowrap;
  23. padding: 4px 9px;
  24. border: solid 1px #BCE8F1;
  25. position: absolute;
  26. z-index: 9999;
  27. top: -50px;
  28. left: 30px;
  29. box-shadow: 3px 3px 0 rgba(153, 153, 153, 0.25);
  30. display:none;
  31. }
  32. .spec_table .batch-input h6 {
  33. font-size: 12px;
  34. color: #555;
  35. }
  36. .spec_table .batch-input .text {
  37. vertical-align: middle;
  38. clear: both;
  39. padding: 0 4px;
  40. vertical-align: middle;
  41. margin-right: 4px;
  42. }
  43. .spec_table .batch-input .arrow {
  44. background: url(<?php echo SHOP_SITE_URL;?>/templates/default/images/seller/ncsc_bg_img.png) no-repeat -240px -20px;
  45. display: block;
  46. width: 10px;
  47. height: 5px;
  48. margin-left: -5px;
  49. bottom: -5px;
  50. left: 50%;
  51. position: absolute;
  52. z-index: 2;
  53. }
  54. .spec_table .batch-input a.close {
  55. font-size: 11px;
  56. line-height: 12px;
  57. color: #BCE8F1;
  58. text-decoration: none;
  59. background-color: #FFF;
  60. text-align: center;
  61. display: block;
  62. width: 12px;
  63. height: 12px;
  64. border-radius: 7px;
  65. border: solid 1px #BCE8F1;
  66. top: -7px;
  67. right: -7px;
  68. position: absolute;
  69. z-index: 2;
  70. }
  71. .spec_table .text.price {
  72. width: 40px;
  73. }
  74. .tableFixed {
  75. position: fixed;
  76. top: 54px;
  77. background-color: #fff;
  78. z-index:998;
  79. left:0px;
  80. display:block;
  81. padding-left:20px;
  82. }
  83. .styleOne {
  84. width: 35px;
  85. display:inline-block
  86. }
  87. .styleTow {
  88. width: 30px;
  89. display:inline-block
  90. }
  91. .tb-type2 th.td {
  92. padding-right: 0;
  93. border-bottom: 1px dotted #CBE9F3;
  94. }
  95. .fixed-bar {
  96. margin-left:0px;
  97. padding-left:20px;
  98. }
  99. </style>
  100. <div class="page">
  101. <div class="fixed-bar">
  102. <div class="item-title">
  103. <h3>通道管理</h3>
  104. <ul class="tab-base">
  105. <li><a href="index.php?act=merchant&op=provider"><span><?php echo $lang['nc_manage'] ?></span></a></li>
  106. <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=common" class="classA" data-type="2-common"><span>普通话费单量控制</span></a></li>
  107. <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=fast" class="classA" data-type="2-fast"><span>快充话费单量控制</span></a></li>
  108. <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=common" class="classA" data-type="1-common"><span>普通油卡单量控制</span></a></li>
  109. <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=fast" class="classA" data-type="1-fast"><span>普通油卡单量控制</span></a></li>
  110. </ul>
  111. </div>
  112. </div>
  113. <div class="fixed-empty"></div>
  114. <form id="price_form" enctype="multipart/form-data" method="post">
  115. <input type="hidden" name="form_submit" value="ok"/>
  116. <table class="table tb-type2 tableFixed">
  117. <tbody class="tbody" >
  118. <tr>
  119. <td colspan="2" class="required" ><label>单量设置:</label></td>
  120. </tr>
  121. <tr>
  122. <td style="border-top: 0;color: #e60d0d;font-size:13px">
  123. 单量:请输入大于-1的数字,-1表示不限;&nbsp;&nbsp;&nbsp;&nbsp;
  124. 优先级:请输入1-100的数字;&nbsp;&nbsp;&nbsp;&nbsp;是否启动:1-开启,0-关闭
  125. </td>
  126. </tr>
  127. <tr class="noborder">
  128. <table class="spec_table tb-type2" style="width: 100%;margin-top: 77px;display: block;">
  129. <tbody id="tableHread" style="position: fixed;top:138px;left:20px;background-color: #fff;z-index:999;width: 100%;">
  130. <tr class="w550">
  131. <th style="text-align: center;width: 120px;min-width:120px;padding-right:0"></th>
  132. <?php foreach ($output['providers'] as $provider) { ?>
  133. <th style="text-align: center;width: 160px;min-width:160px;padding-right:0;background-color: #fff"><?php echo $provider['name']?></th>
  134. <?php }?>
  135. </tr>
  136. <tr class="w500" style="display:block;">
  137. <td style="text-align: center;width: 120px;min-width:120px;"></td>
  138. <?php foreach ($output['providers'] as $provider) { ?>
  139. <td style="text-align: center;width: 150px;min-width:150px;padding-right: 10px;background-color: #fff;" class="batch-td">
  140. <div style="width: 46px;display:inline-block">
  141. 单量
  142. </div>
  143. <div style="width: 40px;display:inline-block">
  144. 优先级
  145. </div>
  146. <div style="width: 40px;display:inline-block">
  147. 开关
  148. </div>
  149. </td>
  150. <?php }?>
  151. </tr>
  152. </tbody>
  153. <tbody class="tbody tableContent" style="display: block;padding-top: 56px;">
  154. <?php foreach ($output['form']['amountData'] as $key => $amount) { ?>
  155. <tr class="w500">
  156. <td style="text-align: center;width: 120px;min-width:120px;">
  157. <?php echo $amount['text']?>
  158. </td>
  159. <?php foreach ($output['providers'] as $provider) { ?>
  160. <input type="hidden" name="pid[]" value="<?php echo $provider['provider_id'];?>">
  161. <input type="hidden" name="name[]" value="<?php echo $provider['name'];?>">
  162. <input type="hidden" name="types[]" value="<?php echo $amount['type'];?>">
  163. <input type="hidden" name="amount[]" value="<?php echo $amount['amount'];?>">
  164. <input type="hidden" name="has[]" value="<?php echo $output['datas'][$provider['provider_id']][$key]['has'];?>">
  165. <td style="text-align: center;width: 150px;min-width:150px;padding-right: 10px;" class="batch-td">
  166. <div style="width: 46px;display:inline-block">
  167. <input type="text" class="input-one styleOne" name="speed[]"
  168. value="<?php echo $output['datas'][$provider['provider_id']][$key]['speed']?>"
  169. <?php if($output['datas'][$provider['provider_id']][$key]['has'] == 0){?>
  170. readOnly
  171. style="background-color:#eaeaea;"
  172. <?php }?>
  173. >
  174. <div class="batch-input" >
  175. <h6>提示:</h6>
  176. <a href="javascript:void(0)" class="close">X</a>
  177. <span>请输入大于-1的数字</span>
  178. </div>
  179. </div>
  180. <div style="width: 40px;display:inline-block;">
  181. <input type="text" class="input-tow styleTow" name="sort[]"
  182. value="<?php echo $output['datas'][$provider['provider_id']][$key]['sort']?>"
  183. <?php if($output['datas'][$provider['provider_id']][$key]['has'] == 0){?>
  184. readOnly
  185. style="background-color:#eaeaea;"
  186. <?php }?>
  187. >
  188. <div class="batch-input" >
  189. <h6>提示:</h6>
  190. <a href="javascript:void(0)" class="close">X</a>
  191. <span>请输入数字,范围在1-100</span>
  192. </div>
  193. </div>
  194. <div style="width: 40px;display:inline-block">
  195. <input type="text" class="input-three styleTow" name="opened[]"
  196. value="<?php echo $output['datas'][$provider['provider_id']][$key]['opened']?>"
  197. <?php if($output['datas'][$provider['provider_id']][$key]['has'] == 0){?>
  198. readOnly
  199. style="background-color:#eaeaea;"
  200. <?php }?>
  201. >
  202. <div class="batch-input" >
  203. <h6>提示:</h6>
  204. <a href="javascript:void(0)" class="close">X</a>
  205. <span>请输入数字0或1,1-开启;0-关闭</span>
  206. </div>
  207. </div>
  208. </td>
  209. <?php }?>
  210. </tr>
  211. <?php }?>
  212. </tbody>
  213. </table>
  214. </tr>
  215. </tbody>
  216. <tfoot>
  217. <tr class="tfoot">
  218. <td colspan="15"><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
  219. </tr>
  220. </tfoot>
  221. </table>
  222. </form>
  223. </div>
  224. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js"
  225. charset="utf-8"></script>
  226. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  227. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
  228. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
  229. <link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
  230. id="cssfile2"/>
  231. <script type="text/javascript">
  232. $(function () {
  233. $(window).scroll(function() {
  234. let toLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
  235. if (toLeft>0) {
  236. let headLeft = toLeft - 20
  237. $('#tableHread')[0].style.left = '-'+headLeft+'px'
  238. } else if (toLeft == 0) {
  239. $('#tableHread')[0].style.left = 20+'px'
  240. }
  241. });
  242. let isSubmit = true
  243. $('.input-one').blur(function () {
  244. // console.log('$(this).value', ($(this)));
  245. let value = $(this)[0].value
  246. if (value >= -1 ) {
  247. isSubmit = true;
  248. $(this)[0].style['borderColor'] = ''
  249. } else {
  250. isSubmit = false
  251. $(this)[0].style['borderColor'] = '#e64444'
  252. }
  253. })
  254. $('.input-tow').blur(function () {
  255. let value = $(this)[0].value
  256. // console.log(value);
  257. if (value >= 1 && value <= 100) {
  258. isSubmit = true;
  259. $(this)[0].style['borderColor'] = ''
  260. } else {
  261. isSubmit = false
  262. $(this)[0].style['borderColor'] = '#e64444'
  263. }
  264. })
  265. $('.input-three').blur(function () {
  266. let value = $(this)[0].value
  267. if (value == 0 || value == 1) {
  268. isSubmit = true
  269. $(this)[0].style['borderColor'] = ''
  270. } else {
  271. isSubmit = false
  272. $(this)[0].style['borderColor'] = '#e64444'
  273. }
  274. })
  275. // $('input').each(function () {
  276. // $(this).focus(function () {
  277. // })
  278. // });
  279. // 开始获取当前地址
  280. let type = '<?php echo $_GET['type'];?>';
  281. let form = '<?php echo $_GET['form'];?>';
  282. $(".classA").each(function () {
  283. if (type+'-'+form == $(this).attr("data-type")) {
  284. $(this).addClass('current')
  285. $(this).attr('href','JavaScript:void(0);')
  286. }
  287. })
  288. // 提交
  289. $("#submitBtn").click(function () {
  290. console.log('isSubmit', isSubmit);
  291. if (isSubmit) {
  292. $("#price_form").submit();
  293. }
  294. })
  295. // tab样式
  296. $(".tab-base a").click(function () {
  297. // console.log('this', $(this));
  298. $(this).addClass('current')
  299. $(this).siblings().removeClass('current')
  300. })
  301. });
  302. </script>