1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-26 15:54:17 +01:00
openstamanager/modules/contratti/ajax/select.php
2018-02-04 09:41:46 +01:00

22 lines
722 B
PHP

<?php
include_once __DIR__.'/../../../core.php';
switch ($resource) {
case 'contratti':
$query = 'SELECT co_contratti.id AS id, CONCAT(numero, " ", nome) AS descrizione FROM co_contratti INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica |where| ORDER BY id';
foreach ($elements as $element) {
$filter[] = 'id='.prepare($element);
}
$where[] = 'an_anagrafiche.idanagrafica='.prepare($superselect['idanagrafica']);
$where[] = 'idstato IN (SELECT `id` FROM co_staticontratti WHERE pianificabile = 1)';
if (!empty($search)) {
$search_fields[] = 'nome LIKE '.prepare('%'.$search.'%');
}
break;
}