<?php

include("session_start.php");

include("session_check.php");include("database.php");



extract($_GET);

$query = mysql_query("delete FROM super_admin where super_id='".$_GET['super_id']."'");

//echo "delete FROM super_admin where super_id='".$_GET['super_id']."'";



//$query1 = mysql_query("delete FROM info where pid='$pid'");

$delete_imei= mysql_query("select * from imei_details where super_id='".$_GET['super_id']."'");

//echo "select * from imei_details where super_id='".$_GET['id']."'";

$num_imei=mysql_num_rows($delete_imei);



$delete_mac= mysql_query("select * from mac_details where super_id='".$_GET['super_id']."'");

$num_mac=mysql_num_rows($delete_mac);



while($num_imei!=0)

{

	$query1 = mysql_query("delete FROM imei_details where super_id='".$_GET['super_id']."'");

	//echo "delete FROM super_admin where super_id='".$_GET['id']."'";

	$num_imei--;

}



while($num_mac!=0)

{

	$query1 = mysql_query("delete FROM mac_details where super_id='".$_GET['super_id']."'");

	//echo "delete FROM super_admin where super_id='".$_GET['id']."'";

	$num_mac--;

}



if($query)

		{

			if($_GET['super_id']!="")

			{

		?>

		<script language="javascript" type="text/javascript">

		alert("Deleted Successfully");

		window.location="super_admin_grid.php";

		</script>

		<?php

		}

		}

		/*if($query1)

		{

			if($_GET['pid']!="")

			{

		?>

		<script language="javascript" type="text/javascript">

		alert("Deleted Successfully from info");

		window.location="index_grid.php";

		</script>

		<?php

		}

		}*/

		?>



<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Survey Application</title>

</head>



<body>

</body>

</html>