gest366/modules/my_impianti/edit.php

268 lines
11 KiB
PHP
Raw Normal View History

2021-02-24 20:40:04 +00:00
<?php
include_once(__DIR__."/../../core.php");
?><form action="" method="post" role="form" enctype="multipart/form-data">
<input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="op" value="update">
<input type="hidden" name="id_record" value="<?php echo $id_record ?>">
<?php
//svuto varaibile di sessione
$_SESSION['filtro_categoria']="0";
$_SESSION['filtro_fornitore']="0";
$dir="entrata";
$rs_ana = $dbo->fetchArray("SELECT * FROM an_anagrafiche WHERE idanagrafica=\"".$records[0]['idanagrafica']."\"");
$idanagrafica = $rs_ana[0]['idanagrafica'];
?>
<div class="panel panel-<?php echo $_SESSION['profilo_pannello'] ?>">
<div class="clearfix"></div>
</br>
<div class="col-md-4">
<div class="pull-left">
<button type="submit" class="btn-app btn-success"><i class="fa fa-check"></i> Salva </button>
</div>
</div>
<div class="col-md-4">
<div class="pull-right">
<div class="pull-left showcase sweet">
<button type="button" class="btn-app btn-danger" ><i class="fa fa-trash-o"></i> Elimina Installazione</span></button>
</div>
</div>
</div>
<div class="col-md-4">
<div class="pull-right">
<a class="btn btn-app btn-info" target="_blank" href="<?php echo $rootdir ?>/editor.php?id_module=2&id_record=<?php echo $idanagrafica ?>"><i class="fa fa-user"></i>Anagrafica</a>
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="panel panel-<?php echo $_SESSION['profilo_pannello'] ?>">
<div class="panel-heading">
<h3 class="panel-title">Dati Impianto Installato</h3>
</div>
<div class="panel-body">
<div class="col-md-4">
<div class="box box-info">
<div class="box-body">
<div class="form-group">
{[ "type": "text", "label": "<?php echo _("Matricola"); ?>", "name": "matricola", "required": 1, "class": "text-center", "value": "$matricola$", "extra": "" ]}
</div>
</div>
</div>
</div>
<div class="col-md-8">
<div class="box box-info">
<div class="box-body">
<div class="form-group">
{[ "type": "text", "label": "<?php echo _("Nome"); ?>", "name": "nome", "required": 1, "class": "", "value": "$nome$", "extra": "" ]}
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="col-md-4">
<div class="box box-info">
<div class="box-body">
<div class="form-group">
{[ "type": "text", "label": "Ragione Sociale", "class": "form-control", "value": "<?php echo $rs_ana[0]['ragione_sociale']?>", "extra": "readonly" ]}
</div>
<div class="form-group">
{[ "type": "text", "label": "Localita", "class": "form-control", "value": "<?php echo $rs_ana[0]['citta']?>", "extra": "readonly" ]}
</div>
<div class="form-group">
{[ "type": "text", "label": "Telefono", "class": "form-control", "value": "<?php echo $rs_ana[0]['telefono']?>", "extra": "readonly" ]}
</div>
<div class="form-group">
{[ "type": "text", "label": "Email", "class": "form-control", "value": "<?php echo $rs_ana[0]['email']?>", "extra": "readonly" ]}
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="box box-info">
<div class="box-body">
<div class="form-group">
{[ "type": "select", "label": "<?php echo _("Tecnico assegnato"); ?>", "name": "idtecnico", "required": 0, "class": "", "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=0 ORDER BY ragione_sociale ASC", "value": "$idtecnico$", "extra": "" ]}
</div>
<div class="form-group">
{[ "type": "text", "label": "<?php echo _("Data installazione"); ?>", "name": "data", "required": 0, "class": "datepicker text-center", "value": "<?php echo date('d/m/Y', strtotime($records[0]['data']) ) ?>", "extra": "" ]}
</div>
<div class="form-group">
{[ "type": "select", "label": "<?php echo _("Sede"); ?>", "name": "idsede", "required": 0, "class": "", "values": "query=SELECT 0 AS id, 'Sede legale' AS descrizione UNION SELECT id, CONCAT_WS( ' - ', nomesede, citta ) AS descrizione FROM an_sedi WHERE idanagrafica='$idanagrafica$'", "value": "$idsede$", "extra": "" ]}
</div>
<div class="form-group">
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="box box-info">
<div class="box-body">
<div class="form-group">
<?php
( $records[0]['immagine'] == '' ) ? $immagine='' : $immagine=$rootdir."/files/my_impianti/".$records[0]['immagine'];
?>
{[ "type": "image", "label": "<?php echo _("Immagine"); ?>", "name": "immagine", "required": 0, "class": "img-thumbnail", "value": "<?php echo $immagine ?>", "extra": "" ]}
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="col-md-4">
<div class="box box-info">
<div class="box-body">
<div class="form-group">
{[ "type": "textarea", "label": "<?php echo _("Descrizione"); ?>", "name": "descrizione", "required": 0, "class": "", "value": "$descrizione$", "extra": "rows='12'" ]}
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="box box-info">
<div class="box-body">
<div class="form-group">
{[ "type": "text", "label": "<?php echo _("Proprietario"); ?>", "name": "proprietario", "required": 0, "value": "$proprietario$", "extra": "" ]}
</div>
<div class="form-group">
{[ "type": "text", "label": "<?php echo _("Ubicazione"); ?>", "name": "ubicazione", "required": 0, "class": "", "value": "$ubicazione$", "extra": "" ]}
</div>
<div class="form-group">
{[ "type": "text", "label": "<?php echo _("Palazzo"); ?>", "name": "palazzo", "required": 0, "class": "", "value": "$palazzo$", "extra": "" ]}
</div>
<div class="form-group">
{[ "type": "text", "label": "<?php echo _("Scala"); ?>", "name": "scala", "required": 0, "class": "", "value": "$scala$", "extra": "" ]}
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="box box-info">
<div class="box-body">
<div class="form-group">
{[ "type": "text", "label": "<?php echo _("Piano"); ?>", "name": "piano", "required": 0, "class": "", "value": "$piano$", "extra": "" ]}
</div>
<div class="form-group">
{[ "type": "text", "label": "<?php echo _("Interno"); ?>", "name": "interno", "required": 0, "class": "", "value": "$interno$", "extra": "" ]}
</div>
<div class="form-group">
{[ "type": "text", "label": "<?php echo _("Occupante"); ?>", "name": "occupante", "required": 0, "class": "", "value": "$occupante$", "extra": "" ]}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-<?php echo $_SESSION['profilo_pannello'] ?>">
<div class="panel-heading">
<h3 class="panel-title">Articoli presenti</h3>
</div>
<div class="panel-body">
<div class="pull-left">
<!--
<a class="btn btn-primary" data-href="<?php echo $rootdir ?>/modules/my_impianti/edit_riga.php?matricola=<?php echo $id_record ?>&idriga=0" data-toggle="modal" data-title="Aggiungi Componente" data-target="#bs-popup"><i class="fa fa-plus"></i> Articolo</a><br>
-->
<a class="btn btn-sm btn-info" data-href="<?php echo $rootdir ?>/modules/my_impianti/add_articolo.php?iddocumento=<?php echo $id_record ?>&filtra_art=<?php echo $filtra_art ?>" data-toggle="modal" data-title="Aggiungi articolo" data-target="#bs-popup"><i class="fa fa-plus"></i> Articolo</a>
<a class="btn btn-sm btn-info" data-href="<?php echo $rootdir ?>/modules/my_impianti/add_riga.php?iddocumento=<?php echo $id_record ?>" data-toggle="modal" data-title="Aggiungi riga" data-target="#bs-popup"><i class="fa fa-plus"></i> Riga generica</a>
</div>
<div class="pull-right">
<button type="submit" class="btn-app btn-success"><i class="fa fa-check"></i> Salva </button>
</div>
<div class="clearfix"></div>
<br>
<div class="row">
<div class="col-md-12">
<table class="table table-striped table-hover table-condensed">
<tr>
<th>Descrizione</th>
<th width="10%" style='text-align:center;'>Q.t&agrave;</th>
<th width="22%" style='text-align:center;'>n°Seriale</th>
<!-- <th width="12%" style='text-align:center;'>Seriale</th> -->
<!-- <th width="12%" style='text-align:center;'>Iva</th> -->
<!-- <th width="10%" style='text-align:center;'>Imponibile</th> -->
<th width="5%"></th>
</tr>
<?php include($docroot."/modules/my_impianti/row-list.php"); ?>
</table>
</div>
</div>
</div>
</div>
</form>
<form action="" method="post" role="form" id="form-delete">
<input type="hidden" name="backto" value="record-list">
<input type="hidden" name="op" value="delete">
</form>
<script>
var id_module = "<?php echo $_GET['id_module'] ?>";
var idanagraficacerca = "<?php echo $idanagrafica ?>";
$('#idcategoria').change( function(){
$.get('<?php echo $rootdir ?>/ajax_autocomplete.php?module=FiltroCat&idcategoria='+this.value+'&idmodulo='+id_module , function(data,response){
start_jquerychosen();
start_inputmask();
});
});
$('#filtro').change( function(){
$.get('<?php echo $rootdir ?>/ajax_autocomplete.php?module=Filtro&idfiltro='+this.value+'&idmodulo='+id_module , function(data,response){
start_jquerychosen();
start_inputmask();
});
});
$('.showcase.sweet button').on('click', () => {
swal({
title: 'Sei sicuro?',
text: "Eliminare questo elemento!",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Conferma!'
}).then((result) => {
if (result.value) {
{ $('#form-delete').submit(); }
}
})
})
</script>