Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Apps\Website\Controllers;
- use Framework\Vars;
- use Framework\Settings;
- use Framework\Api\Api;
- use Modules\Objects\Models;
- use Apps\Website\Helpers;
- Class ObjectOverview extends \Apps\Website\Library\Controller
- {
- protected $objects;
- /**
- * Initialize controller
- * @param int $pageID
- */
- public function __construct()
- {
- parent::__construct();
- $this->objects = new Models\Objects();
- $this->objects->options->pagination = (isset($_GET['c']) ? (int) $_GET['c'] : Settings::get('objects', 'pagination'));
- //$this->objects->options->pagination = false;
- // set order
- if (isset($_GET['s']) && isset($_GET['d'])) {
- $this->objects->setOrder($_GET['s'], $_GET['d']);
- } else {
- $this->objects->setOrder('ingevoerd', 'desc');
- }
- if (!strstr(Vars::$url->url, 'object-maps')) {
- $_SESSION['overzicht'] = Vars::$url->url;
- }
- $this->initialize();
- }
- /**
- * initialize the default view
- */
- public function showTemplate()
- {
- // set assets
- // $this->view->head->add('css', VIEW_URL . '/css/default.css');
- // $this->view->foot->add('js', VIEW_URL . '/js/general.js');
- //$this->view->foot->add('js', VIEW_URL . '/js/objects.js');
- //$this->view->foot->add('js', '//maps.google.com/maps/api/js');
- //$this->view->foot->add('js', VIEW_URL . '/js/assets/markerclusterer_compiled.js');
- //$this->view->foot->add('js', VIEW_URL . '/js/assets/infobubble.min.js');
- // set vars
- Vars::$content->header = Vars::$page->header;
- Vars::$content->objects = $this->loadObjects();
- $this->view->showTemplate(Vars::$page->template, 'object.overview.php');
- }
- public function pageDefault($default = true)
- {
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the koopwoningen view
- */
- public function pageKoopwoningen($default = true)
- {
- $this->objects->search->woning = true;
- $this->objects->search->koop = true;
- $this->objects->search->verkocht = true;
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud', 'verkocht');
- if ($default)
- $this->showTemplate();
- }
- public function pageExclusief($default = true)
- {
- $this->objects->search->woning = true;
- $this->objects->search->koop = true;
- $this->objects->where = '`ob`.`ob_exclusief` = 1 OR `ob_koopprijs` >= 750000';
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the koopwoningen view
- */
- public function pageAppartementen($default = true)
- {
- $this->objects->search->woning->soort = 'appartement';
- $this->objects->search->koop = true;
- $this->objects->search->verkocht = true;
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud', 'verkocht');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the huurwoningen view
- */
- public function pageHuurwoningen($default = true)
- {
- $this->objects->search->woning = true;
- $this->objects->search->huur = true;
- $this->objects->search->status = array('beschikbaar', 'verhuurd onder voorbehoud', 'verhuurd');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the pageKantoorruimte view
- */
- public function pageKantoorruimte($default = true)
- {
- $this->objects->search->bedrijfspand->soort = 'kantoorruimte';
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud', 'verkocht', 'verhuurd onder voorbehoud', 'verhuurd');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the pageBedrijfsruimte view
- */
- public function pageBedrijfsruimte($default = true)
- {
- $this->objects->search->bedrijfspand->soort = 'bedrijfsruimte';
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud', 'verkocht', 'verhuurd onder voorbehoud', 'verhuurd');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the pageWinkelruimte view
- */
- public function pageWinkelruimte($default = true)
- {
- $this->objects->search->bedrijfspand->soort = 'winkelruimte';
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud', 'verkocht', 'verhuurd onder voorbehoud', 'verhuurd');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the pageHoreca view
- */
- public function pageBelegging($default = true)
- {
- $this->objects->search->bedrijfspand = true;
- $this->objects->where = '`ob`.`ob_belegging` = 1';
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud', 'verkocht', 'verhuurd onder voorbehoud', 'verhuurd');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the pageBogVerkocht view
- */
- public function pageBogVerkocht($default = true)
- {
- $this->objects->search->bedrijfspand = true;
- $this->objects->search->status = array('verkocht', 'verhuurd', 'verkocht onder voorbehoud', 'verhuurd onder voorbehoud');
- $this->objects->options->sold_interval = 90;
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the pageBogTotaal view
- */
- public function pageBogTotaal($default = true)
- {
- $this->objects->search->bedrijfspand = true;
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the pageHoreca view
- */
- public function pageHoreca($default = true)
- {
- $this->objects->search->bedrijfspand->soort = 'horeca';
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud', 'verkocht', 'verhuurd onder voorbehoud', 'verhuurd');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the garage view
- */
- public function pageGarages($default = true)
- {
- $this->objects->search->garage = true;
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud', 'verkocht', 'verhuurd onder voorbehoud', 'verhuurd');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the bouwgrond view
- */
- public function pageBouwgrond($default = true)
- {
- $this->objects->search->bouwgrond = true;
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud', 'verkocht', 'verhuurd onder voorbehoud', 'verhuurd');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the bouwgrond view
- */
- public function pageNieuwbouw($default = true)
- {
- $this->objects->search->nieuwbouw = true;
- $this->objects->search->status = array('beschikbaar', 'verkocht onder voorbehoud', 'verkocht', 'verhuurd onder voorbehoud', 'verhuurd');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the bouwgrond view
- */
- public function pageOpenhuis($default = true)
- {
- $this->objects->search->openhuis = true;
- $this->objects->search->status = array('beschikbaar');
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize pageNieuw
- */
- public function pageNieuw($default = true)
- {
- $this->objects->search->woning = true;
- $this->objects->search->status = array('beschikbaar');
- $this->objects->search->ingevoerd = date("Y-m-d", strtotime("-3 Months"));
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize pageNieuwZakelijk
- */
- public function pageNieuwZakelijk($default = true)
- {
- $this->objects->search->bedrijfspand = true;
- $this->objects->search->status = array('beschikbaar');
- $this->objects->search->ingevoerd = date("Y-m-d", strtotime("-3 Months"));
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize pageVerkocht
- */
- public function pageVerkocht($default = true)
- {
- $this->objects->search->status = array('verkocht');
- $this->objects->options->sold_interval = 180;
- if ($default)
- $this->showTemplate();
- }
- public function pageVerhuurd($default = true)
- {
- $this->objects->search->status = array('verhuurd');
- $this->objects->options->sold_interval = 180;
- if ($default)
- $this->showTemplate();
- }
- /**
- * initialize the bouwgrond view
- */
- public function pageStarters($default = true)
- {
- $this->objects->search->woningen = true;
- $this->objects->search->status = array('beschikbaar');
- $this->objects->search->special = 'starter';
- if ($default)
- $this->showTemplate();
- }
- /**
- *
- * @return mixed bool|array
- * @throws \Exception
- */
- public function loadObjects()
- {
- $this->setSearch();
- $this->setType();
- $this->setMainType();
- try {
- if (($results = $this->objects->load()) !== false) {
- // if ($results->total == 1) {
- // $url = Helpers\Object::createUrl($results->data[0]);
- // header('location: ' . $url);
- // exit();
- // } else {
- $_SESSION['objecttotal'] = $results->totaldata;
- return $results;
- // }
- }
- } catch (\PDOException $e) {
- //throw new Exceptions\Object('Er is een fout ontstaan bij het ophalen van de objecten', 1204);
- }
- return false;
- }
- /**
- *
- * @return mixed bool|array
- * @throws \Exception
- */
- public function setSearch()
- {
- if (isset($_GET['koophuur'])) {
- if(is_array($_GET['koophuur'])){
- if (in_array('koop',$_GET['koophuur'])){
- $this->objects->search->koop = true;
- if (isset($_GET['min_prijs']) && !empty($_GET['min_prijs'])) {
- $this->objects->search->min_koopprijs = $_GET['min_prijs'];
- }
- if (isset($_GET['max_prijs']) && !empty($_GET['max_prijs'])) {
- $this->objects->search->max_koopprijs = $_GET['max_prijs'];
- }
- }
- if (in_array('huur',$_GET['koophuur'])){
- $this->objects->search->huur = true;
- if (isset($_GET['min_prijs'])) {
- $this->objects->search->min_huurprijs = $_GET['min_prijs'];
- }
- if (isset($_GET['max_prijs'])) {
- $this->objects->search->max_huurprijs = $_GET['max_prijs'];
- }
- }
- }else{
- if ($_GET['koophuur'] == 'koop') {
- $this->objects->search->koop = true;
- if (isset($_GET['min_prijs']) && !empty($_GET['min_prijs'])) {
- $this->objects->search->min_koopprijs = $_GET['min_prijs'];
- }
- if (isset($_GET['max_prijs']) && !empty($_GET['max_prijs'])) {
- $this->objects->search->max_koopprijs = $_GET['max_prijs'];
- }
- } elseif ($_GET['koophuur'] == 'huur') {
- $this->objects->search->huur = true;
- if (isset($_GET['min_prijs'])) {
- $this->objects->search->min_huurprijs = $_GET['min_prijs'];
- }
- if (isset($_GET['max_prijs'])) {
- $this->objects->search->max_huurprijs = $_GET['max_prijs'];
- }
- }
- }
- }
- if (isset($_GET['kamers'])) {
- if(is_array($_GET['kamers'])):
- foreach($_GET['kamers'] as $kamer):
- if((int)$kamer<=$this->objects->search->min_kamers || (int)$this->objects->search->min_kamers==0):
- $this->objects->search->min_kamers = $kamer;
- endif;
- endforeach;
- endif;
- }
- if (isset($_GET['query']) && !empty($_GET['query'])) {
- if (strstr($_GET['query'], ',')) {
- $query = explode(',', $_GET['query']);
- $this->objects->search->straat = '%' . trim($query[0]) . '%';
- $this->objects->search->plaats = trim($query[1]);
- } else if (in_array(trim($_GET['query']), $this->getPlaatsen())) {
- $this->objects->search->plaats = $_GET['query'];
- } else {
- $this->objects->search->trefwoord = $_GET['query'];
- }
- }
- if (isset($_GET['plaats']) && !empty($_GET['plaats'])) {
- if (strstr($_GET['plaats'], ',')) {
- $query = explode(',', $_GET['plaats']);
- $this->objects->search->straat = '%' . trim($query[0]) . '%';
- $this->objects->search->plaats = trim($query[1]);
- } else if (in_array(trim($_GET['plaats']), $this->getPlaatsen())) {
- $this->objects->search->plaats = $_GET['plaats'];
- } else {
- $this->objects->search->trefwoord = $_GET['plaats'];
- }
- }
- if (isset($_GET['trefwoord']) && !empty($_GET['trefwoord'])) {
- $this->objects->search->trefwoord = $_GET['trefwoord'];
- }
- if (isset($_GET['min_prijs']) && !empty($_GET['min_prijs'])) {
- $this->objects->search->min_koopprijs = $_GET['min_prijs'];
- }
- if (isset($_GET['max_prijs']) && !empty($_GET['max_prijs'])) {
- $this->objects->search->max_koopprijs = $_GET['max_prijs'];
- }
- if (isset($_GET['min_prijs']) && !empty($_GET['min_prijs'])) {
- $this->objects->search->min_huurprijs = $_GET['min_prijs'];
- }
- if (isset($_GET['max_prijs']) && !empty($_GET['max_prijs'])) {
- $this->objects->search->max_huurprijs = $_GET['max_prijs'];
- }
- if (isset($_GET['woonoppervlakte']) && !empty($_GET['woonoppervlakte'])) {
- if (is_array($_GET['woonoppervlakte'])) {
- foreach($_GET['woonoppervlakte'] as $opp):
- if((int)$opp<=$this->objects->search->woning->min_woonoppervlakte || (int)$this->objects->search->woning->min_woonoppervlakte===0):
- $this->objects->search->woning->min_woonoppervlakte = $opp;
- endif;
- endforeach;
- }else{
- $oppervlakte = (int)$_GET['woonoppervlakte'];
- if((int)$oppervlakte<=$this->objects->search->woning->min_woonoppervlakte || (int)$this->objects->search->woning->min_woonoppervlakte===0):
- $this->objects->search->woning->min_woonoppervlakte = $oppervlakte;
- endif;
- }
- }
- if (isset($_GET['perceeloppervlakte']) && !empty($_GET['perceeloppervlakte'])) {
- if (is_array($_GET['perceeloppervlakte'])) {
- foreach($_GET['perceeloppervlakte'] as $opp):
- if((int)$opp<=$this->objects->search->woning->min_perceeloppervlakte || (int)$this->objects->search->woning->min_perceeloppervlakte===0):
- $this->objects->search->woning->min_perceeloppervlakte = $opp;
- endif;
- endforeach;
- }else{
- $oppervlakte = (int)$_GET['perceeloppervlakte'];
- if((int)$oppervlakte<=$this->objects->search->woning->min_perceeloppervlakte || (int)$this->objects->search->woning->min_perceeloppervlakte===0):
- $this->objects->search->woning->min_perceeloppervlakte = $oppervlakte;
- endif;
- }
- }
- if (isset($_GET['bouwvorm']) && !empty($_GET['bouwvorm'])) {
- if(is_array($_GET['bouwvorm'])){
- $this->objects->search->bouwvorm = implode('","',$_GET['bouwvorm']);
- }else{
- $this->objects->search->bouwvorm = $_GET['bouwvorm'];
- }
- }
- if ( (isset(Vars::$content->website['link']) && Vars::$content->website['link'] == 'makelaars') ||
- (isset($_GET['link']) && $_GET['link'] == 'makelaars') ||
- (isset($_GET['link']) && $_GET['link'] == 'zoekresultaten')) {
- $this->objects->where = '`ob`.`ob_woning` = 1';
- if (isset($_GET['woonoppervlakte']) && is_array($_GET['woonoppervlakte'])) {
- foreach($_GET['woonoppervlakte'] as $opp):
- if((int)$opp<=$this->objects->search->woning->min_woonoppervlakte || (int)$this->objects->search->woning->min_woonoppervlakte==0):
- $this->objects->search->woning->min_woonoppervlakte = $opp* 0.5;
- $this->objects->search->woning->max_woonoppervlakte = $opp * 1.5;
- endif;
- endforeach;
- }elseif (isset($_GET['woonoppervlakte']) && !empty($_GET['woonoppervlakte'])) {
- $oppervlakte = (int) $_GET['woonoppervlakte'];
- $this->objects->search->woning->min_woonoppervlakte = $oppervlakte * 0.5;
- $this->objects->search->woning->max_woonoppervlakte = $oppervlakte * 1.5;
- if (isset($_GET['oppervlakte']) && !empty($_GET['oppervlakte'])) {
- $oppervlakte = (int) $_GET['oppervlakte'];
- $this->objects->search->woning->min_oppervlakte = $oppervlakte * 0.5;
- $this->objects->search->woning->max_oppervlakte = $oppervlakte * 1.5;
- }
- } elseif((isset(Vars::$content->website['link']) && Vars::$content->website['link'] == 'bedrijfshuisvesting') ||
- (isset($_GET['link']) && $_GET['link'] == 'bedrijfshuisvesting')) {
- $this->objects->where = '`ob`.`ob_bedrijfspand` = 1';
- if (isset($_GET['bedrijfsruimte_opp']) && !empty($_GET['bedrijfsruimte_opp'])) {
- $oppervlakte = (int) $_GET['bedrijfsruimte_opp'];
- $this->objects->search->bedrijfspand->soort = 'bedrijfsruimte';
- $this->objects->search->bedrijfspand->min_oppervlakte = $oppervlakte * 0.5;
- $this->objects->search->bedrijfspand->max_oppervlakte = $oppervlakte * 1.5;
- }
- if (isset($_GET['kantoorruimte_opp']) && !empty($_GET['kantoorruimte_opp'])) {
- $oppervlakte = (int) $_GET['kantoorruimte_opp'];
- $this->objects->search->bedrijfspand->soort = 'kantoorruimte';
- $this->objects->search->bedrijfspand->min_oppervlakte = $oppervlakte * 0.5;
- $this->objects->search->bedrijfspand->max_oppervlakte = $oppervlakte * 1.5;
- }
- }
- }
- }
- public function setType()
- {
- if (isset($_GET['type']) && is_array($_GET['type'])) {
- foreach ($_GET['type'] as $type) {
- switch ($type) {
- // Makelaars
- case 'Woning':
- case 'Woningaanbod':
- $this->objects->search->woning = true;
- break;
- case 'Appartement':
- if ($this->objects->search->woning !== true) {
- $this->objects->search->woning->soort = 'appartement';
- }
- break;
- case 'Bouwgrond':
- $this->objects->search->bouwgrond = true;
- break;
- case 'Nieuwbouw':
- $this->objects->search->nieuwbouw = true;
- break;
- case 'Garage':
- $this->objects->search->garage = true;
- break;
- // Bedrijfshuisvesting
- case 'Kantoorruimte':
- if ($this->objects->search->bedrijfspand !== true) {
- $this->objects->search->bedrijfspand->soort = 'kantoorruimte';
- }
- break;
- case 'Bedrijfsruimte':
- case 'Bedrijfsaanbod':
- $this->objects->search->bedrijfspand = true;
- break;
- case 'Winkelruimte':
- $this->objects->search->bedrijfspand->soort = 'winkelruimte';
- break;
- case 'Horeca':
- $this->objects->search->bedrijfspand->soort = 'horeca';
- break;
- case 'Bouwgrond':
- $this->objects->search->garage = true;
- break;
- }
- }
- }
- }
- public function setMainType()
- {
- if (isset($_GET['maintype']) && is_array($_GET['maintype'])) {
- foreach ($_GET['maintype'] as $type) {
- switch ($type) {
- // Makelaars
- case 'Woningaanbod':
- $this->objects->search->woning = true;
- break;
- case 'Bedrijfsaanbod':
- $this->objects->search->bedrijfspand = true;
- break;
- }
- }
- }
- }
- public function requestMaps()
- {
- try {
- $this->setNavigation();
- if (isset($_GET['view']) && method_exists($this, $_GET['view'])) {
- $this->{$_GET['view']}(false);
- try {
- $this->objects->options->pagination = false;
- $results = $this->loadObjects();
- if ($results->total > 0) {
- $objects = array();
- foreach ($results->data as $object) {
- $object->labels = Settings::get('objects', 'labels');
- if ($object->latitude != false || $object->longitude != false) {
- $objects[] = array(
- 'adres' => $object->adres,
- 'plaats' => $object->plaats,
- 'url' => Helpers\Object::createUrl($object),
- 'image' => ($object->hoofdfoto !== false ? $object->hoofdfoto->createUrl(600, 400, 'crop') : false),
- 'label' => implode(Helpers\Object::getBullets($object)),
- 'prijs' => Helpers\Object::getPrijs($object),
- 'latitude' => $object->latitude,
- 'longitude' => $object->longitude
- );
- }
- }
- $response = array(
- 'error' => false,
- 'message' => false,
- 'data' => $objects
- );
- } else {
- throw new \Exception('No objects found');
- }
- } catch (Exceptions\Object $e) {
- throw new \Exception($e);
- }
- } else {
- throw new \Exception('View "' . $_GET['view'] . '" not found');
- }
- } catch (\Exception $e) {
- $response = array(
- 'error' => false,
- 'message' => $e->getMessage()
- );
- }
- echo json_encode($response);
- }
- private function formatPlaats($plaats)
- {
- return ucfirst(strtolower(trim($plaats)));
- }
- public function requestAutocomplete()
- {
- try {
- set_time_limit(0);
- $templateWhere = '';
- $templateJoin = '';
- switch ((isset($_GET['website']) ? $_GET['website'] : '')) {
- case 'bedrijfshuisvesting':
- $templateWhere = ' AND `ob_bedrijfspand` = 1';
- break;
- case 'makelaars':
- $templateWhere = ' AND `ob_woning` = 1';
- break;
- }
- if (isset($_GET['q']) && !empty($_GET['q'])) {
- $searchString = $_GET['q'];
- if (strtolower($searchString) == 'den bosch') {
- $searchString = 'hertogenbosch';
- }
- try {
- $objects = array();
- if (preg_match('/[0-9]/', $searchString) === 1) {
- $results = $this->db->execute('
- SELECT ob_postcode_cf as postcode, count(ob_postcode_cf) as aantal
- FROM object
- ' . $templateJoin . '
- WHERE ob_postcode_cf LIKE :search_string
- ' . $templateWhere . '
- AND ob_active = 1 and ob_publiceren = 1 and ob_stilAanbod = 0
- GROUP BY ob_postcode_cf ORDER BY aantal DESC;', array('search_string' => '%' . $searchString . '%'));
- if ($results->rowCount() > 0) {
- foreach ($results as $result) {
- $objects[] = array(
- 'item' => $this->formatPlaats($result['postcode']),
- 'numberOf' => $result['aantal'],
- );
- }
- }
- } else {
- $results = $this->db->execute('
- SELECT ob_plaats as plaats, count(ob_plaats) as aantal
- FROM object
- ' . $templateJoin . '
- WHERE ob_plaats LIKE :search_string
- ' . $templateWhere . '
- AND ob_active = 1 and ob_publiceren = 1 and ob_stilAanbod = 0
- GROUP BY ob_plaats ORDER BY aantal DESC;', array('search_string' => '%' . $searchString . '%'));
- if ($results->rowCount() > 0) {
- foreach ($results as $result) {
- $objects[] = array(
- 'item' => $this->formatPlaats($result['plaats']),
- 'numberOf' => $result['aantal'],
- );
- }
- }
- $results = $this->db->execute('
- SELECT ob_straat as straat , ob_plaats as plaats, count(ob_straat) as aantal
- FROM object
- ' . $templateJoin . '
- WHERE ob_straat LIKE :search_string
- ' . $templateWhere . '
- AND ob_active = 1 and ob_publiceren = 1 and ob_stilAanbod = 0
- GROUP BY ob_plaats ORDER BY aantal DESC;', array('search_string' => '%' . $searchString . '%'));
- if ($results->rowCount() > 0) {
- foreach ($results as $result) {
- $objects[] = array(
- 'item' => $this->formatPlaats($result['straat']) . ', ' . $this->formatPlaats($result['plaats']),
- 'numberOf' => $result['aantal'],
- );
- }
- }
- }
- if (sizeof($objects) > 0) {
- $response = array(
- 'error' => false,
- 'message' => false,
- 'data' => $objects
- );
- } else {
- throw new \Exception('<li>Geen resultaten gevonden</li>');
- }
- } catch (Exceptions\Object $e) {
- throw new \Exception($e);
- }
- } else {
- throw new \Exception('Queryparam "' . $_GET['q'] . '" not found');
- }
- } catch (\Exception $e) {
- $response = array(
- 'error' => false,
- 'message' => $e->getMessage()
- );
- }
- echo json_encode($response);
- }
- private function getPlaatsen()
- {
- $resultArray = array();
- $result = $this->db->execute('SELECT DISTINCT(ob_plaats) FROM object WHERE ob_plaats IS NOT NULL ORDER BY ob_plaats ASC;');
- foreach ($result->fetchAll() as $row) {
- $resultArray[] = $row['ob_plaats'];
- }
- return $resultArray;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement