<?php

$response = array();

// include db connect class
require_once __DIR__ . '/db_config.php';

    
// check for required fields
if (isset($_POST['data']))  {
    
$con = mysqli_connect(DB_SERVER, DB_USER, DB_PASSWORD,DB_DATABASE) or die(mysql_error());
$json=json_decode($_POST['data'],true);


$mail= $json['mail'];
$role=$json["role"];
$taskId=$json["taskId"];
date_default_timezone_set('Asia/Calcutta');
$dt=date('Y-m-d H:i:s');

$query="UPDATE task_task SET t_deleted='yes',t_u_created_by_mailid='$mail',t_u_created_by_type='$role' WHERE task_id='$taskId'";
    if (mysqli_query($con,$query)) {
        $response["s"] = 1;
    } else {
        $response["s"] = 0;
    }
    mysqli_close($con);
} 
    echo json_encode($response);

?>