<?php
session_start();
include("../include/config.php");
include("../include/functions.php"); 
include("../include/simpleimage.php");
validate_admin();

if($_REQUEST['update']=='Update Detail'){
	$orderid=$_REQUEST['orderid'];
	$fname=mysql_real_escape_string($_REQUEST['ship_fname']);
	$lname=mysql_real_escape_string($_REQUEST['ship_lname']);
	$houseno=mysql_real_escape_string($_REQUEST['ship_house_no']);
	$apartment=mysql_real_escape_string($_REQUEST['ship_complex']);
	$street=mysql_real_escape_string($_REQUEST['ship_street']);
	$city=mysql_real_escape_string($_REQUEST['ship_city_id']);
	$state=mysql_real_escape_string($_REQUEST['ship_state']);
	$zipcode=mysql_real_escape_string($_REQUEST['ship_pincode']);
		

	$obj->query("update go_order set ship_fname='$fname',ship_lname='$lname',ship_house_no='$houseno',ship_complex='$apartment',ship_street='$street',ship_city_id='$city',ship_state='$state',ship_pincode='$zipcode' where id='$orderid'");?>
<script>

parent.location="order-list.php"; 

</script>
<?php 
}	
   
if($_REQUEST['order_id']!=''){
$sql=$obj->query("select * from go_order where id=".$_REQUEST['order_id']);
$result=$obj->fetchNextObject($sql);
}

?>
<!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>
<title><?php echo SITE_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left" valign="middle" class="headingbg bodr text14"><em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: User Details for #<?php echo stripslashes($result->id); ?></td>
  </tr>
  <tr>
    <td height="100" align="left" valign="top" bgcolor="#f7faf9" class="bodr"> 
	
        <table width="100%" cellpadding="0" cellspacing="10">
		
         <tr>
          <td  class="paddBot11 paddRt14" colspan="2"><h2>Delivery Address</h2></td>
        </tr>
        <tr>
          <td  class="paddBot11 paddRt14" colspan="2">
		  <table width="100%" border="0" cellspacing="10" cellpadding="0">
		  <form name="frm" method="POST" enctype="multipart/form-data" action="">
        <input type="hidden" name="orderid" value="<?php echo $_REQUEST['order_id'];?>" />
              <tr>
                <td width="18%"><strong> First Name:</strong></td>
                <td width="34%"><input type="text" name="ship_fname" value="<?php echo stripslashes($result->ship_fname);?>" /></td>
                <td width="14%"><strong> Last Name:</strong></td>
                <td width="34%"><input type="text" name="ship_lname" value="<?php echo stripslashes($result->ship_lname);?>" /></td>
              </tr>
              <tr>
                <td width="18%"><strong> House Number:</strong></td>
                <td width="34%"><input type="text" name="ship_house_no" value="<?php echo stripslashes($result->ship_house_no);?>" /></td>
                <td width="18%"><strong> Complex:</strong></td>
                <td width="34%"><input type="text" name="ship_complex" value="<?php echo stripslashes($result->ship_complex);?>" /></td>
              </tr>
              <tr>
                <td width="14%"><strong> Street:</strong></td>
                <td width="34%"><input type="text" name="ship_street" value="<?php echo stripslashes($result->ship_street);?>" /></td>
				<td width="18%"><strong> City:</strong></td>
                <td width="34%"><input type="text" name="ship_city_id" value="<?php echo $result->ship_city_id;?>" /></td>
              </tr>
              <tr>
                
                <td width="14%"><strong> State:</strong></td>
                <td width="34%"><input type="text" name="ship_state" value="<?php echo $result->ship_state;?>" /></td>
				<td width="18%"><strong> Zipcode:</strong></td>
                <td width="34%"><input type="text" name="ship_pincode" value="<?php echo stripslashes($result->ship_pincode);?>" /></td>
              </tr>
			  <tr></tr><tr></tr>
			  <tr>
                
                <td width="14%">&nbsp;</td>
                <td width="24%">&nbsp;</td>
				<td width="18%"><input type="submit" name="update" value="Update Detail" class="btn" /></td>
                <td width="34%">&nbsp;</td>
              </tr>
			  </form>
            </table></td>
        </tr>
       
</table>
</body>
</html>
