<?php
include("code.php");
authorize();
$name=$_SESSION['admin_name'];
$bcode=$_SESSION['branchcode'];

if(isset($_GET['del']))
      {
              mysqli_query($link,"delete from cart where name = '".$_GET['pname']."' and BranchCode='$bcode' and officer='$name'");
              echo "<script>location='pos.php?name=$name&bcode=$bcode'</script>";
                  //$_SESSION['delmsg']="Product deleted !!";
      }	

//=============================================================================================================================================================================
/*$sql =$link->query("select * from emptystockreport where BranchCode='$bcode' and date='$date'");
$num = mysqli_num_rows($sql);
		if($num<1){
		$result=mysqli_query($link,"select * from empty where BranchCode='$bcode'");
				$prev=0;
				while($reply = mysqli_fetch_array($result)){
					$code=$reply['code'];
					$name=$reply['name'];
					$quan=$reply['quantity'];
					
					$sql =$link->query("insert into emptystockreport values('NULL', '$bcode','$date','$code','$name','$quan','0','0',$mon,$yr,'$officer')");
					
				}
				
				echo "<script>alert('Stock  Succesfully Open')</script>";
			echo "<script>location='dashboard.php'</script>";
}else{
	
	echo "<script>alert('Stock Has Been Opened Today')</script>";
			echo "<script>location='dashboard.php'</script>";
}*/

?>