<?php
session_start();
$domain = file_get_contents("../../domain.txt");
include("../../../".$domain."_exec_conc.php");
include("../../injection.php");


if(
!isset($_SESSION[$domain.'_user']) || $_SESSION[$domain.'_user']==""
|| !isset($_POST['ext']) || !isset($_POST['table']) || !isset($_POST['id']) || !isset($_POST['image_id'])
){die;}



//بداية الاستعلام
$query="UPDATE $_POST[table] SET images = REPLACE(images, ',$_POST[image_id].$_POST[ext]', '') WHERE id=$_POST[id]";
mysqli_query($conn,$query);

$file = "../../img/$_POST[table]/$_POST[image_id].$_POST[ext]";
unlink($file);
$file = "../../img/$_POST[table]/$_POST[image_id]_slide.$_POST[ext]";
unlink($file);
$file = "../../img/$_POST[table]/$_POST[image_id]_small.$_POST[ext]";
unlink($file);
$file = "../../img/$_POST[table]/$_POST[image_id]_tiny.$_POST[ext]";
unlink($file);




//echo $query;


?>