<?php
include_once"../config.php";
session_start();
$submit = isset($_POST['submit'])?$_POST['submit']:null;
$update = isset($_POST['update'])?$_POST['update']:null;
$delete = isset($_GET['delete'])?$_GET['delete']:null;

$name = $_POST['name'];
$id = $_POST['id'];
$status = $_POST['status'];


if($submit){
	mysqli_query($con, "INSERT INTO add_special_category set name= '$name',status = '$status' ");
    $_SESSION['try']=1;
	header("location:../add_category.php?try=1");

}else if($update && $id){
	mysqli_query($con, "update add_special_category set name= '$name', status = '$status' where id =  $id ");
     $_SESSION['try']=2;
	 header("location:../add_category.php?try=2");

}elseif($delete){
	mysqli_query($con, "delete from add_special_category where id =  $delete ");
    $_SESSION['try']=3;  
	header("location:../add_category.php?try=3");
}