本文整理汇总了PHP中Region::getRegionName方法的典型用法代码示例。如果您正苦于以下问题:PHP Region::getRegionName方法的具体用法?PHP Region::getRegionName怎么用?PHP Region::getRegionName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Region
的用法示例。
在下文中一共展示了Region::getRegionName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: encoder_redirect_success
function encoder_redirect_success(Region $new_region)
{
$new_region_name = $new_region->getRegionName();
$dir = "VIEW/html/Encoder/Add_Place/Add_Place_Region_inc.php?success=1&Region_Name={$new_region_name}";
$url = BASE_URL . $dir;
header("Location:{$url}");
//redirect the encoder to the regions add place
exit;
}
示例3: insertRandomRow
public function insertRandomRow()
{
/* generate the field values */
/* first generate the random values, then add them to query */
$workTypeId = rand(1, WorkType::getRowsNumber());
$districtId = rand(1, District::getRowsNumber());
$jobSubCategoryId = rand(1, JobSubCategory::getRowsNumber());
$salaryLow = rand(20, 200) * 1000;
$salaryRange = rand(5, 30) * 1000;
$daysOffset = -60 + rand(1, 90);
$startDate = strtotime(sprintf("%+d", $daysOffset) . " day");
$endDate = strtotime(sprintf("%+d", $daysOffset + 30) . " day");
/* Processing this information */
$workType = WorkType::getWorkTypeName(WorkType::getWorkType($workTypeId));
$district = District::getDistrict($districtId);
$districtName = District::getDistrictName($district);
$regionName = Region::getRegionName(Region::getRegion(District::getRegionId($district)));
$jobSubCategory = JobSubCategory::getJobSubCategory($jobSubCategoryId);
$jobSubCategoryName = JobSubCategory::getJobSubCategoryName($jobSubCategory);
$jobCategoryId = JobSubCategory::getJobCategoryId($jobSubCategory);
$jobCategoryName = JobCategory::getJobCategoryName(JobCategory::getJobCategory($jobCategoryId));
$salaryHigh = $salaryLow + $salaryRange;
$jobTitle = "Job in {$regionName}";
$jobDescription = "{$jobSubCategoryName} " . strtolower($workType) . " job in {$districtName}, {$regionName}, in the domain of {$jobCategoryName}, salary from \${$salaryLow} to \${$salaryHigh}.\n";
$jobDescription .= "Posted on " . date("D, jS \\of F, Y", $startDate) . ", valid until " . date("D, jS \\of F, Y", $endDate);
/* Now build the query with the values generated above */
/* job_id */
$values = "NULL";
//AUTO_INCREMENT field
/* job_title */
$values .= ", '{$jobTitle}'";
/* job_description */
$values .= ", '{$jobDescription}'";
/* work_type_id */
$values .= ", '{$workTypeId}'";
/* district_id */
$values .= ", '{$districtId}'";
/* subcategory_id */
$values .= ", '{$jobSubCategoryId}'";
/* salary_low */
$values .= ", '{$salaryLow}'";
/* SalaryHihg */
$values .= ", '{$salaryHigh}'";
/* start_ad_date */
/* format: '2013-05-14 00:00:00' */
$values .= ", '" . date("Y-m-d 00:00:00", $startDate) . "'";
/* end_ad_date */
$values .= ", '" . date("Y-m-d 00:00:00", $endDate) . "'";
/* Build the query */
$query = Job::insertRowQuery($values);
return $query;
}
示例4: region
/**
* @param Region $region
* @return bool
* this function will add the region to the data base
* takes region parameter
*/
function Add_Region(Region $region)
{
$Region_Name = $region->getRegionName();
$Region_Name_Amharic = $region->getRegionNameAmharic();
//add the region to the region database
$query = "INSERT INTO region (Name,Name_Amharic) VALUES('{$Region_Name}','{$Region_Name_Amharic}')";
$result = mysqli_query($this->getDbc(), $query);
if ($result) {
return TRUE;
} else {
return FALSE;
}
}
示例5: getRegion
public static function getRegion($job)
{
/* job -> DistrictId => District row -> RegionId => Region row -> region_name */
/* -> is array access; => is query access */
return Region::getRegionName(Region::getRegion(District::getRegionId(District::getDistrict(self::getDistrictId($job)))));
}
示例6:
function Edit_Region(Region $region, $Region_ID)
{
$Name = $region->getRegionName();
$Name_Amharic = $region->getRegionNameAmharic();
$query = "UPDATE Region set Name='{$Name}',Name_Amharic='{$Name_Amharic}' where ID='{$Region_ID}'";
$result = mysqli_query($this->getDbc(), $query);
//if the company is deleted return true
if ($result) {
return TRUE;
} else {
return FALSE;
}
}