/** * * @param type $Ids chiave per accedere alla tupla * @return type json di un array di supermercati */ function RicercaPerIds($Ids) { header('Content-Type: application/json; charset=UTF-8'); $SupermercatoDAO = new FSupermercato(); $SupTrovato = $SupermercatoDAO->RicercaPerIds($Ids); $Indirizzo = new Indirizzo($SupTrovato[0]["Via"], $SupTrovato[0]["Citta"], $SupTrovato[0]["Civico"]); $Supermercato = new Supermercato($SupTrovato[0]["Nome"], $Indirizzo, $SupTrovato[0]["Ids"]); $SupString = $Supermercato->getAsArray(); return $SupString; }
function RicercaMarket() { $SupermercatoDAO = new FSupermercato(); $numeroSup = $SupermercatoDAO->ContaSupermercati(); $numeroSup = $numeroSup[0][0]; $CSupermercato = new CRicercaSupermercato(); $ArraySup = array(); for ($i = 1; $i <= $numeroSup; $i++) { $j = "S0000" . $i; $ArraySup[] = $CSupermercato->RicercaPerIds($j); } $json = json_encode($ArraySup); return $json; }