index.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.flea_class}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <div class="fixed-empty"></div>
  13. <div class="explanation" id="explanation">
  14. <div class="title" id="checkZoom">
  15. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  16. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  17. </div>
  18. <ul>
  19. <li>{$Think.lang.flearegion_index_help1}</li>
  20. </ul>
  21. </div>
  22. <table class="tb-type1 noborder search">
  23. <tbody>
  24. <tr>
  25. <th><label>{$Think.lang.flearegion_next}</label></th>
  26. <td>
  27. <select name="province" id="province" onchange="refreshdistrict($(this).val(),'province')">
  28. <option value="" {if $province == ''}selected='selected'{/if}>-{$Think.lang.flearegion_city}-</option>
  29. {notempty name="province_list"}
  30. {foreach name="province_list" item="v" key="k" }
  31. <option value="{$v.fleaarea_id}" {if $province == $v.fleaarea_id}selected='selected'{/if}>{$v.fleaarea_name}</option>
  32. {/foreach}
  33. {/notempty}
  34. </select>
  35. <select name="city" id="city" onchange="refreshdistrict($(this).val(),'city')">
  36. <option value="" {if $city == ''}selected='selected'{/if}>-{$Think.lang.flearegion_region}-</option>
  37. {notempty name="city_list"}
  38. {foreach name="city_list" item="v" key="k" }
  39. <option value="{$v.fleaarea_id}" {if $city == $v.fleaarea_id}selected='selected'{/if}>{$v.fleaarea_name}</option>
  40. {/foreach}
  41. {/notempty}
  42. </select>
  43. </td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. <form method="post" id='form_area_list';>
  48. <input type='hidden' name='fleaarea_parent_id' value="{$fleaarea_parent_id}" />
  49. <input type='hidden' name='child_area_deep' value="{$child_area_deep}" />
  50. <input type='hidden' name='hidden_del_id' id='hidden_del_id' value='' />
  51. <table class="ds-default-table">
  52. <thead>
  53. <tr class="thead">
  54. <th class="align-center">{$Think.lang.ds_sort}</th>
  55. <th>{$Think.lang.fleaarea_name}</th>
  56. <th class="align-center">{$Think.lang.ds_handle}</th>
  57. </tr>
  58. </thead>
  59. <tbody id="treet1">
  60. {notempty name="area_list"}
  61. {foreach name="area_list" item="v" key="k" }
  62. <tr id='area_tr_{$v.fleaarea_id}' class="hover edit">
  63. <td class="w48 sort align-center"><span id='area_sort_{$v.fleaarea_id}'><input name="area_sort[{$v.fleaarea_id}]" value="{$v.fleaarea_sort}" type='text'/></span></td>
  64. <td class="node"><span class="node_name" id='area_name_{$v.fleaarea_id}'><input name="area_name[{$v.fleaarea_id}]" value="{$v.fleaarea_name}" type='text'/></span></td>
  65. <td class="w72 align-center"><a href="javascript:void(0)" onclick='del("{$v.fleaarea_id}");'>{$Think.lang.ds_del}</a></td>
  66. </tr>
  67. {/foreach}
  68. {/notempty}
  69. </tbody>
  70. <tbody>
  71. <tr>
  72. <td colspan="15"><a href="JavaScript:void(0);" class="btn-add-nofloat marginleft" onclick='add_tr();'><span>{$Think.lang.region_index_add}</span></a></td>
  73. </tr>
  74. </tbody>
  75. <tfoot>
  76. <tr class="tfoot">
  77. <td colspan="15"><a href="JavaScript:void(0);" class="btn" onclick="form_list_submit();"><span>{$Think.lang.ds_submit}</span></a></td>
  78. </tr>
  79. </tfoot>
  80. </table>
  81. </form>
  82. </div>
  83. {include file="public/footer" /}
  84. <script>
  85. function add_tr(){
  86. $('#treet1').append('<tr class="hover edit"><td class="w48 sort"><input type="text" name="new_area_sort[]" onchange="layer.alert(\'{$Think.lang.flea_index_fill_in_area_name}\')" value="0" /></td><td class="node"><input type="text" name="new_area_name[]" value="" /></td><td><a href="javascript:void(0)" onclick="$(this).parents(\'tr\').remove()">{$Think.lang.ds_del}</a></td></tr>');
  87. }
  88. function edit(id){
  89. //sort
  90. $('#area_sort_'+id).html("<input name='area_sort["+id+"]' value='"+$('#hidden_area_sort_'+id).val()+"' type='text'/>");
  91. //name
  92. $('#area_name_'+id).html("<input name='area_name["+id+"]' value='"+$('#hidden_area_name_'+id).val()+"' type='text'/> ");
  93. }
  94. function del(id){
  95. $('#area_tr_'+id).remove();
  96. $('#hidden_del_id').val($('#hidden_del_id').val()+'|'+id);
  97. }
  98. function refreshdistrict(parent_id,type){
  99. var url = '';
  100. if(type == 'province'){
  101. url += '&province='+$('#province').val();
  102. }
  103. if(type == 'city'){
  104. url += '&province='+$('#province').val()+'&city='+$('#city').val();
  105. }
  106. if(type == 'district'){
  107. url += '&province='+$('#province').val()+'&city='+$('#city').val()+'&district='+$('#district').val();
  108. }
  109. location.href=ADMINSITEURL+'/Flearegion/flea_region?fleaarea_parent_id='+parent_id+url;
  110. }
  111. function form_list_submit(){
  112. layer.confirm('{$Think.lang.region_index_del_tip}', {
  113. btn: ['{$Think.lang.ds_ok}', '{$Think.lang.ds_cancel}'],
  114. title: false,
  115. }, function () {
  116. $('#form_area_list').submit();
  117. });
  118. }
  119. </script>