2017-08-04 16:28:16 +02:00
< ? php
include_once __DIR__ . '/../../core.php' ;
?> <form action="" method="post">
< input type = " hidden " name = " op " value = " update " >
< input type = " hidden " name = " backto " value = " record-edit " >
2018-02-18 19:53:23 +01:00
< input type = " hidden " name = " id_record " value = " <?php echo $id_record ; ?> " >
2017-08-04 16:28:16 +02:00
< div class = " row " >
< div class = " col-md-4 " >
2019-07-08 16:45:00 +02:00
{[ " type " : " span " , " label " : " <?php echo tr('Codice'); ?> " , " name " : " codice " , " value " : " $codice $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
2018-05-21 11:14:37 +02:00
< div class = " col-md-6 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " text " , " label " : " <?php echo tr('Descrizione'); ?> " , " name " : " descrizione " , " required " : 1 , " value " : " $descrizione $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
2018-07-04 17:15:14 +02:00
2018-05-21 11:14:37 +02:00
< div class = " col-md-2 " >
2019-03-28 18:40:19 +01:00
{[ " type " : " number " , " label " : " <?php echo tr('Tempo standard'); ?> " , " name " : " tempo_standard " , " help " : " <?php echo tr('Valore compreso tra 0,25 - 24 ore. <br><small>Esempi: <em><ul><li>60 minuti = 1 ora</li><li>30 minuti = 0,5 ore</li><li>15 minuti = 0,25 ore</li></ul></em></small> Suggerisce il tempo solitamente impiegato per questa tipologia di attivita'); ?>. " , " maxlength " : 5 , " min-value " : " 0 " , " max-value " : " 24 " , " class " : " text-center " , " value " : " $tempo_standard $ " , " icon-after " : " ore " ]}
2018-05-21 11:14:37 +02:00
</ div >
2018-07-04 17:15:14 +02:00
2017-08-04 16:28:16 +02:00
</ div >
< div class = " panel panel-primary " >
< div class = " panel-heading " >
2019-06-13 18:05:19 +02:00
< h3 class = " panel-title " >< ? php echo tr ( 'Addebiti unitari al cliente' ); ?> </h3>
2017-08-04 16:28:16 +02:00
</ div >
< div class = " panel-body " >
< div class = " row " >
2017-09-21 10:01:07 +02:00
< div class = " col-md-4 " >
2019-06-13 18:05:19 +02:00
{[ " type " : " number " , " label " : " <?php echo tr('Addebito orario'); ?> " , " name " : " costo_orario " , " required " : 1 , " value " : " $costo_orario $ " , " icon-after " : " <i class='fa fa-euro'></i> " ]}
2017-08-04 16:28:16 +02:00
</ div >
2017-09-21 10:01:07 +02:00
< div class = " col-md-4 " >
2019-06-13 18:05:19 +02:00
{[ " type " : " number " , " label " : " <?php echo tr('Addebito km'); ?> " , " name " : " costo_km " , " required " : 1 , " value " : " $costo_km $ " , " icon-after " : " <i class='fa fa-euro'></i> " ]}
2017-08-04 16:28:16 +02:00
</ div >
2017-09-21 10:01:07 +02:00
< div class = " col-md-4 " >
2019-06-13 18:05:19 +02:00
{[ " type " : " number " , " label " : " <?php echo tr('Addebito diritto ch.'); ?> " , " name " : " costo_diritto_chiamata " , " required " : 1 , " value " : " $costo_diritto_chiamata $ " , " icon-after " : " <i class='fa fa-euro'></i> " ]}
2017-08-04 16:28:16 +02:00
</ div >
</ div >
</ div >
</ div >
< div class = " panel panel-primary " >
< div class = " panel-heading " >
2019-06-13 18:05:19 +02:00
< h3 class = " panel-title " >< ? php echo tr ( 'Costi unitari del tecnico' ); ?> </h3>
2017-08-04 16:28:16 +02:00
</ div >
< div class = " panel-body " >
< div class = " row " >
2017-09-21 10:01:07 +02:00
< div class = " col-md-4 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " number " , " label " : " <?php echo tr('Costo orario'); ?> " , " name " : " costo_orario_tecnico " , " required " : 1 , " value " : " $costo_orario_tecnico $ " , " icon-after " : " <i class='fa fa-euro'></i> " ]}
2017-08-04 16:28:16 +02:00
</ div >
2017-09-21 10:01:07 +02:00
< div class = " col-md-4 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " number " , " label " : " <?php echo tr('Costo km'); ?> " , " name " : " costo_km_tecnico " , " required_tecnico " : 1 , " value " : " $costo_km_tecnico $ " , " icon-after " : " <i class='fa fa-euro'></i> " ]}
2017-08-04 16:28:16 +02:00
</ div >
2017-09-21 10:01:07 +02:00
< div class = " col-md-4 " >
2019-06-13 18:05:19 +02:00
{[ " type " : " number " , " label " : " <?php echo tr('Costo diritto ch.'); ?> " , " name " : " costo_diritto_chiamata_tecnico " , " required " : 1 , " value " : " $costo_diritto_chiamata_tecnico $ " , " icon-after " : " <i class='fa fa-euro'></i> " ]}
2017-08-04 16:28:16 +02:00
</ div >
</ div >
</ div >
</ div >
</ form >
< ? php
2019-11-20 00:21:58 +01:00
// Permetto eliminazione tipo intervento solo se questo non è utilizzado da nessun'altra parte nel gestionale
2020-01-14 17:20:19 +01:00
//UNION SELECT `in_tariffe`.`idtipointervento` FROM `in_tariffe` WHERE `in_tariffe`.`idtipointervento` = '.prepare($id_record).'
2019-11-14 17:27:33 +01:00
$elementi = $dbo -> fetchArray ( 'SELECT `in_interventi`.`idtipointervento` FROM `in_interventi` WHERE `in_interventi`.`idtipointervento` = ' . prepare ( $id_record ) . '
UNION
SELECT `an_anagrafiche` . `idtipointervento_default` AS `idtipointervento` FROM `an_anagrafiche` WHERE `an_anagrafiche` . `idtipointervento_default` = '.prepare($id_record).'
UNION
SELECT `co_preventivi` . `idtipointervento` FROM `co_preventivi` WHERE `co_preventivi` . `idtipointervento` = '.prepare($id_record).'
UNION
SELECT `co_promemoria` . `idtipointervento` FROM `co_promemoria` WHERE `co_promemoria` . `idtipointervento` = '.prepare($id_record).'
UNION
SELECT `in_interventi_tecnici` . `idtipointervento` FROM `in_interventi_tecnici` WHERE `in_interventi_tecnici` . `idtipointervento` = '.prepare($id_record).'
UNION
SELECT `co_contratti_tipiintervento` . `idtipointervento` FROM `co_contratti_tipiintervento` WHERE `co_contratti_tipiintervento` . `idtipointervento` = '.prepare($id_record).'
ORDER BY `idtipointervento` ' );
if ( ! empty ( $elementi )) {
2017-08-04 16:28:16 +02:00
echo '
2017-09-06 11:59:47 +02:00
< div class = " alert alert-danger " >
2019-11-14 17:27:33 +01:00
'.tr(' Ci sono _NUM_ records collegati ' , [
'_NUM_' => count ( $elementi ),
2017-09-10 14:35:41 +02:00
]) . ' .
2017-08-04 16:28:16 +02:00
</ div > ' ;
2019-07-08 16:45:00 +02:00
} else {
echo '
< a class = " btn btn-danger ask " data - backto = " record-list " >
< i class = " fa fa-trash " ></ i > '.tr(' Elimina ').'
</ a > ' ;
2017-08-04 16:28:16 +02:00
}