123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- {include file="public/header" /}
- <div class="page">
- <form id="adv_form" enctype="multipart/form-data" method="post" name="advForm">
- <table class="ds-default-table">
- <tbody>
- <tr class="noborder">
- <td class="required w120"><label class="validation" for="adv_name">{$Think.lang.adv_name}:</label></td>
- <td class="vatop rowform"><input type="text" name="adv_name" id="adv_name" class="txt" value="{$adv.adv_title|default=''}"></td>
- <td class="vatop tips"></td>
- </tr>
- <tr class="noborder">
- <td class="required"><label>{$Think.lang.adv_ap_id}:</label></td>
- <td class="vatop rowform">
- <select name="ap_id" id="ap_id">
- {foreach name="ap_list" item="ap" key="ap_k" }
- <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>
- {/foreach}
- </select>
- </td>
- <td class="vatop tips"></td>
- </tr>
- <tr class="noborder">
- <td class="required"><label for="adv_startdate">{$Think.lang.ds_start_time}:</label></td>
- <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>
- <td class="vatop tips"></td>
- </tr>
- <tr class="noborder">
- <td class="required"><label for="adv_startdate">{$Think.lang.adv_sort}:</label></td>
- <td class="vatop rowform"><input type="text" name="adv_sort" id="adv_sort" class="txt" value="{$adv.adv_sort|default='255'}"></td>
- <td class="vatop tips">{$Think.lang.adv_sort_role}</td>
- </tr>
- <tr class="noborder">
- <td class="required"><label for="adv_startdate">{$Think.lang.adv_enabled}:</label></td>
- <td class="vatop rowform">
- <div class="onoff">
- <label for="adv_enabled1" class="cb-enable {if condition="$adv.adv_enabled eq 1"}selected{/if}">{$Think.lang.ds_open}</label>
- <label for="adv_enabled0" class="cb-disable {if condition="$adv.adv_enabled eq 0"}selected{/if}">{$Think.lang.ds_close}</label>
- <input id="adv_enabled1" name="adv_enabled" value="1" type="radio" {if condition="$adv.adv_enabled eq 1"} checked="checked"{/if}>
- <input id="adv_enabled0" name="adv_enabled" value="0" type="radio" {if condition="$adv.adv_enabled eq 0"} checked="checked"{/if}>
- </div>
- </td>
- <td class="vatop tips"></td>
- </tr>
- <tr class="noborder">
- <td class="required"><label for="adv_enddate">{$Think.lang.ds_end_time}:</label></td>
- <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>
- <td class="vatop tips"></td>
- </tr>
- <tr class="noborder" id="adv_code">
- <input type="hidden" name="mark" value="0">
- <td class="required"><label for="file_adv_code">{$Think.lang.adv_img_upload}:</label></td>
- <td class="vatop rowform">
- {notempty name="$adv.adv_code"}
- <span class="type-file-show"><img class="show_image" src="{$Think.ADMIN_SITE_ROOT}/images/preview.png">
- <div class="type-file-preview"><img src="{:ds_get_pic(ATTACH_APPADV,$adv.adv_code)}"></div>
- </span>
- {/notempty}
- <span class="type-file-box">
- <input type='text' name='textfield' id='textfield1' class='type-file-text' />
- <input type='button' name='button' id='button1' value='上传' class='type-file-button' />
- <input name="adv_code" id="file_adv_code" type="file" class="type-file-file" id="site_logo" size="30" hidefocus="true">
- </span>
- </td>
- <td class="vatop tips">{$Think.lang.adv_edit_support}gif,jpg,jpeg,png </td>
- </tr>
- <tr class="noborder">
- <td class="required"><label for="adv_link">{$Think.lang.adv_link}:</label></td>
- <td class="vatop rowform">
- <input type="hidden" name="adv_typedate" value="{$adv.adv_typedate|default=''}" />
- <div style="cursor:pointer;" onclick="dsLayerOpen('{:url('Dashboard/h5_link')}','{$Think.lang.ds_link}','700px','450px')"><span id="link_url" style="color:#3297ff">{$adv.adv_typedate|default=$Think.lang.ds_please_choose}</span><span class="iconfont" style="font-size:12px"></span></div>
- </td>
- </tr>
- </tbody>
- <tfoot>
- <tr class="tfoot">
- <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
- </tr>
- </tfoot>
- </table>
- </form>
- </div>
- <script type="text/javascript">
- $(function(){
- $('#adv_startdate').datepicker({dateFormat: 'yy-mm-dd'});
- $('#adv_enddate').datepicker({dateFormat: 'yy-mm-dd'});
- $('#adv_type').on('change', function() {
- change_image_type_desc($(this).val());
- });
- $("#file_adv_code").change(function () {
- $("#textfield1").val($("#file_adv_code").val());
- });
- function change_image_type_desc(type) {
- var desc_array = {};
- desc_array['goods'] = '{$Think.lang.appadv_adv_form_goods_type}';
- desc_array['store'] = '{$Think.lang.appadv_adv_form_store_type}';
- desc_array['article'] = '{$Think.lang.appadv_adv_form_article_type}';
- desc_array['url'] = '{$Think.lang.appadv_adv_form_url_type}';
- $('.adv_type_desc').text(desc_array[type]);
- }
- });
- </script>
- <script>
- $(document).ready(function () {
- $('#adv_form').validate({
- errorPlacement: function (error, element) {
- error.appendTo(element.parent().parent().find('td:last'));
- },
- rules: {
- adv_name : {
- required: true
- },
- adv_sort : {
- number:true,
- range:[0,255]
- }
- },
- messages: {
- adv_name : {
- required : '{$Think.lang.adv_can_not_null}'
- },
- adv_sort : {
- number:'{$Think.lang.ds_sort_number}',
- range:'{$Think.lang.ds_range_0_255}'
- }
- }
- });
- });
- function setLink(path){
- $('input[name="adv_typedate"]').val(path)
- $('#link_url').text(path)
- }
- </script>
|