www.gusucode.com > 仿51.com的php源码 1.1 > User/MyPersonalInfoContact.php

    <?php
include("../include/global.php");
include("CheckLogined.php");
include("../include/dbclass.php");
$db=new DbConn();
$uid=$_COOKIE["uid"];
$sql="select Phone,ContactMethod,ContactContent,c36,c37,IsHidePhone,IsHideContact from userdata where User_Account='$uid'";
$arr=$db->getRs($sql);
if ($_GET["step"]=="4")
{
$Phone=$_POST["f_User_Phone"];
if ($Phone=="")
{
echo "<script>alert('电话号码没有填写!');history.back();</script>";
exit();
}
$ContactContent=$_POST["f_User_ContactContent"];
if ($ContactContent=="")
{
echo "<script>alert('联系方式内容没有填写!');history.back();</script>";
exit();
}
$ContactMethod=$_POST["f_User_ContactMethod"];
$c36=$_POST["36"];
$c37=$_POST["37"];
$IsHidePhone=$_POST["f_User_IsHidePhone"];
$IsHideContact=$_POST["f_User_IsHideContact"];
$sql="update userdata set Phone='$Phone',ContactContent='$ContactContent',ContactMethod='$ContactMethod',c36='$c36',c37='$c37',IsHidePhone='$IsHidePhone',IsHideContact='$IsHideContact' where User_Account='$uid'";
$db->Execute($sql);
echo "<script>alert('保存成功!');location.href='MyPersonalInfoContact.php';</script>";

}
?>
<!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=gb2312" />
<title>村委会档案管理中心 - 个人资料</title>
<link href="../images/User_Main.css" rel="stylesheet" type="text/css" />
<script>
try{
	if(top!=window){
		document.domain	="www.wu-liao.com";		
	}else{
		top.location.href="/webin.php?refer=%2FUser%2FMyPersonalInfoContact.php";
	}
}catch(e){}
function showNewMessage(user){
	top.showNewMessage(user);
}

</script>
<script>
/*********Js Function Begin*********/
	function AppPersonalInfoSelectColorHtml(Obj,Obj2,Obj3,Obj4,Obj5,Obj6)
{
	//var w=screen.availWidth,h=screen.availHeight;
	var w=320,h=250;
	var theURL="../js/selectcolor.html";
	var theDes="status:no;center:yes;help:no;minimize:no;maximize:no;dialogWidth:"+w+"px;scroll:no;dialogHeight:"+h+"px;border:think";
	var t=self.showModalDialog(theURL,null,theDes);
	if(t)
	{
		Obj.style.background=t;
		Obj2.value=t;
		if(Obj3)
			Obj3.style.color=t;
		if(Obj4)
			Obj4.style.color=t;
		if(Obj5)
			Obj5.style.color=t;
		if(Obj6)
			Obj6.style.color=t;
	}
	else
	{
		//alert('颜色选择失败!');
	}
}
/*********Js Function End*********/
function userInfo4(obj)
{
	//标准输出
	var phone=obj.f_User_Phone.value;
	var contact=obj.f_User_ContactContent.value;
	if(!phone)
	{
		alert('电话号码没有填写!');document.all("f_User_Phone").focus();return false;
	}
	else if(!contact)
	{
		alert('联系方式没有填写!');document.all("f_User_ContactContent").focus();return false;
	}
	return true;
}
</script>
</head>
<body>
<div id="top"><?php require("../top.php"); ?>
</div>

<div id="nav">
<div id="navt"></div>
</div>

<div id="mjx"></div>
<div id="main">
<div id="left">
<div id="leph">
<div class="phff">
<div class="phtt">
个人资料分类</div>
<div class="phl2 "><a href="MyPersonalInfo.php" title="基本资料">基本资料</a></div><div class="phl2 "><a href="MyPersonalInfoDetail.php" title="择友资料">择友资料</a></div><div class="phl2 "><a href="MyPersonalInfoLive.php" title="生活方式">生活方式</a></div><div class="phl1"><div class="phz "><a href="MyPersonalInfoContact.php" title="联系方式">联系方式</a></div></div> <div class=phl2 style='font-size:12px;color:red'><div class="phz" ><a href='FixGroup.php' target=_blank></a></div></div></div>
<div class="mxle"><a href="MyPersonalInfoIntro.php">自我介绍</a></div><!--<div class="mxle"><a href="MyPersonalInfoGroup.php">分类管理</a></div>--></div>
</div>
<div id="right">
<div id="a4n">
<script>
var changeFlag=false;	//true表示已修改	false表示没有修改
function changeFlagValue()
{
	changeFlag=true;
}
</script>

<SCRIPT>
function getReadyState()
{
	var x = true;
	var a = document.getElementsByTagName("SCRIPT");
	for (var i=0; i<a.length; i++)
	{
		changeFlag=false;
		if (a[i].readyState=='complete' && x!=false)
		{
			x=true;
		}
		else
		{
			x=false;
		}
	}
	changeFlag=false;
	if (x)
	{
		window.clearTimeout(window.timer);
		//程序开始
		window.onbeforeunload=function()
		{
			if(changeFlag)
			{
				return "是否真的要离开此页面?您刚才所进行的更改还未保存。";
			}
		}
	}
	else
	{
		window.timer=window.setTimeout('getReadyState()',1000);
	}
}
getReadyState();
</SCRIPT>
<div class="anphg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="53%" align="left"style="font-size:14px;color:#000000;">用心填写资料,有助于全新地认识自己!也有利于别人更好地了解您!
</td>
</tr>
</table>
</div>
</div>
<div id="fenle">
<form name=formup method=post action="?step=4" onsubmit="changeFlag=false;return  userInfo4(this)">
<table width="570" border="0" cellpadding="5" cellspacing="0" class="tvb nxx">
<tr ><td height=20 align="right"><span id="phoneq" style="color:<?php echo $arr["c36"]; ?>">电话号码:</span></td><td align="left"><INPUT Name="f_User_Phone" type="Text" MaxLength="20" onpropertychange="changeFlagValue()"/>&nbsp;&nbsp;&nbsp;&nbsp;<span class="stzd">是否保密:</span><select name="f_User_IsHidePhone"  onpropertychange="changeFlagValue()" ><option value=0 >否</option><option value=1 >是</option></select>  <input type=hidden name=36 value="<?php echo $arr["c36"]; ?>"><span class="tvys" style="background:<?php echo $arr["c36"]; ?>" onclick="AppPersonalInfoSelectColorHtml(this,document.all('36'),document.all('f_User_Phone'),document.all('phoneq'))"><img src="images/ysk.gif" width="21" height="18" /></span></td><script>document.all('f_User_Phone').style.color="<?php echo $arr["c36"]; ?>";	</script></tr><tr ><td height="20" align="right"><select name="f_User_ContactMethod"  onpropertychange="changeFlagValue()" ><option value=qq >QQ</option><option value=msn >MSN</option><option value=icq >ICQ</option><option value=雅虎通 >雅虎通</option><option value=网易泡泡 >网易泡泡</option><option value=其它方式 >其它方式</option></select></td><td align="left"><INPUT Name="f_User_ContactContent" type="Text" MaxLength="30" onpropertychange="changeFlagValue()"/>&nbsp;&nbsp;&nbsp;&nbsp;<span class="stzd">是否保密:</span><select name="f_User_IsHideContact"  onpropertychange="changeFlagValue()" ><option value=0 >否</option><option value=1 >是</option></select>  <input type=hidden name=37 value="<?php echo $arr["c37"]; ?>"><span class="tvys" style="background:<?php echo $arr["c37"]; ?>" onclick="AppPersonalInfoSelectColorHtml(this,document.all('37'),document.all('f_User_ContactContent'),document.all('f_User_ContactMethod'))"><img src="images/ysk.gif" width="21" height="18" /></span></td><script>document.all('f_User_ContactContent').style.color="<?php echo $arr["c37"]; ?>";document.all('f_User_ContactMethod').style.color="<?php echo $arr["c37"]; ?>";	</script></tr><tr ><td align=center colspan=2 height=50 style="border-bottom: none;"><div id="x4n"></div><br><input type=submit value=' 确定 ' class='btn'></td></tr>
</table>
</form>

<script>
if (document.all("f_User_Phone").options && "<?php echo $arr["Phone"]; ?>" == "" ){
	document.all("f_User_Phone").options[0].selected=true;
}else{
	document.all("f_User_Phone").value="<?php echo $arr["Phone"]; ?>";
};
if (document.all("f_User_IsHidePhone").options && "<?php echo $arr["IsHidePhone"]; ?>" == "" ){
	document.all("f_User_IsHidePhone").options[0].selected=true;
}else{
	document.all("f_User_IsHidePhone").value="<?php echo $arr["IsHidePhone"]; ?>";
};
if (document.all("f_User_ContactMethod").options && "<?php echo $arr["ContactMethod"]; ?>" == "" ){
	document.all("f_User_ContactMethod").options[0].selected=true;
}else{
	document.all("f_User_ContactMethod").value="<?php echo $arr["ContactMethod"]; ?>";
};
if (document.all("f_User_ContactContent").options && "<?php echo $arr["ContactContent"]; ?>" == "" ){
	document.all("f_User_ContactContent").options[0].selected=true;
}else{
	document.all("f_User_ContactContent").value="<?php echo $arr["ContactContent"]; ?>";
};
if (document.all("f_User_IsHideContact").options && "<?php echo $arr["IsHideContact"]; ?>" == "" ){
	document.all("f_User_IsHideContact").options[0].selected=true;
}else{
	document.all("f_User_IsHideContact").value="<?php echo $arr["IsHideContact"]; ?>";
};
</script>
</div>
</div>
</div>
<div id="bottom">
<div id="baidu" style="color:#a0a0a0;"><?php require("../foot.php"); ?></div>
</div>
</body>
</html>