<?php
// required headers
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");

include_once '../config/database.php';
include_once '../objects/city.php';

$database = new Database();
$db = $database->getConnection();
 
$city = new City($db);
$data = json_decode(file_get_contents("php://input"));

$city->id = $data->id;

$city->getOneRow();

    $detail = array(
            "id" => (int)$city->id,
            "name" => $city->name,
            "code" => $city->code,
            "location" => $city->location,
            "invoice_remark" => $city->invoice_remark,
            "profile_picture" => $city->profile_picture,
            "smart_key" => $city->smart_key,
            "olt_id" => $city->olt_id
        );
echo json_encode($detail);
?>

