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

if(isset($_GET['cat_id'])){
	$id=$_GET['cat_id'];
	mysqli_query($conn,"DELETE FROM `category` WHERE id='$id'");
	header("location:category.php?main=5&cat=1");
}

if(isset($_GET['pro_id'])){
	$id=$_GET['pro_id'];
	mysqli_query($conn,"DELETE FROM `product` WHERE id='$id'");
	header("location:products.php?main=7&cat=1");
}

if(isset($_GET['offer_id'])){
	$id=$_GET['offer_id'];
	mysqli_query($conn,"DELETE FROM `offer` WHERE id='$id'");
	header("location:offers.php?main=8&cat=1");
}

if(isset($_GET['loc_id'])){
	$id=$_GET['loc_id'];
	mysqli_query($conn,"DELETE FROM `location` WHERE id='$id'");
	header("location:locations.php?main=3&cat=1");
}

if(isset($_GET['customer'])){
	$id=$_GET['customer'];
	mysqli_query($conn,"DELETE FROM `contact_enquiry` WHERE id='$id'");
	header("location:customers.php");
}