<?php include 'header.tpl.php';?>
<script>
function me_show(msg_id,msg_pic){
	str_id="id_"+msg_id;
	obj_x=document.getElementById(str_id);
	obj_img=document.getElementById("id_img_"+msg_id);
	if(obj_x.innerHTML=="") obj_x.innerHTML="<img src='"+msg_pic+"'>";
	if(obj_x) obj_x.style.display="";
}
function me_change(msgval){
	var obj_type=document.getElementById("id_type");
	var obj_state=document.getElementById("id_state");
	switch(msgval){
		case "type":
			obj_type.style.display="";
			obj_state.style.display="none";
			break;
		case "state":
			obj_type.style.display="none";
			obj_state.style.display="";
			break;
		default:
			obj_type.style.display="none";
			obj_state.style.display="none";
	}
}
</script>
<div class="pMenu">
<li class="sel"><a href="javascript:frmExecute('');">管理</a></li>
<?php if($obj_ctl_limit->chk_act("add")){?><li><a href="javascript:frmExecute('add');">添加</a></li><?php }?>
<li><span onclick="div_show_hide('objSearch');" style="cursor:hand">查找</span></li>
<li class="info"><a href="javascript:inc_show_help(220);" style="color:#ff0000">帮助</a></li>
</div>
<div class="pSearchDiv" id="objSearch" style="display:<?php if($get_issearch!="1")echo "none"?>">
<table class="sTab">
<tr><td>类型：	<select name="s_type"><option value="">不限</option><?php
foreach($arr_type as $item=>$key){
	$str_sel="";
	if($key==$get_s_type) $str_sel=" selected";
	echo "<option value='".$key."'".$str_sel.">".$item."</option>";
}
?></select>　状态：<select name="s_state"><option value="-999">不限</option><?php
foreach($arr_state as $item=>$key){
	$str_sel="";
	if($key==$get_s_state) $str_sel=" selected";
	echo "<option value='".$key."'".$str_sel.">".$item."</option>";
}
?></select>
　关键字：<input type="text" name="s_key" value="<?php echo $get_s_key?>">　<input type="button" name="s_btnok" value="查找" class="pBtn" onclick="frmExecute('')"> 　<input type="button" name="s_btnok" value="清空" class="pBtn" onclick="window.open('?','_self');"></td><tr>
</table>
</div>
<table class='pTable'>
<tr class='pTabTitRow'>
	<td class='pTabTitCol'></td><td class='pTabTitCol'>名称</td><td class='pTabTitCol'>类别</td><td class='pTabTitCol'>状态</td><td class='pTabTitCol'>添加时间</td><td class='pTabTitCol'>操作</td></tr>
	<?php foreach($arr_friendlink as $item){ ?>
<tr class='pTabRow' id="id_row_<?php echo $item["link_id"]?>" onmouseover="admin_row_mouseover(<?php echo $item["link_id"];?>)" onmouseout="admin_row_mouseout(<?php echo $item["link_id"];?>);">
	<td class='pTabCol' width="100"><input type='checkbox' name='friendlinkid[]' value='<?php echo $item['link_id'];?>' onclick="admin_row_sel(this.checked,<?php echo $item["link_id"]?>);"><input type="text" name="sort_<?php echo $item['link_id'];?>" value="<?php echo $item["link_sort"];?>" size=5></td><td class='pTabCol'><a href="<?php echo $item["link_url"];?>" target="_blank"><?php echo $item['link_name'];?></a>
	<?php if($item["pic"]!=""){?>
	<img src="../images/image_s.gif" onmouseout="div_hide('id_<?php echo $item["link_id"]?>');" onmouseover="me_show('<?php echo $item["link_id"]?>','<?php echo $item["pic"]?>');"><div style="position:absolute;display:none;cursor:pointer" id="id_<?php echo $item["link_id"]?>" onmouseover="this.style.display='';" onmouseout="this.style.display='none';"></div>	
	<?php }?>
	</td>
	<td class='pTabCol'><?php echo $item["type"];?></td><td class='pTabCol'><?php echo $item["state"];?></td><td class='pTabCol'><?php echo $item["addtime"];?></td>
	<td class='pTabCol' onmousedown="frmSet('id','<?php echo $item['link_id'];?>');">
	<?php if($obj_ctl_limit->chk_act("sort")){?>
	<img src="../images/up_1.gif" onclick="javascript:frmExecute('sort_up');" class="pImgbtn" title="向上">　
	<img src="../images/down_1.gif" onclick="javascript:frmExecute('sort_down');" class="pImgbtn" title="向下">　
	<?php }?>
	<?php if($obj_ctl_limit->chk_act("edit")){?><img src="../images/b_edit.png" onclick="javascript:frmExecute('edit');" class="pImgbtn" title="编辑"><?php }?>
	<?php if($obj_ctl_limit->chk_act("del")){?>　<img src="../images/b_drop.png" onclick="javascript:frmExecute('del');" class="pImgbtn" title="删除"><?php }?>
	<?php }?>
</table>
<div class="pPage">
<?php echo $page_split_page?>
</div>
<div class="pFootAct">
<li><input type='checkbox' name='friendlinkidall' value='1' onclick="admin_row_selall(this.form,'friendlinkidall','friendlinkid')">全选　<select name="selact" onchange="me_change(this.value);">
	<option value="">--操作--</option>
	<?php if($obj_ctl_limit->chk_act("del")){?><option value="del_sel">删除</option><?php }?>
	<?php if($obj_ctl_limit->chk_act("sort")){?><option value="sort">排序</option><?php }?>
	<?php if($obj_ctl_limit->chk_act("state")){?><option value="state">设置状态</option><?php }?>
	<?php if($obj_ctl_limit->chk_act("type")){?><option value="type">设置类型</option><?php }?>
	</select>
	<span id="id_state" style="display:none">
<select name="state_val">
<?php
foreach($arr_state as $item=>$key){
	echo "<option value='".$key."'>".$item."</option>";
}
?>
</select>	
	</span>
	<span id="id_type" style="display:none">
<select name="type_val">
<?php
foreach($arr_type as $item=>$key){
	echo "<option value='".$key."'>".$item."</option>";
}
?>
</select>	
	</span>
	&nbsp;<input type="button" name="btnExe" value="执行" onclick="frmExecute(document.frmMain.selact.value);" class="pBtn"></li>
</div>
<?php include 'footer.tpl.php';?>		
