<?php 
session_start();
//mysql_connect("localhost","root","vertrigo") or die("Error Connecting Server");
//mysql_select_db("sm") or die("Error Opening Database");
include 'dbc.php';

$userid=$_SESSION["userid"];
$today=date("d-m-Y");
$id=$_REQUEST["id"];
$sqll = "select * from users where id='$id'";
$data=mysql_query($sqll) or die ("Error:" . mysql_error());
$rows=mysql_num_rows($data);
$user_data=mysql_fetch_array($data);

  if($rows==0)
    {
	   $Message =  "This Record Cannot Deleted";
	    header("Location:add_users_report.php?Message={$Message}");
	  }
	  else
	  {
	 
$sql = "delete from users where id='$id'";
mysql_query($sql) or die("Error : " . mysql_error());

$Message = "Record Deleted";
    header("Location:add_users_report.php?Message={$Message}");
}
/*$sql="Select * from agents where userid='$user_id'";
$data=mysql_query($sql) or die ("Error:" . mysql_error());
$userdata=mysql_fetch_array($data);
$email=$userdata["e_mail"];
mail($email . ",info@lalburj.com","Candidate Information","Candidate Data Posted Successfully","Passport No:" . $app_pp_no . " of " . $app_name . "Has been Posted Successfully By:" . $_SESSION["userid"]);*/
?>
