. */ use Modules\Anagrafiche\Anagrafica; use Modules\Banche\Banca; include_once __DIR__.'/../../core.php'; switch (filter('op')) { case 'add': $id_anagrafica = filter('id_anagrafica'); $anagrafica = Anagrafica::find($id_anagrafica); $nome = filter('nome'); $iban = filter('iban'); $bic = filter('bic'); $banca = Banca::build($anagrafica, $nome, $iban, $bic); $id_record = $banca->id; if (isAjaxRequest()) { echo json_encode([ 'id' => $id_record, 'text' => $nome, ]); } flash()->info(tr('Aggiunta nuova _TYPE_', [ '_TYPE_' => 'banca', ])); break; case 'update': $nome = filter('nome'); $banca->nome = post('nome'); $banca->iban = post('iban'); $banca->bic = post('bic'); $banca->note = post('note'); $banca->id_pianodeiconti3 = post('id_pianodeiconti3'); $banca->filiale = post('filiale'); $banca->creditor_id = post('creditor_id'); $banca->predefined = post('predefined'); $banca->save(); flash()->info(tr('Salvataggio completato')); break; case 'delete': $banca->delete(); flash()->info(tr('_TYPE_ eliminata con successo!', [ '_TYPE_' => 'Banca', ])); break; }