コード例 #1
0
ファイル: Ajax.php プロジェクト: sysraj86/carnivalcrm
             }
             $response = json_encode($synced);
         } else {
             return false;
         }
     }
 } else {
     if ($action == "get_tour_num") {
         $response = Tour::get_tour_num();
     } else {
         if ($action == "get_destination_by_area") {
             if (isset($_POST['area'])) {
                 $area_id = $_POST['area'];
                 $department = $_POST['department'];
                 $country_id = $_POST['country_id'];
                 $destinations = Destination::getDestinationsByArea($country_id, $area_id, $department);
                 $response = get_select_options_with_id($destinations, '');
             }
         } else {
             if ($action == "get_cities_by_areas") {
                 if (isset($_POST['areas'])) {
                     $areas = $_POST['areas'];
                     $areas = explode("|", $areas);
                     $countries = explode(",", $_POST['country']);
                     $countries = implode("','", $countries);
                     $cities = array();
                     $query = "SELECT \r\n                    D.* \r\n                    FROM\r\n                    destinations D \r\n                    JOIN c_areas_destinations_c AD \r\n                    ON D.ID = AD.c_areas_de577anations_idb \r\n                    JOIN c_areas A \r\n                    ON A.ID = AD.c_areas_de9d4fc_areas_ida \r\n                    JOIN countries_destinations_c cd \r\n                    ON cd.countries_bc13nations_idb = D.id\r\n                    JOIN countries c \r\n                    ON c.id = cd.countries_5a12untries_ida\r\n                    WHERE (1!=1 ";
                     foreach ($areas as $id) {
                         $query .= " or A.id = '{$id}'";
                     }
                     $query .= ') and cd.deleted =0 and c.deleted =0 and D.deleted = 0 and AD.deleted=0 and A.deleted = 0 ';
コード例 #2
0
ファイル: EditView.php プロジェクト: sysraj86/carnivalcrm
    } */
$country_id = '';
if (count($areas) > 0) {
    $area_options .= '<option value ="">none</option>';
    foreach ($areas as $row) {
        if ($row['id'] == $focus->area && $row['country_id'] == $focus->country_id) {
            $area_options .= "<option  selected='selected' data-code='" . $row['code'] . "' data-country='" . $row['country_id'] . "' value='" . $row['id'] . "' >" . $row['name'] . '-' . $row['country'] . "</option>";
        } else {
            $area_options .= "<option  data-code='" . $row['code'] . "' data-country='" . $row['country_id'] . "' value='" . $row['id'] . "' >" . $row['name'] . '-' . $row['country'] . "</option>";
        }
        $area_pattern .= $area_pattern == "" ? "" : "|";
        $area_pattern .= $row['code'];
    }
}
$destination = Destination::getDestinationsByArea($focus->country_id, $focus->area, $focus->deparment);
if (!empty($focus->noiden)) {
    $noiden = explode('^,^', $focus->noiden);
    $ss->assign('DESTINATIONS', get_select_options_with_id($destination, $noiden));
} else {
    $ss->assign('DESTINATIONS', '<option data-code="" value="">--None--</option>');
}
$ss->assign("TOUR_AREA", $area_options);
//$ss->assign("TOUR_AREA", get_select_options_with_id($app_list_strings['destination_region_dom'],$focus->area));
// custom
if ($focus->tour_code) {
    // $tour_code_area = substr($focus->tour_code, 0, 5);
    if (preg_match('/^(' . $frame_types_pattern . ')(' . $area_pattern . ')(\\d+)(\\/)(\\w+)-(\\d+)$/', $focus->tour_code, $matches)) {
        $tour_frame_type = $matches[1];
        $tour_code_area = $matches[2];
        $tour_code_num = $matches[3];