<?php 
 
 require 'db.php';
$data = json_decode(file_get_contents('php://input'), true);
$uid = $data['uid'];

if($uid == '')
{
	$returnArr = array("ResponseCode"=>"401","Result"=>"false","ResponseMsg"=>"Something Went wrong  try again !");
}
else 
{
    $add = array();
	$d = $con->query("select * from address where uid = '$uid'");
    while ($row = $d->fetch_assoc()) {

        $addd['latitude'] = $row['latitude'];
        $addd['longitude'] = $row['longitude'];

        $addd['delivery_charge'] = 0;
        $addd['distance'] = $row['distance'];
        $addd['shop_distance'] = $row['shop_distance'];

        $addd['id'] = $row['id'];
        $addd['hno'] = $row['hno'];
        $addd['area'] = $row['area'];
        $addd['landmark'] = $row['landmark'];
        $addd['name'] = $row['name'];
        $addd['pincode'] = $row['pincode'];
        $addd['street'] = $row['street'];
        $addd['type'] = $row['type'];
        $addd['uid'] = $row['uid'];
        $add[] = $addd;
    }
    
	$returnArr = array("ResponseCode"=>"200","Result"=>"true","ResponseMsg"=>"Address Get Successfully","ResultData"=>$add);
}
echo json_encode($returnArr);
mysqli_close($con);
?> 	