<?php
	!defined('DIRCMS_MANAGE') && exit('Access Denied!');
	if(!$module->roleid_check('yp',$_roleid))showmsg_nourl($lang['RETURN_NOPRI']);
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="admin/template/css/style.css" />
<script type="text/javascript" src="images/js/jquery.min.js"></script>
<script type="text/javascript" src="admin/template/js/admin.js"></script>
<script language="javascript" src="admin/template/js/css.js"></script>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="javascript:void(0);" class="on">黄页管理</a></li>
			<li><a href="?file=yp&mod=yp&action=add">添加黄页</a></li>
		</ul>
	</div>
	<div class="main">
		<div class="search">
			<form action="?" method="get" name="search">
			<input type="hidden" name="mod" value="<?php echo isset($mod)?$mod:'yp';?>"> 
			<input type="hidden" name="file" value="<?php echo isset($file)?$file:'yp';?>"> 
			<input type="hidden" name="action" value="<?php echo isset($action)?$action:'manage';?>"> 
				<fieldset>
					<legend>搜索黄页</legend>
						黄页名称：
						<input type="text" name="k" size="35" value="<?php echo isset($k) && !empty($k)?htmlspecialchars(stripslashes($k)):'';?>" />
						<input type="submit" class="button" value="开始查找" />
				</fieldset>
			</form>
		</div>
		<table cellspacing="0" class="datalist" id="list" width="98%">
		<tr>			
			<th width="5%" class="firstcol">反选</th>
			<th width="7%">ID</th>
			<th width="20%">黄页名称</th>
			<th width="7%">竞价</th>
			<th width="14%">黄页类型</th>
			<th width="10%">推荐</th>
			<th width="29%">内容管理</th>
			<th width="8%">管理</th>
		</tr>
		<form action="" method="post" name="myform">
		<input type="hidden" name="do_submit" value="1" />
		<?php if($result){foreach($result as $val){?>
		<tr>
		  <td width="5%" align="center"><input type="checkbox" checked="checked" name="id[]" value="<?php echo $val['id'];?>" class="checkbox" /></td>
		  <td width="7%" align="center"><?php echo $val['id'];?></td>
		  <td width="20%" style="padding-left:4px"><a href="<?php echo $val['url'];?>" target="_blank"><?php echo $val['name'];?></a> <?php echo $val['istop']?'<font color="#0000ff">[荐]</font>':'';?><?php echo $val['businesslicense']?'<font color="#00ff00">[营]</font>':'';?><?php echo $val['status']==2 || !$val['status']?'<font color="#999999">[待审]</font>':'';?><?php echo $val['identitycard']?'<font color="#ff0000">[身]</font>':'';?></td>
		  <td width="7%" align="center"><?php echo $val['seo'];?></td>
		  <td width="14%" align="center"><a href="?mod=yp&file=yp&action=manage&k=<?php echo isset($k)?$k:'';?>&typeid=<?php echo $val['typeid'];?>"><?php echo get_selectmenu('yp',$val['typeid']);?></a></td>
		  <td width="10%" align="center"><?php echo $val['istop']?'已推荐 <a href="'.ADMIN_FILE.'?mod=yp&file=yp&action=top&istop=0&id='.$val['id'].'"><u>取消</u></a>':'未推荐 <a href="'.ADMIN_FILE.'?mod=yp&file=yp&action=top&istop=1&id='.$val['id'].'"><u>推荐</u></a>';?> </td>
		  <td width="29%" align="center"><a href="?mod=yp&file=yp&action=news&ypid=<?php echo $val['id'];?>"><u>新闻</u></a> | <a href="?mod=yp&file=yp&action=discount&ypid=<?php echo $val['id'];?>"><u>优惠</u></a> | <a href="?mod=yp&file=yp&action=product&ypid=<?php echo $val['id'];?>"><u>产品</u></a> | <a href="?mod=yp&file=yp&action=comment&ypid=<?php echo $val['id'];?>"><u>留言</u></a></td>
		  <td width="8%" align="center"><a href="?mod=yp&file=yp&action=edit&id=<?php echo $val['id'];?>"><u>编辑</u></a></td>
		</tr>
		<?php }?>
		<tr>
			<td align="center"><input type="checkbox" name="chkall2" value="1" checked="checked" class="checkbox" onclick="check_all(this)" /></td>
			<td colspan="6">
			<input type="button" onclick="this.form.action='?mod=yp&file=yp&action=close&status=1';this.form.submit();" class="submit" value="开通黄页" />
			<input type="button" onclick="this.form.action='?mod=yp&file=yp&action=close&status=2';this.form.submit();" class="submit" value="关闭黄页" />
			<input type="button" onclick="this.form.action='?mod=yp&file=yp&action=businesslicense&status=1';this.form.submit();" class="submit" value="通过营业执照认证" />
			<input type="button" onclick="this.form.action='?mod=yp&file=yp&action=businesslicense&status=0';this.form.submit();" class="submit" value="关闭营业执照认证" />
			<input type="button" onclick="this.form.action='?mod=yp&file=yp&action=identitycard&status=1';this.form.submit();" class="submit" value="通过身份证认证" />
			<input type="button" onclick="this.form.action='?mod=yp&file=yp&action=identitycard&status=0';this.form.submit();" class="submit" value="关闭身份证认证" />
			</td>
		</tr>
		</form>
		<?php }else{?>
		<tr><td colspan="7">目前尚未开通任何黄页...</td></tr>	
		<?php }?>
		<tr><td colspan="7"><?php echo $yp->pagestring;?></td></tr>
		</table>
	</div>
</div>
</body>
</html>