/**
 * nv_location_make_string()
 *
 * @param int $provinceid            
 * @param int $districtid            
 * @param int $wardid            
 * @return
 *
 */
function nv_location_make_string($provinceid = 0, $districtid = 0, $wardid = 0)
{
    global $db, $db_config, $site_mods, $location_array_config;
    $string = array();
    if (!empty($wardid)) {
        $ward_info = nv_location_get_ward_info($wardid);
        $string[] = $ward_info['title'];
    }
    if (!empty($districtid)) {
        $district_info = nv_location_get_district_info($districtid);
        $string[] = $district_info['title'];
    }
    if (!empty($provinceid)) {
        $province_info = nv_location_get_province_info($provinceid);
        $string[] = $province_info['title'];
    }
    return implode(', ', $string);
}
Пример #2
0
        $nv_Cache->delMod($module_name);
        Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&provinceid=' . $provinceid . '&districtid=' . $districtid);
        die;
    }
}
$row = array();
$error = array();
$row['wardid'] = $nv_Request->get_int('wardid', 'post,get', 0);
$row['provinceid'] = $nv_Request->get_int('provinceid', 'post,get', 0);
$row['districtid'] = $nv_Request->get_int('districtid', 'post,get', 0);
$array_district = nv_location_get_district($row['provinceid']);
if (!isset($array_district[$row['districtid']])) {
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=province');
    die;
}
$province_info = nv_location_get_province_info($row['provinceid']);
$row['countryid'] = $province_info['countryid'];
$array_country = nv_location_get_country();
if (!isset($array_country[$row['countryid']])) {
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=country');
    die;
}
$array_province = nv_location_get_province($row['countryid']);
if (!isset($array_province[$row['provinceid']])) {
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=province');
    die;
}
if ($nv_Request->isset_request('submit', 'post')) {
    $row['code'] = $nv_Request->get_title('code', 'post,get', '');
    $row['districtid'] = $nv_Request->get_int('districtid', 'post,get', 0);
    $row['title'] = $nv_Request->get_title('title', 'post', '');