<?php
header ('Content-Type: application/json');
header('Acess-Control-Allow-Origin: *');
header('Acess-Control-Allow-Methods: Post');


include 'confing.php';

$data=json_decode(file_get_contents("php://input"),true);

date_default_timezone_set("Asia/Kolkata");
$date = date("Y-m-d h:i A");
$name=$data['name'];
$phone=$data['phone'];
$message=$data['message'];




$sql="INSERT INTO support (name, phone,message,date)
VALUES ('{$name}','{$phone}','{$message}','{$date}')";

// echo ($sql);


$result=mysqli_query($conn,$sql) or die("error while");


                  

if($result){

    echo json_encode(array('message'=>'done','status'=>'1'));


}else{

    echo json_encode(array('id'=>'is not done','status'=>'0'));

}


?>