<?
/**
 * 我的学员
 * $Id: user_search_list.inc,v 1.1
 * @author taocy
 * @package src.admin.templates
 */
?>
<b>公海学员</b><br /><br />

<form action="ocean_user_list.php" method="post" name="ocean_user_list">
	<input type="hidden" name="search_flg" value="true" />
	<table>
		<tr>
			<td>渠道</td>
			<td class="begin_blank">
					<select name="channel_no" style="width:200px;">
						<option value="0" <?= "1000"==$channel_no ? " selected " : "" ?>>全部</option>
						<option value="1000" <?= "1000"==$channel_no ? " selected " : "" ?>>系统用户</option>
						<?
							foreach ($channel_list as $channel_dat) {
						?>
							<option value="<?=$channel_dat->channel_no ?>"<?=$channel_dat->channel_no == $channel_no ? " selected " : "" ?>><?=$channel_dat->title ?></option>
						<?
							}
						?>
					</select>
			</td>
			<td>状态</td>
			<td>
				<select name="status">
					<option value="ALL" <?=$status == "ALL" ? " selected " : "" ?> >全部</option>
					<?
						echo $status;
						foreach ($user_status_list as $user_status_obj) {
					?>
						<option value="<?=$user_status_obj->id ?>"<?=$user_status_obj->id == $status ? " selected " : "" ?>><?=$user_status_obj->title ?></option>
					<?
						}
					?>
				</select>
			</td>
			<td>手机</td>
			<td><input type="text" value="<?=htmlspecialchars($mobile) ?>" name="mobile" /></td>
			<td>姓名</td>
			<td><input type="text" value="<?=htmlspecialchars($nickname) ?>" name="nickname" /></td>

			<td><input type="button" value="搜索" onclick="searchOceanUser()" /></td>
		</tr>
	</table>
	
</form><br />
<div style="text-align:center;float: right;font-size:18px;">共<?=$total_count ?>件记录</div>
<div style="clear:both"></div>
<?
require_once("page_common.inc");
?>
<!--page end-->
<div id="result_list">
<?
if ($total_count > 0) {
	$asc_img = "<img src=\"images/arrow_asc.png\" width=\"12\" height=\"12\" border=\"0\" alt=\"asc\" />";
	$desc_img = "<img src=\"images/arrow_desc.png\" width=\"12\" height=\"12\" border=\"0\" alt=\"desc\" />";
?>
<table>
<tr>
	<th class="contents_title">ID</th>
	<th class="contents_title">注册时间</th>
	<th class="contents_title">姓名</th>
	<th class="contents_title">手机号码</th>
	<th class="contents_title">积分</th>
	<th class="contents_title">性别</th>
	<th class="contents_title">微信</th>
	<th class="contents_title">QQ</th>
	<th class="contents_title">状态</th>
	<th class="contents_title">渠道</th>
	<th class="contents_title">操作</th>
</tr>

<?
	foreach($user_mst_list as $tmp) {
		//获取用户渠道名称
		$channel_title = $channel_map[$tmp["channel_no"]];
?>
<tr>
    <td align="center"><?=$tmp["id"] ?></td>
    <td align="center"><?=$tmp["registration_date"] ?></td>
    <td align="center"><?=$tmp["nickname"] ?></td>
	<td align="center"><?=$tmp["mobile"] ?></td>
	<td align="center"><?=$tmp["point"] ?></td>
    <td align="center"><?=$tmp["sex"] == "UNKNOW" ? "未知" : "" ?><?=$tmp["sex"] == "FEMALE" ? "女" : "" ?><?=$tmp["sex"] == "MALE" ? "男" : "" ?></td>
	<td align="center"><?=htmlspecialchars($tmp["wechat_no"]) ?></td>
	<td align="center"><?=htmlspecialchars($tmp["qq_no"]) ?></td>
	<td align="center"><?=UserStatus::getTitleById($tmp["status"]); ?></td>
	<td align="center"><?=htmlspecialchars($channel_title) ?></td>
    <td align="center">
		<?
			if (checkAuthority("ADMIN,MANAGER")) {
				$user_id = $tmp["id"];
		?>
		<a class="flatbutton" href="user_send_coupon.php?id=<?=$user_id ?>">送券</a>
		<a class="flatbutton" href="user_send_point.php?id=<?=$user_id ?>">添加积分</a>
		<a class="flatbutton" href="user_edit_comment_input2.php?id=<?=$user_id?> ?>">回访记录</a>
		<a class="flatbutton" href="user_edit_input2.php?action=edit&id=<?=$user_id ?>">编辑</a>
		<?
			}
		?>
        <a class="flatbutton" href="ocean_user_list.php?action=get&id=<?=$tmp["id"] ?>">领取</a>
    </td>
</tr>
<?
    }
?>
</table>

<?
} else {
    echo '<div align="center"><font color="red">暂无数据……</font></div>';
}
?>
</div>