本文整理汇总了PHP中Countries::GetAllCountries方法的典型用法代码示例。如果您正苦于以下问题:PHP Countries::GetAllCountries方法的具体用法?PHP Countries::GetAllCountries怎么用?PHP Countries::GetAllCountries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Countries
的用法示例。
在下文中一共展示了Countries::GetAllCountries方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
//.........这里部分代码省略.........
$this->params['plan2_listings'] = prepare_input($_POST['plan2_listings']);
}
if (isset($_POST['plan3_listings'])) {
$this->params['plan3_listings'] = prepare_input($_POST['plan3_listings']);
}
if (isset($_POST['plan4_listings'])) {
$this->params['plan4_listings'] = prepare_input($_POST['plan4_listings']);
}
$rid = MicroGrid::GetParameter('rid');
$action = MicroGrid::GetParameter('action');
$this->email_notifications = '';
$this->user_password = '';
$this->allow_adding_by_admin = ModulesSettings::Get('customers', 'allow_adding_by_admin');
$this->allow_changing_password = ModulesSettings::Get('customers', 'password_changing_by_admin');
$this->reg_confirmation = ModulesSettings::Get('customers', 'reg_confirmation');
$allow_adding = $this->allow_adding_by_admin == 'yes' ? true : false;
$this->primaryKey = 'id';
$this->tableName = TABLE_CUSTOMERS;
$this->dataSet = array();
$this->error = '';
///$this->languageId = (isset($_REQUEST['language_id']) && $_REQUEST['language_id'] != '') ? $_REQUEST['language_id'] : Languages::GetDefaultLang();
$this->formActionURL = 'index.php?admin=mod_customers_management';
$this->actions = array('add' => $allow_adding, 'edit' => true, 'details' => true, 'delete' => true);
$this->actionIcons = true;
$this->allowRefresh = true;
$this->allowTopButtons = true;
$this->allowLanguages = false;
$this->WHERE_CLAUSE = '';
$this->ORDER_CLAUSE = 'ORDER BY id DESC';
$this->isAlterColorsAllowed = true;
$this->isPagingAllowed = true;
$this->pageSize = 20;
$this->isSortingAllowed = true;
$total_countries = Countries::GetAllCountries('priority_order DESC, name ASC');
$arr_countries = array();
foreach ($total_countries[0] as $key => $val) {
$arr_countries[$val['abbrv']] = $val['name'];
}
// prepare plans array
$total_plans = AdvertisePlans::GetAllPlans();
$arr_plans = array();
foreach ($total_plans[0] as $key => $val) {
$arr_plans[$val['id']] = $val['plan_name'];
}
// prepare groups array
$total_groups = CustomerGroups::GetAllGroups();
$arr_groups = array();
foreach ($total_groups[0] as $key => $val) {
$arr_groups[$val['id']] = $val['name'];
}
// prepare languages array
$total_languages = Languages::GetAllActive();
$arr_languages = array();
foreach ($total_languages[0] as $key => $val) {
$arr_languages[$val['abbreviation']] = $val['lang_name'];
}
$this->isFilteringAllowed = true;
// define filtering fields
$this->arrFilteringFields = array(_FIRST_NAME => array('table' => 'c', 'field' => 'first_name', 'type' => 'text', 'sign' => 'like%', 'width' => '80px'), _LAST_NAME => array('table' => 'c', 'field' => 'last_name', 'type' => 'text', 'sign' => 'like%', 'width' => '80px'), _EMAIL => array('table' => 'c', 'field' => 'email', 'type' => 'text', 'sign' => 'like%', 'width' => '90px'), _ACTIVE => array('table' => 'c', 'field' => 'is_active', 'type' => 'dropdownlist', 'source' => array('0' => _NO, '1' => _YES), 'sign' => '=', 'width' => '85px'), _GROUP => array('table' => 'c', 'field' => 'group_id', 'type' => 'dropdownlist', 'source' => $arr_groups, 'sign' => '=', 'width' => '85px'));
$customer_ip = get_current_ip();
$datetime_format = get_datetime_format();
$date_format_view = get_date_format('view');
$date_format_edit = get_date_format('edit');
$default_plan_info = AdvertisePlans::GetDefaultPlanInfo();
$default_plan_id = isset($default_plan_info['id']) ? (int) $default_plan_info['id'] : 0;
$default_plan_lc = isset($default_plan_info['listings_count']) ? (int) $default_plan_info['listings_count'] : 0;
示例2: DrawAllCountries
/**
* Draw all languages array
* @param $tag_name
* @param $selected_value
* @param $select_default
* @param $draw
*/
public static function DrawAllCountries($tag_name = 'b_country', $selected_value = '', $select_default = true, $draw = true)
{
$output = '<select name="' . $tag_name . '" id="' . $tag_name . '">';
$output .= '<option value="">-- ' . _SELECT . ' --</option>';
$countries = Countries::GetAllCountries('priority_order DESC, name ASC');
for ($i = 0; $i < $countries[1]; $i++) {
if ($select_default && $countries[0][$i]['is_default'] && empty($selected_value)) {
$selected_state = 'selected="selected"';
} else {
if ($selected_value == $countries[0][$i]['abbrv']) {
$selected_state = 'selected="selected"';
} else {
$selected_state = '';
}
}
$output .= '<option ' . $selected_state . ' value="' . $countries[0][$i]['abbrv'] . '">' . $countries[0][$i]['name'] . '</option>';
}
$output .= '</select>';
if ($draw) {
echo $output;
} else {
return $output;
}
}
示例3: DrawAdvancedSearch
/**
* Draws advanced search form
* @param $draw
*/
public static function DrawAdvancedSearch($draw = true)
{
$keyword = isset($_POST['keyword']) ? trim(prepare_input($_POST['keyword'])) : '';
$keyword = str_replace('"', '"', $keyword);
$keyword = str_replace("'", ''', $keyword);
$search_in = Application::Get('search_in');
$sel_categories = isset($_POST['sel_categories']) ? (int) $_POST['sel_categories'] : '';
$sel_listings_locations = isset($_POST['sel_listings_locations']) ? prepare_input($_POST['sel_listings_locations']) : '';
$sel_listings_sub_locations = isset($_POST['sel_listings_sub_locations']) ? prepare_input($_POST['sel_listings_sub_locations']) : '';
$sel_view = isset($_POST['sel_view']) ? prepare_input($_POST['sel_view']) : '';
$sel_sortby = isset($_POST['sel_sortby']) ? prepare_input($_POST['sel_sortby']) : '';
$sel_orderby = isset($_POST['sel_orderby']) ? prepare_input($_POST['sel_orderby']) : '';
$chk_with_images = isset($_POST['chk_with_images']) ? prepare_input($_POST['chk_with_images']) : '';
// prepare categories array
$objCategories = Categories::Instance();
$total_categories = $objCategories->GetAllExistingCategories();
$total_countries = Countries::GetAllCountries('priority_order DESC, name ASC');
$output = '<form style="margin:10px" id="frmAdvSearch" name="frmAdvSearch" action="index.php?page=search_advanced" method="post">
' . draw_hidden_field('task', 'advanced_search', false) . '
' . draw_hidden_field('p', '1', false) . '
' . draw_hidden_field('search_in', 'listings') . '
' . draw_token_field(false) . '
<input type="text" name="keyword" value="' . $keyword . '" placeholder="' . _SEARCH_KEYWORDS . '...">
<span>' . _IN . '</span>
<select name="sel_categories">';
$output .= '<option value="">-- ' . _ALL . ' --</option>';
foreach ($total_categories as $key => $val) {
if ($val['level'] == '1') {
$category_name = $val['name'];
} else {
if ($val['level'] == '2') {
$category_name = ' • ' . $val['name'];
} else {
if ($val['level'] == '3') {
$category_name = ' :: ' . $val['name'];
}
}
}
$output .= '<option ' . ($sel_categories == $val['id'] ? 'selected="selected"' : '') . ' value="' . $val['id'] . '">' . $category_name . '</option>';
}
$output .= '</select> ';
$output .= ListingsLocations::DrawAllLocations(array('tag_name' => 'sel_listings_locations', 'selected_value' => $sel_listings_locations, 'javascript_event' => 'onchange="jQuery(\'#frmAdvSearch\').submit();"'), false) . ' ';
$output .= ListingsSubLocations::DrawAllSubLocations($sel_listings_locations, array('tag_name' => 'sel_listings_sub_locations', 'selected_value' => $sel_listings_sub_locations), false);
$output .= '<span style="float:right;">
<input value="' . _SEARCH . '" class="form_button" type="submit">
</span>
<div style="padding-top:4px;margin-left:-3px;">
<table><tbody><tr>
<td>' . _VIEW . ':
<select name="sel_view">
<option value="0" ' . ($sel_view == '0' ? ' selected="selected"' : '') . '>-- ' . _ALL . ' --</option>
<option value="1" ' . ($sel_view == '1' ? ' selected="selected"' : '') . '>' . _TODAY . '</option>
<option value="2" ' . ($sel_view == '2' ? ' selected="selected"' : '') . '>' . _YESTERDAY . '</option>
<option value="3" ' . ($sel_view == '3' ? ' selected="selected"' : '') . '>' . _LAST_7_DAYS . '</option>
</select>
</td>
<td>' . _SORT_BY . ':
<select name="sel_sortby">
<option value="0" ' . ($sel_sortby == '0' ? ' selected="selected"' : '') . '>' . _DATE . '</option>
<option value="1" ' . ($sel_sortby == '1' ? ' selected="selected"' : '') . '>' . _VIEW . '</option>
</select>
</td>
<td>' . _ORDER_BY . ':
<select name="sel_orderby">
<option value="ASC" ' . ($sel_orderby == 'ASC' ? ' selected="selected"' : '') . '>' . _ASCENDING . '</option>
<option value="DESC" ' . ($sel_orderby == 'DESC' ? ' selected="selected"' : '') . '>' . _DESCENDING . '</option>
</select>
</td>
<td style="padding-top:4px;"><input name="chk_with_images" type="checkbox" ' . ($chk_with_images == '1' ? ' checked="checked"' : '') . ' value="1">' . _WITH_IMAGES_ONLY . '</td>
</tr>
</tbody>
</table>
</div>
</form>';
if ($draw) {
echo $output;
} else {
return $output;
}
}