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


PHP country::getCountryByCityId方法代碼示例

本文整理匯總了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'] = 'Валюта не определена';
//.........這裏部分代碼省略.........
開發者ID:kapai69,項目名稱:fl-ru-damp,代碼行數:101,代碼來源:step_employer.php


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