adv_form.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-empty"></div>
  4. <form id="adv_form" enctype="multipart/form-data" method="post" name="advForm">
  5. <table class="ds-default-table">
  6. <tbody>
  7. <tr class="noborder">
  8. <td class="required w120"><label class="validation" for="adv_name">{$Think.lang.adv_name}:</label></td>
  9. <td class="vatop rowform"><input type="text" name="adv_name" id="adv_name" class="txt" value="{$adv.adv_title|default=''}"></td>
  10. <td class="vatop tips"></td>
  11. </tr>
  12. <tr class="noborder">
  13. <td class="required"><label>{$Think.lang.adv_ap_id}:</label></td>
  14. <td class="vatop rowform">
  15. <select name="ap_id" id="ap_id">
  16. {foreach name="ap_list" item="ap" key="ap_k" }
  17. <option value='{$ap.ap_id}' {if condition="$Request.param.ap_id eq $ap.ap_id || $adv.ap_id eq $ap.ap_id"}selected{/if}>{$ap.ap_name}[{$ap.ap_width}X{$ap.ap_height}]</option>
  18. {/foreach}
  19. </select>
  20. </td>
  21. <td class="vatop tips"></td>
  22. </tr>
  23. <tr class="noborder">
  24. <td class="required"><label for="adv_startdate">{$Think.lang.ds_start_time}:</label></td>
  25. <td class="vatop rowform"><input type="text" name="adv_startdate" id="adv_startdate" class="txt date" value="{:date('Y-m-d',$adv.adv_startdate)}"></td>
  26. <td class="vatop tips"></td>
  27. </tr>
  28. <tr class="noborder">
  29. <td class="required"><label for="adv_startdate">{$Think.lang.adv_sort}:</label></td>
  30. <td class="vatop rowform"><input type="text" name="adv_sort" id="adv_sort" class="txt" value="{$adv.adv_sort|default='0'}">
  31. </td>
  32. <td class="vatop tips">{$Think.lang.adv_sort_role}</td>
  33. </tr>
  34. <tr class="noborder">
  35. <td class="required"><label for="adv_startdate">{$Think.lang.adv_enabled}:</label></td>
  36. <td class="vatop rowform">
  37. <div class="onoff">
  38. <label for="adv_enabled1" class="cb-enable {if condition="$adv.adv_enabled eq 1"}selected{/if}">{$Think.lang.ds_open}</label>
  39. <label for="adv_enabled0" class="cb-disable {if condition="$adv.adv_enabled eq 0"}selected{/if}">{$Think.lang.ds_close}</label>
  40. <input id="adv_enabled1" name="adv_enabled" value="1" type="radio" {if condition="$adv.adv_enabled eq 1"} checked="checked"{/if}>
  41. <input id="adv_enabled0" name="adv_enabled" value="0" type="radio" {if condition="$adv.adv_enabled eq 0"} checked="checked"{/if}>
  42. </div>
  43. </td>
  44. <td class="vatop tips"></td>
  45. </tr>
  46. <tr class="noborder">
  47. <td class="required"><label for="adv_enddate">{$Think.lang.ds_end_time}:</label></td>
  48. <td class="vatop rowform"><input type="text" name="adv_enddate" id="adv_enddate" class="txt date" value="{:date('Y-m-d',$adv.adv_enddate)}"></td>
  49. <td class="vatop tips"></td>
  50. </tr>
  51. <tr id="adv_code" class="noborder">
  52. <input type="hidden" name="mark" value="0">
  53. <td class="required"><label for="file_adv_code">{$Think.lang.adv_img_upload}:</label></td>
  54. <td class="vatop rowform">
  55. {notempty name="$adv.adv_code"}
  56. <span class="type-file-show"><img class="show_image" src="{$Think.ADMIN_SITE_ROOT}/images/preview.png">
  57. <div class="type-file-preview"><img src="{:ds_get_pic(ATTACH_ADV,$adv.adv_code)}"></div>
  58. </span>
  59. {/notempty}
  60. <span class="type-file-box">
  61. <input type='text' name='textfield' id='textfield1' class='type-file-text' />
  62. <input type='button' name='button' id='button1' value='上传' class='type-file-button' />
  63. <input name="adv_code" id="file_adv_code" type="file" class="type-file-file" id="site_logo" size="30" hidefocus="true">
  64. </span>
  65. </td>
  66. <td class="vatop tips">{$Think.lang.adv_edit_support}gif,jpg,jpeg,png </td>
  67. </tr>
  68. <tr class="noborder" >
  69. <td class="required"><label for="adv_bgcolor">{$Think.lang.adv_bgcolor}:</label></td>
  70. <td class="vatop rowform">
  71. <input id="adv_bgcolor" type="text" name="adv_bgcolor" value="{$adv.adv_bgcolor|default='#fff'}"/>
  72. </td>
  73. </tr>
  74. <tr id="adv_link" class="noborder">
  75. <td class="required"><label for="adv_link">{$Think.lang.adv_link}:</label></td>
  76. <td class="vatop rowform"><input type="text" id="adv_link" name="adv_link" value="{$adv.adv_link|default=''}" class="txt"></td>
  77. <td class="vatop tips">{$Think.lang.adv_link_donotadd}</td>
  78. </tr>
  79. </tbody>
  80. <tfoot>
  81. <tr class="tfoot">
  82. <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
  83. </tr>
  84. </tfoot>
  85. </table>
  86. </form>
  87. </div>
  88. <link href="{$Think.PLUGINS_SITE_ROOT}/colorpicker/evol.colorpicker.css" rel="stylesheet" type="text/css">
  89. <script src="{$Think.PLUGINS_SITE_ROOT}/colorpicker/evol.colorpicker.min.js"></script>
  90. <script type="text/javascript">
  91. $(function(){
  92. $('#adv_startdate').datepicker({dateFormat: 'yy-mm-dd'});
  93. $('#adv_enddate').datepicker({dateFormat: 'yy-mm-dd'});
  94. $('#adv_bgcolor').colorpicker({showOn: 'both'});
  95. $("#file_adv_code").change(function () {
  96. $("#textfield1").val($("#file_adv_code").val());
  97. });
  98. });
  99. </script>
  100. <script>
  101. //按钮先执行验证再提交表单
  102. $(function(){
  103. $('#adv_form').validate({
  104. errorPlacement: function(error, element){
  105. error.appendTo(element.parent().parent().find('td:last'));
  106. },
  107. rules : {
  108. adv_name : {
  109. required : true
  110. }
  111. },
  112. messages : {
  113. adv_name : {
  114. required : '{$Think.lang.ap_can_not_null}'
  115. }
  116. }
  117. });
  118. });
  119. </script>