<?php
include("../../db.php");
error_reporting(E_ALL);
header("Access-Control-Allow-Origin: * ");

    $id = $_GET['id'];
	
    $chkphoto=$db->getVal("select image from security where id='".$id."'");
    if($chkphoto!=null) 
    {
        unlink("../../uploads/security/".$chkphoto);
    }

        $flgUp = $db->delete("security", "where id='$id'");

	if($flgUp!="")
	{
		echo json_encode(array('status' => 1, 'msg'=>'Record deleted successfully'));
	}
	else
	{		
	 	echo json_encode(array('status' => 0, 'msg'=>'Record Not deleted. Please Try Again..!'));
	}
?>