<?php 
include ('includes/db1config.php');
include ('../includes/mysql_connect.php');
$userId=$_POST['userid'];
$fileName=$_POST['file_name'];
$sql = "DELETE FROM document_alias WHERE filename= '$fileName' ";
mysql_query($sql) or die(mysql_error());
if(is_dir('../custom/users/'.$userid)){
//echo "../custom/users/".$userId."/".$fileName;	
unlink("../custom/users/".$userId."/".$fileName);
echo json_encode(
		array(
		 	'message' => 'File deleted successfully',
		 	'status'  => 1,
		)
	);
}