<?php include 'header.tpl.php';?>
<script>
function me_change(msgval){
	obj_id_state=document.getElementById("id_state");
	obj_id_position=document.getElementById("id_position");
	switch(msgval){
		case "state":
		{
			obj_id_state.style.display="";
			obj_id_position.style.display="none";
			break;
		}
		case "position":
		{
			obj_id_state.style.display="none";
			obj_id_position.style.display="";
			break;
		}
		default:
		{
			obj_id_position.style.display="none";
			obj_id_state.style.display="none";
		}
	}
}
</script>
<div class="pMenu">
<li class="sel"><a href="javascript:frmExecute('');">管理</a></li>
<li><a href="javascript:frmExecute('add');">添加</a></li>
<li><span onclick="div_show_hide('objSearch');" style="cursor:hand">查找</span></li>
<li class="info"><a href="javascript:inc_show_help(218);" 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_position"><option value="">不限</option><?php echo $this_s_position;?></select>　状态：<select name="s_state"><option value="-101">不限</option><option value="1" <?php if($get_s_state==1) echo " selected";?>>正常</option><option value="0" <?php if($get_s_state==0) echo " selected";?>>关闭</option><option value="-1" <?php if($get_s_state==-1) echo " selected";?>>定时</option><option value="-2" <?php if($get_s_state==-2) echo " selected";?>>过期</option></select>
　关键字：<input type="text" name="s_name" value="<?php echo $get_s_name?>">　<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>
<div>
<table class='pTable'>
<tr class='pTabTitRow'>
	<td class='pTabTitCol'></td><td class='pTabTitCol'>Id</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_ads as $item){ ?>
<tr class='pTabRow' id="id_row_<?php echo $item["ads_id"]?>" onmouseover="admin_row_mouseover(<?php echo $item["ads_id"];?>)" onmouseout="admin_row_mouseout(<?php echo $item["ads_id"];?>);">
	<td class='pTabCol' width="100"><input type='checkbox' name='adsid[]' value='<?php echo $item['ads_id'];?>' onclick="admin_row_sel(this.checked,<?php echo $item["ads_id"]?>);"><input type="text" name="sort_<?php echo $item['ads_id'];?>" value="<?php echo $item["ads_sort"];?>" size=5></td><td class='pTabCol'><?php echo $item['ads_id'];?></td><td class='pTabCol'><?php echo $item['ads_title'];?></td>
	<td class='pTabCol'><?php echo $item['position'];?></td><td class='pTabCol'><?php echo $item['ads_type'];?></td><td class='pTabCol'><?php echo $item['state'];?></td>
	<td class='pTabCol' onmousedown="frmSet('id','<?php echo $item['ads_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>
<div class="pPage">
<?php echo $page_split_page?>
</div>
<div class="pFootAct">
<li><input type='checkbox' name='adsidall' value='1' onclick="admin_row_selall(this.form,'adsidall','adsid')">全选　<select name="selact" onchange="me_change(this.value);">
	<option value="">--操作--</option>
	<?php if($obj_ctl_limit->chk_act("position")){?><option value="position">设置位置</option><?php }?>
	<?php if($obj_ctl_limit->chk_act("state")){?><option value="state">设置状态</option><?php }?>
	<?php if($obj_ctl_limit->chk_act("sort")){?><option value="sort">排序</option><?php }?>
	<?php if($obj_ctl_limit->chk_act("del")){?><option value="del_sel">删除</option><?php }?>
	</select>　<span id="id_state" style="display:none"><select name="state_val">
	<option value="1">正常</option>
	<option value="0">关闭</option>
	</select></span><span id="id_position" style="display:none">位置：	<select name="position_val"><option value="">不限</option><?php echo $this_s_position;?></select></span>
	&nbsp;<input type="button" name="btnExe" value="执行" onclick="frmExecute(document.frmMain.selact.value);" class="pBtn"></li>
</div>
<div style="float:left;margin-top:20px;padding-left:20px;color:#ff8800;padding-bottom:30px;text-align:left;line-height:20px">
多个广告调用方法：{website_ads_list(位置,数量,类型,分隔符,是否为js调用)}<br>
举例：{website_ads_list("A",5,"pic","div",0)}  表示：调用A位置下面的图片类型，数量为5，广告之间以&lt;div&gt;分隔<br>
单个广告调用方法：{website_ads_show(广告id,是否为js调用)}<br>
举例：{website_ads_show(1,0)} 表示：调用id为：1 的那条广告,普通调用<br>
当在静态页面或站外调用广告时，可能需要用js的方法来调用，此时，就在上面参数：是否为js调用的地方改为：1，就行了<br>
举例：<br>
&nbsp;&nbsp;&nbsp;&nbsp;步骤一：在/templates/temp/default/ 下面新建一页面 如：js_ads1.html<br>
&nbsp;&nbsp;&nbsp;&nbsp;步骤二：在页面里输入：document.write('{website_ads_list("A",5,"pic","div",1)}');<br>
&nbsp;&nbsp;&nbsp;&nbsp;步骤三：如果有广告内容的话， 将这句代码 ：<script src="http://你的网站域名/index.php?app=js_ads1"></script>  加入到要放广告位置的页面，就可以预览效果了
</div>
<?php include 'footer.tpl.php';?>