<?php
include_once(dirname(__FILE__) . '/../../../class/include.php');
include_once(dirname(__FILE__) . '/../../auth.php');
if ($_POST['option'] == 'delete') {
$PORTFOLIO = new Portfolio($_POST['id']);
unlink('../../../upload/portfolio/product/' . $PORTFOLIO->image_name);
unlink('../../../upload/portfolio/product/gallery/' . $PORTFOLIO->image_name);
$result = $PORTFOLIO->delete();
if ($result) {
$data = array("status" => TRUE);
header('Content-type: application/json');
echo json_encode($data);
}
} |