当前位置: 首页>>代码示例>>PHP>>正文


PHP Region::getRegionId方法代码示例

本文整理汇总了PHP中Region::getRegionId方法的典型用法代码示例。如果您正苦于以下问题:PHP Region::getRegionId方法的具体用法?PHP Region::getRegionId怎么用?PHP Region::getRegionId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Region的用法示例。


在下文中一共展示了Region::getRegionId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fieldRegion

 protected function fieldRegion($jsAction = "")
 {
     $output = "";
     $allRegions = Region::getAllRows();
     echo "HERE";
     $output .= "<select name=\"" . static::regionIdFieldName . "\" {$jsAction}>\n";
     /* The following logic will determine the selected option */
     /* Chose a do...while() in order to avoid code duplication for the 'selected' option logic */
     $regionId = static::anyRegionCode;
     $regionName = "Any region";
     $firstRow = true;
     do {
         if (!$firstRow) {
             $regionId = Region::getRegionId($row);
             $regionName = Region::getRegionName($row);
         } else {
             $firstRow = false;
         }
         if ($this->searchedRegionId == $regionId) {
             $selected = "selected";
         } else {
             $selected = "";
         }
         /* here is the actual option output */
         $output .= " <option {$selected} value =\"{$regionId}\">{$regionName}</option>\n";
     } while (($row = $allRegions->fetch_row()) != NULL);
     $output .= "</select>\n";
     return $output;
 }
开发者ID:preeti07,项目名称:GetTheJob,代码行数:29,代码来源:jobQuickSearchForm.php

示例2: jsDistrictUpdate

 protected function jsDistrictUpdate()
 {
     $output = "";
     /* create the region <-> district connection */
     $output .= "var districtNames = new Array();\n";
     $output .= "var districtIds = new Array();\n";
     $output .= "districtNames[" . static::anyRegionCode . "] = [\"Select region first\"];\n";
     $output .= "districtIds[" . static::anyRegionCode . "] = [\"" . static::anyDistrictCode . "\"];\n";
     $regionList = Region::getAllRows();
     $regionCount = 0;
     while (($region = $regionList->fetch_row()) != NULL) {
         $regionId = Region::getRegionId($region);
         $districtList = District::getDistrictList($regionId);
         /* first the district names */
         $output .= "districtNames[{$regionId}] = [\"Any district\"";
         while (($district = $districtList->fetch_row()) != NULL) {
             $output .= ", \"" . District::getDistrictName($district) . "\"";
         }
         $output .= "];\n";
         /* then the district Ids */
         $output .= "districtIds[{$regionId}] = [\"" . static::anyDistrictCode . "\"";
         $districtList->data_seek(0);
         while (($district = $districtList->fetch_row()) != NULL) {
             $output .= ", \"" . District::getDistrictId($district) . "\"";
         }
         $output .= "];\n";
     }
     /* print the districtUpdate() function */
     /* the below code is JavaScript */
     $output .= "\n";
     $output .= "districtList = document." . static::formName . "." . static::districtIdFieldName . ";\n";
     $output .= "function districtUpdate(selectedRegionId){\n";
     $output .= " districtList.options.length = 0;\n";
     $output .= " for (i=0; i < districtNames[selectedRegionId].length; i++) {\n";
     $output .= "      districtList.options[districtList.options.length] = new Option(districtNames[selectedRegionId][i],districtIds[selectedRegionId][i]);\n";
     $output .= " }\n";
     $output .= "}\n";
     return $output;
 }
开发者ID:preeti07,项目名称:GetTheJob,代码行数:39,代码来源:jobAdvancedSearchForm.php


注:本文中的Region::getRegionId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。