本文整理汇总了PHP中country::getCountryByCityId方法的典型用法代码示例。如果您正苦于以下问题:PHP country::getCountryByCityId方法的具体用法?PHP country::getCountryByCityId怎么用?PHP country::getCountryByCityId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类country
的用法示例。
在下文中一共展示了country::getCountryByCityId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionProjects
/**
* Обработка информации шага проекты.
*/
public function actionProjects()
{
$prj_id = $_SESSION['view_wizard_project'];
if (!$prj_id) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/attachedfiles.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/project_exrates.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
$prj_exrates = project_exrates::GetAll();
$categories = professions::GetAllGroupsLite();
$professions = professions::GetAllProfessions();
array_group($professions, 'groupid');
$professions[0] = array();
$addedPrc = is_pro() ? 0 : new_projects::PRICE_ADDED;
$colorPrc = new_projects::PRICE_COLOR * ($addedPrc > 0 ? 1 : 0);
$boldPrc = new_projects::PRICE_BOLD + $addedPrc;
$logoPrc = new_projects::PRICE_LOGO + $addedPrc;
$cTopPrice = new_projects::PRICE_CONTEST_TOP1DAY + $addedPrc;
$pTopPrice = new_projects::PRICE_TOP1DAY + $addedPrc;
$action = __paramInit('string', 'action', 'action', null);
$attachedfiles_session = __paramInit('string', 'attachedfiles_session', 'attachedfiles_session', false);
// проверяем есть ли уже созданый проект
$projects = $this->getCreatedProjects();
$existPrjID = count($projects) > 0 ? $projects[0][id] : null;
// выводим ранее сохраненный проект
if ($action != 'create_project' && $existPrjID) {
$data = $projects[0];
list($category, $subcategory) = explode('|', $data['categories']);
$currency_name = $this->CURRENCY_TYPE[$data['currency']];
$priceby_name = $this->PRICEBY_TYPE[$data['priceby']];
$data['pro_only'] = $data['pro_only'] === 't';
$price = $data['payed'];
$option = array();
$option['top'] = $data['top_count'] > 0;
$option['top_count'] = $data['top_count'];
$option['color'] = $data['is_color'] === 't';
$option['bold'] = $data['is_bold'] === 't';
$option['logo'] = $data['logo_id'] > 0;
} elseif ($action == 'create_project') {
// сохраняем новый проект или изменяем старый
$in_office = __paramInit('int', null, 'in_office', 0);
$type = __paramInit('string', null, 'kind');
if ($type == 'contest') {
$data['kind'] = 7;
$data['end_date'] = date('d-m-Y', strtotime(__paramInit('string', null, 'end_date_eng_format', 0)));
$data['win_date'] = date('d-m-Y', strtotime(__paramInit('string', null, 'win_date_eng_format', 0)));
} elseif ($in_office == 1) {
$location = __paramInit('integer', null, 'location_column_id');
if ($location == 1) {
$data['city'] = __paramInit('integer', null, 'location_db_id');
$data['country'] = country::getCountryByCityId($data['city']);
} else {
$data['country'] = __paramInit('integer', null, 'location_db_id');
}
$data['kind'] = 4;
} else {
$data['kind'] = 1;
}
$data['name'] = __paramInit('string', null, 'name');
$data['descr'] = __paramInit('string', null, 'descr');
$category = __paramInit('int', null, 'r_category');
$subcategory = __paramInit('int', null, 'r_subcategory');
$agreement = __paramInit('int', null, 'agreement', 0);
$data['pro_only'] = __paramInit('int', null, 'pro_only', 0) == 1 ? true : false;
if ($agreement != 1) {
$data['cost'] = __paramInit('int', null, 'cost', 0);
$data['priceby'] = __paramInit('int', null, 'r_priceby', 0);
$data['currency'] = __paramInit('int', null, 'r_currency', 0);
$data['budget_type'] = __paramInit('int', null, 'budget_type', 0);
}
if (is_empty_html($data['descr'])) {
$error['descr'] = 'Поле не заполнено';
}
if (is_empty_html($data['name'])) {
$error['name'] = 'Поле не заполнено';
}
// проверяем длину необработанной строки, а иначе спецсимволы считаются как несколько символов
if (strlen(stripslashes($_POST['name'])) > 60) {
$error['name'] = 'Превышен лимит - 60 символов';
}
if (!$category) {
$error['category'] = 'Не выбран раздел';
} elseif ($subcategory) {
$data['categories'] = "{$category}|{$subcategory}";
} else {
$data['categories'] = $category;
}
if ($data['cost'] < 0) {
$error['cost'] = 'Введите положительную сумму';
}
if ($data['cost'] > 999999) {
$error['cost'] = 'Слишком большая сумма';
}
if ($data['cost'] > 0 && ($data['currency'] < 0 || $data['currency'] > 3)) {
$error['currency'] = 'Валюта не определена';
//.........这里部分代码省略.........