<?php
require_once ("varables.php");

$myJSON['message'] = "کمبود منابع";
$myJSON['mmm'] = array();

if(isset($_POST["url"]) && isset($_POST["an1d"]) 
	&& isset($_POST["nekot"]) && isset($_POST["banner"]) )
{
	$banner = str_replace('"',"",$_POST["banner"]);

    $connect = @mysqli_connect($hostname,$username,$password,$database);
    if($connect)
    {
		@mysqli_query($connect,"SET CHARACTER SET utf8mb4;");
		
		if(unlink($banner)){
			$inser_q = "UPDATE tbl_company SET banner = '' ,bennerurl ='' WHERE id ='1'";
			$insres=@mysqli_query($connect,$inser_q);
			if(!$insres)
				$myJSON['message']= "404".@mysqli_error($connect);
			else{
				$myJSON['message']= "200" ;
			}
		}		
	}
	 else
		 $myJSON['message']="402";
}
    echo json_encode($myJSON);
?>
