www.gusucode.com > 仿51.com的php源码 1.1 > User/MyPersonalInfoDetail.php
<?php include("../include/global.php"); include("CheckLogined.php"); include("../include/dbclass.php"); $db=new DbConn(); $uid=$_COOKIE["uid"]; $sql="select FriendIdea,Pay,LoveHistory,HasSex,LoverOb,c14,c15,c16,c17,c18 from userdata where User_Account='$uid'"; $arr=$db->getRs($sql); if ($_GET["step"]=="2") { $FriendIdea=$_POST["f_User_FriendIdea"]; if ($FriendIdea=="") { echo "<script>alert('交友目的没有选择!');history.back();</script>"; exit(); } $Pay=$_POST["f_User_Pay"]; if ($Pay=="") { echo "<script>alert('约会谁买单没有选择!');history.back();</script>"; exit(); } $LoveHistory=$_POST["f_User_LoveHistory"]; if ($LoveHistory=="") { echo "<script>alert('恋爱史没有选择!');history.back();</script>"; exit(); } $HasSex=$_POST["f_User_HasSex"]; if ($HasSex=="") { echo "<script>alert('性经历没有选择!');history.back();</script>"; exit(); } $LoverOb=$_POST["f_User_LoverOb"]; if ($LoverOb=="") { echo "<script>alert('理想的对象没有填写!');history.back();</script>"; exit(); } $c14=$_POST["14"]; $c15=$_POST["15"]; $c16=$_POST["16"]; $c17=$_POST["17"]; $c18=$_POST["18"]; $sql="update userdata set FriendIdea='$FriendIdea',Pay='$Pay',LoveHistory='$LoveHistory',HasSex='$HasSex',LoverOb='$LoverOb',c14='$c14',c15='$c15',c16='$c16',c17='$c17',c18='$c18' where User_Account='$uid'"; $db->Execute($sql); echo "<script>alert('保存成功!');location.href='MyPersonalInfoDetail.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%2FMyPersonalInfoDetail.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 userInfo2(obj) { var friendIdea=obj.f_User_FriendIdea.value; var pay=obj.f_User_Pay.value; var love=obj.f_User_LoveHistory.value; var hasSex=obj.f_User_HasSex.value; var loveob=obj.f_User_LoverOb.value; if(friendIdea==0) { alert('交友目的没有选择!');document.all("f_User_FriendIdea").focus();return false; } else if(pay==0) { alert('约会谁买单没有选择!');document.all("f_User_Pay").focus();return false; } else if(love==0) { alert('恋爱史没有选择!'); document.all("f_User_LoveHistory").focus();return false; } else if(hasSex==0) { alert('性经历没有选择!'); document.all("f_User_HasSex").focus();return false; } else if(!loveob) { alert('理想的对象没有填写!'); document.all("f_User_LoverOb").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="phl1"><div class="phz "><a href="MyPersonalInfoDetail.php?group=%D4%F1%D3%D1%D7%CA%C1%CF" title="择友资料">择友资料</a></div></div><div class="phl2 "><a href="MyPersonalInfoLive.php?group=%C9%FA%BB%EE%B7%BD%CA%BD" title="生活方式">生活方式</a></div><div class="phl2 "><a href="MyPersonalInfoContact.php?group=%C1%AA%CF%B5%B7%BD%CA%BD" title="联系方式">联系方式</a></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="/User/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=2" onsubmit="changeFlag=false;return userInfo2(this)"> <table width="570" border="0" cellpadding="5" cellspacing="0" class="tvb nxx"> <input type=hidden name=14 value="<?php echo $arr["c14"]; ?>"><tr><td height="20" align="right" valign="top"style="line-height:20px;" width=121><span id="whyq" style="color:<?php echo $arr["c14"]; ?>">我的交友目的:</span></td><td align="left" width=425><select name="f_User_FriendIdea" onpropertychange="changeFlagValue()" ><option value=0 >----</option><option value=友情 >友情</option><option value=爱情 >爱情</option><option value=正式征婚 >正式征婚</option><option value=思想交流 >思想交流</option><option value=都可以 >都可以</option></select></td><td align="left" width=24><span class="tvys" style="background:<?php echo $arr["c14"]; ?>" onclick="AppPersonalInfoSelectColorHtml(this,document.all('14'),document.all('f_User_FriendIdea'),document.all('whyq'))"><img src="images/ysk.gif" width="21" height="18" /></span></td><script> document.all('f_User_FriendIdea').style.color="<?php echo $arr["c14"]; ?>"; </script></tr><input type=hidden name=15 value="<?php echo $arr["c15"]; ?>"><tr><td height="20" align="right" valign="top"style="line-height:20px;"><span id="payq" style="color:<?php echo $arr["c15"]; ?>">约会时谁买单:</span></td><td align="left"><select name="f_User_Pay" onpropertychange="changeFlagValue()" ><option value=0 >----</option><option value=当然是男的 >当然是男的</option><option value=AA制 >AA制</option><option value=自己 >自己</option><option value=对方 >对方</option><option value=到时再说 >到时再说</option></select></td><td align="left"><span class="tvys" style="background:<?php echo $arr["c15"]; ?>" onclick="AppPersonalInfoSelectColorHtml(this,document.all('15'),document.all('f_User_Pay'),document.all('payq'))"><img src="images/ysk.gif" width="21" height="18" /></span></td><script> document.all('f_User_Pay').style.color="<?php echo $arr["c15"]; ?>"; </script></tr><input type=hidden name=16 value="<?php echo $arr["c16"]; ?>"><tr><td height="20" align="right" valign="top"style="line-height:20px;"><span id="historyq" style="color:<?php echo $arr["c16"]; ?>">我的恋爱史:</span></td><td align="left"><select name="f_User_LoveHistory" onpropertychange="changeFlagValue()" ><option value=0 >----</option><option value=有 >有</option><option value=有过多次 >有过多次</option><option value=没有 >没有</option><option value=不知算不算 >不知算不算</option><option value=已婚 >已婚</option><option value=离异 >离异</option><option value=正在恋爱 >正在恋爱</option><option value=保密 >保密</option></select></td><td align="left"><span class="tvys" style="background:<?php echo $arr["c16"]; ?>" onclick="AppPersonalInfoSelectColorHtml(this,document.all('16'),document.all('f_User_LoveHistory'),document.all('historyq'))"><img src="images/ysk.gif" width="21" height="18" /></span></td><script> document.all('f_User_LoveHistory').style.color="<?php echo $arr["c16"]; ?>"; </script></tr><input type=hidden name=17 value="<?php echo $arr["c17"]; ?>"><tr><td height="20" align="right" valign="top"style="line-height:20px;"><span id="sexq" style="color:<?php echo $arr["c17"]; ?>">我的性经历:</span></td><td align="left"><select name="f_User_HasSex" onpropertychange="changeFlagValue()" ><option value=0 >----</option><option value=没有 >没有</option><option value=有 >有</option><option value=不好意思说 >不好意思说</option><option value=不知算不算 >不知算不算</option><option value=忘记了 >忘记了</option><option value=无可奉告 >无可奉告</option><option value=我不懂哦 >我不懂哦</option><option value=经验丰富 >经验丰富</option><option value=这还用问? >这还用问?</option><option value=晕,这种问题都有? >晕,这种问题都有?</option><option value=保密 >保密</option></select></td><td align="left"><span class="tvys" style="background:<?php echo $arr["c17"]; ?>" onclick="AppPersonalInfoSelectColorHtml(this,document.all('17'),document.all('f_User_HasSex'),document.all('sexq'))"><img src="images/ysk.gif" width="21" height="18" /></span></td><script> document.all('f_User_HasSex').style.color="<?php echo $arr["c17"]; ?>"; </script></tr><tr > <td height="20" align="right"><input type=hidden name=18 value="<?php echo $arr["c18"]; ?>"><span id="obq" style="color:<?php echo $arr["c18"]; ?>">理想的对象:</span></td> <td align="left"><input name="f_User_LoverOb" type="text" maxlength="80" size=60 style="color:<?php echo $arr["c18"]; ?>" onpropertychange=changeFlagValue()></td> <td align="left"><span class="tvys" style="background:<?php echo $arr["c18"]; ?>" onclick="AppPersonalInfoSelectColorHtml(this,document.all('18'),document.all('f_User_LoverOb'),document.all('obq'))"><img src="images/ysk.gif" width="21" height="18" /></span></td> </tr><tr ><td colspan=3 style="border-bottom: none;"> <div id="filearea" style="text-align:left"> </div> </td></tr><tr ><td colspan=3 align=center height=50 style="border-bottom: none;"><div id="x4n"></div><br><div class="a4"></div><div style="float:left;width:200px;margin-left:150px!important;margin-left:80px"><input type=submit value=' 确定 ' class='btn'></div></td></tr> </table> <script> if (document.all("f_User_FriendIdea").options && "<?php echo $arr["FriendIdea"]; ?>" == "" ){ document.all("f_User_FriendIdea").options[0].selected=true; }else{ document.all("f_User_FriendIdea").value="<?php echo $arr["FriendIdea"]; ?>"; }; if (document.all("f_User_Pay").options && "<?php echo $arr["Pay"]; ?>" == "" ){ document.all("f_User_Pay").options[0].selected=true; }else{ document.all("f_User_Pay").value="<?php echo $arr["Pay"]; ?>"; }; if (document.all("f_User_LoveHistory").options && "<?php echo $arr["LoveHistory"]; ?>" == "" ){ document.all("f_User_LoveHistory").options[0].selected=true; }else{ document.all("f_User_LoveHistory").value="<?php echo $arr["LoveHistory"]; ?>"; }; if (document.all("f_User_HasSex").options && "<?php echo $arr["HasSex"]; ?>" == "" ){ document.all("f_User_HasSex").options[0].selected=true; }else{ document.all("f_User_HasSex").value="<?php echo $arr["HasSex"]; ?>"; }; if (document.all("f_User_LoverOb").options && "<?php echo $arr["LoverOb"]; ?>" == "" ){ document.all("f_User_LoverOb").options[0].selected=true; }else{ document.all("f_User_LoverOb").value="<?php echo $arr["LoverOb"]; ?>"; }; </script> </form> </div> </div> </div> <div id="bottom"> <div id="baidu" style="color:#a0a0a0;"><?php require("../foot.php"); ?></div> </div> </body> </html>