<?php 
require 'db.php';
$data = json_decode(file_get_contents('php://input'), true);
if($data['name'] == '' or $data['uid'] == '' or $data['message'] == '')
{
    $returnArr = array("ResponseCode"=>"401","Result"=>"false","ResponseMsg"=>"Something Went Wrong!");
}
else
{
    $name = strip_tags(mysqli_real_escape_string($con,$data['name']));
    $uid = strip_tags(mysqli_real_escape_string($con,$data['uid']));
    $message = strip_tags(mysqli_real_escape_string($con,$data['message']));
    $shop_id = strip_tags(mysqli_real_escape_string($con,$data['shop_id']));
    $shop_code = strip_tags(mysqli_real_escape_string($con,$data['shop_code']));
    
    $timestamp = date("Y-m-d H:i:s");
    $con->query("insert into queries(`shop_id`,`shop_code`,`uid`,`name`,`message`,`message_date`)values('$shop_id','$shop_code','$uid','$name','$message','$timestamp')");
    $returnArr = array("ResponseCode"=>"200","Result"=>"true","ResponseMsg"=>"Queries Sent Successfully");
}

echo json_encode($returnArr);