<?php
require("../conn.php");
ob_start();
session_start(); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link href="../css/css.css" rel="stylesheet" type="text/css"> 
<style type="text/css">
<!--
body { 
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head> 
<script language="javascript">
function onfocus_check(id) { id.style.border='2px #FF0000 solid'; }
function onblur_check(id) { id.style.border='1px #6CB5FF solid'; }
var xmlHttp
function sort_list(id,city_id)
{
var url='../city_select.php?submit_action=1&id='+id+'&city_id='+city_id;
if (window.ActiveXObject)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")	
}
else if (window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest()
}
xmlHttp.open("GET",url,true)
xmlHttp.onreadystatechange=stateChanged
xmlHttp.send(null)
}

function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("city_sort").innerHTML=xmlHttp.responseText
}
}

function search_type_check(id) {
if (id=='') { search_value.style.display='none'; user_form.search_value.value=''; }
if (id==1) { user_form.search_value.style.display=''; user_form.search_value.value='请输入用户名'; } 
if (id==2) { user_form.search_value.style.display=''; user_form.search_value.value='请输入电子邮箱'; }
if (id==3) { user_form.search_value.style.display=''; user_form.search_value.value='请输入姓名'; }
if (id==4) { user_form.search_value.style.display=''; user_form.search_value.value='请输入移动电话'; }
}

function search_on_focus() { if (user_form.search_value.value=='请输入用户名' || user_form.search_value.value=='请输入电子邮箱' || user_form.search_value.value=='请输入姓名' || user_form.search_value.value=='请输入移动电话') { user_form.search_value.value=''; } }
function search_on_blur() { if (user_form.search_type.value==1 && user_form.search_value.value=='') { user_form.search_value.value='请输入用户名'; } 
if (user_form.search_type.value==2 && user_form.search_value.value=='') { user_form.search_value.value='请输入电子邮箱'; }
if (user_form.search_type.value==3 && user_form.search_value.value=='') { user_form.search_value.value='请输入姓名'; }
if (user_form.search_type.value==4 && user_form.search_value.value=='') { user_form.search_value.value='请输入移动电话'; }
}

function user_form_check() { 
if (user_form.email.value=='') { alert('请输入电子邮箱!'); user_form.email.focus(); return false; }
var filter=/^\s*([A-Za-z0-9_-]+(\.\w+)*@(\w+\.)+\w{2,3})\s*$/;
if (!filter.test(document.user_form.email.value)) { alert('请输入正确的电子邮箱格式!'); user_form.email.focus(); return false; }
if (user_form.yourname.value=='') { alert('请输入姓名!'); user_form.yourname.focus(); return false; }
if (user_form.province_name.value=='') { alert('请选择所在区域!'); user_form.province_name.focus(); return false; }
if (user_form.city_name.value=='') { alert('请选择所在区域!'); user_form.city_name.focus(); return false; }
if (user_form.address.value=='') { alert('请输入地址!'); user_form.address.focus(); return false; }
if (user_form.mobile.value=='') { alert('请输入移动电话!'); user_form.mobile.focus(); return false; }
if (isNaN(user_form.mobile.value)) { alert('移动电话必须为数字!'); user_form.mobile.focus(); return false; }
if (user_form.mobile.value.length<11 || user_form.mobile.value.length>11) { alert('请输入正确的移动电话号码!'); user_form.mobile.focus(); return false; }
}
</script>
<?php if ($_POST['province_name']!='') { $province_name=str_sql($_POST['province_name']); } else { $province_name=str_sql($_GET['province_name']); } 
	   if ($_POST['subject_name']!='') { $subject_name=str_sql($_POST['subject_name']); } else { $subject_name=str_sql($_GET['subject_name']); }?><body onLoad="javascript:<?php if ($_GET['disp_type']=='list' && $province_name=='') { ?>sort_list('','');<?php } if ($subject_name=='') { ?>subject_list('');<?php } ?>"><div align="center">
<?php switch ($_GET['disp_type']) { 
	   case 'list':
	  if ($_POST['occupation_value']!='') { $occupation_value=str_sql($_POST['occupation_value']); } else { $occupation_value=str_sql($_GET['occupation_value']); }
	  if ($_POST['province_name']!='') { $province_name=str_sql($_POST['province_name']); } else { $province_name=str_sql($_GET['province_name']); }
      if ($_POST['city_name']!='') { $city_name=str_sql($_POST['city_name']); } else { $city_name=str_sql($_GET['city_name']); }
	  if ($province_name!='' && $city_name!='') { $area_name=','.$province_name.','.$city_name.','; }
	  if ($_POST['year_value']!='') { $year_value=str_sql($_POST['year_value']); } else { $year_value=str_sql($_GET['year_value']); }
	  if ($_POST['month_value']!='') { $month_value=str_sql($_POST['month_value']); } else { $month_value=str_sql($_GET['month_value']); }
	  if ($_POST['day_value']!='') { $day_value=str_sql($_POST['day_value']); } else { $day_value=str_sql($_GET['day_value']); }
	  if ($year_value!='') { $date_value=$year_value; }	  
	  if ($year_value!='' && $month_value!='') { $date_value=$year_value.'-'.$month_value; }
	  if ($month_value!='' && $day_value!='') { $date_value=$year_value.'-'.$month_value.'-'.$day_value; }
	  if ($_POST['search_type']!='') { $search_type=str_sql($_POST['search_type']); } else { $search_type=str_sql($_GET['search_type']); }
	  if ($_POST['search_value']!='') { $search_value=str_sql($_POST['search_value']); } else { $search_value=str_sql($_GET['search_value']); }	 
	  $state_value=str_sql($_GET['state_value']); ?>
<script language="javascript">function del_confirm(page,id) { if (confirm('真的要删除吗？')) { location.href='user_list_action.php?type_action=del&occupation_value=<?=$occupation_value?>&province_name=<?=$province_name?>&city_name=<?=$city_name?>&search_type=<?=$search_type?>&search_value=<?=$search_value?>&year_value=<?=$year_value?>&month_value=<?=$month_value?>&day_value=<?=$day_value?>&state_value=<?=$state_value?>&page='+page+'&id='+id; } }</script>
<?php $list="select * from user_info_manage where user_level<>'admin_user'";
	  if ($_GET['authentication_value']==1) { $list=$list." and identity_card<>''"; }
      if ($state_value!='') { $list=$list." and state_info='$state_value'"; }
	  $list=$list." order by id desc";
	  $rs_list=mysql_query ($list);
	  if (mysql_num_rows($rs_list)/20>intval(mysql_num_rows($rs_list)/20)) { $rows_count=intval(mysql_num_rows($rs_list)/20)+1; } else { $rows_count=intval(mysql_num_rows($rs_list)/20); }
	 $page=$_GET['page'];
	 if($page==0 || $page=='') { $page=1; }
	 if($page>$rows_count) { $page=$rows_count; }
	 if($rows_count<1) { $rows_count=1; } 	 
	 if(mysql_fetch_object($rs_list)) { ?>
<table width="970" height="20" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="970" border="0" cellpadding="0" cellspacing="0" style="border-top:1px #9DC3EA solid;border-left:1px #9DC3EA solid;border-right:1px #9DC3EA solid;" class="news_css"><tr align="center"><td width="150" height="30" background="../images/sort_background.jpg" bgcolor="#F4FAFF" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;font-weight:bold;">用户名</td>
            <td width="220" background="../images/sort_background.jpg" bgcolor="#F4FAFF" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;font-weight:bold;">电子邮箱</td>
            <td width="120" background="../images/sort_background.jpg" bgcolor="#F4FAFF" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;font-weight:bold;">性别</td>
            <td width="150" background="../images/sort_background.jpg" bgcolor="#F4FAFF" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;font-weight:bold;">移动电话</td>
            <td width="90" background="../images/sort_background.jpg" bgcolor="#F4FAFF" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;font-weight:bold;">QQ号码</td>
            <td width="80" background="../images/sort_background.jpg" bgcolor="#F4FAFF" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;font-weight:bold;">您的身份</td>
            <td width="80" background="../images/sort_background.jpg" bgcolor="#F4FAFF" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;font-weight:bold;">发布日期</td>
            <td width="80" background="../images/sort_background.jpg" bgcolor="#F4FAFF" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;font-weight:bold;">操作</td></tr><tr>
	 <?php 
	 if(mysql_data_seek($rs_list,($page-1)*20)) {
	 for($i=1;$i<=20;$i++) {	 
	 if($rs_user_list=mysql_fetch_object($rs_list)) { ?> 
            <td height="30" align="center" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;"><?=$rs_user_list->user_name?></td>
            <td align="center" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;"><?=$rs_user_list->e_mail?></td>
            <td align="center" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;"><?=$rs_user_list->sex_info?></td>
            <td align="center" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;"><?=$rs_user_list->mobile_number?></td>
            <td align="center" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;"><?php if ($rs_user_list->qq_info!='') { ?><?=$rs_user_list->qq_info?><?php } else { ?>无<?php } ?></td>
            <td align="center" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;"><?=$rs_user_list->user_level?></td>
            <td align="center" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;"><?=$rs_user_list->submit_date?></td>
            <td align="center" style="border-right:1px #9DC3EA solid;border-bottom:1px #9DC3EA solid;"><a href="javascript:del_confirm(<?=$page?>,<?=$rs_user_list->id?>);">删除</a></td>
          </tr>		  
		  <tr align="left" bgcolor="#F4FAFF">
            <form name="form1" method="post" action="../login_action.php?type_action=state_edit&id=<?=$rs_user_list->id?>&occupation_value=<?=$occupation_value?>&province_name=<?=$province_name?>&city_name=<?=$city_name?>&search_type=<?=$search_type?>&search_value=<?=$search_value?>&year_value=<?=$year_value?>&month_value=<?=$month_value?>&day_value=<?=$day_value?>&state_value=<?=$state_value?>&page=<?=$page?>"><td height="30" colspan="8" style="border-bottom:1px #9DC3EA solid;"><table width="970" height="20" border="0" cellpadding="0" cellspacing="0" style="font-size:12px;">
              <tr>
                <td align="right">当前状态：</td>	
               	<td width="150"><?php if ($rs_user_list->state_info==1) { ?><input type="radio" name="state_value_<?=$rs_user_list->id?>" value="0">未认证　<input name="state_value_<?=$rs_user_list->id?>" type="radio" value="1" checked>已认证<?php } else { ?><input type="radio" name="state_value_<?=$rs_user_list->id?>" value="0" checked>未认证　<input name="state_value_<?=$rs_user_list->id?>" type="radio" value="1">已认证<?php } ?></td>
				<td width="90"><input name="imageField" type="image" src="../images/manage_edit.jpg" width="40" height="20" border="0"></td>
			    <td width="630"><?php if ($rs_user_list->identity_card!='') { ?><a href="user_list_manage.php?disp_type=authentication_info&id=<?=$rs_user_list->id?>" target="_blank"><font color="#FF0000">查看认证资料</font></a><?php } ?></td>
              </tr>
            </table></td></form></tr>
	<?php } } } ?></table>	
	<br><span class="news_css"><a href="user_list_manage.php?disp_type=list&occupation_value=<?=$occupation_value?>&province_name=<?=$province_name?>&city_name=<?=$city_name?>&search_type=<?=$search_type?>&search_value=<?=$search_value?>&year_value=<?=$year_value?>&month_value=<?=$month_value?>&day_value=<?=$day_value?>&state_value=<?=$state_value?>">第一页</a>　　　<a href="user_list_manage.php?disp_type=list&occupation_value=<?=$occupation_value?>&province_name=<?=$province_name?>&city_name=<?=$city_name?>&search_type=<?=$search_type?>&search_value=<?=$search_value?>&year_value=<?=$year_value?>&month_value=<?=$month_value?>&day_value=<?=$day_value?>&state_value=<?=$state_value?>&page=<?=$page-1?>">上一页</a>　　　　　　<?=$page?>　　　　　　共 <?=$rows_count?> 页　　　　　<a href="user_list_manage.php?disp_type=list&occupation_value=<?=$occupation_value?>&province_name=<?=$province_name?>&city_name=<?=$city_name?>&search_type=<?=$search_type?>&search_value=<?=$search_value?>&year_value=<?=$year_value?>&month_value=<?=$month_value?>&day_value=<?=$day_value?>&state_value=<?=$state_value?>&page=<?=$page+1?>">下一页</a>　　　<a href="user_list_manage.php?disp_type=list&occupation_value=<?=$occupation_value?>&province_name=<?=$province_name?>&city_name=<?=$city_name?>&search_type=<?=$search_type?>&search_value=<?=$search_value?>&year_value=<?=$year_value?>&month_value=<?=$month_value?>&day_value=<?=$day_value?>&state_value=<?=$state_value?>&page=<?=$rows_count?>">最后一页</a><?php } else { ?><br><br><br><br>暂无记录!<?php } ?></span><br><br>	
<?php
break; case 'authentication_info':
$id=str_sql($_GET['id']);
$user_check="select * from user_info_manage where id='$id'";
$rs_user_check=mysql_query ($user_check);  
if ($rs_user=mysql_fetch_object ($rs_user_check)) { ?><img src="../<?=$rs_user->identity_card?>" width="700" height="700"><?php   
} } ?>
</div>
</body>
</html>