<?php
ob_start();
error_reporting(0);
include("connect.php");
session_start(); 
$ver = $_SESSION["admin_id"];
if(!isset($_SESSION["admin_id"])){
   header('location:http://www.btcover.appexperts.net');
}
date_default_timezone_set('Asia/Calcutta');
	$cdate  = date("Y-m-d");

$da  = date("Y-m-d H:i:s");
$policy_id=$_REQUEST['id'];
$res = mysqli_query($con,"select * from tbl_policy_type where policy_id='$policy_id'");
$ver1 = mysqli_fetch_assoc($res);
$delete_status=$ver1['status'];

if($delete_status=='Active')
{
	$uq1=mysqli_query($con,"update tbl_policy_type set status='Deactive',update_datetime='$da' where policy_id='$policy_id'");
}
if($delete_status=='Deactive')
{
	$uq1=mysqli_query($con,"update tbl_policy_type set status='Active',update_datetime='$da' where policy_id='$policy_id'");
}
if($uq1){ header('Location:policy-category.php'); }
?>