Migliorato inserimento anagrafiche con campi aggiuntivi

This commit is contained in:
Luca 2018-04-17 23:41:56 +02:00
parent db561c29e3
commit 6990663c32
3 changed files with 78 additions and 6 deletions

View File

@ -583,9 +583,6 @@ input.small-width {
.callout a{
text-decoration: none;
}
.box{
border-top:0px;
}
/*fix per tabs editor */
.nav-tabs-custom > .nav-tabs > li{
border-top: 3px solid #ddd;

View File

@ -175,6 +175,16 @@ switch (post('op')) {
$dbo->insert('an_anagrafiche', [
'ragione_sociale' => $ragione_sociale,
'codice' => $codice,
'piva' => post('piva'),
'codice_fiscale' => post('codice_fiscale'),
'indirizzo' => post('indirizzo'),
'citta' => post('citta'),
'cap' => post('cap'),
'provincia' => post('provincia'),
'telefono' => post('telefono'),
'cellulare' => post('cellulare'),
'email' => post('email'),
'idrelazione' => post('idrelazione'),
'idagente' => $idagente,
]);

View File

@ -22,10 +22,75 @@ echo '
<div class="col-md-6">
{[ "type": "select", "label": "'.tr('Tipo di anagrafica').'", "name": "idtipoanagrafica[]", "multiple": "1", "required": 1, "values": "query=SELECT idtipoanagrafica AS id, descrizione FROM an_tipianagrafiche WHERE idtipoanagrafica NOT IN (SELECT DISTINCT(x.idtipoanagrafica) FROM an_tipianagrafiche_anagrafiche x INNER JOIN an_tipianagrafiche t ON x.idtipoanagrafica = t.idtipoanagrafica INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica = x.idanagrafica WHERE t.descrizione = \'Azienda\' AND deleted = 0) ORDER BY descrizione", "value": "'.$idtipoanagrafica.'" ]}
</div>
</div>
</div>';
<!-- PULSANTI -->
<div class="row">
echo
'<div class="box box-info collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">'.tr('Dati anagrafici').'</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-plus"></i>
</button>
</div>
</div>
<div class="box-body collapse">
<div class="row">
<div class="col-md-4">
{[ "type": "text", "label": "'.tr('Partita IVA').'", "maxlength": 13, "name": "piva", "class": "text-center alphanumeric-mask", "value": "" ]}
</div>
<div class="col-md-4">
{[ "type": "text", "label": "'.tr('Codice fiscale').'", "maxlength": 16, "name": "codice_fiscale", "class": "text-center alphanumeric-mask", "value": "" ]}
</div>
<div class="col-md-4">
{[ "type": "select", "label": "'.tr('Relazione').'", "name": "idrelazione", "values": "query=SELECT id, descrizione, colore AS _bgcolor_ FROM an_relazioni ORDER BY descrizione", "value": "" ]}
</div>
</div>
<div class="row">
<div class="col-md-4">
{[ "type": "text", "label": "'.tr('Indirizzo').'", "name": "indirizzo", "value": "" ]}
</div>
<div class="col-md-2">
{[ "type": "text", "label": "'.tr('C.A.P.').'", "name": "cap", "maxlength": 5, "class": "text-center", "value": "" ]}
</div>
<div class="col-md-4">
{[ "type": "text", "label": "'.tr('Città').'", "name": "citta", "class": "text-center", "value": "" ]}
</div>
<div class="col-md-2">
{[ "type": "text", "label": "'.tr('Provincia').'", "name": "provincia", "maxlength": 2, "class": "text-center", "value": "" ]}
</div>
</div>
<div class="row">
<div class="col-md-4">
{[ "type": "text", "label": "'.tr('Telefono').'", "name": "telefono", "class": "text-center", "value": "", "icon-before": "<i class=\"fa fa-phone\"></i>" ]}
</div>
<div class="col-md-4">
{[ "type": "text", "label": "'.tr('Cellulare').'", "name": "cellulare", "class": "text-center", "value": "", "icon-before": "<i class=\"fa fa-mobile\"></i>" ]}
</div>
<div class="col-md-4">
{[ "type": "text", "label": "'.tr('Email').'", "name": "email", "class": "email-mask", "placeholder":"casella@dominio.ext", "value": "", "icon-before": "<i class=\"fa fa-envelope\"></i>" ]}
</div>
</div>
</div>
</div>';
echo
'<div class="row">
<div class="col-md-12 text-right">
<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> '.tr('Aggiungi').'</button>
</div>