ok

Mini Shell

Direktori : /proc/thread-self/root/proc/self/root/home2/selectio/public_html/obnovit-tracking/api/
Upload File :
Current File : //proc/thread-self/root/proc/self/root/home2/selectio/public_html/obnovit-tracking/api/delete.php

<?php include"../config/config.php";
if($_POST['type']=="site-delete"){
$statement = $pdo->prepare("UPDATE tbl_site SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="products_delete',del"){
$statement = $pdo->prepare("UPDATE tbl_product SET status=? WHERE id=?");
$result=$statement->execute(array(1,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}
if($_POST['type']=="employee_delete"){
$statement = $pdo->prepare("UPDATE tbl_user SET status=? WHERE id=?");
$result=$statement->execute(array(1,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="employee_delete"){
$statement = $pdo->prepare("UPDATE tbl_employee SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="desgination_delete"){
$statement = $pdo->prepare("UPDATE tbl_desgination SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="department_delete"){
$statement = $pdo->prepare("UPDATE tbl_departement SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="leave_request_delete"){
$statement = $pdo->prepare("UPDATE tbl_leave_request SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="permission_delete"){
$statement = $pdo->prepare("UPDATE tbl_permision_request SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}
if($_POST['type']=="role_delete"){
$statement = $pdo->prepare("UPDATE tbl_role SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}
if($_POST['type']=="user_delete"){
$statement = $pdo->prepare("UPDATE tbl_user SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}
if($_POST['type']=="location_delete"){
$statement = $pdo->prepare("UPDATE tbl_exp_location SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="category_delete"){
$statement = $pdo->prepare("UPDATE tbl_category SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="dynamic_delete"){
$statement = $pdo->prepare("UPDATE ".$_POST['table']." SET status=? WHERE id=?");
$result=$statement->execute(array(0,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}
if($_POST['type']=="dynamic_active"){
$statement = $pdo->prepare("UPDATE ".$_POST['table']." SET status=? WHERE id=?");
$result=$statement->execute(array(1,$_POST['delete_id']));
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}



if($_POST['type']=="dynamic_followup_delete"){
    $id=$_POST['delete_id'];
$statement = $pdo->prepare("delete from tbl_follow_up WHERE id=$id;delete from tbl_follow_up_tracking WHERE follow_up_id=$id;");
$result=$statement->execute();
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="dynamic_followup_history_delete"){
    $id=$_POST['delete_id'];
$statement = $pdo->prepare("delete from tbl_follow_up_tracking WHERE id=$id;");
$result=$statement->execute();
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="attendence_delete"){
$id=$_POST['delete_id'];
$statement = $pdo->prepare("DELETE FROM tbl_attendence WHERE id=$id;");
$result=$statement->execute();
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="dynamic_lead_delete"){
    $id=$_POST['delete_id'];
$statement = $pdo->prepare("delete from tbl_lead WHERE id=$id;delete from tbl_payment WHERE lead_id=$id;");
$result=$statement->execute();
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}

if($_POST['type']=="dynamic_lead_payment_history_delete"){
    $id=$_POST['delete_id'];
$statement = $pdo->prepare("delete from tbl_payment WHERE id=$id");
$result=$statement->execute();
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}







if($_POST['type']=="hard_delete"){
    $id=$_POST['delete_id'];
    $statement = $pdo->prepare("delete from ".$_POST['table_name']." WHERE id=$id");
    $result=$statement->execute();
if($result==1)
	{
	    $message='Success..';
	    $error='1';
	}
	else
	{
	    $message='Failed..';
	    $error='0';
	}
		$datas[] = array('message' => $message, 'error' => $error);                   
        echo $message;
}
?>

Zerion Mini Shell 1.0