This commit is contained in:
Luca 2019-06-11 18:12:00 +02:00
parent 246fb0aa92
commit 4de7ec4717
2 changed files with 6 additions and 4 deletions

View File

@ -27,6 +27,7 @@ switch ($operazione) {
break;
case 'updatesede':
$id = filter('id');
$array = [
'nomesede' => post('nomesede'),
'indirizzo' => post('indirizzo'),
@ -48,14 +49,15 @@ switch ($operazione) {
'lng' => post('lng'),
];
$dbo->update('an_sedi', $array, ['id' => $id_record]);
$dbo->update('an_sedi', $array, ['id' => $id]);
flash()->info(tr('Salvataggio completato!'));
break;
case 'deletesede':
$dbo->query('DELETE FROM `an_sedi` WHERE `id`='.prepare($id_record));
$id = filter('id');
$dbo->query('DELETE FROM `an_sedi` WHERE `id` = '.prepare($id).'');
flash()->info(tr('Sede eliminata!'));

View File

@ -15,7 +15,7 @@ echo '
<form action="" method="post" role="form" id="form_sedi">
<input type="hidden" name="id_plugin" value="'.$id_plugin.'">
<input type="hidden" name="id_parent" value="'.$id_parent.'">
<input type="hidden" name="id_record" value="'.$id_record.'">
<input type="hidden" name="id" value="'.$record['id'].'">
<input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="op" value="updatesede">
@ -129,7 +129,7 @@ echo '
<!-- PULSANTI -->
<div class="row">
<div class="col-md-12">
<a class="btn btn-danger ask" data-backto="record-edit" data-op="deletesede" data-id_record="'.$record['id'].'" data-id_plugin="'.$id_plugin.'" data-id_module="'.$id_module.'" data-id_parent="'.$id_parent.'">
<a class="btn btn-danger ask" data-backto="record-edit" data-op="deletesede" data-id="'.$record['id'].'" data-id_plugin="'.$id_plugin.'" data-id_module="'.$id_module.'" data-id_parent="'.$id_parent.'">
<i class="fa fa-trash"></i> '.tr('Elimina').'
</a>