2017-08-04 16:28:16 +02:00
< ? php
include_once __DIR__ . '/../../core.php' ;
/*
TECNICI ASSEGNATI ALL ' AUTOMEZZO
*/
2018-05-11 15:56:08 +02:00
$q_art = " SELECT *, (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=dt_automezzi_tecnici.idtecnico) AS nometecnico FROM dt_automezzi_tecnici WHERE idautomezzo= " . prepare ( $id_record );
2017-08-04 16:28:16 +02:00
$rs_art = $dbo -> fetchArray ( $q_art );
if ( ! empty ( $rs_art )) {
echo '
< table class = " table table-striped table-hover table-condensed " >
< tr >
2017-09-04 12:02:29 +02:00
< th > '.tr(' Tecnico ').' </ th >
< th width = " 25% " > '.tr(' dal ').' </ th >
< th width = " 25% " > '.tr(' al ').' </ th >
2017-08-04 16:28:16 +02:00
< th width = " 5% " ></ th >
</ tr > ' ;
foreach ( $rs_art as $r ) {
// Tecnico
echo '
< tr >
< td >
< input type = " hidden " name = " idautomezzotecnico[] " value = " '. $r['id'] .' " >
'.$r[' nometecnico '].'
</ td > ' ;
// Data di inizio
echo '
< td >
2018-05-11 15:56:08 +02:00
{[ " type " : " date " , " name " : " data_inizio['. $r['id'] .'] " , " required " : 1 , " maxlength " : 10 , " value " : " '. $r['data_inizio'] .' " ]}
2017-08-04 16:28:16 +02:00
</ td > ' ;
// Data di fine
echo '
< td >
2018-05-11 15:56:08 +02:00
{[ " type " : " date " , " name " : " data_fine['. $r['id'] .'] " , " maxlength " : 10 , " value " : " '. $r['data_fine'] .' " , " min-date " : " '. $r['data_inizio'] .' " ]}
2017-08-04 16:28:16 +02:00
</ td > ' ;
// Pulsanti per aggiornamento date tecnici
echo '
< td >
2017-09-04 12:02:29 +02:00
< a class = " btn btn-danger ask " data - backto = " record-edit " data - op = " deltech " data - id = " '. $r['id'] .' " data - msg = " '.tr( " Rimuovere il tecnico responsabile dell 'automezzo?").' " >
2017-08-04 16:28:16 +02:00
< i class = " fa fa-trash " ></ i >
</ a >
</ td >
</ tr > ' ;
2018-02-18 19:53:23 +01:00
echo '
2017-08-04 16:28:16 +02:00
< script type = " text/javascript " >
$ ( function () {
$ ( " #data_inizio'. $r['id'] .' " ) . on ( " dp.change " , function ( e ) {
$ ( " #data_fine'. $r['id'] .' " ) . data ( " DateTimePicker " ) . minDate ( e . date );
2017-09-19 16:20:44 +02:00
if ( $ ( " #data_fine'. $r['id'] .' " ) . data ( " DateTimePicker " ) . date () < e . date ){
$ ( " #data_fine'. $r['id'] .' " ) . data ( " DateTimePicker " ) . date ( e . date );
}
2017-08-04 16:28:16 +02:00
})
});
</ script > ' ;
}
echo '
</ table > ' ;
} else {
echo '
2017-09-04 12:02:29 +02:00
< p > '.tr(' Nessun tecnico inserito ').' ...</ p > ' ;
2017-08-04 16:28:16 +02:00
}