<?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=utf-8"/>
<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>
			<?php if($ypid){?><li><a href="?file=yp&mod=yp&action=product_add&ypid=<?php echo $ypid;?>">添加产品</a></li><?php }?>
		</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="ypid" value="<?php echo $ypid;?>"> 
			<input type="hidden" name="typeid" value="<?php echo $typeid;?>"> 
			<input type="hidden" name="file" value="<?php echo isset($file)?$file:'yp';?>"> 
			<input type="hidden" name="action" value="<?php echo isset($action)?$action:'product';?>"> 
				<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="26%">产品名称</th>
			<th width="19%">产品类型</th>
			<th width="20%">黄页名称</th>
			<th width="13%">发布时间</th>
			<th width="10%">点击率</th>
			<th width="7%">管理</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="26%" align="center"><a href="yp/web/showproduct.php?id=<?php echo $val['id'];?>" target="_blank"><?php echo $val['title'];?></a></td>
		  <td width="19%" align="center"><a href="?mod=yp&file=yp&action=product&ypid=<?php echo $ypid;?>&typeid=<?php echo $val['typeid'];?>&k=<?php echo $k;?>"><?php echo $yp->producttypeinfo($val['typeid']);?></a></td>
		  <td width="20%" align="center"><?php echo $val['yp'];?></td>
			<td width="13%" align="center"><?php echo date('Y-m-d',$val['inputtime']);?></td>
			<td width="10%" align="center"><?php echo $val['clicks'];?>次</td>
			<td width="7%" align="center"><a href="?mod=yp&file=yp&action=product_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="if(confirm('确实要删除所选信息?'))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>