<?php
	//session_start();
	
	include("config.php");
	error_reporting(0);
	$user=$_SESSION['username'];
	
	include("include/functions.php");
	
	if(isset($_REQUEST['add_det']))
 {
	  $uname=$_REQUEST['email'];
	  $sname=$_REQUEST['sname'];
	 $sphone=$_REQUEST['sphone'];
	 $sdoor_no=$_REQUEST['sdoor_no'];
	 $semail=$_REQUEST['semail'];
	 $slocality=$_REQUEST['slocality'];
	 $sstreet=$_REQUEST['sstreet'];
	 $scity=$_REQUEST['scity'];
	 $sdistrict=$_REQUEST['sdistrict'];
	 $sstate=$_REQUEST['sstate'];
	  
	   $spincode=$_REQUEST['spincode'];
	
	$select="select * from shipping_address";
	 mysql_query($select);
	 
	 $insert="insert into shipping_address(username,name,phone,door_no,email,locality,street,city,district,state,pincode)values('$uname','$sname','$sphone','$sdoor_no','$semail','$slocality','$sstreet','$scity','$sdistrict','$sstate','$spincode')";
	 $add=mysql_query($insert);
	
	 header("location:profile.php?add=Success");
 }
	
	
	
	
	
?>
<script language="javascript">
	function addtocart(pid){
		document.form1.productid.value=pid;

		document.form1.command.value='add';
		document.form1.submit();
	}
</script>


<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>


<form name="form1">
	<input type="hidden" name="productid" />
    <input type="hidden" name="productimage" />
    <input type="hidden" name="command" />
</form>
<!DOCTYPE HTML>
<html>
	<head>
		<title><?php echo $tittle;?></title>
		<link href="css/style.css" rel='stylesheet' type='text/css' />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
		</script>
		<!----webfonts---->
		<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
		<!----//webfonts---->
		<!----start-alert-scroller---->
		<script src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/jquery.easy-ticker.js"></script>
		<script type="text/javascript">
		$(document).ready(function(){
			$('#demo').hide();
			$('.vticker').easyTicker();
		});
		</script>
		<!----start-alert-scroller---->
		<!-- start menu -->
		<link href="css/megamenu.css" rel="stylesheet" type="text/css" media="all" />
		<script type="text/javascript" src="js/megamenu.js"></script>
		<script>$(document).ready(function(){$(".megamenu").megamenu();});</script>
		<script src="js/menu_jquery.js"></script>
		<!-- //End menu -->
		<!---slider---->
		<link rel="stylesheet" href="css/slippry.css">
		<script src="js/jquery-ui.js" type="text/javascript"></script>
		<script src="js/scripts-f0e4e0c2.js" type="text/javascript"></script>
		<script>
			  jQuery('#jquery-demo').slippry({
			  // general elements & wrapper
			  slippryWrapper: '<div class="sy-box jquery-demo" />', // wrapper to wrap everything, including pager
			  // options
			  adaptiveHeight: false, // height of the sliders adapts to current slide
			  useCSS: false, // true, false -> fallback to js if no browser support
			  autoHover: false,
			  transition: 'fade'
			});
		</script>
		<!----start-pricerage-seletion---->
		<script type="text/javascript" src="js/jquery-ui.min.js"></script>
		<link rel="stylesheet" type="text/css" href="css/jquery-ui.css">
		<script type='text/javascript'>//<![CDATA[ 
			$(window).load(function(){
			 $( "#slider-range" ).slider({
			            range: true,
			            min: 0,
			            max: 500,
			            values: [ 100, 400 ],
			            slide: function( event, ui ) {  $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
			            }
			 });
			$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - $" + $( "#slider-range" ).slider( "values", 1 ) );
			
			});//]]>  
		</script>
		<!----//End-pricerage-seletion---->
		<!---move-top-top---->
		<script type="text/javascript" src="js/move-top.js"></script>
		<script type="text/javascript" src="js/easing.js"></script>
		<script type="text/javascript">
			jQuery(document).ready(function($) {
				$(".scroll").click(function(event){		
					event.preventDefault();
					$('html,body').animate({scrollTop:$(this.hash).offset().top},1200);
				});
			});
		</script>
		<!---//move-top-top---->
        <script type="text/javascript">
    function FillBilling(f) {
  if(f.billingtoo.checked == true) {
    f.sname.value = f.name.value;
    f.sphone.value = f.phone.value;
	f.sdoor_no.value = f.door_no.value;
	f.semail.value = f.email.value;
	f.slocality.value = f.locality.value;
	f.sstreet.value = f.street.value;
	f.scity.value = f.city.value;
	f.sdistrict.value = f.district.value;
	f.sstate.value = f.state.value;
	
	f.spincode.value = f.pincode.value;
  }
}
</script>
	</head>
	<body>
		<!---start-wrap---->
			<!---start-header---->
			<?php include("include/header.php"); ?>
            
            <div class="content details-page">
			<!---start-product-details--->
			<div class="product-details">
				<div class="wrap">
    
<div class="main">
		<div class="container">
        <ul class="product-head">
						
						<div class="clear"> </div>
					</ul>
    
		  <div class="register-grids">
          
		  	  <form method="post" id="chgpass1" enctype="multipart/form-data" action="">
           	  
               
               <?php
$user=$_SESSION['username'];
$select="select * from user_account where username='$user'";
$result=mysql_query($select);
$row = mysql_fetch_array($result);
?>
               
				 <div class="register-top-grid">
                 <h3>
                 </h3>
					<h3>YOUR DETAILS</h3>
					 <div>
						<span>Name<label style="color:#F00;">*</label></span>
						<input type="text" name="name" required class="required" value="<?php echo $row['name']; ?>"> 
					 </div>
                     <div>
						<span>Email ID<label style="color:#F00;">*</label></span>
						<input type="text" name="email" required class="required"  value="<?php echo $row['username']; ?>"> 
					 </div>
					 
					 <div>
						<span>Phone No.<label style="color:#F00;">*</label></span>
						<input type="text" name="phone" required class="required" value="<?php echo $row['phone']; ?>"> 
					 </div>
                     
                     <div>
						<span>Door No.<label style="color:#F00;">*</label></span>
						<input type="text" name="door_no"  required class="required"  value="<?php echo $row['door_no']; ?>"> 
					 </div>
                     
                     <div>
						<span>Locality<label style="color:#F00;">*</label></span>
						<input type="text" name="locality" required class="required"  value="<?php echo $row['locality']; ?>"> 
					 </div>
                     
                     <div>
						<span>Street<label style="color:#F00;">*</label></span>
						<input type="text" name="street" required class="required"  value="<?php echo $row['street']; ?>"> 
					 </div>
                     
					 <div>
						<span>City<label style="color:#F00;">*</label></span>
						<input type="text" name="city" required class="required"  value="<?php echo $row['city']; ?>"> 
					 </div>
                     
                     <div>
						<span>District<label style="color:#F00;">*</label></span>
						<input type="text" name="district" required class="required"  value="<?php echo $row['district']; ?>"> 
					 </div>
					 
                     
                     <div>
						<span>State<label style="color:#F00;">*</label></span>
						<input type="text" name="state" required class="required"  value="<?php echo $row['state']; ?>"> 
					 </div>
                     <div>
						<span>pincode<label style="color:#F00;">*</label></span>
						<input type="text" name="pincode" required class="required" maxlength="10"  value="<?php echo $row['pincode']; ?>"> 
					 </div>
                     
                     
                    
					 <div class="clearfix"> </div>
					   <a class="news-letter" href="#">
						 <label class="checkbox"><input type="checkbox" name="billingtoo" onClick="FillBilling(this.form)"><i> </i>Click this box if Your Details and Shipping Details are the same.</label>
					   </a>
					</div>
                    
						<div class="register-bottom-grid">
							<h3 style="margin-top:50px;">SHIPPING DETAILS</h3>
                            
                            
							 <div>
						<span>Name<label style="color:#F00;">*</label></span>
						<input type="text" name="sname" required class="required"> 
					 </div>
                     <div>
						<span>Email ID<label style="color:#F00;">*</label></span>
						<input type="text" name="semail" required class="required"> 
					 </div>
					 
					 <div>
						<span>Phone No.<label style="color:#F00;">*</label></span>
						<input type="text" name="sphone" required class="required"> 
					 </div>
                     
                     <div>
						<span>Door No.<label style="color:#F00;">*</label></span>
						<input type="text" name="sdoor_no" required class="required"> 
					 </div>
                     
                     <div>
						<span>Locality<label style="color:#F00;">*</label></span>
						<input type="text" name="slocality" required class="required"> 
					 </div>
                     
                     <div>
						<span>Street<label style="color:#F00;">*</label></span>
						<input type="text" name="sstreet" required class="required"> 
					 </div>
                     
					 <div>
						<span>City<label style="color:#F00;">*</label></span>
						<input type="text" name="scity" required class="required"> 
					 </div>
                     
                     <div>
						<span>District<label style="color:#F00;">*</label></span>
						<input type="text" name="sdistrict" required class="required"> 
					 </div>
					 
                     
                     <div>
						<span>State<label style="color:#F00;">*</label></span>
						<input type="text" name="sstate" required class="required"> 
					 </div>
                     <div>
						<span>pincode<label style="color:#F00;">*</label></span>
						<input type="text" name="spincode" required class="required" maxlength="10"> 
					 </div>
                     
							 
						  </div>
                         
				  <div class="clearfix"> </div>
                   
						<input type="submit" name="add_det" value="CONTINUE TO NEXT STEP" />
                        <div class="clearfix"> </div>
					 </form>
                     <script type="text/javascript">
						function formCallback(result, form) 
						{
							window.status = "valiation callback for form '" + form.id + "': result = " + result;
						}
						
						var valid = new Validation('chgpass1', {immediate : true, onFormValidate : formCallback});
						Validation.addAllThese([
							['validate-password', 'Your password must be more than 6 characters and not be \'password\' or the same as your name', {
								minLength : 7,
								notOneOf : ['password','PASSWORD','1234567','0123456'],
								notEqualToField : 'field1'
							}],
							['validate-password-confirm', 'Your confirmation password does not match your first password, please try again.', {
								equalToField : 'field39'

							}]
						]);
					</script> 
                    
					</div>
			</div>
	  </div>
	</div>
    </div>
     <div class="clearfix" style="clear:both;"> </div>
   <?php include("include/footer.php"); ?>