| Server IP : 162.214.74.102 / Your IP : 216.73.217.114 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/leo/application/plugins/module_imobles/controllers/ |
Upload File : |
<?php
include_once "Controller.php";
include_once __DIR__ . "/../helpers/OruloHelper.php";
class OruloController extends Controller {
public function __construct($ui, $_L, $config, $_pd = null)
{
@ini_set('memory_limit', '4095M');
@ini_set('max_execution_time', 0);
@set_time_limit(0);
parent::__construct($ui, $_L, $config, $_pd);
$this->oruloHelper = new OruloHelper();
}
public function updateEnterpriseData(){
$this->oruloHelper->getAllEnterprises();
}
public function apiQueries(){
$json = "";
$filter = array();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$filter['search_method'] = filter_var(_post('search_method'), FILTER_SANITIZE_STRING);
$filter['search_parameter'] = filter_var(_post('search_parameter'), FILTER_SANITIZE_STRING);
$_SESSION['filter']['module_imobles/orulo/apiQueries'] = $filter;
switch ($filter['search_method']) {
case 'searchByState':
$json = $this->oruloHelper->getEnterprisesJSONFromState($filter['search_parameter']);
break;
case 'searchByEnterpriseName':
$json = $this->oruloHelper->getEnterpriseJSONByName($filter['search_parameter']);
break;
case 'searchByEnterpriseOruloID':
$json = $this->oruloHelper->getEnterpriseJSONByID($filter['search_parameter']);
break;
case 'searchByStateWithDetails':
$enterprises = $this->oruloHelper->getEnterprisesDetailsJSONFromState($filter['search_parameter']);
// Salvo em arquivo por causa do conteúdo grande.
$str = json_encode($enterprises, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
header('Content-Disposition: attachment; filename="empreendimentos.json"');
header('Content-type: application/json');
header('Content-Length: ' . strlen($str));
header('Connection: close');
echo $str;
break;
default:
# code...
break;
}
}
if($json != ""){
$json = json_encode($json, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
}
$this->ui->assign('json', $json);
$this->ui->assign('filter', $filter);
$this->ui->assign('_include', 'orulo/apiQueries');
$this->ui->display('wrapper.tpl');
}
public function findOruloIDforGOEnterprises(){
$this->oruloHelper->findOruloIDforGOEnterprises();
}
public function findOruloIDforEnterpriseTypeUnits(){
if (empty($this->routes[3]) || !is_numeric($this->routes[3])) {
die($this->_L['Id_Required']);
}
$enterprise_id = $this->routes[3];
$msg = $this->oruloHelper->findOruloIDforEnterpriseTypeUnits($enterprise_id);
echo $msg;
}
}