<?php ob_start(); ?>
<?php include("../conn.php");?>
<?php include("../common/head.php")?>
<?php 


include('../conn.php');


if(isset($_GET['id'])){
    $l=$_GET['l'];
    $type=$_GET['type'];
	$id=mysqli_real_escape_string($conn, $_GET['id']);
    $id=base64_decode($id);
$confirm=1;

if($type==1){
    $value='0';
}
else{
     $value='1';
}


				
			  
$sql4 = "UPDATE `orders_details` SET `status`=1 , `delivery_status`=$value where orderid='$id'";
if(mysqli_query($conn,$sql4)){
			
	
 }
		$sql = "UPDATE `orders` SET `confirm`='$confirm' where orderid='$id'";
		if(mysqli_query($conn,$sql)){
			
           header("location:../print_receipt?p=$l&item=".urlencode(base64_encode($id)));
		}
		else{
		  echo 'Error: '.mysqli_error($conn);
		} 
	}
 