<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>刀客建站系统   管理中心  - 软件回收站 </title>
<%{include file="header.html"}%>
</head>
<body>
<h1>

<span class="action-span"><a href="index.php?act=soft.dlist">软件列表</a></span>
<span class="action-span1"><a href="index.php?act=index.default_page">刀客建站系统   管理中心 </a>  - 软件回收站</span>
<span style='float:right;margin-right:10px;'><img src='images/top_help.gif'><a href="http://sitepub.cn/help"> 帮助 </a></span>
<span style='float:right;margin-right:10px;'><img src='images/top_forum.gif'><a href="http://bbs.sitepub.cn"> 论坛 </a></span>
<div style="clear:both"></div>
</h1>
<div class="form-div">
  <form action="" name="searchForm" method='GET'>
	<input type='hidden' name='act' value='soft.callback_dlist'>
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />

    Name<input type="text" name="software_name" size="15" />
    <input type="submit" value=" Search " class="button" />
  </form>
</div>

<form method="post" action="index.php?act=soft.batch_handle" >
  <div class="list-div" id="listDiv">
<%{if $out.soft_arr}%>
<table >
  <tr>
    <th>
      <input id='all_check_box' type="checkbox" />
      ID</a><img src="images/sort_desc.gif"/>    </th>
    <th>软件名称</th>

    <th>软件版本</th>
    <th>软件ICON</th>
    <th>进入回收站时间</th>
	</tr>	
	<%{foreach from=$out.soft_arr item=s_v key=s_k}%>	 
		 <tr style='background-color:#FFF;' onmouseover='this.style.backgroundColor="";' onmouseout='this.style.backgroundColor="#FFF";'>
			<td ><input type="checkbox" name="checkboxes[]" value="<%{$s_v.software_id}%>" /><%{$s_v.software_id}%></td>
			<td align="center"><%{$s_v.software_name|escape:html}%></td>
			<td align="center"><%{$s_v.software_version}%></td>
			<td align="center"><%{if $s_v.software_icon}%><img width=32 height=32 src='<%{$s_v.software_icon}%>'><%{else}%>暂无<%{/if}%></td>
			<td align="center">
				<%{$s_v.last_update|date_format:"%Y-%m-%d %H:%I:%S"}%>	
			</td>
		  </tr>
    <%{/foreach}%>
  </table>

<table id="page-table">
  <tr style='background-color:#FFF;' >
    <td>
      <input type="hidden" name='handle_value' id="handle_value_id" value="" />
      <select name="handle_type" id="selAction" onchange="change_action(this)">
        <option value="">请选择...</option>
        <option value="no_is_stop">恢复</option>
        <option value="is_del">删除</option>
      </select>
      <input type="submit" value=" 保存 " id="btnSubmit" name="btnSubmit" class="button" disabled="true" />
    </td>
   <td align="right" nowrap="true">
            <div id="turn-page">
        共 <span id="totalRecords"><%{$out.page_arr.total}%></span> 款软件
        <span id="page-link">
		  <%{foreach from=$out.page_arr.thepage item=v key=k}%>	
				<%{if $k==$out.page_arr.page}%>	
					<b><%{$k}%></b>			
				<%{else}%>
				<a href="<%{$v}%>"><%{$k}%></a>			
				<%{/if}%>
			<%{/foreach}%>	
		  </span>
      </div>

    </td>
  </tr>

</table>
<%{else}%>
<div align='center'>暂无软件</div>
<%{/if}%>

</div>

</form>

<script>
$(document).ready(function(){
	$("#all_check_box").click(
		function(){
			var _this	=	this;
			$(":checkbox").each(function(i){
				if(this.name.match('checkboxes')){
					if(_this.checked){
						this.checked	=true;
					}else{
						this.checked	=false;
					}
				}
			});
			disabled_or_en();
		}		
	);
});

$(":checkbox").each(function(i){
	if(!this.name.match('checkboxes')){
		return;
	}
	$(this).click(function(){
			disabled_or_en();
	});
});



function change_action(obj)
{
	if(obj.value.match(/^no/)){
		$("#handle_value_id").val("0");
	}else if(obj.value!=''){
		$("#handle_value_id").val("1");
	}
		disabled_or_en();
}


function disabled_or_en()
{
	check_num	=	false;
	$(":checkbox").each(function(i){
		if(this.name.match('checkboxes')){
			if(this.checked){
				check_num	=	true;	
				return;
			}	
		}
	});
	check_type	=	false;
	if($("#selAction").val()){
		check_type	=	true;
	}
	if(check_type&&check_num){
			$("#btnSubmit")[0].disabled	=	false;	
	}else{
			$("#btnSubmit")[0].disabled	=	true;	
	}
}




</script>

</body>
</html>

