function assegnaAgenti() { $f = new FacadeGestioneAccount(); $stringa = "Scegli un Agente:<br><br>"; $agenti = array(); $view = file_get_contents('indexAmministratore.html'); $agenti = $f->getAgenti(); if (isset($_GET['immobile'])) { $id = $_GET['immobile']; } else { $id = $_GET['trattativa']; } if ($agenti != null) { foreach ($agenti as $value) { $cf = $value->getCodice(); if (isset($_GET['immobile'])) { $stringa = $stringa . "<form method='GET' action='indexAmministratore.php'><div>Nome: " . $value->getNome() . "<br>CF: " . $value->getCodice() . "<br><button type='submit' name='action'value='assegnaImmobile'>Assegna</button><input type='hidden' name='agente' value='{$cf}'><input type='hidden' name='oggetto' value='{$id}'></div></form>" . "<br><br>"; } else { $stringa = $stringa . "<form method='GET' action='indexAmministratore.php'><div>Nome: " . $value->getNome() . "<br>CF: " . $value->getCodice() . "<br><button type='submit' name='action'value='assegnaTrattativa'>Assegna</button><input type='hidden' name='agente' value='{$cf}'><input type='hidden' name='oggetto' value='{$id}'></div></form>" . "<br><br>"; } } } // $stringa=$stringa."</div></form>"; $view_xhtml_valorizzata = str_replace('{CATALOGO}', $stringa, $view); echo $view_xhtml_valorizzata; }