<?php

require_once __DIR__ . '/db_config.php';

$r = array();

if (isset($_POST["report_id"]) ) {
 
$report_id=$_POST["report_id"];
$reason=$_POST["reason"];
$user_id=$_POST["user_id"];
date_default_timezone_set("Asia/Calcutta");   //India time (GMT+5:30)
$datetime=date('Y-m-d H:i:s');

$con = mysqli_connect(DB_SERVER, DB_USER, DB_PASSWORD,DB_DATABASE) or die(mysql_error());

$query="UPDATE defect_report 
    SET delete_status=1 AND delete_DT='$datetime' AND delete_reason='$reason' AND delete_user_id='$user_id' 
    WHERE report_id='$report_id'";


    $result=mysqli_query($con,$query);
    if($result){
        $r["s"] = 1;
    }else{
        $r["s"] = 0;
    }

mysqli_close($con);

}

echo json_encode($r,JSON_UNESCAPED_SLASHES);


?>