<?php
	!defined('DIRCMS_MANAGE') && exit('Access Denied!');
?>
<!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=gb2312" />
<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>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="javascript:void(0);" class="on">商家管理</a></li>
			<li><a href="?file=yellowpages&action=convert">转型申请</a></li>
			<li><a href="?file=yellowpages&action=guestbook">企业留言</a></li>	
		</ul>
	</div>
	<div class="main">
		<div class="search">
			<form action="?" method="get" name="search">
			<input type="hidden" name="file" value="<?php echo $file;?>"> 
			<input type="hidden" name="action" value="<?php echo $action;?>"> 
				<fieldset>
					<legend>商家查找</legend>
						企业名称/会员名：<input type="text" name="k" size="35" value="<?php echo $k?htmlspecialchars(stripslashes($k)):'';?>" />
						<input type="submit" class="button" value="开始查找" />
				</fieldset>
			</form>
		</div>
		<table cellspacing="0" class="datalist" id="list">
		<tr>			
			<th width="3%" class="firstcol">全选</th>
            <th width="11%">用户名</th>
			<th width="33%">企业名称</th>
			<th width="15%">会员类型</th>
			<th width="11%"><a title="按照注册时间降序排序" href="<?php echo ADMIN_FILE;?>?file=<?php echo $file;?>&action=manage&orderby=<?php echo urlencode('regtime DESC');?>">注册时间</a></th>
			<th width="10%"><a title="按照登录时间降序排序" href="<?php echo ADMIN_FILE;?>?file=<?php echo $file;?>&action=manage&orderby=<?php echo urlencode('logintime DESC');?>">上次登录</a></th>	
			<th width="6%">状态</th>		
            <th width="11%">管理操作</th>
		</tr>
		<form action="" method="post" name="myform">
		<input type="hidden" name="do_submit" value="1" />
		<?php if($data){foreach($data as $val){?>
		<tr>
			<td align="center"><input type="checkbox" class="checkbox" name="id[]" value="<?php echo $val['id'];?>" /></td>
			<td align="center" style="padding-left:5px">&nbsp;<a href="<?php echo $val['spaceurl'];?>" target="_blank"><?php echo $val['username'];?></a></td>
			<td align="center" style="padding-left:5px">&nbsp;<a href="<?php echo $val['companyurl'];?>" target="_blank"><?php echo $val['companyname'];?></a></td>
			<td align="center">
			<?php
			$r=cache_read('membergrade'.$val['gradeid'].'.cache.php',DIRCMS_ROOT.'data/cache/');
			echo $r['gradename'];
			?></td>
			<td align="center"><?php echo date('Y-m-d',$val['regtime']);?></td>
			<td align="center"><?php echo date('Y-m-d',$val['logintime']);?></td>
			<td align="center" style="padding-left:5px"><?php echo $val['iscompmayed']?'通过':'待审';?></td>
			<td align="center"><a href="<?php echo ADMIN_FILE;?>?file=<?php echo $file;?>&action=yellowpages_edit&id=<?php echo $val['id'];?>">修改</a> <a href="<?php echo $val['companyurl'];?>" target="_blank">访问</a></td>
		</tr>
		<?php }?>
		<tr>
			<td width="3%" align="center">
			<input type="checkbox" name="chkall2" value="1" class="checkbox" onclick="check_all(this)" /></td>
			<td colspan="7" align="left">
			<input type="radio" value="yellowpages_unpassed" class="radio" name="do" />待审
			&nbsp;&nbsp;
			<input type="radio" class="radio" value="yellowpages_passed" name="do" />审核
			&nbsp;&nbsp;
			<input type="radio" class="radio" value="yellowpages_close" checked="checked" name="do" />转为普通会员
			&nbsp;&nbsp;
			<input type="button" value="执行操作" class="button" onclick="if(confirm('确定进行选定操作吗？')){this.form.submit();}" />
			</td>
		</tr>
		</form>
		<?php }else{?>
		<tr><td colspan="8">尚未发现任何商家...</td></tr>	
		<?php }?>
		<tr>
			<td colspan="8" style="text-align:right; padding-right:8px"><?php echo $pagestring;?></td>
		</tr>
		</table>
	</div>
</div>
</body>
</html>