<body>
<?php 
include_once "subsystem/funzioni.php";
include_once "subsystem/facadeAccount.php";
include_once "subsystem/facadeTrattative.php";
if (isset($_GET['action'])) {
    if ($_GET['action'] == 'Registra') {
        $f = new FacadeGestioneAccount();
        $cod = $_GET['codiceFiscale'];
        $nome = $_GET['nome'];
        $data = $_GET['data'];
        $email = $_GET['email'];
        $telefono = $_GET['telefono'];
        $username = $_GET['username'];
        $password = $_GET['password'];
        if ($f->registraAgente($cod, $nome, $data, $email, $telefono, $username, $password) == null) {
            echo "<script type='text/javascript'>alert('Registrazione non riuscita');window.location.replace('indexAmministratore.php');</script>";
        } else {
            echo "<script type='text/javascript'>alert('Registrazione avvenuta con successo');window.location.replace('indexAmministratore.php');</script>";
        }
    } else {
        if ($_GET['action'] == 'modifica') {
            formModificaUtente($_GET['cod']);
        } else {
            if ($_GET['action'] == 'conferma') {
                $f = new FacadeGestioneAccount();
                if (isset($_SESSION['modificaUtente'])) {
                    $cod = $_SESSION['modificaUtente'];
                }
                $cod2 = $_GET['codiceFiscale'];
                $nome = $_GET['nome'];