<?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'];
$cname=$json["cname"];
$role=$json["role"];
$taskId=$json["taskId"];
date_default_timezone_set('Asia/Calcutta');
$dt=date('Y-m-d H:i:s');


$query="UPDATE task_assign set a_deleted='yes' where task_id='$taskId'";
  
$response["s"] =mysqli_query($con,$query);
 mysqli_query($con,"UPDATE task_task SET task_task.t_status='unassigned' WHERE task_id='$taskId'");
    mysqli_close($con);
} 
    echo json_encode($response);

?>