<?php /* Smarty version 2.6.19, created on 2008-09-23 13:36:53
         compiled from link/index.phtml */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'truncateex', 'link/index.phtml', 250, false),array('modifier', 'date_format', 'link/index.phtml', 252, false),)), $this); ?>
<!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="<?php echo $this->_tpl_vars['baseUrl']; ?>
/public/styles/layout.css" />
	<link rel="stylesheet" rev="stylesheet" type="text/css" media="screen, projection" href="<?php echo $this->_tpl_vars['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="<?php echo $this->_tpl_vars['baseUrl']; ?>
/admin/article/del/"> 
	<table >
	<thead>
	  <tr align="center">
	    <th class="title" colspan="12">友情链接管理</th>
	  </tr>
	</thead>	
	<tbody>
      <tr>
	    <th >&nbsp;</th>
		<th >列表号</th>
		<th >网站名称</th>
		<th >网站联系人</th>
		<th >站长Email</th>
		<th >状态</th>
		<th >操作</th>
	  </tr>
	 
<?php unset($this->_sections['ArticleList']);
$this->_sections['ArticleList']['name'] = 'ArticleList';
$this->_sections['ArticleList']['loop'] = is_array($_loop=$this->_tpl_vars['arrArticles']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['ArticleList']['show'] = true;
$this->_sections['ArticleList']['max'] = $this->_sections['ArticleList']['loop'];
$this->_sections['ArticleList']['step'] = 1;
$this->_sections['ArticleList']['start'] = $this->_sections['ArticleList']['step'] > 0 ? 0 : $this->_sections['ArticleList']['loop']-1;
if ($this->_sections['ArticleList']['show']) {
    $this->_sections['ArticleList']['total'] = $this->_sections['ArticleList']['loop'];
    if ($this->_sections['ArticleList']['total'] == 0)
        $this->_sections['ArticleList']['show'] = false;
} else
    $this->_sections['ArticleList']['total'] = 0;
if ($this->_sections['ArticleList']['show']):

            for ($this->_sections['ArticleList']['index'] = $this->_sections['ArticleList']['start'], $this->_sections['ArticleList']['iteration'] = 1;
                 $this->_sections['ArticleList']['iteration'] <= $this->_sections['ArticleList']['total'];
                 $this->_sections['ArticleList']['index'] += $this->_sections['ArticleList']['step'], $this->_sections['ArticleList']['iteration']++):
$this->_sections['ArticleList']['rownum'] = $this->_sections['ArticleList']['iteration'];
$this->_sections['ArticleList']['index_prev'] = $this->_sections['ArticleList']['index'] - $this->_sections['ArticleList']['step'];
$this->_sections['ArticleList']['index_next'] = $this->_sections['ArticleList']['index'] + $this->_sections['ArticleList']['step'];
$this->_sections['ArticleList']['first']      = ($this->_sections['ArticleList']['iteration'] == 1);
$this->_sections['ArticleList']['last']       = ($this->_sections['ArticleList']['iteration'] == $this->_sections['ArticleList']['total']);
?>
  <tr>
	    <th><input type="checkbox" name="id[]" value="<?php echo $this->_tpl_vars['arrArticles'][$this->_sections['ArticleList']['index']]['id']; ?>
"/></th>
		<td><?php echo $this->_tpl_vars['arrArticles'][$this->_sections['ArticleList']['index']]['id']; ?>
</td>
		<td><?php echo ((is_array($_tmp=$this->_tpl_vars['arrArticles'][$this->_sections['ArticleList']['index']]['title'])) ? $this->_run_mod_handler('truncateex', true, $_tmp, 15, '..', true) : smarty_modifier_truncateex($_tmp, 15, '..', true)); ?>
</td>
		<td><?php echo $this->_tpl_vars['arrArticles'][$this->_sections['ArticleList']['index']]['author']; ?>
</td>
		<td><?php echo ((is_array($_tmp=$this->_tpl_vars['arrArticles'][$this->_sections['ArticleList']['index']]['addtime'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</td>
		<td><?php if ($this->_tpl_vars['arrArticles'][$this->_sections['ArticleList']['index']]['show'] == '1'): ?>已发布<?php elseif ($this->_tpl_vars['arrArticles'][$this->_sections['ArticleList']['index']]['show'] == '0'): ?>未发布<?php else: ?>已锁定<?php endif; ?></td>
		<td><a href="<?php echo $this->_tpl_vars['baseUrl']; ?>
/admin/article/edit/id/<?php echo $this->_tpl_vars['arrArticles'][$this->_sections['ArticleList']['index']]['id']; ?>
/" title="编辑文章">编辑</a> <a href="<?php echo $this->_tpl_vars['baseUrl']; ?>
/admin/article/del/id/<?php echo $this->_tpl_vars['arrArticles'][$this->_sections['ArticleList']['index']]['id']; ?>
" onclick="return shouldDelItem();" title="删除日志">删除</a></td>
	  </tr>

 <?php endfor; else: ?>
  <tr>
	    <td colspan="7" >对不起.没有查找到数据!</td>
</tr>
 
 <?php endif; ?>
	  
	   <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"><?php echo $this->_tpl_vars['pageInfo']; ?>
</div>
	<div style="clear:both;"></div>
</div>
</body>
</html>