ok
Direktori : /home2/selectio/www/caliberembedded.com/admin/api/ |
Current File : /home2/selectio/www/caliberembedded.com/admin/api/delete.php |
<?php include"../config/config.php"; if($_POST['type']=="soft_delete"){ try{ $status=0; if($_POST['table']=='tbl_members'){ $status=3; } $statement = $pdo->prepare("UPDATE ".$_POST['table']." SET status=? WHERE id=?"); $result=$statement->execute(array($status,$_POST['delete_id'])); if($result==1) { $message='Success..'; $error='1'; } else { $message='Failed..'; $error='0'; } $datas[] = array('message' => $message, 'error' => $error); echo $message; }catch(exception $e){ echo $e; } } if($_POST['type']=="hard_delete"){ try{ error_log("it is worki0ng"); $statement = $pdo->prepare("delete from ".$_POST['table']." WHERE id=".$_POST['delete_id']); $result=$statement->execute(); if($result==1) { $message='Success..'; $error='1'; } else { $message='Failed..'; $error='0'; } $datas[] = array('message' => $message, 'error' => $error); echo $message; }catch (exception $e){ echo $e; } } ?>