Esempio n. 1
0
        $tour['destination_dom'] = $destiantion_dom;
        $tour['currency'] = $currency;
        $tour['status'] = $status;
        $tours[$row['id']] = $tour;
    }
    $response = json_encode($tours);
} else {
    if (isset($_POST['tour_id']) && isset($_POST['department'])) {
        //tour id
        $tour_id = $_POST['tour_id'];
        //tour
        $tour = new Tour();
        //fill field
        $tour->retrieve($tour_id);
        ///get program line
        $result = $tour->get_tour_program_lines($tour_id);
        $lines = array();
        $allCountries = Country::get_list_countries($tour->deparment);
        while ($row = $db->fetchByAssoc($result)) {
            $line = array();
            $programs = array();
            $selectedKey = array();
            //countries
            $countries = explode(',', $row['countries']);
            //countries -> html select
            $list_countries = get_select_options_with_id($allCountries, $countries);
            //areas
            $allAreas = Tour::get_list_areas_by_countries($countries, 1);
            //paser base64 string -> json string -> array
            $areas = explode(',', $row['areas']);
            $list_areas = "<option value=''>--None--</option>";