<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/users/user_info.html
 * 如果您的模型要进行修改，请修改 models/modules/users/user_info.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php
 //引入模块公共方法文件 
 require("foundation/module_users.php");

	//语言包引入
	$u_langpackage=new userslp;

	//变量获得
	$user_id =get_sess_userid();

	//表声明区
	$t_users = $tablePreStr."users";

	$dbo = new dbex;
	//读写分离定义函数
	dbtarget('r',$dbServs);

	$user_row = get_user_info($dbo,$t_users,$user_id);
	
	//性别预定义
	$man_c="";
	$woman_c="";
	if($user_row['user_sex']==0){
		$woman_c="checked=checked";
		}
	if($user_row['user_sex']==1){
		$man_c="checked=checked";
		}
		
	//婚姻预定义
	$sec_c="";
	$mer_c="";
	$n_mer_c="";
	if($user_row['user_marry']==0){
		$sec_c="selected=selected";
		}
	if($user_row['user_marry']==1){
		$mer_c="selected=selected";
		}
	if($user_row['user_marry']==2){
		$n_mer_c="selected=selected";
		}	
		

?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/row_menus.css">
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/iframe.css">
<script src="skin/default/js/area_database.js" type="text/javascript"></script>
<script src="skin/default/js/area_config.js" type="text/javascript"></script>
<script type='text/javascript'>
function checkform(){
	qq=document.form.qq.value;
	if(isNaN(qq)){
		parent.Dialog.alert("<?php echo $u_langpackage->u_qq_err;?>");
		return false;
	}
	var mood_text=trim(document.form.name.value);
	if(mood_text==''){
		parent.Dialog.alert("<?php echo $u_langpackage->u_no_name;?>");
		return false;
	}
}
function select_area(type){
	document.getElementById(type+"_info").style.display="none";
	document.getElementById(type).style.display="block";
}
 function trim(str){  //删除左右两端的空格
     return str.replace(/(^\s*)|(\s*$)|(　*)/g , "");
 }
 parent.guide("user_info");
	</script>
</head>

<body>
  <div class="main_right_title">
     <span class="main_title_dot9"></span>
     <span class="main_title_txt"><?php echo $u_langpackage->u_conf;?></span>
  </div>
		<div id="tabsB">
			<ul>
		    <li><a href="?app=user_info" title="<?php echo $u_langpackage->u_info;?>" class="nowbutl"><span class="nowbutr"><?php echo $u_langpackage->u_info;?></span></a></li>
		    <li><a href="?app=user_ico" title="<?php echo $u_langpackage->u_icon;?>"><span><?php echo $u_langpackage->u_icon;?></span></a></li>
		    <li><a href="?app=user_integral" title="<?php echo $u_langpackage->u_integral;?>"><span><?php echo $u_langpackage->u_integral;?></span></a></li>
		    <li><a href="?app=user_pw_change" title="<?php echo $u_langpackage->u_pw;?>"><span><?php echo $u_langpackage->u_pw;?></span></a></li>
		    <li><a href="?app=user_dressup" title="<?php echo $u_langpackage->u_dressup;?>"><span><?php echo $u_langpackage->u_dressup;?></span></a></li>
		  </ul>
		</div>
		
		<div class="container">
			<div class="rs_head"><?php echo $u_langpackage->u_fill;?></div>
		</div>
		
		<form name="form" method="post" action="do.php?act=user_info" onsubmit="return checkform()">
			
			<table class="main main_left" border="0">
	
				<tr>
					<th><?php echo $u_langpackage->u_name;?></th>
					<td><input type="text" id="name" name="name" value="<?php echo $user_row['user_name'];?>" maxlength="10" autocomplete='off'/></td>
				</tr>
				
				<tr>
					<th><?php echo $u_langpackage->u_sex;?></th>
					<td>
						<label for="sexm">
							<input id="sexm" type="radio" value="1" name="sex" <?php echo $man_c;?> /><?php echo $u_langpackage->u_man;?>
						</label>
						
						<label for="sexw">
							<input id="sexw" type="radio" value="0" name="sex" <?php echo $woman_c;?> /><?php echo $u_langpackage->u_wen;?>
						</label>
					</td>
				</tr>
				
				<tr>
					<th><?php echo $u_langpackage->u_marr;?></th>
					<td>
						<select id="marry" name="marry">
							<option value="0" <?php echo $sec_c;?>><?php echo $u_langpackage->u_sec;?></option>
							<option value="1" <?php echo $mer_c;?>><?php echo $u_langpackage->u_marr_n;?></option>
							<option value="2" <?php echo $n_mer_c;?>><?php echo $u_langpackage->u_marr_y;?></option>
						</select>
					</td>
				</tr>
	
				<tr>
					<th><?php echo $u_langpackage->u_bird;?></th>
					<td>
						<?php echo get_birth_date($user_row['birth_year'],$user_row['birth_month'],$user_row['birth_day']);?>
					</td>
				</tr>
				<tr>
					<th><?php echo $u_langpackage->u_bld;?></th>
					<td>
						<?php echo get_blood($user_row['user_blood']);?>
					</td>
				</tr>
				
				<tr>
					<th><?php echo $u_langpackage->u_birc;?></th>
					
					<td>
						<div id="birth_info"><?php echo $user_row['birth_province'];?>&nbsp&nbsp<?php echo $user_row['birth_city'];?>&nbsp&nbsp<input type='button'  class="top_button" onclick='select_area("birth");' value='选择' /></div>
						<div id="birth" style="display:none">
							
							<select name='s_birth_province' onchange="TwoSelectInit(area2,this.value);document.getElementById('birth_province').value=this.value;"></select>
							<input type='hidden' name='birth_province' id='birth_province' value='<?php echo $user_row["birth_province"];?>' />
							
							<select name='s_birth_city' onchange='document.getElementById("birth_city").value=this.value'></select>
							<input type='hidden' name='birth_city' id='birth_city' value='<?php echo $user_row["birth_city"];?>' />
							
							<script type="text/javascript">
								var area2 = new HwTwoSelect(document.form.s_birth_province,document.form.s_birth_city,selecttext,"－<?php echo $u_langpackage->u_province;?>－@","－<?php echo $u_langpackage->u_city;?>－@",0);
								TwoSelectInit(area2);
							</script>
							
						</div>
					</td>
				</tr>
				
				<tr>
					<th><?php echo $u_langpackage->u_res;?></th>
					<td>
						<div id="reside_info"><?php echo $user_row['reside_province'];?>&nbsp&nbsp<?php echo $user_row['reside_city'];?>&nbsp&nbsp<input type='button' class='top_button' onclick='select_area("reside");' value='选择' /></div>
					
						<div id="reside" style="display:none">
							<select name='s_reside_province' onchange="TwoSelectInit(area1,this.value);document.getElementById('reside_province').value=this.value;"></select>
							<input type='hidden' name='reside_province' id='reside_province' value='<?php echo $user_row["reside_province"];?>' />
							
							<select name='s_reside_city' onchange='document.getElementById("reside_city").value=this.value'></select>
							<input type='hidden' name='reside_city' id='reside_city' value='<?php echo $user_row["reside_city"];?>' />
							
							<script type="text/javascript">
								var area1 = new HwTwoSelect(document.form.s_reside_province,document.form.s_reside_city,selecttext,"－<?php echo $u_langpackage->u_province;?>－@","－<?php echo $u_langpackage->u_city;?>－@",0);
								TwoSelectInit(area1);
							</script>
						
						</div>
					</td>
				</tr>
				
				<tr>
					<th>QQ</th>
					<td><input type="text" class="t_input" name="qq" value="<?php echo $user_row['user_qq'];?>" maxlength="16" autocomplete='off'/></td>
				</tr>
				
				<tr>
					<td></td>
					<td>
						<input type="submit" name="profilesubmit2" value="<?php echo $u_langpackage->u_b_con;?>" class="anniu" />
						<input type="button" name="Submit" onclick="location.href='?app=user_info'" class="anniu" value="<?php echo $u_langpackage->u_b_can;?>" />
					</td>
				</tr>
			</table>
			
	</form>
</body>
</html>
