$itm->lot_size = $lot_size;
                $itm->price = $price;
                $itm->price_per_sqft = $price_per_sqft;
                $itm->property_type = $property_type;
                $itm->realestate_id = $realestate_id;
                $itm->rooms = $rooms;
                $itm->sqft = $sqft;
                $itm->status = $status;
                $itm->updated_at = time();
                $itm->zipcode = $zipcode;
                if ($realestate != null) {
                    $itm->created_at = $realestate->created_at;
                    $itm->realestate_id = $realestate->realestate_id;
                    $controllerRealEstate->updateRealEstate($itm);
                } else {
                    $controllerRealEstate->insertRealEstate($itm);
                    $realestate_id = $controllerRealEstate->getLastInsertedId();
                }
                $itm = $controllerRealEstate->getRealEstateByRealEstateId($realestate_id);
                $json = "{\n                        \"realestate_info\" : {\n                                      \"address\" : \"{$itm->address}\",\n                                      \"agent_id\" : \"{$itm->agent_id}\",\n                                      \"baths\" : \"{$itm->baths}\",\n                                      \"beds\" : \"{$itm->beds}\",\n                                      \"built_in\" : \"{$itm->built_in}\",\n                                      \"country\" : \"{$itm->country}\",\n                                      \"created_at\" : \"{$itm->created_at}\",\n                                      \"desc1\" : \"{$itm->desc1}\",\n                                      \"featured\" : \"{$itm->featured}\",\n                                      \"lat\" : \"{$itm->lat}\",\n                                      \"lon\" : \"{$itm->lon}\",\n                                      \"is_deleted\" : \"0\",\n\n                                      \"lot_size\" : \"{$itm->lot_size}\",\n                                      \"price\" : \"{$itm->price}\",\n                                      \"price_per_sqft\" : \"{$itm->price_per_sqft}\",\n                                      \"property_type\" : \"{$itm->property_type}\",\n                                      \"realestate_id\" : \"{$itm->realestate_id}\",\n                                      \"rooms\" : \"{$itm->rooms}\",\n                                      \"sqft\" : \"{$itm->sqft}\",\n                                      \"status\" : \"{$itm->status}\",\n                                      \"updated_at\" : \"{$itm->updated_at}\",\n                                      \"zipcode\" : \"{$itm->zipcode}\"\n                                      },\n                        \"status\" : {\n                                      \"status_code\" : \"-1\",\n                                      \"status_text\" : \"Success.\"\n                                    }\n                        }";
            } else {
                $json = "{\n                        \"status\" : {\n                                      \"status_code\" : \"5\",\n                                      \"status_text\" : \"It seems you are out of sync. Please relogin again.\"\n                                    }\n                        }";
            }
        } else {
            $json = "{\n                          \"status\" : {\n                                        \"status_code\" : \"5\",\n                                        \"status_text\" : \"It seems you are out of sync. Please relogin again.\"\n                                      }\n                          }";
        }
    } else {
        $json = "{\n                  \"status\" : {\n                                \"status_code\" : \"3\",\n                                \"status_text\" : \"Invalid Access.\"\n                              }\n                  }";
    }
}
echo $json;