mb_home.edit.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php defined('InShopNC') or exit('Access Invalid!');?>
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <h3>首页设置</h3>
  6. <ul class="tab-base">
  7. <li><a href="index.php?act=mb_home&op=mb_home_list" ><span><?php echo $lang['nc_manage'];?></span></a></li>
  8. <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_edit'];?></span></a></li>
  9. </ul>
  10. </div>
  11. </div>
  12. <div class="fixed-empty"></div>
  13. <form id="link_form" enctype="multipart/form-data" method="post">
  14. <input type="hidden" name="form_submit" value="ok" />
  15. <input type="hidden" name="h_id" value="<?php echo $output['home_array']['h_id'];?>" />
  16. <table class="table tb-type2">
  17. <tbody>
  18. <tr class="noborder">
  19. <td colspan="2" class="required"><label class="validation" for="h_title"><?php echo $lang['home_index_title'];?>:</label></td>
  20. </tr>
  21. <tr class="noborder">
  22. <td class="vatop rowform"><input type="text" value="<?php echo $output['home_array']['h_title'];?>" name="h_title" id="h_title" class="txt"></td>
  23. <td class="vatop tips"><?php echo $lang['home_add_name'];?></td>
  24. </tr>
  25. <tr class="noborder">
  26. <td colspan="2" class="required"><label class="validation" for="h_desc"><?php echo $lang['home_index_desc'];?>:</label></td>
  27. </tr>
  28. <tr class="noborder">
  29. <td class="vatop rowform"><input type="text" value="<?php echo $output['home_array']['h_desc'];?>" name="h_desc" id="h_desc" class="txt"></td>
  30. <?php if($output['home_array']['h_type'] == 'type1') { ?>
  31. <td class="vatop tips"><?php echo $lang['home_add_desc'];?></td>
  32. <?php } else { ?>
  33. <td class="vatop tips">推荐两个关键词用逗号分割(例:精品女装,服装箱包)</td>
  34. <?php } ?>
  35. </tr>
  36. <tr class="noborder">
  37. <td colspan="2" class="required"><label class="validation" for="h_keyword"><?php echo $lang['home_index_keyword'];?>:</label></td>
  38. </tr>
  39. <tr class="noborder">
  40. <td class="vatop rowform"><input type="text" value="<?php echo $output['home_array']['h_keyword'];?>" name="h_keyword" id="h_keyword" class="txt"></td>
  41. <td class="vatop tips"><?php echo $lang['home_add_keyword'];?></td>
  42. </tr>
  43. <?php if($output['home_array']['h_type'] == 'type1') { ?>
  44. <tr class="noborder">
  45. <td colspan="2" class="required"><label class="validation" for="h_keyword">多关键词:</label></td>
  46. </tr>
  47. <tr class="noborder">
  48. <td class="vatop rowform"><input type="text" value="<?php echo $output['home_array']['h_multi_keyword'];?>" name="h_multi_keyword" id="h_multi_keyword" class="txt"></td>
  49. <td class="vatop tips">首页显示的多关键词,最多6个词,用半角逗号分割(例子:男装,女装)</td>
  50. </tr>
  51. <?php } ?>
  52. <tr>
  53. <td colspan="2" class="required"><label for=""><?php echo $lang['home_index_pic_sign'];?>:</label></td>
  54. </tr>
  55. <tr class="noborder">
  56. <td class="vatop rowform"><span class="type-file-show"><img class="show_image" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/preview.png">
  57. <div class="type-file-preview"><img src="<?php echo UPLOAD_SITE_URL.DS.ATTACH_MOBILE.'/home/'.$output['home_array']['h_img'];?>"></div>
  58. </span> <span class="type-file-box">
  59. <input name="h_img" type="file" class="type-file-file" id="h_img" size="30">
  60. </span></td>
  61. <td class="vatop tips"><?php echo $lang['home_add_sign']; ?></td>
  62. </tr>
  63. <tr>
  64. <td colspan="2" class="required"><label for="h_sort"><?php echo $lang['nc_sort'];?>:</label></td>
  65. </tr>
  66. <tr class="noborder">
  67. <td class="vatop rowform"><input type="text" value="<?php echo $output['home_array']['h_sort'];?>" name="h_sort" id="h_sort" class="txt"></td>
  68. <td class="vatop tips"><?php echo $lang['home_add_sort_tip'];?></td>
  69. </tr>
  70. <tfoot>
  71. <tr class="tfoot">
  72. <td colspan="15"><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span><?php echo $lang['nc_submit'];?></span></a></td>
  73. </tr>
  74. </tfoot>
  75. </table>
  76. </form>
  77. </div>
  78. <script>
  79. //按钮先执行验证再提交表单
  80. $(function(){$("#submitBtn").click(function(){
  81. if($("#link_form").valid()){
  82. $("#link_form").submit();
  83. }
  84. });
  85. });
  86. //
  87. $(document).ready(function(){
  88. $('#link_form').validate({
  89. errorPlacement: function(error, element){
  90. error.appendTo(element.parent().parent().prev().find('td:first'));
  91. },
  92. rules : {
  93. h_title : {
  94. required : true,
  95. maxlength : 6
  96. },
  97. h_desc : {
  98. required : true,
  99. maxlength : 10
  100. },
  101. h_keyword : {
  102. required : true,
  103. maxlength : 6
  104. },
  105. h_sort : {
  106. number : true
  107. }
  108. },
  109. messages : {
  110. h_title : {
  111. required : '<?php echo $lang['home_add_null'];?>',
  112. maxlength : '<?php echo $lang['home_add_maxlength'];?>'
  113. },
  114. h_desc : {
  115. required : '<?php echo $lang['home_add_null'];?>',
  116. maxlength : '<?php echo $lang['home_add_maxlength'];?>'
  117. },
  118. h_keyword : {
  119. required : '<?php echo $lang['home_add_null'];?>',
  120. maxlength : '<?php echo $lang['home_add_maxlength'];?>'
  121. },
  122. h_sort : {
  123. number : '<?php echo $lang['home_add_sort_int'];?>'
  124. }
  125. }
  126. });
  127. });
  128. </script>
  129. <script type="text/javascript">
  130. $(function(){
  131. var textButton="<input type='text' name='textfield' id='textfield1' class='type-file-text' /><input type='button' name='button' id='button1' value='' class='type-file-button' />"
  132. $(textButton).insertBefore("#h_img");
  133. $("#h_img").change(function(){
  134. $("#textfield1").val($("#h_img").val());
  135. });
  136. });
  137. </script>