<?php
include("../dbconfig.php");


/* delete for Contact details */
if (isset($_POST["data1"]) && isset($_POST["del"])){
	$sql= "DELETE FROM event_contact WHERE id = '".$_POST["data1"]."'";
	if ($db->query($sql) === TRUE) {
				echo "Data Successfully Deleted";
	}else {
		echo "Error updating record: 1" . $db->error;
	}
}

/* delete for Register details */
if (isset($_POST["data2"]) && isset($_POST["del"])){
	$sql= "DELETE FROM event_group_register WHERE id = '".$_POST["data2"]."'";
	if ($db->query($sql) === TRUE) {
				echo "Data Successfully Deleted";
	}else {
		echo "Error updating record: 1" . $db->error;
	}
}

/* delete for customer details */
if (isset($_POST["data3"]) && isset($_POST["del"])){
	$sql= "DELETE FROM event_group_customers WHERE id = '".$_POST["data3"]."'";
	if ($db->query($sql) === TRUE) {
				echo "Data Successfully Deleted";
	}else {
		echo "Error updating record: 1" . $db->error;
	}
}
/* delete for group_register details */

if (isset($_POST["id1"]) && isset($_POST["del"])){
	$sql= "DELETE FROM group_register WHERE id = '".$_POST["id1"]."'";
	if ($db->query($sql) === TRUE) {
				echo "Data Successfully Deleted";
	}else {
		echo "Error updating record: 1" . $db->error;
	}
}
/* delete for personalised reg details */

if (isset($_POST["id2"]) && isset($_POST["del"])){
	$sql= "DELETE FROM personalised_register WHERE id = '".$_POST["id2"]."'";
	if ($db->query($sql) === TRUE) {
				echo "Data Successfully Deleted";
	}else {
		echo "Error updating record: 1" . $db->error;
	}
}

/* delete for institute reg details */

if (isset($_POST["id3"]) && isset($_POST["del"])){
	$sql= "DELETE FROM institute WHERE id = '".$_POST["id3"]."'";
	if ($db->query($sql) === TRUE) {
				echo "Data Successfully Deleted";
	}else {
		echo "Error updating record: 1" . $db->error;
	}
}

/* delete for Customer details/new barcode details */

if (isset($_POST["id4"]) && isset($_POST["del"])){
	$sql= "DELETE FROM  new_barcode WHERE id = '".$_POST["id4"]."'";
	if ($db->query($sql) === TRUE) {
				echo "Data Successfully Deleted";
	}else {
		echo "Error updating record: 1" . $db->error;
	}
}





?>
