| 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/imobles/application/plugins/module_imobles/helpers/ |
Upload File : |
<?php
include_once __DIR__ . "/ConstructionCompanyTable.php";
class DinamicaUnits extends ConstructionCompanyTable {
public function celebrateVacaBrava($csv, $enterprise_id) {
$csv = explode("\n", $csv);
$result_data = array();
foreach($csv as $line) {
$data = array();
$line = str_getcsv($line);
if ($this->isUnitNum($line[0])) {
$data['unit_number'] = $line[0];
$data['area'] = $line[1];
$data['parking_spaces'] = $line[3] . ' ' . $line[4] . ' ' . $line[5];
$data['parking_spaces_count'] = $this->countParkingSpaces($data['parking_spaces']);
$data['parking_cover'] = $this->checkParkingCover($line[6]);
$data['parking_place'] = $line[7];
$data['price'] = $line[11];
$data['availability'] = 1;
$data['crawler_type_id'] = 4;
$data['verified'] = 1;
$data['enterprise_id'] = $enterprise_id;
$data['entry'] = $line[9];
$data['installment'] = null;
$data['financing'] = $line[10];
}else{
continue;
}
array_push($result_data, $data);
}
$this->units_helper->batchOfUnits($result_data);
}
public function muyBueno($csv, $enterprise_id) {
$csv = explode("\n", $csv);
$result_data = array();
foreach($csv as $line) {
$data = array();
$line = str_getcsv($line);
if ($this->isUnitNum($line[0])) {
$data['unit_number'] = $line[0];
$data['area'] = $line[1];
$data['parking_spaces'] = $line[2] . ' ' . $line[3];
$data['parking_spaces_count'] = $this->countParkingSpaces($data['parking_spaces']);
$data['availability'] = 1;
$data['crawler_type_id'] = 4;
$data['verified'] = 1;
$data['enterprise_id'] = $enterprise_id;
$data['entry'] = $line[7];
$data['installment'] = $line[8];
$data['financing'] = $line[10];
$data['price'] = $line[11];
}else{
continue;
}
array_push($result_data, $data);
}
$this->units_helper->batchOfUnits($result_data);
}
public function elloVacaBrava($csv, $enterprise_id) {
$csv = explode("\n", $csv);
$result_data = array();
foreach($csv as $line) {
$data = array();
$line = str_getcsv($line);
if ($this->isUnitNum($line[0])) {
$data['unit_number'] = $line[0];
$data['area'] = $line[1];
$data['parking_spaces'] = $line[3] . ' ' . $line[4];
$data['parking_spaces_count'] = $this->countParkingSpaces($data['parking_spaces']);
$data['availability'] = 1;
$data['crawler_type_id'] = 4;
$data['verified'] = 1;
$data['enterprise_id'] = $enterprise_id;
$data['entry'] = $line[11];
$data['installment'] = $line[12];
$data['financing'] = $line[14];
$data['price'] = $line[15];
}else{
continue;
}
array_push($result_data, $data);
}
$this->units_helper->batchOfUnits($result_data);
}
public function fluenceMarista($csv, $enterprise_id) {
$csv = explode("\n", $csv);
$result_data = array();
foreach($csv as $line) {
$data = array();
$line = str_getcsv($line);
if ($this->isUnitNum($line[0])) {
if(count($line) < 10) {
continue;
}
$data['unit_number'] = $line[0];
$data['area'] = $line[1];
$data['parking_spaces'] = $line[3] . ' ' . $line[4] . ' ' . $line[5];
$data['parking_spaces_count'] = $this->countParkingSpaces($data['parking_spaces']);
$data['availability'] = 1;
$data['crawler_type_id'] = 4;
$data['verified'] = 1;
$data['enterprise_id'] = $enterprise_id;
$data['entry'] = $line[10];
$data['installment'] = $line[11];
$data['financing'] = $line[14];
$data['price'] = $line[15];
}else{
continue;
}
array_push($result_data, $data);
}
$this->units_helper->batchOfUnits($result_data);
}
public function softPedroLudovico($csv, $enterprise_id) {
$csv = explode("\n", $csv);
$result_data = array();
foreach($csv as $line) {
$data = array();
$line = str_getcsv($line);
if ($this->isUnitNum($line[1])) {
if (count(array_count_values($line)) <= 6) {
continue;
}
if (count($line) > 19) {
array_splice($line, 8, 3);
}
$data['unit_number'] = $line[1];
$data['area'] = $line[2];
$data['parking_spaces'] = $line[6] . ' ' . $line[7];
$data['parking_spaces_count'] = $this->countParkingSpaces($data['parking_spaces']);
$data['availability'] = 1;
$data['crawler_type_id'] = 4;
$data['verified'] = 1;
$data['enterprise_id'] = $enterprise_id;
$data['entry'] = $line[12];
$data['installment'] = $line[13];
$data['financing'] = $line[15];
$data['price'] = $line[16];
}else{
continue;
}
array_push($result_data, $data);
}
$this->units_helper->batchOfUnits($result_data);
}
public function detailVacaBrava($csv, $enterprise_id) {
$csv = explode("\n", $csv);
$result_data = array();
foreach($csv as $line) {
$data = array();
$line = str_getcsv($line);
if ($this->isUnitNum($line[0])) {
$data['unit_number'] = $line[0];
$data['area'] = $line[1];
$data['parking_spaces'] = $line[2] . ' ' . $line[3] . ' ' . $line[4];
$data['parking_spaces_count'] = $this->countParkingSpaces($data['parking_spaces']);
$data['availability'] = 1;
$data['crawler_type_id'] = 4;
$data['verified'] = 1;
$data['enterprise_id'] = $enterprise_id;
$data['entry'] = $line[9];
$data['installment'] = null;
$data['financing'] = $line[10];
$data['price'] = $line[8];
}else{
continue;
}
array_push($result_data, $data);
}
$this->units_helper->batchOfUnits($result_data);
}
private function checkParkingCover($cell) {
if (strpos(strtolower($cell, 'desc'))) {
return false;
}
return true;
}
}