<?
require_once('functions.php');


if($_POST['submitted']){
$id=$_POST['id'];
$user=$_SESSION['user'];
$status=$_POST['sure'];
if($id){
if($status=='Yes'){

$name=mysql_real_escape_string($_POST['name']);
$t="delete from labor where lab_id='$id' limit 1";
$tt=mysqli_query($dbc,$t);
//UserAudit($_SESSION['user'],"Deleted Product $name",date("Y/m/d"),$ip);
//$res='Deleted Product';
//$r="insert into audit(product,stock,qty,reason,date,value,user)value('$id','$d','0','$res',NOW(),'Product Edit ','$user')";
//$sql=mysqli_query($dbc,$r);
}


}


$url='stff.php';
ob_end_clean();
header("Location: $url");
}
	$type='DELETE PRODUCTS';
						//if(Rights($_SESSION['user_id'],$type,$_SESSION['department'])){	

require_once('conf.php');
$id = $_GET['id'];
$r=mysql_query("select CONCAT_WS(' ',first,last)as name from labor where lab_id='$id'");
$row=mysql_fetch_array($r);
 echo '<form action="delete_stff.php"method="post">
 <h3>Staff Name: ' . $row['name'] . '</h3>
 <p><b>Are you sure you want to Delete  This Individual?<br />
 <input type="radio" name="sure"
value="Yes" /> Yes
 <input type="radio" name="sure" value=
"No" checked="checked" /> No</p>
 <p><input type="submit" name="submit"
value="Delete Staff" /></p>
 <input type="hidden" name="submitted"
value="TRUE" />
 <input type="hidden" name="name" value="'
. $row['nam'] . '" />
 <input type="hidden" name="id" value="'
. $id . '" />
 </form>';
 
//}else{
	//											   LackRights();
		//										   }


 ?>
 