<?php
	//Connects to your Database
	include "../db_connection/db_connection.php";
	include "../config/config.php";		
	$page_id	=	base64_decode(base64_decode(base64_decode($_GET['page_id']))); //THIS IS PAGE ID  
	                  
	//cat_name,d_no,hdes_name,imgInp
if($page_id==1) //this is for basic details add page	
{ 		
		
		$lob	=	$_POST['lob']; 
		$lob    = str_replace("/", "-", $lob);
				
		foreach($_POST['category'] as $cat_id)
		{
		
			$INSRT		= "INSERT INTO silver_loading(`design_det_id`, `loading_date`, `post_dt`) VALUES ('$cat_id','$lob','$cur_time')";		
			$QURY		= mysqli_query($connect,$INSRT);
			
			$UPDATE = "UPDATE design_det SET design_status = 'In Silver Loading',update_dt = '$cur_time' WHERE design_det_id = '$cat_id'";
			$QRY    = mysqli_query($connect,$UPDATE); 
			
			$UPDATE_cd = "UPDATE silver_pending SET up_status = 'yes',update_dt = '$cur_time' WHERE design_det_id = '$cat_id'";
			$QRY_cd    = mysqli_query($connect,$UPDATE_cd); 	
		}
		
?>
		<script type="text/javascript">
            //alert("Data inserted successfully");
            //history.back();
            window.location='../silver_loading_list.php';
        </script>
<?php
}
?>
	
