function image_delete_byid($js){

  global $ar,$db;

  $dt=array();  

  $sql=SELECT * from `files` where id=.$js[id];

  $res=mysqli_query($db,$sql);

  if(mysqli_num_rows($res)==1) {

    $r=mysqli_fetch_assoc($res);

    $dt[success]=true;

    $this_path=$ar[img_path]..$r[modul]./.$r[path];

    $dt[r]=$r;

    $dt[path]=$this_path;

    if(is_dir($this_path)) {

      $dt[is_dir]=exist;

      emptyDir($this_path);

      Delete($db,files,id=.$js[id],0);

    }

  } else {

    $dt[error]=true;

    $dt[message]=data not found;

  }

  return $dt;

}