-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpost_delete.php
35 lines (25 loc) · 938 Bytes
/
post_delete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
header('Content-type: application/json; charset=UTF-8');
$response = array();
if ($_POST['delete']) {
require_once 'class.farmer.php';
$farmer_delete = new FARMER();
$pid = intval($_POST['delete']);
// $stmt = $admin_delete->runQuery("DELETE FROM farmer_posts WHERE ID=:pid");
// $stmt->execute(array(':pid'=>$pid));
if ($farmer_delete->delete_post($pid)) {
$response['status'] = 'success';
$response['message'] = 'News Deleted Successfully ...';
} else {
$response['status'] = 'error';
$response['message'] = 'Unable to delete product ...';
}
echo json_encode($response);
//$stmt_select = $DB_con->query("SELECT new_photo FROM asawa_new WHERE new_id='$pid'");
// //$stmt_select->execute(array(':pid'=>$pid));
// $imgRow=$stmt_select->fetch_array();
// if($imgRow['new_photo'] != '')
// {
// unlink("new_images/".$imgRow['new_photo']);
// }
}