<?php
include('db_connection.php');
$Mainclass=new DB_Controller();
?> 
<!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=utf-8" />

<title>Untitled Document</title>

<link href="https://fonts.googleapis.com/css?family=Quicksand&display=swap" rel="stylesheet">

<script type="text/javascript" src="files/bower_components/jquery/js/jquery.min.js"></script>

<style type="text/css">

body{

margin:0px;

padding:0px;

font-family: quicksand, sans-serif !important;

}



.wrapper{

float:left;

width:100%;

height:auto;

}



.header_div{

float:left;

width:97%;

height:auto;

padding: 8px 0% 8px 3%;

font-weight:600;

font-size:20px;

color:#FFFFFF;

text-transform:uppercase;

background-color:#263544;

}



.body_maindiv{

float:left;

width:100%;

height:auto;

padding:2% 0%;

}



.heading_maindiv{

float:left;

width:100%;

height:auto;

text-align:left;

font-size:13px;

color:#000000;

font-weight:600;

padding-bottom:6px;

}



.dropdown_div{

display: block;

    width: 95%;

    height: 35px;

line-height:35px;
padding:0px 2%;
  

    background-color: #fff;

    border: 1px solid #ccc;

    border-radius: 4px;

    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);

    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;

	    font-size: 13px;

    border-radius: 2px;

    border: 1px solid #ccc;

	outline:0px;

}

.table_header {

    background-color: #263544;

    text-align: center;

    color: #FFFFFF;

    font-size: 13px;

    padding: 4px 0px;

}



.table_body {

    background-color: #e7eef6;

    text-align: center;

    color: #000000;

    font-size: 13px;

    padding: 4px 0px;

}



.btn{

float:right;

border-radius: 2px;

text-transform: capitalize;

font-size: 15px;

padding: 10px 19px;

text-align:center;

color:#FFFFFF;

background-color:#4099ff;

border:0;

cursor:pointer;

	

}



</style>



<script>

function ClosePopup()

{

	//alert(123);

	 //document.getElementByClass("fancybox-close").click();
	 window.parent.location.href='pending-stn.php';

//$('.fancybox-close').click();



//javascript:parent.jQuery.fancybox.close();

}

</script>

<script>

function Validate()

{

	var box=$('#box').val();
	var courier=$('#courier').val();
	var Shipment_No=$('#Shipment_No').val();
	var Total_Weight=$('#Total_Weight').val();
	
	$('#box').css("border-color","");
	$('#courier').css("border-color","");
	$('#Shipment_No').css("border-color","");
	$('#Total_Weight').css("border-color","");

	if(box=='')

	{

	$('#box').css("border-color","#FF0000");

	return false;	

	}
	
	if(courier=='')
	{

	$('#courier').css("border-color","#FF0000");

	return false;	

	}
	if(Shipment_No=='')
	{

	$('#Shipment_No').css("border-color","#FF0000");

	return false;	

	}
	if(Total_Weight=='')
	{

	$('#Total_Weight').css("border-color","#FF0000");

	return false;	

	}

}

</script>

</head>



<body>

<?php
$Order_Id=$_REQUEST['Order_No'];

if(isset($_REQUEST['submit1']))
{


       


$Condition=" Order_No='".$Order_Id."'";
$FieldValue="No_of_Boxes='".$_REQUEST['box']."',Courier_Name='".$_REQUEST['courier']."',Shipment_No='".$_REQUEST['Shipment_No']."', Total_Weight ='".$_REQUEST['Total_Weight']."'";

$Update_Order_Master=$Mainclass->Update_Data('gold_indent_master',$FieldValue,$Condition);












if($Get_Indent_Details['Ref_Order_No']!='')
{
?>
<script>window.parent.location.href='pending_indent.php';</script>
<?php
  }
  else{
  ?>
  <script>window.parent.location.href='pending-stn.php';</script>
  <?php
  }
}

?>



<?php

$Condition=" Order_No='".$Order_Id."'";
$Get_Indent_Details=$Mainclass->Fetch_individual_data('gold_indent_master','*',$Condition);
?>

<div class="wrapper">

<div class="header_div">Update Shipment Details</div>

<form method="post" onsubmit="return Validate()" action="#">

<div class="body_maindiv">







<div class="heading_maindiv">No of Boxes</div>



<div class="heading_maindiv" style="margin-bottom:10px;">

<input name="box" id="box" type="text" class="dropdown_div" value="<?php echo $Get_Indent_Details['No_of_Boxes']; ?>" Placeholder="No of Boxes" autocomplete="off" />





</div>


<div class="heading_maindiv">Courier Name </div>



<div class="heading_maindiv" style="margin-bottom:10px;">

<input name="courier" id="courier" type="text" class="dropdown_div" value="<?php echo $Get_Indent_Details['Courier_Name']; ?>" Placeholder="Courier Name " autocomplete="off" />





</div>

<div class="heading_maindiv">Shipment No</div>



<div class="heading_maindiv" style="margin-bottom:10px;">

<input name="Shipment_No" id="Shipment_No" type="text" class="dropdown_div" value="<?php echo $Get_Indent_Details['Shipment_No']; ?>" Placeholder="Shipment No" autocomplete="off" />





</div>

<div class="heading_maindiv">Total Weight of Item</div>



<div class="heading_maindiv" style="margin-bottom:10px;">

<input name="Total_Weight" id="Total_Weight" type="text" value="<?php echo $Get_Indent_Details['Total_Weight']; ?>" class="dropdown_div" Placeholder="Total Weight of Item" autocomplete="off" />





</div>




<div class="heading_maindiv">

<?php
if($Get_Indent_Details['Courier_Name']=="")
{

?>




<input name="submit1" type="submit" value="Submit" class="btn" />

<?php
}
else{
	
	?>
	<input name="submit1" type="submit" value="Update" class="btn" />
	<?php
	
}
?>

<input name="submit" type="button" value="Cancel" class="btn" style="margin-right:5px; background-color:#f0f0f0; color:#000000;"  onclick="ClosePopup()"/>





</div>


</div>

</form>







</div>

</body>

</html>