<?
include("../config/conn.php");
include("../config/function.php");
sesCheck();
$bh=$_GET[bh];
$userid=returnuserid($_SESSION["SHOPUSER"]);
if($_GET[control]=="update"){
 $sj=date("Y-m-d H:i:s");	
 $ifmr=intval($_POST[R1]);
 if(1==$ifmr){updatetable("yjcode_shdz","ifmr=0");}
 $area1=sqlzhuru($_POST[area1]);
 $area2=sqlzhuru($_POST[add2]);
 $area3=sqlzhuru($_POST[add3]);
 updatetable("yjcode_shdz","lxr='".sqlzhuru($_POST[t1])."',add1=".$area1.",add1v='".returnarea($area1)."',add2=".$area2.",add2v='".returnarea($area2)."',add3=".$area3.",add3v='".returnarea($area3)."',addr='".sqlzhuru($_POST[t2])."',mot='".sqlzhuru($_POST[t3])."',yb='".sqlzhuru($_POST[t4])."',sj='".$sj."',zt=0,ifmr=".$ifmr." where bh='".$bh."' and userid=".$userid);
 php_toheader("shdz.php?t=suc&bh=".$bh);
}

while0("*","yjcode_shdz where bh='".$bh."' and userid=".$userid);if(!$row=mysql_fetch_array($res)){php_toheader("shdzlist.php");}
$ifarea="yes";
$add1=$row[add1];
$add2=$row[add2];
$add3=$row[add3];
?>
<!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="x-ua-compatible" content="ie=7" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用户管理面板 - <?=webname?></title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/personalCenter.css">
<link rel="stylesheet" type="text/css" href="css/global.css">
<link rel="stylesheet" type="text/css" href="css/index.css">
<!--<link rel="stylesheet" type="text/css" href="css/gameListStyle.css">
<link rel="stylesheet" type="text/css" href="css/oldstyle.css">-->
<link rel="stylesheet" type="text/css" href="css/layui.css">
<script language="javascript" src="../js/basic.js"></script>
<script language="javascript" src="js/index.js"></script>
<script language="javascript">
function tj(){
if(document.f1.t1.value==""){alert("请输入收货人姓名");document.f1.t1.focus();return false;}	
if(document.f1.t2.value==""){alert("请输入详细地址");document.f1.t2.focus();return false;}	
if(document.f1.t3.value==""){alert("请输入手机号码");document.f1.t3.focus();return false;}	
tjwait();
f1.action="shdz.php?control=update&bh=<?=$bh?>";
}
function area1cha(){
 farea2.location="../tem/area2.php?area1id="+document.getElementById("area1").value;	
}
</script>
</head>
<body style="background:#f7f7f7;">
<? include("top.php");?>



<div class="personal_center main_wrap clear">
<? include("left.php");?>
<div class="realName">
        <div class="rn_title">
            <span>收货地址</span>
        </div>

<!--RB-->
<div class="right">

 <? include("rcap1.php");?>
 <script language="javascript">
 document.getElementById("rcap8").className="l1 l2";
 </script>

 <? systs("恭喜您，操作成功!","shdz.php?bh=".$bh)?>
 <form name="f1" method="post" onsubmit="return tj()">
 <input type="hidden" value="shdz" name="jvs" />
 <ul class="uk">
 <li class="l1"><span class="red">*</span>收货人：</li>
 <li class="l2"><input name="t1" class="inp" value="<?=$row[lxr]?>" size="25" type="text" /></li>
 <li class="l1"><span class="red">*</span>所在地区：</li>
 <li class="l2"><? include("../tem/area.php");?></li>
 <li class="l1"><span class="red">*</span>详细地址：</li>
 <li class="l2"><input name="t2" class="inp" value="<?=$row[addr]?>" size="50" type="text" /> <span class="hui">&nbsp;无须重复省市县</span></li>
 <li class="l1"><span class="red">*</span>手机号码：</li>
 <li class="l2"><input name="t3" class="inp" value="<?=$row[mot]?>" size="25" type="text" /></li>
 <li class="l1">默认地址：</li>
 <li class="l2">
 <span class="finp">
 <label><input name="R1" type="radio" value="0"<? if(empty($row[ifmr])){?> checked="checked"<? }?> /> 否</label>&nbsp;&nbsp;&nbsp;
 <label><input name="R1" type="radio" value="1"<? if($row[ifmr]==1){?> checked="checked"<? }?> /> 是</label>
 </span>
 </li>
 <li class="l1">邮编：</li>
 <li class="l2"><input name="t4" class="inp" value="<?=$row[yb]?>" size="10" type="text" /></li>
 <li class="l3"></li>
 <li class="l4"><?=tjbtnr("保存修改","shdzlist.php")?></li>
 </ul>
 </form>

</div> 
<!--RE-->

</div>
<? include("bottom.php");?>
</body>
</html>