<?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	
{ 		
		$hdes_name	=	base64_decode(base64_decode(base64_decode($_POST['hdes_name'])));
		$pre_tally	=	$_POST['pre_tally'];
		$tot_wastge	=	$_POST['tot_wgt'];
		$recov_wt 	= 	$_POST['dust_wgt'];
		$fin_wgt 	= 	$_POST['fin_wgt'];
		$wes_per 	= 	$_POST['wes_per'];
		$tot_lod 	= 	$_POST['tot_lod'];
		$cur_tall 	= 	date("d-m-Y",strtotime($cur_time));
		
		$INSRT		= "INSERT INTO `dust_tally`(`emp_det_id`, `tally_date`, `pre_tally_date`, `was_weight`, `return_weight`, `final_weight`, `tot_load_weight`, `wastage_percentage`, `post_dt`) VALUES ('$hdes_name','$cur_tall','$pre_tally','$tot_wastge','$recov_wt','$fin_wgt','$tot_lod','$wes_per','$cur_time')";		
		$QURY		= mysqli_query($connect,$INSRT);
		
?>
		<script type="text/javascript">
            //alert("Data inserted successfully");
            //history.back();
            window.location='../dust_tally_list.php';
        </script>
<?php
}
?>
	
