<!--<?php print <<<EOT
-->
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<style>
td {font-size: 9pt;line-height: 1.5;}
body {font-size: 9pt;line-height: 1.5;}
a:link { font-size: 9pt; color: #000000; text-decoration: none }
a:visited{ font-size: 9pt; color: #000000; text-decoration: none }
a:hover {font-size: 9pt;color: red}
</style>
<A name="results"/>
<!-- SEARCH RESULTS START -->
<!--
EOT;
if($mode == "search" or $users != ""){
$url_to = $pageurl."&page=$navigation_page";
print <<<EOT
-->
<table width="100%"  border="0" cellpadding="4" cellspacing="1" bgcolor="#A5D0F1">
<FORM name="topform" action="users.php" method="POST">
  <tr>
    <td background="images/wbg.gif" bgcolor="#F0F3F8" colspan="6"><b>会员列表</b></td>
	<td background="images/wbg.gif" bgcolor="#F0F3F8" colspan="13" align="right">
<INPUT type='hidden' name='mode' value='search'>
<INPUT type="text" name="substring" size="20" value="$substring">
<INPUT type="submit" value="搜索">
    </td>
 </tr>
</FORM>
<FORM action="users.php" method="POST" name="processuserform">
<INPUT type="hidden" name="mode" value="">
<INPUT type="hidden" name="pagestr" value="$pagestr">
  <tr bgcolor="#FFFFFF">
    <td colspan="19">
<!--
EOT;
include ('resultspage.htm');
print <<<EOT
--></td>
  </tr>
  <tr bgcolor="#F0F3F8" height="30" align="center">
	<td width="25"><input type="checkbox" name="checkbox" value="Check All" onClick="CheckAll(this.form)"></td>
	<td width="25">ID</td>
	<td width="60">会员名</td>
    <td>姓名</td>
    <td>等级</td>
    <td>烧香</td>
    <td>念佛</td>
    <td>祈福</td>
    <td>抄经</td>
    <td>放生</td>
	<td>祭祀</td>
	<td>忏悔</td>
	<td>禄位</td>
	<td>礼佛</td>
	<td>诵经</td>
	<td>禅坐</td>
    <td>注册</td>
    <td>登录</td>
    <td>次数</td>
  </tr>
<!--
EOT;
if($users){
foreach($users as $users){
$bgcolor =($bgcolor == '#FFFFFF')?'#F0F3F8':'#FFFFFF';
$users[regdtm] = get_date($users[regdtm]);
$users[logindtm] = get_date($users[logindtm]);
print <<<EOT
-->
  <tr onMouseOver="javascript:this.bgcolor='#FFFFCC'" onmouseout="javascript:this.bgcolor='$bgcolor'" bgcolor="$bgcolor" height="30" align="center">
    <td><INPUT type="checkbox" name="users_to_delete[$users[uid]]"></td>
    <td><A href="user.php?uid=$users[uid]" target="_blank">$users[uid]</A></td>
    <td align="left"><A href="user.php?uid=$users[uid]" target="_blank">$users[username]</A></td>
    <td><A href="user.php?uid=$uid[username]" target="_blank">$users[hxname]</A></td>
    <td><a href="users.php?mode=search&membership=$users[membership]">$users[membership]</a></td>
    <td>$users[sxnum]</td>
    <td>$users[nfnum]</td>
    <td>$users[qfnum]</td>
    <td>$users[cjnum]</td>
    <td>$users[fsnum]</td>
	<td>$users[jsnum]</td>
	<td>$users[chnum]</td>
	<td>$users[lwnum]</td>
	<td>$users[lfnum]</td>
	<td>$users[sjnum]</td>
	<td>$users[cznum]</td>
    <td>$users[regdtm]</td>
    <td>$users[logindtm]</td>
    <td>$users[logins]</td>
  </tr>
<!--
EOT;
}}print <<<EOT
-->
  <tr bgcolor="#FFFFFF">
    <td colspan="19">
<!--
EOT;
include ('resultspage.htm');
print <<<EOT
-->
    </td>
  </tr>
  <tr bgcolor="#F0F3F8">
    <td colspan="19">
<input type='button' name='chkall' value='全 选' onclick='CheckAll(this.form)'>&nbsp;
<INPUT type="button" value="删除选中" onclick="if(confirm('您确定要删除选中的会员吗？'))document.processuserform.mode.value='delete'; document.processuserform.submit();">
    </td>
  </tr>
</FORM>
</table>
<!--
EOT;
}print <<<EOT
-->
<FORM name="searchform" action="users.php" method="POST">
<INPUT type='hidden' name='mode' value='search'>
<table width="100%"  border="0" cellpadding="4" cellspacing="1" bgcolor="#A5D0F1">
  <tr>
    <td background="images/wbg.gif" bgcolor="#F0F3F8" colspan="2"><b>搜索会员</b></td>
  </tr>
  <tr height="25" bgcolor="#FFFFFF">
	<td width="120" align="center">关键字：</td> 
	<td><INPUT type="text" name="substring" size="30" value="$substring"><INPUT type="submit" value="搜索"></td>
 </tr>
  <tr height="25" bgcolor="#FFFFFF">
    <td align="center">搜索范围</td> 
    <td><INPUT type="checkbox" name="by_username" checked>会员名&nbsp;&nbsp;
        <INPUT type="checkbox" name="by_hxname" checked>姓名&nbsp;&nbsp;
		<INPUT type="checkbox" name="by_email" checked>Email</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF" colspan="2">

<table>
  <tr>
    <td id="close1" style="cursor: hand;" onclick="visibleBox('1')">&nbsp;&nbsp;<img src="images/plus.gif" border="0" align="absmiddle" alt="Click to open"></td>
    <td id="open1" style="display: none; cursor: hand;" onclick="visibleBox('1')">&nbsp;&nbsp;<img src="images/minus.gif" border="0" align="absmiddle" alt="Click to close"></td>
    <td><A href="javascript:void(0);" onclick="visibleBox('1')"><B>高级搜索选项</B></A></td>
  </tr>
</table>

<div style="display: none;" id="box1" name="box1">
<table width="100%"  border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
  <tr height="30" bgcolor="#EFEFEF">
    <td colspan="2"><b>高级搜索选项</b></td>
  </tr>
  <tr height="25" bgcolor="#FFFFFF">
    <td>会员等级：</td>
    <td><SELECT name="membership">
<OPTION value="">...请选择...</OPTION>
<!--
EOT;
if($membership_levels){
foreach($membership_levels as $ml){
$spmlselected = ($usertype == $key and $membership == $ml[membership])?"selected":"";
print <<<EOT
-->
<OPTION value="$ml[membership]" $spmlselected>$ml[membership]</OPTION>
<!--
EOT;
}}print <<<EOT
-->
</SELECT>
    </td>
  </tr>
  <tr height="25" bgcolor="#FFFFFF">
    <td>会员分类：</td>
    <td><SELECT name="userkind">
<OPTION value="">...请选择...</OPTION>
<!--
EOT;
if($netgou[user_types]){
foreach($netgou[user_types] as $ut){
$mlsselected = ($userinfo[userkind] == $ut[title])?"selected":"";
print <<<EOT
-->
<OPTION value="$ut[title]" $mlsselected>$ut[title]</OPTION>
<!--
EOT;
}}print <<<EOT
-->
</SELECT>
    </td>
  </tr>
  <tr height="25" bgcolor="#FFFFFF">
	<td>搜索特定时间：</td>
	<td >
<!--
EOT;
$rdchecked = ($registration_date != "")?"checked":"";
$lldchecked = ($last_login_date != "")?"checked":"";
print <<<EOT
-->
<INPUT type="checkbox" name="registration_date" value="Y" $rdchecked onclick="javascript:managedate('date_type')">注册时间&nbsp;&nbsp;
<INPUT type="checkbox" name="last_login_date" value="Y" $lldchecked onclick="javascript:managedate('date_type')">上次登录
    </td>
  </tr>
  <tr height="25" bgcolor="#FFFFFF">
    <td>注册日期：<script src="../include/calender.js"></script></td>
    <td>
<input type="text" name="start_date" size="18" value="$start_date" onFocus="CalendarWebControl.show(this,false,this.value);"> -
<input type="text" name="end_date" size="18" value="$end_date" onFocus="CalendarWebControl.show(this,true,this.value);"><br />
<!--
EOT;
$dpmchecked = ($date_period == "M")?" checked":"";
$dpwchecked = ($date_period == "W")?" checked":"";
$dpdchecked = ($date_period == "D")?" checked":"";
$dpychecked = ($date_period == "Y")?" checked":"";
$dp7dchecked = ($date_period == "7D")?" checked":"";
$dp30dchecked = ($date_period == "30D")?" checked":"";
$dp365dchecked = ($date_period == "365D")?" checked":"";
print <<<EOT
-->
<INPUT type="radio" name="date_period" value="D" $dpdchecked>今日
<INPUT type="radio" name="date_period" value="W" $dpwchecked>本周
<INPUT type="radio" name="date_period" value="M" $dpmchecked>本月
<INPUT type="radio" name="date_period" value="Y" $dpychecked>本年
<INPUT type="radio" name="date_period" value="7D" $dp7dchecked>一周
<INPUT type="radio" name="date_period" value="30D" $dp30dchecked>一月
<INPUT type="radio" name="date_period" value="365D" $dp365dchecked>一年
    </td>
  </tr>
  <tr height="25" bgcolor="#EFEFEF">
    <td></td>
    <td><INPUT type="submit" value="搜索"></td>
  </tr>
</table>
</div>
    </td>
  </tr>
</table>
</FORM>
<script type="text/javascript" language="JavaScript 1.2">
<!--
    function visibleBox(id,skipOpenClose)
    {
        elm1 = document.getElementById("open"+id);
        elm2 = document.getElementById("close"+id);
        elm3 = document.getElementById("box"+id);
        if (skipOpenClose) 
        {
            if (elm3.style.display == "") {
                elm3.style.display = "none";
            } else {
                elm3.style.display = "";
            }
        }
        else
        {
            if (elm1.style.display == "") {
                elm1.style.display = "none";
                elm2.style.display = "";
                elm3.style.display = "none";
            } else {
                elm1.style.display = "";
                elm2.style.display = "none";
                elm3.style.display = "";
            }
        }
    }
	
function managedate(type, status) {

	if (type == 'address') {
	
		var fields = new Array('POSTed_data[city]','POSTed_data[state]','POSTed_data[country]','POSTed_data[zipcode]');
		
	}
	if (type == 'date') {
	
		var fields = new Array('StartDay','StartMonth','StartYear','EndDay','EndMonth','EndYear');

	}
	if (type == 'date_type') {
		status = document.searchform.elements['POSTed_data[registration_date]'].checked + document.searchform.elements['POSTed_data[last_login_date]'].checked;

		if (status != 0)
			status = false;
		else
			status = true;
	
		for (var i = 0; i < document.searchform.elements.length; i++)
			if (document.searchform.elements[i].name == 'POSTed_data[date_period]')
				document.searchform.elements[i].disabled = status;
	
		disable_dates = false;
		
		if (status)
			disable_dates = true;
		else {
			if (date_selected != 'C')
				disable_dates = true;
		}
		
		managedate('date', disable_dates);
		return true;

	}
	
	for (i in fields)
		document.searchform.elements[fields[i]].disabled = status;
	
}

function CheckAll(form){
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		e.checked == true ? e.checked = false : e.checked = true;
	}
}
-->
</script>
<!--
EOT;
?>-->