<?php defined('PHPNEW_STATIC_TPL') === false && exit('PHPnew Blog');?>
<style type="text/css">
    .ptitle{height: 30px; line-height: 30px; font-weight: bolder; font-size: 13px; color: #353939;}
    .thread_date{font-size:12px; margin-left: 8px; font-weight: normal;}
    .ptitle a:hover{ color: #FF8040;}
    .my_table{line-height: 2em; margin-bottom: 20px;}
    .my_table td{ border-bottom: 1px dotted $c1; height: 30px;line-height: 30px; text-align: center;}
    .my_table th{ border-bottom: 2px solid $c1; color: $c1; font-weight: bolder; text-align: center;}
    .hig td{background-color: #F4EED9;}
</style>
<script type="text/javascript">
var link_alink , link_name, link_tags, deles,link_ico,link_asc, i=0;
function ajax_cats(ids,ide){
    i ++;
    link_alink = encodeURIComponent($('.link_alink_'+ids).val());
    link_name = encodeURIComponent($('.link_name_'+ids).val());
    link_tags = encodeURIComponent($('.link_tags_'+ids).val());
    link_ico = encodeURIComponent($('.link_ico_'+ids).val());
    link_asc = encodeURIComponent($('.link_asc_'+ids).val());
    ids = encodeURIComponent(ids);
    deles = ide;
    $.get('./index.php?admincp=setlink&type=ajax&link_name='+link_name+'&link_tags='+link_tags+'&link_ico='+link_ico+'&link_alink='+link_alink+'&link_asc='+link_asc+'&deles='+deles+'&c_id='+ids+'&rand='+Math.random(),function (data){});
}
var s = 0;
function submit_link(ide){
    if(ide==1 && !confirm('请确认是否删除所选项?')){
        return false;
    }
    $("input:checked").each(function (){
            ajax_cats($(this).attr('value'),ide);
    })
    alert('本次更新共影响'+ i+'行');
    i = 0;
    js_header('{ADM_GET_URL}');
}


function checkboxchange(obj){
    if($(obj).attr('checked')){
        $(obj).parent().parent().find("input[type='text']").attr('disabled',false);
        $(obj).css('border','2px solid {$c1}');
    }else{
        $(obj).parent().parent().find("input[type='text']").attr('disabled',true);
    }
}
$(function(){
    $("input[type='text']").attr('disabled',true);
})
</script>
<div>
<form method="post" id="form1" action="{ADM_GET_URL}" enctype="application/x-www-form-urlencoded">
<table class="my_table">
    <tr class="admin_list">
        <th style=" width: 50px;">操作</th>
        <th style="width: 220px;">链接名称</th>
         <th>url</th>
          <th>logo</th>
           <th>描述</th>
            <th>排序</th>
    </tr>
    <!--{loop $link_array $key $val}-->
    <tr>
        <td><input type="checkbox" onchange="checkboxchange(this);" class="checklist_{$key}" value="{$key}" /></td>
        <td><input type="text" class="link_name_{$key}" style="width: 210px;" value="$val[link_name]" /></td>
        <td><input type="text" class="link_alink_{$key}" value="$val[link_alink]" /></td>
        <td><input type="text" class="link_ico_{$key}" value="$val[link_ico]" /></td>
        <td><input type="text" class="link_tags_{$key}" value="$val[link_tags]" /></td>
        <td><input type="text" class="link_asc_{$key}" style="width: 30px;" value="$val[link_asc]" /></td>
    </tr>
    <!--{/loop}-->
    <tr>
        <td><input type="checkbox" onchange="checkboxchange(this);"  class="dele_a" value="a" /></td>
        <td><input type="text" class="link_name_a" style="width: 210px;" name="link_name_a" /></td>
        <td><input type="text" class="link_alink_a" name="link_alink_a" /></td>
        <td><input type="text" class="link_ico_a" name="link_ico_a" /></td>
        <td><input type="text" class="link_tags_a" name="link_tags_a" /></td>
        <td><input type="text" class="link_asc_a" style="width: 30px;" name="link_asc_a" /> </td>
    </tr>
    <tr>
        <td colspan="4" style="text-align: left;">{$page_list}</td>
        <td colspan="2" style="text-align: right; padding-right: 5px;"><input type="submit" onclick="submit_link(0); return false" value="更新" />  <input onclick="submit_link(1); return false" type="submit" value="删除" />　</td>
    </tr>
</table>
</form>
</div>