Exemplo n.º 1
0
function formModificaUtente($cod)
{
    $f = new FacadeGestioneAccount();
    $view = "";
    $utente = $f->visualizzaCliente($cod);
    $stringa = "";
    if (isset($_SESSION['tipo'])) {
        if ($_SESSION['tipo'] == 'agente') {
            $view = file_get_contents('indexAgente.html');
            $stringa = "<form method='GET' action='indexAgente.php'>";
        }
        if ($_SESSION['tipo'] == 'amministratore') {
            $view = file_get_contents('indexAmministratore.html');
            $stringa = "<form method='GET' action='indexAmministratore.php'>";
        }
    }
    $_SESSION['modificaUtente'] = $cod;
    $nome = $utente->getNome();
    $data = $utente->getDataNascita();
    $originalDate = $data;
    $newDate = date('Y-m-d', strtotime($originalDate));
    $email = $utente->getEmail();
    $telefono = $utente->getTelefono();
    $username = $utente->getUsername();
    $password = $utente->getPassword();
    $stringa = $stringa . "Codice Fiscale: <input type='text' name='codiceFiscale' value='{$cod}'/><br><br>Nome e Cognome: <input type='text' name='nome' value='{$nome}'/><br><br>\n\t\tData Nascita: <input type='date' name='data' value={$newDate} /><br><br>Email: <input type='email' name='email' value='{$email}'><br><br>Telefono: <input type='number' name='telefono' value='{$telefono}'/><br><br>Username: <input type='text' name='username' value='{$username}'/><br><br>Password: <input type='password' name='password' value='passsword'><br><br><button type='submit' name='action' value='conferma'>Conferma</button>";
    $view_xhtml_valorizzata = str_replace('{CATALOGO}', $stringa, $view);
    echo $view_xhtml_valorizzata;
}