<form action="/Admin/{$modulename}/CategoryDelete" method="post" name="formsubmit" id="formsubmit">
<div class="rounded table" style="width: 100%;">
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="box_top">
        <thead class="thead">
            <tr class="space">
                <th colspan="10">列表查看  </th>
            </tr>
        </thead>
    </table>
    <div class="contentbox" data-uri='{:U("Admin/$modulename/doEditStatus")}'>
        <table width="100%" class="list td_align"  id="J_cate_tree">
            <thead>
                <tr class="thead">
                    <th class="align-center"><input name="id" type="checkbox" class="checkAll" id="checkboxall"  data-checklist="checkSon_x" data-direction="x"/></th>
                    <th align="left">标题</th>
                    <th class="align-center">ID</th>
                    <th class="align-center">排序</th>
                    <th class="align-center">是否显示</th>
                    <th class="align-center">创建时间</th>
                    <th class="align-center">更新时间</th>
                    <th class="align-center">操作</th>
                </tr>
            </thead>
            <tbody>
            {$list}
            <empty name="data">
                <tr><td colspan="9" class="left align-center">暂时没有数据!</td></tr>
            </empty>
            </tbody>
        </table>
        <div style="float:left; line-height:50px; width:600px; padding-left:20px;">



<input id="submit" data-url="{:U("Admin/$modulename/CategoryAdd")}"  data-height='200' data-width='500' title="添加" class="btn dialog" type="button" value="添加">
<input id="delete"  class="btn" type="submit" value="删除选中">
        
        </div>         
        <div class="pagination">
            <ul>
            {$page}
            <select name="pageall" onChange="window.location.href=this.value">
                <option value='{:U("Admin/$modulename/index","pageall=1")}' <if condition="$filter.pageall eq '1'">selected="selected"</if>>1条/页</option>
                <option value='{:U("Admin/$modulename/index","pageall=5")}' <if condition="$filter.pageall eq '5'">selected="selected"</if>>5条/页</option>
                <option value='{:U("Admin/$modulename/index","pageall=10")}'<if condition="$filter.pageall eq '10'">selected="selected"</if>>10条/页</option>
                <option value='{:U("Admin/$modulename/index","pageall=20")}'<if condition="$filter.pageall eq '20'">selected="selected"</if>>20条/页</option>
                <option value='{:U("Admin/$modulename/index","pageall=50")}'<if condition="$filter.pageall eq '50'">selected="selected"</if>>50条/页</option>
                <option value='{:U("Admin/$modulename/index","pageall=80")}'<if condition="$filter.pageall eq '80'">selected="selected"</if>>80条/页</option>
                <option value='{:U("Admin/$modulename/index","pageall=100")}'<if condition="$filter.pageall eq '100'">selected="selected"</if>>100条/页</option>
                <option value='{:U("Admin/$modulename/index","pageall=500")}'<if condition="$filter.pageall eq '500'">selected="selected"</if>>500条/页</option>
            </select>
        </ul>
        </div>
        <div style="clear: both;"></div>
    </div>
    

</div>
</form>
<script>
    $(document).ready(function(){
        $(".doDel").live('click',function(){
			if(confirm("提示：您确定要删除吗？")){
				return true;	
			}
			return false;
        });
		
		$("#delete").click(function(){
			if(confirm("提示：您确定要删除吗？删除后不能恢复！")){
				return true;	
			}	
			return false;
		});		
        
        //切换
        $('.pointer').live('click', function() {
            var url = $(".contentbox").attr("data-uri");
            var img    = this,
            s_val  = ($(img).attr('data-value'))== 0 ? 1 : 0,

            s_name = $(img).attr('data-field'),
            s_id   = $(img).attr('data-id'),
            s_src  = $(img).attr('src');
            s_msg = ($(img).attr('data-value'))== 0 ? '启用' : '停用';
            $.ajax({
                url:url,
                cache:false,
                dataType:"json",
                data: {id:s_id, field:s_name, val:s_val},
                type:"POST",
                beforeSend:function(){
                    $("#J_ajax_loading").stop().removeClass('ajax_error').addClass('ajax_loading').html("提交请求中，请稍候...").show();
                },
                error:function(){
                    $("#J_ajax_loading").addClass('ajax_error').html("AJAX请求发生错误！").show().fadeOut(5000);
                },
                success:function(msgObj){
                    $("#J_ajax_loading").hide();
                    if(msgObj.status == '1'){
                        $("#J_ajax_loading").removeClass('ajax_error').addClass('ajax_success').html(msgObj.info).show().fadeOut(5000);
                        if(s_src.indexOf('0')>-1) {
                                $(img).attr({'src':s_src.replace('0','1'),'data-value':s_val,'title':s_msg,'alt':s_msg});
                        } else {
                                $(img).attr({'src':s_src.replace('1','0'),'data-value':s_val,'title':s_msg,'alt':s_msg});
                        }
                    }else{
                        $("#J_ajax_loading").removeClass('ajax_success').addClass('ajax_error').html(msgObj.info).show().fadeOut(5000);
                    }
                }
            });
        });
    });
</script>