stat.setting.orderprange.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php defined('InShopNC') or exit('Access Invalid!');?>
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <h3><?php echo $lang['nc_statgeneral'];?></h3>
  6. <?php echo $output['top_link'];?>
  7. </div>
  8. </div>
  9. <div class="fixed-empty"></div>
  10. <table class="table tb-type2" id="prompt">
  11. <tbody>
  12. <tr class="space odd">
  13. <th class="nobg" colspan="12"><div class="title"><h5><?php echo $lang['nc_prompts'];?></h5><span class="arrow"></span></div></th>
  14. </tr>
  15. <tr>
  16. <td>
  17. <ul>
  18. <li>设置订单金额区间,当对订单金额进行相关统计时按照以下设置的价格区间进行统计和显示</li>
  19. <li>设置价格区间的几点建议:一、建议设置的第一个价格区间起始额为0;二、价格区间应该设置完整,不要缺少任何一个起始额和结束额;三、价格区间数值应该连贯例如0~100,101~200</li>
  20. </ul></td>
  21. </tr>
  22. </tbody>
  23. </table>
  24. <form method="post" action="index.php" name="pricerangeform" id="pricerangeform">
  25. <input type="hidden" value="ok" name="form_submit">
  26. <input type="hidden" name="act" value="stat_general" />
  27. <input type="hidden" name="op" value="orderprange" />
  28. <table id="pricerang_table" class="table tb-type2">
  29. <thead class="thead">
  30. <tr class="space">
  31. <th colspan='4'><a id="addrow" href="javascript:void(0);" class="btns"><span>增加一行</span></a></th>
  32. </tr>
  33. <tr>
  34. <th>起始额</th>
  35. <th>结束额</th>
  36. <th>操作</th>
  37. </tr>
  38. </thead>
  39. <tbody>
  40. <?php if (!empty($output['list_setting']['stat_orderpricerange']) && is_array($output['list_setting']['stat_orderpricerange'])){?>
  41. <?php foreach ($output['list_setting']['stat_orderpricerange'] as $k=>$v){ ?>
  42. <tr id="row_<?php echo $k; ?>">
  43. <td><input type="text" class="txt" value="<?php echo $v['s'];?>" name="pricerange[<?php echo $k;?>][s]"></td>
  44. <td><input type="text" class="txt" value="<?php echo $v['e'];?>" name="pricerange[<?php echo $k;?>][e]"></td>
  45. <td><a href="JavaScript:void(0);" onclick="delrow(<?php echo $k;?>);"><?php echo $lang['nc_del']; ?></a></td>
  46. </tr>
  47. <?php } ?>
  48. <?php }?>
  49. </tbody>
  50. <tfoot>
  51. <tr class="tfoot">
  52. <td colspan="4" class="align-center"><a id="ncsubmit" class="btn" href="JavaScript:void(0);"><span>提交</span></a></td>
  53. </tr>
  54. </tfoot>
  55. </table>
  56. </form>
  57. </div>
  58. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
  59. <script type="text/javascript">
  60. function delrow(i){
  61. $("#row_"+i).remove();
  62. }
  63. $(function(){
  64. var i = <?php echo count($output['list_setting']['stat_orderpricerange']); ?>;
  65. i += 1;
  66. var html = '';
  67. /*新增一行*/
  68. $('#addrow').click(function(){
  69. html = '<tr id="row_'+i+'">';
  70. html += '<td><input type="text" class="txt" name="pricerange['+i+'][s]" value="0"/></td>';
  71. html += '<td><input type="text" class="txt" name="pricerange['+i+'][e]" value="0"/></td>';
  72. html += '<td><a href="JavaScript:void(0);" onclick="delrow('+i+');"><?php echo $lang['nc_del']; ?></a></td>';
  73. $('#pricerang_table').find('tbody').append(html);
  74. i += 1;
  75. });
  76. $('#ncsubmit').click(function(){
  77. var result = true;
  78. $("#pricerang_table").find("[name^='pricerange']").each(function(){
  79. if(!$(this).val()){
  80. result = false;
  81. }
  82. });
  83. if(result){
  84. $('#pricerangeform').submit();
  85. } else {
  86. showDialog('请将价格区间填写完整');
  87. }
  88. });
  89. })
  90. </script>