Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
54 righe
1.4 KiB
54 righe
1.4 KiB
<?php |
|
|
|
$mode = $_REQUEST['action']; |
|
switch ($mode) { |
|
case 'searchAeroporto': |
|
$term = Utils::getFromReq("searchTerm", ""); |
|
searchAeroporto($term); |
|
break; |
|
case 'searchAeroportoRitorno': |
|
$term = Utils::getFromReq("searchTerm", ""); |
|
searchAeroportoRitorno($term); |
|
break; |
|
case 'list_partenza': |
|
list_partenza(); |
|
break; |
|
case 'list_ritorno': |
|
list_ritorno(); |
|
break; |
|
case 'searchCompagnie': |
|
$term = Utils::getFromReq("searchTerm", ""); |
|
searchAeroportoCompagnie($term); |
|
break; |
|
|
|
} |
|
|
|
function list_partenza(){ |
|
$rows = Aeroporti::ListAeroporti(); |
|
exit(json_encode($rows)); |
|
} |
|
|
|
|
|
function list_ritorno(){ |
|
$andata = $_POST['codice_andata']; |
|
$rows = Aeroporti::ListDestinazione($andata); |
|
exit(json_encode($rows)); |
|
} |
|
|
|
function searchAeroporto($term) { |
|
|
|
$return = Aeroporti::autocomplete($term); |
|
exit(html_entity_decode(json_encode($return))); |
|
} |
|
function searchAeroportoRitorno($term) { |
|
$codice = Utils::getFromReq("codice", ""); |
|
$return = Aeroporti::autocompleteRitorno($term, $codice); |
|
exit(html_entity_decode(json_encode($return))); |
|
} |
|
|
|
function searchAeroportoCompagnie($term) { |
|
$partenza = Utils::getFromReq("partenza", ""); |
|
$destinazione = Utils::getFromReq("destinazione", ""); |
|
$return = AnagraficaCompagnie::autocomplete($term, $partenza, $destinazione); |
|
exit(html_entity_decode(json_encode($return))); |
|
} |