function translateJSON($itm) { $controllerAgent = new ControllerAgent(); $agent = $controllerAgent->getAgentByUserId($itm->user_id); $agentJSON = "\"agent_info\" : null"; if ($agent != null) { $agentJSON = "\n \"agent_info\" : {\n \"address\" : \"{$agent->address}\",\n \"agent_id\" : \"{$agent->agent_id}\",\n \"contact_no\" : \"{$agent->contact_no}\",\n \"country\" : \"{$agent->country}\",\n \"created_at\" : \"{$agent->created_at}\",\n \"email\" : \"{$agent->email}\",\n \"name\" : \"{$agent->name}\",\n \"sms\" : \"{$agent->sms}\",\n \"updated_at\" : \"{$agent->updated_at}\",\n \"zipcode\" : \"{$agent->zipcode}\",\n \"photo_url\" : \"{$agent->photo_url}\",\n \"thumb_url\" : \"{$agent->thumb_url}\",\n \"twitter\" : \"{$agent->twitter}\",\n \"fb\" : \"{$agent->fb}\",\n \"linkedin\" : \"{$agent->linkedin}\",\n \"company\" : \"{$agent->company}\",\n \"user_id\" : \"{$itm->user_id}\"\n }\n "; } $json = "{\n \"user_info\" : {\n \"user_id\" : \"{$itm->user_id}\",\n \"username\" : \"{$itm->username}\",\n \"login_hash\" : \"{$itm->login_hash}\",\n \"facebook_id\" : \"{$itm->facebook_id}\",\n \"twitter_id\" : \"{$itm->twitter_id}\",\n \"full_name\" : \"{$itm->full_name}\",\n \"email\" : \"{$itm->email}\",\n },\n {$agentJSON},\n\n \"status\" : {\n \"status_code\" : \"-1\",\n \"status_text\" : \"Success.\"\n }\n }"; return $json; }
<?php require_once '../header_rest.php'; $controllerRestAgent = new ControllerAgent(); $controllerUser = new ControllerUser(); $user_id = ""; if (!empty($_POST['user_id'])) { $user_id = $_POST['user_id']; } $login_hash = ""; if (!empty($_POST['login_hash'])) { $login_hash = $_POST['login_hash']; } $address = ""; if (!empty($_POST['address'])) { $address = trim(strip_tags($_POST['address'])); } $contact_no = ""; if (!empty($_POST['contact_no'])) { $contact_no = trim(strip_tags($_POST['contact_no'])); } $country = ""; if (!empty($_POST['country'])) { $country = trim(strip_tags($_POST['country'])); } $email = ""; if (!empty($_POST['email'])) { $email = $_POST['email']; } $name = ""; if (!empty($_POST['name'])) {
<?php require_once 'header.php'; $controller = new ControllerAgent(); $agents = $controller->getAgents(); if (!empty($_SERVER['QUERY_STRING'])) { $extras = new Extras(); $agent_id = $extras->decryptQuery1(KEY_SALT, $_SERVER['QUERY_STRING']); if ($agent_id != null) { $controller->deleteAgent($agent_id, 1); echo "<script type='text/javascript'>location.href='agents.php';</script>"; } else { echo "<script type='text/javascript'>location.href='403.php';</script>"; } } $search_criteria = ""; if (isset($_POST['button_search'])) { $search_criteria = trim(strip_tags($_POST['search'])); $agents = $controller->getAgentsBySearching($search_criteria); } ?> <!DOCTYPE html> <html lang="en"><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content="">
<?php require_once 'header.php'; $controller = new ControllerRealEstate(); $controllerAgent = new ControllerAgent(); $controllerPropertyType = new ControllerPropertyType(); $agents = $controllerAgent->getAgents(); $propertytypes = $controllerPropertyType->getPropertyTypes(); $extras = new Extras(); if (isset($_POST['submit'])) { $itm = new RealEstate(); $itm->address = htmlspecialchars(trim(strip_tags($_POST['address'])), ENT_QUOTES); $itm->baths = htmlspecialchars(trim(strip_tags($_POST['baths'])), ENT_QUOTES); $itm->beds = trim(strip_tags($_POST['beds'])); $itm->built_in = trim(strip_tags($_POST['built_in'])); $itm->country = htmlspecialchars(trim(strip_tags($_POST['country'])), ENT_QUOTES); $itm->created_at = time(); $itm->desc1 = $extras->removeHttp(htmlspecialchars(trim(strip_tags($_POST['desc1'])), ENT_QUOTES)); $itm->featured = htmlspecialchars(trim(strip_tags($_POST['featured'])), ENT_QUOTES); $itm->lat = trim(strip_tags($_POST['lat'])); $itm->lon = trim(strip_tags($_POST['lon'])); $itm->lot_size = trim(strip_tags($_POST['lot_size'])); $itm->price = htmlspecialchars(trim(strip_tags($_POST['price'])), ENT_QUOTES); $itm->price_per_sqft = htmlspecialchars(trim(strip_tags($_POST['price_per_sqft'])), ENT_QUOTES); $itm->property_type = trim(strip_tags($_POST['property_type'])); $itm->rooms = trim(strip_tags($_POST['rooms'])); $itm->sqft = trim(strip_tags($_POST['sqft'])); $itm->status = trim(strip_tags($_POST['status'])); $itm->updated_at = time(); $itm->is_deleted = 0; $itm->agent_id = trim(strip_tags($_POST['agent_id']));
<?php require_once '../header_rest.php'; $controllerAgent = new ControllerAgent(); $controllerUser = new ControllerUser(); if (!empty($_POST['user_id'])) { $user_id = $_POST['user_id']; } if (!empty($_POST['login_hash'])) { $login_hash = $_POST['login_hash']; } $agent_id = 0; if (!empty($_POST['agent_id'])) { $agent_id = $_POST['agent_id']; } $photo_url = ""; if (!empty($_POST['photo_url'])) { $photo_url = trim(strip_tags($_POST['photo_url'])); } $thumb_url = ""; if (!empty($_POST['thumb_url'])) { $thumb_url = trim(strip_tags($_POST['thumb_url'])); } if (!empty($agent_id) && !empty($login_hash) && !empty($user_id)) { $user = $controllerUser->getUserByUserId($user_id); $login_hash = str_replace(" ", "+", $login_hash); if ($user != null) { if ($user->login_hash == $login_hash) { $itm = new Agent(); $itm->photo_url = $photo_url; $itm->thumb_url = $thumb_url;
<?php require_once 'header.php'; $controller = new ControllerAgent(); $controllerUser = new ControllerUser(); $users = $controllerUser->getUsers(); $extras = new Extras(); $agent_id = $extras->decryptQuery1(KEY_SALT, $_SERVER['QUERY_STRING']); if ($agent_id != null) { $agent = $controller->getAgentByAgentId($agent_id); if (isset($_POST['submit'])) { $itm = new Agent(); $itm->address = trim(strip_tags($_POST['address'])); $itm->contact_no = trim(strip_tags($_POST['contact_no'])); $itm->country = trim(strip_tags($_POST['country'])); $itm->created_at = time(); $itm->email = trim(strip_tags($_POST['email'])); $itm->name = trim(strip_tags($_POST['name'])); $itm->sms = trim(strip_tags($_POST['sms'])); $itm->updated_at = time(); $itm->zipcode = trim(strip_tags($_POST['zipcode'])); $itm->photo_url = trim(strip_tags($_POST['photo_url'])); $itm->thumb_url = trim(strip_tags($_POST['thumb_url'])); $itm->twitter = trim(strip_tags($_POST['twitter'])); $itm->fb = trim(strip_tags($_POST['fb'])); $itm->linkedin = trim(strip_tags($_POST['linkedin'])); $itm->company = trim(strip_tags($_POST['company'])); $itm->user_id = trim(strip_tags($_POST['user_id'])); $itm->agent_id = $agent_id; $count = count($_FILES["file"]["name"]); if (!empty($_FILES["file"]["name"][0]) && !empty($_FILES["file"]["name"][1])) {