waybill.add.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?php defined('InShopNC') or exit('Access Invalid!');?>
  2. <div class="page">
  3. <!-- 页面导航 -->
  4. <div class="fixed-bar">
  5. <div class="item-title">
  6. <h3>运单模板</h3>
  7. <ul class="tab-base">
  8. <?php foreach($output['menu'] as $menu) { if($menu['menu_key'] == $output['menu_key']) { ?>
  9. <li><a href="JavaScript:void(0);" class="current"><span><?php echo $menu['menu_name'];?></span></a></li>
  10. <?php } else { ?>
  11. <li><a href="<?php echo $menu['menu_url'];?>" ><span><?php echo $menu['menu_name'];?></span></a></li>
  12. <?php } } ?>
  13. </ul>
  14. </div>
  15. </div>
  16. <div class="fixed-empty"></div>
  17. <form id="add_form" method="post" action="<?php echo urlAdmin('waybill', 'waybill_save');?>" enctype="multipart/form-data">
  18. <?php if($output['waybill_info']) { ?>
  19. <input type="hidden" name="waybill_id" value="<?php echo $output['waybill_info']['waybill_id'];?>">
  20. <input type="hidden" name="old_waybill_image" value="<?php echo $output['waybill_info']['waybill_image'];?>">
  21. <?php } ?>
  22. <table class="table tb-type2">
  23. <tbody>
  24. <tr class="noborder">
  25. <td colspan="2" class="required"><label class="validation" for="waybill_name">模板名称<?php echo $lang['nc_colon'];?></label></td>
  26. </tr>
  27. <tr class="noborder">
  28. <td class="vatop rowform"><input type="text" value="<?php echo $output['waybill_info']?$output['waybill_info']['waybill_name']:'';?>" name="waybill_name" id="waybill_name" class="txt"></td>
  29. <td class="vatop tips">运单模板名称,最多10个字</td>
  30. </tr>
  31. <tr class="noborder">
  32. <td colspan="2" class="required"><label class="validation" for="waybill_name">物流公司<?php echo $lang['nc_colon'];?></label></td>
  33. </tr>
  34. <tr class="noborder">
  35. <td class="vatop rowform">
  36. <select name="waybill_express">
  37. <?php if(!empty($output['express_list']) && is_array($output['express_list'])) {?>
  38. <?php foreach($output['express_list'] as $value) {?>
  39. <option value="<?php echo $value['id'];?>|<?php echo $value['e_name'];?>" <?php if($value['selected']) { echo 'selected'; }?> ><?php echo $value['e_name'];?></option>
  40. <?php } ?>
  41. <?php } ?>
  42. </select>
  43. </td>
  44. <td class="vatop tips">模板对应的物流公司</td>
  45. </tr>
  46. <tr class="noborder">
  47. <td colspan="2" class="required"><label class="validation" for="waybill_width">宽度<?php echo $lang['nc_colon'];?></label></td>
  48. </tr>
  49. <tr class="noborder">
  50. <td class="vatop rowform"><input type="text" value="<?php echo $output['waybill_info']?$output['waybill_info']['waybill_width']:'';?>" name="waybill_width" id="waybill_width" class="txt"></td>
  51. <td class="vatop tips">运单宽度,单位为毫米(mm)</td>
  52. </tr>
  53. <tr class="noborder">
  54. <td colspan="2" class="required"><label class="validation" for="waybill_height">高度<?php echo $lang['nc_colon'];?></label></td>
  55. </tr>
  56. <tr class="noborder">
  57. <td class="vatop rowform"><input type="text" value="<?php echo $output['waybill_info']?$output['waybill_info']['waybill_height']:'';?>" name="waybill_height" id="waybill_height" class="txt"></td>
  58. <td class="vatop tips">运单高度,单位为毫米(mm)</td>
  59. </tr>
  60. <tr class="noborder">
  61. <td colspan="2" class="required"><label class="validation" for="waybill_top">上偏移量<?php echo $lang['nc_colon'];?></label></td>
  62. </tr>
  63. <tr class="noborder">
  64. <td class="vatop rowform"><input type="text" value="<?php echo $output['waybill_info']?$output['waybill_info']['waybill_top']:'0';?>" name="waybill_top" id="waybill_top" class="txt"></td>
  65. <td class="vatop tips">运单模板上偏移量,单位为毫米(mm)</td>
  66. </tr>
  67. <tr class="noborder">
  68. <td colspan="2" class="required"><label class="validation" for="waybill_left">左偏移量<?php echo $lang['nc_colon'];?></label></td>
  69. </tr>
  70. <tr class="noborder">
  71. <td class="vatop rowform"><input type="text" value="<?php echo $output['waybill_info']?$output['waybill_info']['waybill_left']:'0';?>" name="waybill_left" id="waybill_left" class="txt"></td>
  72. <td class="vatop tips">运单模板左偏移量,单位为毫米(mm)</td>
  73. </tr>
  74. <tr class="noborder">
  75. <td colspan="2" class="required"><label class="validation" for="waybill_image">模板图片<?php echo $lang['nc_colon'];?></label></td>
  76. </tr>
  77. <tr class="noborder">
  78. <td class="vatop rowform">
  79. <span class="type-file-show">
  80. <?php if($output['waybill_info']) { ?>
  81. <img class="show_image" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/preview.png">
  82. <div class="type-file-preview"><img width="500" src="<?php echo $output['waybill_info']['waybill_image_url'];?>"></div>
  83. <?php } ?>
  84. </span>
  85. <span class="type-file-box">
  86. <input type='text' name='waybill_image_name' id='waybill_image_name' class='type-file-text' />
  87. <input type='button' name='button' id='button1' value='' class='type-file-button' />
  88. <input name="waybill_image" type="file" class="type-file-file" id="waybill_image" size="30" hidefocus="true" nc_type="change_seller_center_logo">
  89. </span>
  90. </td>
  91. <td class="vatop tips">请上传扫描好的运单图片,图片尺寸必须与快递单实际尺寸相符</td>
  92. </tr>
  93. <tr class="noborder">
  94. <td colspan="2" class="required"><label class="validation" for="waybill_image">启用<?php echo $lang['nc_colon'];?></label></td>
  95. </tr>
  96. <tr class="noborder">
  97. <td class="vatop rowform">
  98. <?php
  99. if(!empty($output['waybill_info']) && $output['waybill_info']['waybill_usable'] == '1') {
  100. $usable = 1;
  101. } else {
  102. $usable = 0;
  103. }
  104. ?>
  105. <input id="waybill_usable_1" type="radio" name="waybill_usable" value="1" <?php echo $usable ? 'checked' : '';?>>
  106. <label for="waybill_usable_1">是</label>
  107. <input id="waybill_usable_0" type="radio" name="waybill_usable" value="0" <?php echo $usable ? '' : 'checked';?>>
  108. <label for="waybill_usable_0">否</label>
  109. <td class="vatop tips">请首先设计并测试模板然后再启用,启用后商家可以使用</td>
  110. </tr>
  111. </tbody>
  112. <tfoot>
  113. <tr>
  114. <td colspan="2"><a id="submit" href="javascript:void(0)" class="btn"><span><?php echo $lang['nc_submit'];?></span></a></td>
  115. </tr>
  116. </tfoot>
  117. </table>
  118. </form>
  119. </div>
  120. <script type="text/javascript">
  121. $(document).ready(function(){
  122. $("#waybill_image").change(function(){
  123. $("#waybill_image_name").val($(this).val());
  124. });
  125. $("#submit").click(function(){
  126. $("#add_form").submit();
  127. });
  128. $('#add_form').validate({
  129. errorPlacement: function(error, element){
  130. error.appendTo(element.parents('tr').prev().find('td:first'));
  131. },
  132. rules : {
  133. waybill_name: {
  134. required : true,
  135. maxlength : 10
  136. },
  137. waybill_width: {
  138. required : true,
  139. digits: true
  140. },
  141. waybill_height: {
  142. required : true,
  143. digits: true
  144. },
  145. waybill_top: {
  146. required : true,
  147. number: true
  148. },
  149. waybill_left: {
  150. required : true,
  151. number: true
  152. },
  153. waybill_image: {
  154. <?php if(!$output['waybill_info']) { ?>
  155. required : true,
  156. <?php } ?>
  157. accept: "jpg|jpeg|png"
  158. }
  159. },
  160. messages : {
  161. waybill_name: {
  162. required : "模板名称不能为空",
  163. maxlength : "模板名称最多10个字"
  164. },
  165. waybill_width: {
  166. required : "宽度不能为空",
  167. digits: "宽度必须为数字"
  168. },
  169. waybill_height: {
  170. required : "高度不能为空",
  171. digits: "高度必须为数字"
  172. },
  173. waybill_top: {
  174. required : "上偏移量不能为空",
  175. number: "上偏移量必须为数字"
  176. },
  177. waybill_left: {
  178. required : "左偏移量不能为空",
  179. number: "左偏移量必须为数字"
  180. },
  181. waybill_image: {
  182. <?php if(!$output['waybill_info']) { ?>
  183. required : '图片不能为空',
  184. <?php } ?>
  185. accept: '图片类型不正确'
  186. }
  187. }
  188. });
  189. });
  190. </script>