<?php
session_start();
$username = $_SESSION['staff'];


$staffID=$_GET['staffID'];

if($_SESSION['staff']!= null)
{
if($_POST["Back"] == "Back")
{
	echo "<script language='javascript'>window.location='invlist.php'</script>"; 
}

if($_POST["Delete"] == "Delete")
{
include("connect.php");


$invNo=$_POST['invNo'];
	$query=mysql_query("delete from invoice where invNo='$invNo'");
	$query2=mysql_query("delete from invitem where invNo='$invNo'");
	echo "<script>alert('Invoice $invNo is deleted.')</script>";
	echo "<script language='javascript'>window.location='invlist.php'</script>"; 
}

}else{
	echo "<script language='javascript'>alert ('Please login.')</script>";
	echo "<script language='javascript'>window.location='index.php'</script>";
}
?>