GetNumCountries() public static method

public static GetNumCountries ( $p_languageId = null, $p_code = null, $p_name = null )
Beispiel #1
0
require_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/country/country_common.php";
require_once $GLOBALS['g_campsiteDir'] . "/classes/SimplePager.php";
camp_load_translation_strings("api");
if (!$g_user->hasPermission('ManageCountries') && !$g_user->hasPermission('DeleteCountries')) {
    camp_html_goto_page("/{$ADMIN}/");
}
$f_country_language_selected = camp_session_get('f_country_language_selected', '');
$f_country_offset = camp_session_get('f_country_offset', 0);
if (empty($f_country_language_selected)) {
    $f_country_language_selected = null;
}
$ItemsPerPage = 20;
$languages = Language::GetLanguages(null, null, null, array(), array(), true);
$countries = Country::GetCountries($f_country_language_selected, null, null, array("LIMIT" => array("START" => $f_country_offset, "MAX_ROWS" => $ItemsPerPage)));
$numCountries = Country::GetNumCountries($f_country_language_selected);
$pager = new SimplePager($numCountries, $ItemsPerPage, "f_country_offset", "index.php?");
$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Countries"), "");
echo camp_html_breadcrumbs($crumbs);
?>

<P>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="3" class="action_buttons">
<?php 
if ($g_user->hasPermission("ManageCountries")) {
    ?>
<TR>
	<TD>
		<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1">
Beispiel #2
0
?>
:</TD>
	<TD>
	<INPUT TYPE="TEXT" class="input_text" NAME="f_country_name" SIZE="32" >
	</TD>
</TR>
<TR>
	<TD ALIGN="RIGHT" ><?php 
echo $translator->trans("Language");
?>
:</TD>
	<TD>
		<SELECT NAME="f_country_new_language" class="input_select">
		<?php 
foreach ($languages as $language) {
    $num = Country::GetNumCountries($language->getLanguageId(), $f_country_code);
    if ($num == 0) {
        ?>
				<OPTION VALUE="<?php 
        p($language->getLanguageId());
        ?>
"><?php 
        p(htmlspecialchars($language->getNativeName()));
        ?>
				<?php 
    }
}
?>
		</SELECT>
	</TD>
</TR>