<?php
include("../../db.php");
error_reporting(E_ALL);
header("Access-Control-Allow-Origin: * ");

$id = $_REQUEST['cid'];

if ($id ==null || $id == ""){
    echo json_encode(array('status' => 0, 'msg' => 'circular id is needed'));
    return ;
}

$chkphoto = $db->getVal("select upload_notice from student_notice where content_id ='" . $id . "'");

if ($chkphoto != null) {
    unlink("../../uploads/notice/" . $chkphoto);
}

$flgUp = $db->delete("student_notice", "where content_id='$id'");

if ($flgUp != "") {
    echo json_encode(array('status' => 1, 'msg' => 'delete Successfully'));

} else {
    echo json_encode(array('status' => 0, 'msg' => 'image Not delete Please Try Again..!'));
}
