2018-02-04 09:41:46 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include_once __DIR__.'/../../../core.php';
|
|
|
|
|
|
|
|
switch ($resource) {
|
|
|
|
case 'tipiintervento':
|
2018-05-21 15:47:44 +02:00
|
|
|
$query = 'SELECT idtipointervento AS id, IF(tempo_standard <= 0, descrizione, CONCAT(descrizione, \' (\', REPLACE(FORMAT(tempo_standard, 2), \'.\', \',\'), \' ore)\')) AS descrizione, tempo_standard FROM in_tipiintervento |where| ORDER BY idtipointervento';
|
2018-02-04 09:41:46 +01:00
|
|
|
|
|
|
|
foreach ($elements as $element) {
|
|
|
|
$filter[] = 'idtipointervento='.prepare($element);
|
|
|
|
}
|
|
|
|
if (!empty($search)) {
|
|
|
|
$search_fields[] = 'descrizione LIKE '.prepare('%'.$search.'%');
|
|
|
|
}
|
2018-05-21 12:33:07 +02:00
|
|
|
|
|
|
|
$custom['tempo_standard'] = 'tempo_standard';
|
2018-02-04 09:41:46 +01:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|