function mostraClienti() { $f = new FacadeGestioneAccount(); $stringa = ""; $clienti = array(); if ($_SESSION['tipo'] == 'agente') { $view = file_get_contents('indexAgente.html'); $clienti = $f->getUtenti(); $stringa = "<form method='GET' action='indexAgente.php'>"; } else { $view = file_get_contents('indexAmministratore.html'); $clienti = $f->getAgenti(); $stringa = "<form method='GET' action='indexAmministratore.php'>"; } if ($clienti != null) { foreach ($clienti as $value) { $id = $value->getCodice(); $stringa = $stringa . "<div>Nome: " . $value->getNome() . "<br>CF: " . $value->getCodice() . "<br><button type='submit' name='cf'value='{$id}'>Visualizza</button></div>" . "<br><br>"; } } $stringa = $stringa . "</div></form>"; $view_xhtml_valorizzata = str_replace('{CATALOGO}', $stringa, $view); echo $view_xhtml_valorizzata; }