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


   $id=$_REQUEST['id'];    
	
 $chkphoto=$db->getVal("select image_name from image_upload where id='".$id."'");

  
         if($chkphoto!=null) 
         {
     
         unlink("../../uploads/gallery/" . $chkphoto);
         
             
         }	

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



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