0acc91d4c6b3cbd91e5b98a818082973.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?php /*a:2:{s:58:"/data/web/mall.valimart.net/app/admin/view/brand/form.html";i:1657785096;s:61:"/data/web/mall.valimart.net/app/admin/view/public/header.html";i:1657785098;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <title><?php echo htmlentities((isset($html_title) && ($html_title !== '')?$html_title:config('ds_config.site_name'))); ?><?php echo htmlentities(lang('system_backend')); ?></title>
  8. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  9. <link rel="stylesheet" href="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/css/admin.css">
  10. <link rel="stylesheet" href="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.css">
  11. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery-2.1.4.min.js"></script>
  12. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.validate.min.js"></script>
  13. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.cookie.js"></script>
  14. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/common.js"></script>
  15. <script src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/js/admin.js"></script>
  16. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.js"></script>
  17. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery.ui.datepicker-zh-CN.js"></script>
  18. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/perfect-scrollbar.min.js"></script>
  19. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/layer/layer.js"></script>
  20. <script type="text/javascript">
  21. var BASESITEROOT = "<?php echo htmlentities(BASE_SITE_ROOT); ?>";
  22. var ADMINSITEROOT = "<?php echo htmlentities(ADMIN_SITE_ROOT); ?>";
  23. var BASESITEURL = "<?php echo htmlentities(BASE_SITE_URL); ?>";
  24. var HOMESITEURL = "<?php echo htmlentities(HOME_SITE_URL); ?>";
  25. var ADMINSITEURL = "<?php echo htmlentities(ADMIN_SITE_URL); ?>";
  26. </script>
  27. </head>
  28. <body>
  29. <div id="append_parent"></div>
  30. <div id="ajaxwaitid"></div>
  31. <div class="page">
  32. <form id="brand_form" method="post" name="form1" enctype="multipart/form-data">
  33. <input type="hidden" name="brand_id" value="<?php echo htmlentities($brand_array['brand_id']); ?>" />
  34. <table class="ds-default-table">
  35. <tbody>
  36. <tr class="noborder">
  37. <td class="required w120"><label class="validation"><?php echo htmlentities(lang('brand_index_name')); ?>:</label></td>
  38. <td class="vatop rowform"><input type="text" value="<?php echo htmlentities($brand_array['brand_name']); ?>" name="brand_name" id="brand_name" class="txt"></td>
  39. <td class="vatop tips"></td>
  40. </tr>
  41. <tr class="noborder">
  42. <td class="required"><label class="validation"><?php echo htmlentities(lang('brand_name_initial')); ?>:</label></td>
  43. <td class="vatop rowform"><input type="text" value="<?php echo htmlentities($brand_array['brand_initial']); ?>" name="brand_initial" id="brand_initial" class="txt"></td>
  44. <td class="vatop tips"><?php echo htmlentities(lang('brand_name_initial_tips')); ?></td>
  45. </tr>
  46. <tr class="noborder">
  47. <td class="required"><?php echo htmlentities(lang('brand_index_class')); ?>: </td>
  48. <td class="vatop rowform" id="gcategory"><input type="hidden" value="<?php echo htmlentities($brand_array['gc_id']); ?>" name="class_id" class="mls_id">
  49. <input type="hidden" value="<?php echo htmlentities($brand_array['brand_class']); ?>" name="brand_class" class="mls_name">
  50. <span class="mr10"><?php echo htmlentities($brand_array['brand_class']); ?></span>
  51. <?php if(!(empty($brand_array['class_id']) || (($brand_array['class_id'] instanceof \think\Collection || $brand_array['class_id'] instanceof \think\Paginator ) && $brand_array['class_id']->isEmpty()))): ?>
  52. <input class="edit_gcategory" type="button" value="<?php echo htmlentities(lang('ds_edit')); ?>">
  53. <?php endif; ?>
  54. <select <?php if(!(empty($brand_array['class_id']) || (($brand_array['class_id'] instanceof \think\Collection || $brand_array['class_id'] instanceof \think\Paginator ) && $brand_array['class_id']->isEmpty()))): ?>style="display:none;"<?php endif; ?> class="class-select">
  55. <option value="0"><?php echo htmlentities(lang('ds_please_choose')); ?>...</option>
  56. <?php if(!(empty($gc_list) || (($gc_list instanceof \think\Collection || $gc_list instanceof \think\Paginator ) && $gc_list->isEmpty()))): if(is_array($gc_list) || $gc_list instanceof \think\Collection || $gc_list instanceof \think\Paginator): if( count($gc_list)==0 ) : echo "" ;else: foreach($gc_list as $key=>$v): if($v['gc_parent_id'] == '0'): ?>
  57. <option value="<?php echo htmlentities($v['gc_id']); ?>"><?php echo htmlentities($v['gc_name']); ?></option>
  58. <?php endif; ?>
  59. <?php endforeach; endif; else: echo "" ;endif; ?>
  60. <?php endif; ?>
  61. </select>
  62. </td>
  63. <td class="vatop tips"><?php echo htmlentities(lang('brand_index_class_tips')); ?></td>
  64. </tr>
  65. <tr class="noborder">
  66. <td class="required"><?php echo htmlentities(lang('brand_index_pic_sign')); ?>: </td>
  67. <td class="vatop rowform">
  68. <?php if(!(empty($brand_array['brand_pic']) || (($brand_array['brand_pic'] instanceof \think\Collection || $brand_array['brand_pic'] instanceof \think\Paginator ) && $brand_array['brand_pic']->isEmpty()))): ?>
  69. <span class="type-file-show"> <img class="show_image" src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/images/preview.png">
  70. <div class="type-file-preview" style="display: none;"><img id="view_img" src="<?php echo ds_get_pic(ATTACH_BRAND,$brand_array['brand_pic']); ?>"></div>
  71. </span>
  72. <?php endif; ?>
  73. <span class="type-file-box">
  74. <input type='text' name='brand_pic' id='brand_pic' class='type-file-text' />
  75. <input type='button' name='button' id='button' value='上传' class='type-file-button' />
  76. <input name="_pic" type="file" class="type-file-file" id="_pic" size="30" hidefocus="true" />
  77. </span>
  78. </td>
  79. <td class="vatop tips"><?php echo htmlentities(lang('brand_index_upload_tips')); ?><?php echo htmlentities(lang('brand_add_support_type')); ?>gif,jpg,png</td>
  80. </tr>
  81. <tr class="noborder">
  82. <td class="required"><?php echo htmlentities(lang('brand_showtype')); ?>: </td>
  83. <td class="vatop rowform">
  84. <input id="brand_showtype_0" type="radio" <?php if($brand_array['brand_showtype']==0): ?>checked<?php endif; ?> value="0" style="margin-bottom:6px;" name="brand_showtype" />
  85. <label for="brand_showtype_0"><?php echo htmlentities(lang('brand_showtype_img')); ?></label>
  86. <input id="brand_showtype_1" type="radio" <?php if($brand_array['brand_showtype']==1): ?>checked<?php endif; ?> value="1" style="margin-bottom:6px;" name="brand_showtype" />
  87. <label for="brand_showtype_1"><?php echo htmlentities(lang('brand_showtype_text')); ?></label>
  88. </td>
  89. <td class="vatop tips"><?php echo htmlentities(lang('brand_showtype_tips')); ?></td>
  90. </tr>
  91. <tr class="noborder">
  92. <td class="required"><?php echo htmlentities(lang('brand_add_if_recommend')); ?>: </td>
  93. <td class="vatop rowform onoff"><label for="brand_recommend1" class="cb-enable <?php if($brand_array['brand_recommend'] == '1'): ?>selected<?php endif; ?>" title="<?php echo htmlentities(lang('ds_yes')); ?>"><span><?php echo htmlentities(lang('ds_yes')); ?></span></label>
  94. <label for="brand_recommend0" class="cb-disable <?php if($brand_array['brand_recommend'] == '0'): ?>selected<?php endif; ?>" title="<?php echo htmlentities(lang('ds_no')); ?>"><span><?php echo htmlentities(lang('ds_no')); ?></span></label>
  95. <input id="brand_recommend1" name="brand_recommend" <?php if($brand_array['brand_recommend'] == '1'): ?>checked="checked"<?php endif; ?> value="1" type="radio">
  96. <input id="brand_recommend0" name="brand_recommend" <?php if($brand_array['brand_recommend'] == '0'): ?>checked="checked"<?php endif; ?> value="0" type="radio"></td>
  97. <td class="vatop tips"><?php echo htmlentities(lang('brand_index_recommend_tips')); ?></td>
  98. </tr>
  99. <tr>
  100. </tr>
  101. <tr class="noborder">
  102. <td class="required"><?php echo htmlentities(lang('ds_sort')); ?>: </td>
  103. <td class="vatop rowform"><input type="text" value="<?php echo htmlentities($brand_array['brand_sort']); ?>" name="brand_sort" id="brand_sort" class="txt"></td>
  104. <td class="vatop tips"><?php echo htmlentities(lang('brand_add_update_sort')); ?></td>
  105. </tr>
  106. </tbody>
  107. <tfoot>
  108. <tr class="tfoot">
  109. <td colspan="15" ><input class="btn" type="submit" value="<?php echo htmlentities(lang('ds_submit')); ?>"/></td>
  110. </tr>
  111. </tfoot>
  112. </table>
  113. </form>
  114. </div>
  115. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/mlselection.js"></script>
  116. <script>
  117. function call_back(picname){
  118. $('#brand_pic').val(picname);
  119. $('#view_img').attr('src','<?php echo htmlentities(UPLOAD_SITE_URL); ?>/<?php echo htmlentities(ATTACH_BRAND); ?>/'+picname);
  120. }
  121. //按钮先执行验证再提交表单
  122. $(function(){
  123. // 编辑分类时清除分类信息
  124. $('.edit_gcategory').click(function(){
  125. $('input[name="class_id"]').val('');
  126. $('input[name="brand_class"]').val('');
  127. });
  128. jQuery.validator.addMethod("initial", function(value, element) {
  129. return /^[A-Za-z0-9]$/i.test(value);
  130. }, "");
  131. $("#brand_form").validate({
  132. errorPlacement: function(error, element){
  133. error.appendTo(element.parent().parent().find('td:last'));
  134. },
  135. rules : {
  136. brand_name : {
  137. required : true,
  138. remote : {
  139. url :"<?php echo url('Brand/ajax',['branch'=>'check_brand_name']); ?>",
  140. type:'get',
  141. data:{
  142. brand_name : function(){
  143. return $('#brand_name').val();
  144. },
  145. id : '<?php echo htmlentities($brand_array['brand_id']); ?>'
  146. }
  147. }
  148. },
  149. brand_initial : {
  150. initial : true
  151. },
  152. brand_sort : {
  153. number : true,
  154. range : [0,255]
  155. }
  156. },
  157. messages : {
  158. brand_name : {
  159. required : '<?php echo htmlentities(lang('brand_add_name_null')); ?>',
  160. remote : '<?php echo htmlentities(lang('brand_add_name_exists')); ?>'
  161. },
  162. brand_initial : {
  163. initial : '<?php echo htmlentities(lang('brand_add_initial')); ?>'
  164. },
  165. brand_sort : {
  166. number : '<?php echo htmlentities(lang('brand_add_sort_int')); ?>',
  167. range : '<?php echo htmlentities(lang('class_sort_explain')); ?>'
  168. }
  169. }
  170. });
  171. });
  172. gcategoryInit('gcategory');
  173. </script>