Exemple #1
0
}
if ($user_data['return-date']) {
    $user_data['return-date'] = date($fmt, strtotime($user_data['return-date']));
}
if ($action == 'airport_lookup' || $action == 'search') {
    $Airports = new Airports();
    // manually selected overrides
    if (@$_REQUEST['selected-from-airport'] && $_REQUEST['selected-from-airport'] != 'none') {
        $_REQUEST['from-airport'] = $_REQUEST['selected-from-airport'];
    }
    if (@$_REQUEST['selected-to-airport'] && $_REQUEST['selected-to-airport'] != 'none') {
        $_REQUEST['to-airport'] = $_REQUEST['selected-to-airport'];
    }
    if (@$_REQUEST['from-airport']) {
        $user_data['from-airport'] = $_REQUEST['from-airport'];
        $from_airports = $Airports->find($_REQUEST['from-airport']);
        if (count($from_airports) == 1) {
            $user_data['from-airport'] = $from_airports[0]['title'];
        }
    }
    if (@$_REQUEST['to-airport']) {
        $user_data['to-airport'] = $_REQUEST['to-airport'];
        $to_airports = $Airports->find($_REQUEST['to-airport']);
        if (count($to_airports) == 1) {
            $user_data['to-airport'] = $to_airports[0]['title'];
        }
    }
}
/**
 * Main rendering of the HTML is done here, split in to sections
 */