7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
131 lines
7.8 KiB
PHP
131 lines
7.8 KiB
PHP
<?php
|
|
if(THIS_IN!="edt_c")
|
|
exit("错误的访问!");
|
|
$uid=check_cookie();
|
|
$db=_mysql_connect();
|
|
$msg_login_user=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
|
|
$_title_="用户管理";
|
|
$_nav_="<a href=\"".$_SERVER[PHP_SELF]."?_m=user/main\">首页</a>";
|
|
switch($_a){
|
|
case "set_password" :
|
|
$content0[]=array("用户名",$msg_login_user["username"]);
|
|
$content0[]=array("新密码","<input type=\"password\" name=\"password\" style='width:100px'> *");
|
|
$content0[]=array("新密码确认","<input type=\"password\" name=\"password_confirm\" style='width:100px'> *");
|
|
//js_code
|
|
$js_code="";
|
|
//
|
|
$content="<script>
|
|
function ok(){
|
|
obj=document.form1;
|
|
if(obj.password.value==''){
|
|
alert('请输入密码!');
|
|
obj.password.focus();
|
|
return false;
|
|
}
|
|
if(obj.password.value!=obj.password_confirm.value){
|
|
alert('2次输入的密码不一致!');
|
|
obj.password.focus();
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
</script><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\"><form name=\"form1\" action=\"".$_SERVER[PHP_SELF]."\" onsubmit=\"return ok()\"><input type=\"hidden\" name=\"_m\" value=\"user/info\"><input type=\"hidden\" name=\"_a\" value=\"save_password\">";
|
|
for($i=0;$i<count($content0);$i++){
|
|
$content.="<tr><td width=\"120\" align=\"right\" style=\"font-weight:bold;\">".$content0[$i][0]."</td><td align=\"left\"> ".$content0[$i][1]."</td></tr>";
|
|
}
|
|
$content.="<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"保存修改\"></td></tr></table>";
|
|
$_button_="<input type=\"button\" value=\" 返 回 \" onclick=\"location.href='".$_SERVER[PHP_SELF]."?_m=user/info'\">";
|
|
$_title1_="密码设置";
|
|
break;
|
|
case "save_password" :
|
|
if($password!=$password_confirm)
|
|
alert_and_back("2次输入的密码不一致!");
|
|
$query="update ".$table_pre."user set password='".md5($password)."' where id='".$uid."'";
|
|
$db->query($query);
|
|
$lid=$id?$id:$db->insert_id();
|
|
set_log("用户密码设置",$msg_login_user["username"]."|".$uid);
|
|
echo "<script>
|
|
alert('密码设置成功,下次登录请使用新密码!');
|
|
location.href=\"".$_SERVER[PHP_SELF]."?_m=user/info\";
|
|
</script>";
|
|
break;
|
|
case "modify";
|
|
$d_gender=$msg_login_user["gender"];
|
|
$d_zjlx=$msg_login_user["zjlx"];
|
|
//
|
|
$content0[]=array("用户名","<input type=\"text\" name=\"username\" value=\"".$msg_login_user["username"]."\" style='width:100px' maxlength=\"50\" disabled> *");
|
|
$content0[]=array("密码提示问题","<input type=\"text\" name=\"password_question\" style='width:300px' value=\"".$msg_login_user["password_question"]."\"> *");
|
|
$content0[]=array("密码提示答案","<input type=\"text\" name=\"password_answer\" style='width:150px' value=\"".$msg_login_user["password_answer"]."\"> *");
|
|
$content0[]=array("真实姓名","<input type=\"text\" name=\"name\" style='width:80px' value=\"".$msg_login_user["name"]."\"> <select name=\"gender\">".get_main_op($arr_gender,$d_gender)."</select>");
|
|
$content0[]=array("固定电话","<input type=\"text\" name=\"phone\" style='width:200px' value=\"".$msg_login_user["phone"]."\">");
|
|
$content0[]=array("手机号码","<input type=\"text\" name=\"cellphone\" style='width:200px' value=\"".$msg_login_user["cellphone"]."\">");
|
|
$content0[]=array("电子邮箱","<input type=\"text\" name=\"email\" style='width:200px' value=\"".$msg_login_user["email"]."\">");
|
|
$content0[]=array("证件号码","<select name=\"zjlx\"><option value=''>--</option>".get_main_op($arr_zjlx,$d_zjlx)."</select> <input type=\"text\" name=\"zjhm\" style='width:200px' value=\"".$msg_login_user["zjhm"]."\">");
|
|
$content0[]=array("出生日期","<input type=\"text\" name=\"birthday\" style='width:70px' value=\"".deel_date_null($msg_login_user["birthday"])."\" onclick=\"WdatePicker()\" readonly>");
|
|
$content0[]=array("居住城市","<input type=\"text\" name=\"city\" style='width:80px' value=\"".$msg_login_user["city"]."\">");
|
|
$content0[]=array("邮寄地址","<input type=\"text\" name=\"addr\" style='width:300px' value=\"".$msg_login_user["addr"]."\">");
|
|
$content0[]=array("邮编","<input type=\"text\" name=\"postcode\" style='width:80px' value=\"".$msg_login_user["postcode"]."\">");
|
|
$content0[]=array("备注信息","<textarea name=\"remark\" style='width:200px' rows=\"3\">".$msg_login_user["remark"]."</textarea>");
|
|
$content0[]=array("注册日期",date("Y-m-d",$msg_login_user["add_date"]));
|
|
//
|
|
$content="<script>
|
|
function ok(){
|
|
if(obj.password_question.value==''){
|
|
alert('请输入密码提示问题!');
|
|
obj.password_question.focus();
|
|
return false;
|
|
}
|
|
if(obj.password_answer.value==''){
|
|
alert('请输入密码提示答案!');
|
|
obj.password_answer.focus();
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
</script><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\"><form name=\"form1\" action=\"".$_SERVER[PHP_SELF]."\" onsubmit=\"return ok()\"><input type=\"hidden\" name=\"_m\" value=\"user/info\"><input type=\"hidden\" name=\"_a\" value=\"save_modify\">";
|
|
for($i=0;$i<count($content0);$i++){
|
|
$content.="<tr><td width=\"120\" align=\"right\" style=\"font-weight:bold;\">".$content0[$i][0]."</td><td align=\"left\"> ".$content0[$i][1]."</td></tr>";
|
|
}
|
|
$content.="<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"保存修改\"></td></tr></table>";
|
|
$_button_="<input type=\"button\" value=\" 返 回 \" onclick=\"location.href='".$_SERVER[PHP_SELF]."?_m=user/info'\">";
|
|
$_title1_="修改个人资料";
|
|
break;
|
|
case "save_modify" :
|
|
$query="update ".$table_pre."user set name='".$name."',password_question='".$password_question."',password_answer='".$password_answer."',gender='".$gender."',phone='".$phone."',cellphone='".$cellphone."',email='".$email."',zjlx='".$zjlx."',zjhm='".$zjhm."',city='".$city."',addr='".$addr."',postcode='".$postcode."',birthday='".$birthday."',remark='".$remark."' where id='".$uid."'";
|
|
$db->query($query);
|
|
set_log("学员资料修改",$msg_login_user["username"]."|".$uid);
|
|
echo "<script>
|
|
alert('信息保存成功!');
|
|
location.href=\"".$_SERVER[PHP_SELF]."?_m=user/info\";
|
|
</script>";
|
|
break;
|
|
default:
|
|
$_title1_="个人资料";
|
|
$content0[]=array("用户名",$msg_login_user["username"]);
|
|
$content0[]=array("密码提示问题",$msg_login_user["password_question"]);
|
|
$content0[]=array("密码提示答案",$msg_login_user["password_answer"]);
|
|
$content0[]=array("真实姓名",$msg_login_user["name"]);
|
|
$content0[]=array("性别",get_main_value($arr_gender,$msg_login_user["gender"]));
|
|
$content0[]=array("固定电话",$msg_login_user["phone"]);
|
|
$content0[]=array("手机号码",$msg_login_user["cellphone"]);
|
|
$content0[]=array("电子邮箱",$msg_login_user["email"]);
|
|
$content0[]=array("证件类别",get_main_value($arr_zjlx,$msg_login_user["zjlx"]));
|
|
$content0[]=array("证件号码",$msg_login_user["zjhm"]);
|
|
$content0[]=array("出生日期",deel_date_null($msg_login_user["birthday"]));
|
|
$content0[]=array("居住城市",$msg_login_user["city"]);
|
|
$content0[]=array("邮寄地址",$msg_login_user["addr"]);
|
|
$content0[]=array("邮编",$msg_login_user["postcode"]);
|
|
$content0[]=array("备注信息",dhtmlchars($msg_login_user["remark"]));
|
|
$content0[]=array("注册日期",date("Y-m-d",$msg_login_user["add_date"]));
|
|
$content="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">";
|
|
for($i=0;$i<count($content0);$i++){
|
|
$content.="<tr><td width=\"120\" align=\"right\" style=\"font-weight:bold;\">".$content0[$i][0]."</td><td align=\"left\"> ".$content0[$i][1]."</td></tr>";
|
|
}
|
|
$content.="</table>";
|
|
$_button_="<input type=\"button\" value=\"资料修改\" onclick=\"location.href='".$_SERVER[PHP_SELF]."?_m=user/info&_a=modify'\"> <input type=\"button\" value=\"密码设置\" onclick=\"location.href='".$_SERVER[PHP_SELF]."?_m=user/info&_a=set_password'\">";
|
|
break;
|
|
}
|
|
$_title_=$_title1_."-首页";
|
|
$_right="hidden";
|
|
include template("user");
|
|
?>
|