<?php 
session_start();
include 'dbc.php';



$userid=$_SESSION["userid"];
$std_rollno=$_POST["std_rollno"];
$class_name=$_POST["class_name"];
$sqll = "select * from admission where std_rollno='$std_rollno' and class_name='$class_name' and user_id='$userid'";
$data=mysql_query($sqll) or die ("Error:" . mysql_error());
$rows=mysql_num_rows($data);
$user_data=mysql_fetch_array($data);
  if($rows==0)
    {
	   echo "This Record Does Not Exist";
	  }
	  else
	  {
$sql = "delete from admission where std_rollno='$std_rollno' and class_name='$class_name' and user_id='$userid'";
mysql_query($sql) or die("Error : " . mysql_error());

$sql1 = "delete from std_ledger where std_rollno='$std_rollno' and class_name='$class_name' and user_id='$userid'";
mysql_query($sql1) or die("Error : " . mysql_error());
$sql2 = "delete from std_ledger1 where rollno='$std_rollno' and cname='$class_name' and user_id='$userid'"; 
mysql_query($sql2) or die("Error : " . mysql_error());


header("location:del_adm_info.php");
}
/*$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"]);*/
?>
<a href="del_adm_info.php"> Back </a>
