<?php 
require 'db.php';
$data = json_decode(file_get_contents('php://input'), true);
if($data['uid'] == '' or $data['msg'] == '' or $data['rate'] == '')
{
    $returnArr = array("ResponseCode"=>"401","Result"=>"false","ResponseMsg"=>"Something Went Wrong!");
}
else
{
    $uid = strip_tags(mysqli_real_escape_string($con,$data['uid']));
    $msg = strip_tags(mysqli_real_escape_string($con,$data['msg']));
    $rate = strip_tags(mysqli_real_escape_string($con,$data['rate']));
    $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 feedback(`shop_id`,`shop_code`,`uid`,`msg`,`rate`,`timestamp`)values('$shop_id','$shop_code','$uid','$msg','$rate','$timestamp')");
    $returnArr = array("user"=>$c,"ResponseCode"=>"200","Result"=>"true","ResponseMsg"=>"Thanks for Your Feedback!");
}
echo json_encode($returnArr);
