2017-09-18 16:55:19 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include_once __DIR__.'/../../core.php';
|
|
|
|
|
|
|
|
$operazione = filter('op');
|
|
|
|
|
|
|
|
switch ($operazione) {
|
|
|
|
case 'addreferente':
|
2018-02-15 17:30:42 +01:00
|
|
|
$dbo->insert('an_referenti', [
|
|
|
|
'idanagrafica' => $id_parent,
|
|
|
|
'nome' => $post['nome'],
|
|
|
|
'mansione' => $post['mansione'],
|
|
|
|
'telefono' => $post['telefono'],
|
|
|
|
'email' => $post['email'],
|
|
|
|
'idsede' => $post['idsede'],
|
|
|
|
]);
|
|
|
|
$id_record = $dbo->lastInsertedID();
|
|
|
|
|
|
|
|
$_SESSION['infos'][] = tr('Aggiunto nuovo referente!');
|
2017-09-18 16:55:19 +02:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'updatereferente':
|
2018-02-15 17:30:42 +01:00
|
|
|
$dbo->update('an_referenti', [
|
|
|
|
'idanagrafica' => $id_parent,
|
|
|
|
'nome' => $post['nome'],
|
|
|
|
'mansione' => $post['mansione'],
|
|
|
|
'telefono' => $post['telefono'],
|
|
|
|
'email' => $post['email'],
|
|
|
|
'idsede' => $post['idsede'],
|
|
|
|
], ['id' => $id_record]);
|
2017-09-18 16:55:19 +02:00
|
|
|
|
|
|
|
$_SESSION['infos'][] = tr('Salvataggio completato!');
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'deletereferente':
|
2018-02-15 17:30:42 +01:00
|
|
|
$dbo->query('DELETE FROM `an_referenti` WHERE `id`='.prepare($id_record));
|
2017-09-18 16:55:19 +02:00
|
|
|
|
|
|
|
$_SESSION['infos'][] = tr('Referente eliminato!');
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|