openstamanager/modules/zone/ajax/select.php

19 lines
532 B
PHP
Raw Normal View History

2019-11-20 10:24:56 +01:00
<?php
include_once __DIR__.'/../../../core.php';
switch ($resource) {
case 'zone':
$query = 'SELECT `id`, CONCAT(`nome`, \' - \', `descrizione`) AS `descrizione` FROM an_zone |where| ORDER BY descrizione ASC';
foreach ($elements as $element) {
$filter[] = 'id='.prepare($element);
}
if (!empty($search)) {
$search_fields[] = 'nome LIKE '.prepare('%'.$search.'%');
$search_fields[] = 'descrizione LIKE '.prepare('%'.$search.'%');
}
break;
}