2017-08-04 16:28:16 +02:00
< ? php
include_once __DIR__ . '/../../core.php' ;
$id_record = $get [ 'idautomezzo' ];
// Form di inserimento responsabili automezzo
echo '
2017-09-22 15:19:59 +02:00
< form action = " '. $rootdir .'/editor.php?id_module='.Modules::get('Automezzi')['id'].'&id_record='. $id_record .' " method = " post " >
2017-08-04 16:28:16 +02:00
< input type = " hidden " name = " op " value = " addtech " >
< input type = " hidden " name = " backto " value = " record-edit " >
< input type = " hidden " name = " id_record " value = " '. $id_record .' " >
< div class = " row " > ' ;
// Tecnico
echo '
< div class = " col-md-6 " >
2018-07-17 08:05:19 +02:00
{[ " type " : " select " , " label " : " '.tr('Tecnico').' " , " name " : " idtecnico " , " required " : 1 , " values " : " query=SELECT an_anagrafiche.idanagrafica AS id, ragione_sociale AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE (descrizione= \ 'Tecnico \ ') AND deleted_at IS NULL ORDER BY ragione_sociale " , " value " : " '. $idtecnico .' " ]}
2017-08-04 16:28:16 +02:00
</ div > ' ;
// Data di partenza
echo '
< div class = " col-md-3 " >
2018-04-24 00:03:25 +02:00
{[ " type " : " date " , " label " : " '.tr('Data dal').' " , " name " : " data_inizio " , " required " : 1 , " maxlength " : 10 , " value " : " -now- " ]}
2017-08-04 16:28:16 +02:00
</ div > ' ;
// Data di fine
echo '
< div class = " col-md-3 " >
2018-07-03 12:28:38 +02:00
{[ " type " : " date " , " label " : " '.tr('Data al').' " , " name " : " data_fine " , " maxlength " : 10 , " min-date " : " -now- " ]}
2017-08-04 16:28:16 +02:00
</ div > ' ;
echo '
</ div >
<!-- PULSANTI -->
< div class = " row " >
< div class = " col-md-12 text-right " >
2017-09-04 12:02:29 +02:00
< button type = " submit " class = " btn btn-primary pull-right " >< i class = " fa fa-plus " ></ i > '.tr(' Aggiungi ').' </ button >
2017-08-04 16:28:16 +02:00
</ div >
</ div >
</ form > ' ;
echo '
< script src = " '. $rootdir .'/lib/init.js " ></ script > ' ;
echo '
< script type = " text/javascript " >
$ ( function () {
$ ( " #data_inizio " ) . on ( " dp.change " , function ( e ) {
$ ( " #data_fine " ) . data ( " DateTimePicker " ) . minDate ( e . date );
2017-09-19 16:20:44 +02:00
if ( $ ( " #data_fine " ) . data ( " DateTimePicker " ) . date () < e . date ){
$ ( " #data_fine " ) . data ( " DateTimePicker " ) . date ( e . date );
}
2017-08-04 16:28:16 +02:00
})
});
</ script > ' ;