<!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>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title> 商品入库管理系统</title>
	<link rel="stylesheet" type="text/css" media="screen" href="<{$baseUrl}>/public/styles/layout.css" />
	<link rel="stylesheet" rev="stylesheet" type="text/css" media="screen, projection" href="<{$baseUrl}>/public/styles/pagenav.css" />
<script language="javascript" type="text/javascript">

function selectAll(thisObject,formId){
	var thisForm=document.getElementById(formId);
	if(thisObject.checked==true){
		var objectNum=thisForm.elements.length;
		for(var i=0;i<objectNum;i++){
			//alert("ddd");
			thisForm.elements[i].checked=true;
		}
	}
	else{
		var objectNum=thisForm.elements.length;
		for(var i=0;i<objectNum;i++){
			thisForm.elements[i].checked=false;
		}
	}
}

function reverseSelect(id){
	
	var thisForm=document.getElementById(id);
	var objectNum=thisForm.elements.length;
	objectNum=objectNum-2;
	for(var i=0;i<objectNum;i++){
		//alert(thisForm.elements[i].checked);
		if(thisForm.elements[i].checked==true){
			thisForm.elements[i].checked=false;
		}
		else{
			thisForm.elements[i].checked=true;
		}

	}
}

function checkShouldDelItems(formId){
	var thisForm=document.getElementById(formId);
	var objectNum=thisForm.elements.length;
	objectNum=objectNum-3;
	var flag=0;
	for(var i=0;i<objectNum;i++){
		if(thisForm.elements[i].checked==true){
			flag++;
			break;
		}
	}

	if(flag==0){
		showMsg("您没有选择要删除的条目，请返回修改！");
		return false;
	}
	else{
		if(confirm("确定要删除您选中的条目吗？")){
			return true;
		}
		else{
			return false;	
		}
	}	
}

function shouldDelItem(){
	if(confirm("確定要刪除嗎??")){
		return true;	
	}	
	else{
		return false;	
	}
}









function CreateEl(t,c,i){
		var x=document.createElement(t);
		x.className=c;
		x.id=i;
		x.style.display="block";
		return(x);
}



function getViewportInfo() {     
     var w = (window.innerWidth) ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.offsetWidth;     
	 var h = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.offsetHeight;     
	 return {w:w,h:h}; 
}; 

function setOpacity(el){
		el.style.filter="alpha(opacity:70)";
		el.style.KHTMLOpacity="0.70";
		el.style.MozOpacity="0.70";
		el.style.opacity="0.70";
}


function showBack(){
		if(document.documentElement.scrollTop){
				var scrollpositionLeft=document.documentElement.scrollLeft;
				var scrollpositionTop=document.documentElement.scrollTop;
		}
		else{
				var scrollpositionLeft=document.body.scrollLeft;
				var scrollpositionTop=document.body.scrollTop;				
		}
		var thisToumingDiv=CreateEl("div","","thisToumingDiv");
		var oWin=getViewportInfo();
		thisToumingDiv.style.position="absolute";
		thisToumingDiv.style.width="100%";
		thisToumingDiv.style.height=document.body.scrollHeight+"px";
		thisToumingDiv.style.left="0px";
		thisToumingDiv.style.top="0px";		
		thisToumingDiv.style.backgroundColor='#999999';
        setOpacity(thisToumingDiv);
		
		document.getElementsByTagName("body")[0].appendChild(thisToumingDiv);

}

function shutBack(){
		document.getElementsByTagName("body")[0].removeChild(document.getElementById("thisToumingDiv"));
}

function showMsg(thismsg){
		var oWin=getViewportInfo();
		if(document.documentElement.scrollTop){
				var scrollpositionLeft=document.documentElement.scrollLeft;
				var scrollpositionTop=document.documentElement.scrollTop;
		}
		else{
				var scrollpositionLeft=document.body.scrollLeft;
				var scrollpositionTop=document.body.scrollTop;				
		}
		showBack();
		var thisTishiKuang=CreateEl("div","","thisTishiKuang");
		thisTishiKuang.style.position="absolute";
		thisTishiKuang.style.width="350px";
		thisTishiKuang.style.height="70px";
		thisTishiKuang.style.backgroundColor='#fff';
		

		thisTishiKuang.style.left=(oWin.w/2-175+scrollpositionLeft)+"px";
		thisTishiKuang.style.top=(oWin.h/2-35+scrollpositionTop)+"px";		
		
		thisTishiKuang.style.textAlign='center';
		thisTishiKuang.style.paddingTop='30px';
		thisTishiKuang.style.border='1px solid #CCC';
		
		document.getElementsByTagName("body")[0].appendChild(thisTishiKuang);
		
		thisTishiKuang.innerHTML='<div align=center>'+thismsg+'</div><br /><div align=center><a onclick=shutMsg()>关闭</a></div>';
}

function shutMsg(){
		if(document.getElementById("thisTishiKuang")||document.getElementById("thisToumingDiv")){
				document.getElementsByTagName("body")[0].removeChild(document.getElementById("thisTishiKuang"));
				document.getElementsByTagName("body")[0].removeChild(document.getElementById("thisToumingDiv"));
		}
}

function alterMsg(msg){
		document.getElementById("thisTishiKuang").innerHTML='<div align=center>'+msg+'</div><br /><div align=center><a onclick=shutMsg()>关闭</a></div>';
}



function selectAll(thisObject,formId){
	var thisForm=document.getElementById(formId);
	if(thisObject.checked==true){
		var objectNum=thisForm.elements.length;
		for(var i=0;i<objectNum;i++){
			//alert("ddd");
			thisForm.elements[i].checked=true;
		}
	}
	else{
		var objectNum=thisForm.elements.length;
		for(var i=0;i<objectNum;i++){
			thisForm.elements[i].checked=false;
		}
	}
}

function reverseSelect(id){
	
	var thisForm=document.getElementById(id);
	var objectNum=thisForm.elements.length;
	objectNum=objectNum-2;
	for(var i=0;i<objectNum;i++){
		//alert(thisForm.elements[i].checked);
		if(thisForm.elements[i].checked==true){
			thisForm.elements[i].checked=false;
		}
		else{
			thisForm.elements[i].checked=true;
		}

	}
}





</script>

</head>

<body>
<div id="navbar">
    <p><!-- <span><select name=""><option value="0">后台首页</option></select></span> -->你的位置: <a href="main.html" title="">后台首页</a> &gt; 相册管理</p>
</div>
<div class="table-div">
   <form name="formDisplay" method="post"  id="formDisplay" action="<{$baseUrl}>/admin/album/del/"> 
	<table >
	<thead>
	  <tr align="center">
	    <th class="title" colspan="6">相册管理</th>
	  </tr>
	</thead>	
	<tbody>
      <tr>
	    <th >&nbsp;</th>
		<th >相册封面</th>
		<th >相册名称</th>
		<th >建立时间</th>
		<th >状态</th>
		<th >操作</th>
	  </tr>

<{section name=AlbumList  loop=$arrAlbums}>
  <tr>
	    <th><input type="checkbox" name="id[]" value="<{$arrAlbums[AlbumList].id}>"/></th>
		<td><img id="<{$arrAlbums[AlbumList].title}>" src="<{$arrAlbums[AlbumList].imgurl}>" width="50" height="50" /></td>
		<td><{$arrAlbums[AlbumList].name|truncateex:15:'..':true}></td>
		
		<td><{$arrAlbums[AlbumList].addtime|date_format:"%Y-%m-%d"}></td>
		<td><{if $arrAlbums[AlbumList].show=='1'}>已发布<{elseif $arrAlbums[AlbumList].show=='0'}>未发布<{else}>已锁定<{/if}></td>
		<td><a href="<{$baseUrl}>/admin/album/edit/id/<{$arrAlbums[AlbumList].id}>/" title="编辑文章">编辑</a> <a href="<{$baseUrl}>/admin/album/del/id/<{$arrAlbums[AlbumList].id}>" onclick="return shouldDelItem();" title="删除日志">删除</a></td>
	  </tr>

 <{sectionelse}>
  <tr>
	    <td colspan="7" align="center">对不起.没有查找到数据!</td>
</tr>
 
 <{/section}>
	  
	   <td colspan="7" >
	 <div align="center"><input onClick="selectAll(this,'formDisplay');"
			type="checkbox" /> 全选 <input
			onClick="reverseSelect('formDisplay');return false;" type="submit"
			value="反选" /> <input
			onClick="return checkShouldDelItems('formDisplay');" type="submit"
			value="删除选中项" /></div>
			 </td>
	</tbody>	
    </table>
 </form>
	<div id="pages"><{$pageInfo}></div>
	<div style="clear:both;"></div>
</div>
</body>
</html>