2017-08-04 16:28:16 +02:00
< ? php
include_once __DIR__ . '/../../core.php' ;
2018-07-10 16:39:02 +02:00
$img = null ;
2018-07-18 15:20:10 +02:00
if ( ! empty ( $record [ 'immagine' ])) {
$fileinfo = Uploads :: fileInfo ( $record [ 'immagine' ]);
2018-07-10 16:39:02 +02:00
2018-07-13 16:19:44 +02:00
$default_img = '/' . Uploads :: getDirectory ( $id_module ) . '/' . $fileinfo [ 'filename' ] . '_thumb600.' . $fileinfo [ 'extension' ];
2018-07-10 16:39:02 +02:00
2018-07-18 15:20:10 +02:00
$img = file_exists ( DOCROOT . $default_img ) ? ROOTDIR . $default_img : ROOTDIR . '/' . Uploads :: getDirectory ( $id_module ) . '/' . $record [ 'immagine' ];
2018-07-10 16:39:02 +02:00
}
2018-02-23 16:04:50 +01:00
?> <form action="" method="post" id="edit-form" enctype="multipart/form-data">
2017-08-04 16:28:16 +02:00
< input type = " hidden " name = " backto " value = " record-edit " >
< input type = " hidden " name = " op " value = " update " >
2018-02-18 19:53:23 +01:00
< input type = " hidden " name = " matricola " value = " <?php echo $id_record ; ?> " >
2017-08-04 16:28:16 +02:00
<!-- DATI ANAGRAFICI -->
< div class = " panel panel-primary " >
< div class = " panel-heading " >
2017-09-04 12:02:29 +02:00
< h3 class = " panel-title " >< ? php echo tr ( 'Dati impianto' ); ?> </h3>
2017-08-04 16:28:16 +02:00
</ div >
< div class = " panel-body " >
< div class = " row " >
< div class = " col-md-3 " >
2018-07-10 16:39:02 +02:00
{[ " type " : " image " , " label " : " <?php echo tr('Immagine'); ?> " , " name " : " immagine " , " class " : " img-thumbnail " , " value " : " <?php echo $img ; ?> " ]}
2017-08-04 16:28:16 +02:00
</ div >
< div class = " col-md-9 " >
< div class = " row " >
2019-07-23 12:13:58 +02:00
< div class = " col-md-6 " >
2019-05-03 16:31:58 +02:00
{[ " type " : " text " , " label " : " <?php echo tr('Matricola'); ?> " , " name " : " matricola " , " required " : 1 , " class " : " text-center " , " maxlength " : 25 , " value " : " $matricola $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
2019-07-23 12:13:58 +02:00
< div class = " col-md-6 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " text " , " label " : " <?php echo tr('Nome'); ?> " , " name " : " nome " , " required " : 1 , " value " : " $nome $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
< div class = " clearfix " ></ div >
2019-07-23 12:13:58 +02:00
< div class = " col-md-6 " >
2018-08-28 17:10:23 +02:00
< ? php
2018-09-03 16:49:43 +02:00
echo Modules :: link ( 'Anagrafiche' , $record [ 'idanagrafica' ], null , null , 'class="pull-right"' );
?>
2018-11-29 14:46:31 +01:00
{[ " type " : " select " , " label " : " <?php echo tr('Cliente'); ?> " , " name " : " idanagrafica " , " required " : 1 , " value " : " $idanagrafica $ " , " extra " : " " , " ajax-source " : " clienti " ]}
2017-08-04 16:28:16 +02:00
</ div >
2019-07-23 12:13:58 +02:00
< div class = " col-md-6 " >
2019-08-29 14:28:05 +02:00
{[ " type " : " select " , " label " : " <?php echo tr('Categoria'); ?> " , " name " : " id_categoria " , " required " : 0 , " value " : " $id_categoria $ " , " values " : " query=SELECT id, nome AS descrizione FROM my_impianti_categorie " ]}
2018-10-18 19:36:19 +02:00
</ div >
2017-08-04 16:28:16 +02:00
</ div >
</ div >
</ div >
< div class = " row " >
< div class = " col-md-4 " >
2018-11-29 14:46:31 +01:00
{[ " type " : " select " , " label " : " <?php echo tr('Tecnico assegnato'); ?> " , " name " : " idtecnico " , " ajax-source " : " tecnici " , " value " : " $idtecnico $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
< div class = " col-md-4 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " date " , " label " : " <?php echo tr('Data installazione'); ?> " , " name " : " data " , " value " : " $data $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
2020-07-31 14:25:50 +02:00
< ? php
echo '
2017-08-04 16:28:16 +02:00
< div class = " col-md-4 " >
2020-08-27 09:15:30 +02:00
{[ " type " : " select " , " label " : " '.tr('Sede').' " , " name " : " idsede " , " value " : " $idsede $ " , " required " : " 1 " , " ajax-source " : " sedi " , " select-options " : '.json_encode([' idanagrafica ' => $record[' idanagrafica ']]).' , " placeholder " : " '.tr('Sede legale').' " ]}
2020-07-31 14:25:50 +02:00
</ div > ' ;
?>
2017-08-04 16:28:16 +02:00
</ div >
< div class = " row " >
< div class = " col-md-12 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " textarea " , " label " : " <?php echo tr('Descrizione'); ?> " , " name " : " descrizione " , " value " : " $descrizione $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
</ div >
< div class = " row " >
< div class = " col-md-12 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " text " , " label " : " <?php echo tr('Proprietario'); ?> " , " name " : " proprietario " , " value " : " $proprietario $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
</ div >
< div class = " row " >
< div class = " col-md-4 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " text " , " label " : " <?php echo tr('Ubicazione'); ?> " , " name " : " ubicazione " , " value " : " $ubicazione $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
< div class = " col-md-4 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " text " , " label " : " <?php echo tr('Palazzo'); ?> " , " name " : " palazzo " , " value " : " $palazzo $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
< div class = " col-md-4 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " text " , " label " : " <?php echo tr('Scala'); ?> " , " name " : " scala " , " value " : " $scala $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
</ div >
< div class = " row " >
< div class = " col-md-4 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " text " , " label " : " <?php echo tr('Piano'); ?> " , " name " : " piano " , " value " : " $piano $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
< div class = " col-md-4 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " text " , " label " : " <?php echo tr('Interno'); ?> " , " name " : " interno " , " value " : " $interno $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
< div class = " col-md-4 " >
2017-09-04 12:02:29 +02:00
{[ " type " : " text " , " label " : " <?php echo tr('Occupante'); ?> " , " name " : " occupante " , " value " : " $occupante $ " ]}
2017-08-04 16:28:16 +02:00
</ div >
</ div >
</ div >
</ div >
</ form >
2018-09-28 16:17:10 +02:00
{( " name " : " filelist_and_upload " , " id_module " : " $id_module $ " , " id_record " : " $id_record $ " )}
2018-02-04 17:31:33 +01:00
2017-08-04 16:28:16 +02:00
< a class = " btn btn-danger ask " data - backto = " record-list " >
2017-09-04 12:02:29 +02:00
< i class = " fa fa-trash " ></ i > < ? php echo tr ( 'Elimina' ); ?>
2017-08-04 16:28:16 +02:00
</ a >
2018-08-01 18:39:24 +02:00
< script type = " text/javascript " >
2020-07-31 14:25:50 +02:00
$ ( document ) . ready ( function () {
$ ( '#idanagrafica' ) . change ( function () {
updateSelectOption ( " idanagrafica " , $ ( this ) . val ());
2018-08-01 18:39:24 +02:00
session_set ( 'superselect,idanagrafica' , $ ( this ) . val (), 0 );
2020-07-31 14:25:50 +02:00
var value = ! $ ( this ) . val ();
2018-08-11 15:49:46 +02:00
2020-07-31 14:25:50 +02:00
$ ( " #idsede " ) . prop ( " disabled " , value )
. selectReset ();
2018-08-01 18:39:24 +02:00
});
});
2018-08-11 15:49:46 +02:00
</ script >