2018-11-28 02:10:12 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include_once __DIR__.'/../../../core.php';
|
|
|
|
|
|
|
|
switch ($resource) {
|
|
|
|
case 'categorie_documenti':
|
2019-10-04 17:00:53 +02:00
|
|
|
$query = 'SELECT id, descrizione FROM do_categorie |where| ORDER BY descrizione ASC';
|
2018-11-28 02:10:12 +01:00
|
|
|
|
|
|
|
foreach ($elements as $element) {
|
2019-10-04 17:00:53 +02:00
|
|
|
$filter[] = 'do_categorie.id='.prepare($element);
|
2018-11-28 02:10:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (empty($filter)) {
|
|
|
|
$where[] = 'deleted_at IS NULL';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty($search)) {
|
|
|
|
$search_fields[] = 'descrizione LIKE '.prepare('%'.$search.'%');
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|