<!--#include file="Content_Fun.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="<%=sitepath%>css/bootstrap.min.css" rel="stylesheet">
<link href="<%=sitepath%>css/font-awesome.min.css" rel="stylesheet">
<link href="<%=sitepath%>plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link href="<%=sitepath%>css/animate.min.css" rel="stylesheet">
<link href="<%=sitepath%>css/style.min.css" rel="stylesheet">
<link href="<%=sitepath&adminpath%>css/adminstyle.css" rel="stylesheet">
<script src="<%=sitepath%>js/jquery.min.js"></script>
<script src="<%=sitepath&adminPath%>js/adminjs.js"></script>
<!--[if lte IE 9]>
<script src="<%=sitepath%>js/respond.min.js"></script>
<script src="<%=sitepath%>js/html5.js"></script>
<![endif]-->
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
<div class="ibox float-e-margins">
<div class="row row-lg">
<div class="col-md-6">
							<div class="panel">
								<div class="panel-heading">
									<h3 class="panel-title">回收站</h3>
									<div class="panel-aj">
										<button type="button" class="btn-toggle-collapse"><i class="fa fa-chevron-down"></i></button>
										<button type="button" class="btn-remove"><i class="fa fa-times"></i></button>
									</div>
								</div>
<div class="panel-body">
<div class="panel-body no-padding">		
<div class="ibox-content">

<div class="col-sm-12">
          <div class="col-sm-7">   
           <button id="allclear" class="btn btn-danger" type="button" ><i class="fa fa-trash">　</i>清空</button>       	
            <button id="truedel" disabled class="btn btn-danger" type="button" ><i class="fa fa-trash">　</i>删除</button>
            <button id="recycle" disabled class="btn btn-primary" type="button" ><i class="fa fa-check">　</i>恢复</button>
             <button onClick="location.reload()" class="btn btn-primary1" type="button"><i class="fa fa-refresh"></i> 刷新</button>
          </div>
          <table id="table"
           data-toggle="table"
           data-pagination="true"
           data-search="true"          
           data-show-toggle="true"
           data-show-columns="true"
           data-advanced-search="true"   
           data-id-field="id"       
           data-id-table="advancedTable"
           data-show-export="true"  
           data-page-list="[10, 20, 50, 100, 200]"  >
            <thead>
              <tr>
                <th class="tableid" data-field="state" data-checkbox="true"></th>
                <th class="tableorder" data-field="id" data-sortable="true">ID</th>
                <th class="tableurl" data-field="title" data-sortable="true">名称</th>
                <th class="tabletype" data-field="sortname" data-sortable="true">分类名称</th>
                <th class="tableedit" data-field="time" data-sortable="true">时间</th>                
                <th class="tableorder" data-field="order" data-sortable="true" width="20">排序</th>
                <th class="tableedit" data-field="edit" >编辑</th>
              </tr>
            </thead>
<%
sql="select * from [dbpre]content,cms_sort where C_sid=SID and C_onoff<>1 order by C_order asc,CID desc"
set rs=dbsql(sql)
do while not rs.eof 
echo "<tr>"&vbcrlf& _	
		"<td></td>"&vbcrlf& _	
        "<td>"&rs("CID")&"</td>"&vbcrlf& _	
		 "<td><a href='"&sitepath&"content/?"&rs("C_sid")&"_"&rs("CID")&siteExt&"' target='_blank''>"&rs("C_title")&"</a></td>"&vbcrlf& _	
         "<td><a>"&rs("S_name")&"</a></td>"&vbcrlf& _	
        "<td>"&rs("C_AddTime")&"</td>"&vbcrlf& _			
	    "<td><input type='number'  min='0' max='99' id='order"&rs("CID")&"'  class='order' value='"&rs("C_order")&"'></td>"&vbcrlf& _	
	    "<td><button type='button'  onclick=recycle('"&rs("CID")&"')  class='btn btn-primary btn-xs'><i class='fa fa-check'></i> 恢复</button>　<button type='button'  onclick=delture('"&rs("CID")&"')  class='btn btn-danger btn-xs'><i class='fa fa-times'></i> 删除</button></td>"&vbcrlf& _	
    "</tr>"&vbcrlf  
rs.movenext
if not rs.eof then result=result&","
Loop
closers rs			
%>            
          </table>
        </div>

</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End Panel Other -->
</div>
<script src="<%=sitepath%>js/bootstrap.min.js"></script> 
<script src="<%=sitepath%>js/klorofil-common.js"></script>
<script src="<%=sitepath%>plugins/peity/jquery.peity.min.js"></script> 
<script src="<%=sitepath%>plugins/bootstrap-table/bootstrap-table.min.js"></script> 
<script src="<%=sitepath%>plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> 
<script src="<%=sitepath%>plugins/layer/layer.min.js"></script>
<script>
 	 var $table = $('#table'),
		 $recycle = $('#recycle');	
		 $truedel = $('#truedel');		
	 $(function () {
        $table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function () {
			$recycle.prop('disabled', !$table.bootstrapTable('getSelections').length);
			$truedel.prop('disabled', !$table.bootstrapTable('getSelections').length);
        });
		 $truedel.click(function () {	
		  var ids = $.map($table.bootstrapTable('getSelections'), function (row) {  
			 return row.id		
            });		
			setdisabled();
			delture(ids.toString())
		});
		 $recycle.click(function () {	
		  var ids = $.map($table.bootstrapTable('getSelections'), function (row) {
			 return row.id		
            });	
			setdisabled();					
			recycle(ids.toString())
		});
	});
function setdisabled(){
	$recycle.prop('disabled', true);
	$truedel.prop('disabled', true);
}
$("#allclear").click(function(){
	layer.confirm('您确定清空回收站吗，不可恢复？', {
		  btn: ['清空','取消'] //按钮
		}, function(){
		$.post("?act=allclear",{idval:"all"},function(data){
			$('#table').empty();
			  layer.msg('全部清空', {icon: 1});
			});
		});		
	})
</script>   
</body>
</html>
