{include file="public/header" /}



<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.adv_index_manage}</h3>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>

    <form method="get" name="formSearch" id="formSearch">
        <div class="ds-search-form">
            <dl>
                <dt>{$Think.lang.adv_ap_id}</dt>
                <dd>
                    <select name="ap_id">
                        <option value="">{$Think.lang.ds_please_choose}...</option>
                        {foreach name="ap_list" item="ap_v"}
                        <option value="{$ap_v.ap_id}" {if condition="$Request.param.ap_id eq $ap_v.ap_id"}selected{/if}>{$ap_v.ap_name}[{$ap_v.ap_width}X{$ap_v.ap_height}]</option>
                        {/foreach}
                    </select>
                </dd>
            </dl>
            <div class="btn-group">
                <input type="submit" class="btn" value="{$Think.lang.ds_search}">
                {if $filtered}
                <a href="{:url('Appadv/adv')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
                {/if}
            </div>
        </div>
    </form>
    
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom">
            <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
            <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
        </div>
        <ul>
            <li>{$Think.lang.adv_help3}</li>
        </ul>
</div>

    <div class="fixed-empty"></div>
    <form method="post" id="store_form">
        <table class="ds-default-table">
            <thead>
                <tr class="thead">
                    <th></th>
                    <th>{$Think.lang.adv_name}</th>
                    <th>{$Think.lang.adv_ap_id}</th>
                    <th>{$Think.lang.adv_sort}</th>
                    <th>{$Think.lang.adv_enabled}</th>
                    <th class="align-center">{$Think.lang.ds_start_time}</th>
                    <th class="align-center">{$Think.lang.ds_end_time}</th>
                    <th class="align-center">{$Think.lang.ds_handle}</th>
                </tr>
            </thead>
            <tbody>
                {notempty name="adv_info"}
                {foreach name="adv_info" item="v"}
                <tr class="hover" id="ds_row_{$v.adv_id}">
                    <td class="w24"><input type="checkbox" class="checkitem" name="del_id[]" value="{$v.adv_id}" /></td>
                    <td class="name"><span class="editable"  ds_type="inline_edit" ajax_branch='adv_branch' fieldname="adv_title" fieldid="{$v.adv_id}" required="1"  title="{$Think.lang.ds_editable}">{$v.adv_title}</span></td>
                    <td>
                        {foreach name="ap_list" item="ap_v"}
                        {if $ap_v.ap_id === $v.ap_id }
                        <span title="{$ap_v.ap_name}">{$ap_v.ap_name}</span>
                        {/if}
                        {/foreach}
                    </td>
                    <td class="align-center sort"><span title="{$Think.lang.ds_editable}" ajax_branch="adv_branch" datatype="number" fieldid="{$v.adv_id}" fieldname="adv_sort" ds_type="inline_edit" class="editable">{$v.adv_sort}</span></td>
                    <td class="align-center yes-onoff">
                        {if $v.adv_enabled eq '0'}
                        <a href="JavaScript:void(0);" class="disabled" ajax_branch="adv_branch" ds_type="inline_edit" fieldname="adv_enabled" fieldid="{$v.adv_id}" fieldvalue="0" title="{$Think.lang.ds_editable}"><img src="{$Think.ADMIN_SITE_ROOT}/images/treetable/transparent.gif"></a>
                        {else /}
                        <a href="JavaScript:void(0);" class="enabled" ajax_branch="adv_branch" ds_type="inline_edit" fieldname="adv_enabled" fieldid="{$v.adv_id}" fieldvalue="1" title="{$Think.lang.ds_editable}"><img src="{$Think.ADMIN_SITE_ROOT}/images/treetable/transparent.gif"></a>
                        {/if}
                    </td>
                    <td class="align-center nowrap">{$v.adv_startdate|date='Y-m-d'}</td>
                    <td class="align-center nowrap">{$v.adv_enddate|date='Y-m-d'}</td>
                    <td class="w120 align-center">
                        <a href="javascript:dsLayerOpen('{:url('Appadv/adv_edit',['adv_id'=>$v.adv_id])}','{$Think.lang.ds_edit}-{$v.adv_title}')"  class="dsui-btn-edit"><i class="iconfont"></i>{$Think.lang.ds_edit}</a>
                        <a href="javascript:dsLayerConfirm('{:url('Appadv/adv_del',['adv_id'=>$v.adv_id])}','{$Think.lang.ds_ensure_install}',{$v.adv_id})" class="dsui-btn-del"><i class="iconfont"></i>{$Think.lang.ds_del}</a>
                    </td>
                </tr>
                {/foreach}
                {else /}
                <tr class="no_data">
                    <td colspan="15">{$ap_name}{$Think.lang.ds_no_record}</td>
                </tr>
                {/notempty}
            </tbody>
        </table>
        {$show_page|raw}
    </form>
</div>
<script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/js/jquery.edit.js" charset="utf-8"></script>