本文整理汇总了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;
}
示例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);