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