<?php
session_start();
include("dbconfig.php");
if(isset($_SESSION['username']) && isset($_SESSION['password']))
{
    $username=$_SESSION['username'];
    $pass=$_SESSION['password'];
    
}
else
{
     echo '<META http-equiv="refresh" content="0;logout.php">';
}
if(isset($_GET['BillNo'])){
mysqli_query($db,"DELETE FROM bill where BillNo='$_GET[BillNo]'");
mysqli_query($db,"DELETE FROM billparticulars where BillNo='$_GET[BillNo]'");

 echo "<script>alert('Bill Deleted!')</script>";
 echo "<script>window.history.go(-1)</script>";

}
elseif(isset($_GET['FBillNo'])){
	mysqli_query($db,"DELETE FROM finalbill where FinalBillNo='$_GET[FBillNo]'");
	 echo "<script>alert('Bill Deleted!')</script>";
 echo "<script>window.history.go(-1)</script>";
}

if(isset($_GET['userslno'])){
mysqli_query($db,"DELETE FROM billlogin where SlNo='$_GET[userslno]'");
	 echo "<script>alert('User Deleted!!')</script>";
$url="/Billing/Admin/default/ViewUsers.php";
echo "<meta http-equiv=\"refresh\" content=\"0;url=$url\" />";
}
?>
