當前位置: 首頁>>代碼示例>>PHP>>正文


PHP country::GetCountriesByCountUser方法代碼示例

本文整理匯總了PHP中country::GetCountriesByCountUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP country::GetCountriesByCountUser方法的具體用法?PHP country::GetCountriesByCountUser怎麽用?PHP country::GetCountriesByCountUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在country的用法示例。


在下文中一共展示了country::GetCountriesByCountUser方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processRequest


//.........這裏部分代碼省略.........
                 $membuf->add($memkey, $result, $expire);
             }
             return json_encode($result);
         case 'getprofessions':
             $n = __paramInit('integer', '', 'id');
             if ($n !== false) {
                 $membuf = new memBuff();
                 $memkey = "b-combo-getprofbygroup{$n}";
                 $result = $membuf->get($memkey);
                 if (!$result) {
                     $rows = professions::GetProfs($n);
                     $result = array(0 => iconv('WINDOWS-1251', 'UTF-8//IGNORE', 'Все специальности'));
                     foreach ($rows as $k => $i) {
                         $result[$i['id']] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['name']);
                     }
                     $membuf->add($memkey, $result, $expire);
                 }
                 $data = array(array('parentId' => "{$n}"), $result);
                 return json_encode($data);
             }
         case 'get_pro_types':
             $membuf = new memBuff();
             $memkey = 'b-combo-get_pro_type';
             $result = $membuf->get($memkey);
             if (!$result) {
                 $rows = op_codes::getCodes(array(47, 48, 49, 50, 51));
                 $result = array();
                 foreach ($rows as $k => $i) {
                     $result[$i['id']] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['op_name']);
                 }
                 $result[76] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', 'На несколько недель');
                 $membuf->add($memkey, $result, $expire);
             }
             return json_encode($result);
         case 'getcountries':
         case 'getrelevantcountries':
             $membuf = new memBuff();
             $memkey = 'b-combo-getcountriesr';
             $result = $membuf->get($memkey);
             if (!$result) {
                 $rows = country::GetCountriesByCountUser();
                 $result = array();
                 foreach ($rows as $k => $i) {
                     $result[$i['id']] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i['name']);
                 }
                 $membuf->add($memkey, $result, $expire);
             }
             return json_encode($result);
         case 'getcities':
             $n = __paramInit('integer', '', 'id');
             if ($n !== false) {
                 $membuf = new memBuff();
                 $memkey = "b-combo-getcitybycountry{$n}";
                 $result = $membuf->get($memkey);
                 if (!$result) {
                     $rows = city::GetCities($n);
                     $result = array('0' => iconv('WINDOWS-1251', 'UTF-8//IGNORE', 'Все города'));
                     if (is_array($rows)) {
                         foreach ($rows as $k => $i) {
                             $result[$k] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i);
                         }
                     }
                     $membuf->add($memkey, $result, $expire);
                 }
                 $data = array(array('parentId' => "{$n}"), $result);
                 return json_encode($data);
             }
         case 'getcitiesbyid':
             $n = __paramInit('integer', '', 'id');
             if ($n !== false) {
                 $membuf = new memBuff();
                 $memkey = "b-combo-getcitybycountry{$n}";
                 $result = $membuf->get($memkey);
                 if (!$result) {
                     $rows = city::GetCities($n);
                     $result = array('0' => iconv('WINDOWS-1251', 'UTF-8//IGNORE', 'Все города'));
                     foreach ($rows as $k => $i) {
                         $result[$k] = iconv('WINDOWS-1251', 'UTF-8//IGNORE', $i);
                     }
                     $membuf->add($memkey, $result, $expire);
                 }
                 return json_encode($result);
             }
         case 'getuserlistbysbr':
         case 'getuserlistold':
         case 'getuserlist':
             return $this->getUsersList($_POST['word'], (int) $_POST['limit'], (int) $_POST['userType'], (int) $_POST['scope']);
         case 'get_user_info':
             return json_encode(users::GetUserShortInfo((int) $_POST['uid']));
         case 'getusersandcompanies':
             return $this->getUsersAndCompany($_POST['word'], (int) $_POST['limit'], (int) $_POST['userType'], (int) $_POST['scope'], false);
         case 'get_user_or_company_info':
             return $this->getUserOrCompanyRecord();
         case 'getsms':
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/registration.php';
             $registration = new registration();
             $registration->listenerAction(__paramInit('string', null, 'action'));
     }
     return false;
 }
開發者ID:kapai69,項目名稱:fl-ru-damp,代碼行數:101,代碼來源:b_combo_box_request_handler.php

示例2: define

<?php

define('IS_PHP_JS', true);
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stdf.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php';
$membuf = new memBuff();
$memkey = 'b-combo-getcitiesandcountries';
$s = 0;
//$membuf->get($memkey);
if (!$s) {
    $rows = country::GetCountriesByCountUser();
    $result = array(0 => "'0' : 'Все страны'");
    foreach ($rows as $k => $i) {
        $i['name'] = str_replace('"', '"', $i['name']);
        $result[$i['id']] = str_replace("'", "\\'", $i['name']);
    }
    //города России 1
    $rows = city::GetCities(1);
    $cResult = array('0' => "'0' : 'Россия'", 'undefined_value' => "'undefined_value' : 'Все города'");
    foreach ($rows as $k => $i) {
        $i = str_replace('"', '"', $i);
        $i = str_replace("'", "\\'", $i);
        $cResult[$k] = "'{$k}' : '{$i}'";
    }
    $result[1] = $cResult;
    //города Украины 2
    $rows = city::GetCities(2);
    $cResult = array('0' => "'0' : 'Украина'", 'undefined_value' => "'undefined_value' : 'Все города'");
    foreach ($rows as $k => $i) {
        $i = str_replace('"', '"', $i);
開發者ID:kapai69,項目名稱:fl-ru-damp,代碼行數:31,代碼來源:cities_js.php


注:本文中的country::GetCountriesByCountUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。