Add show all to registrations

This commit is contained in:
Mark Crane
2014-07-04 03:47:32 +00:00
parent 25cdd980fc
commit f88c5fd34c
3 changed files with 22 additions and 4 deletions

View File

@@ -46,6 +46,11 @@
$text['label-response']['pt-pt'] = "Resposta:";
$text['label-response']['fr-fr'] = "Réponse:";
$text['button-show_all']['en-us'] = "Show All";
$text['button-show_all']['es-cl'] = "Mostrar Todos";
$text['button-show_all']['pt-pt'] = "Mostrar Todos";
$text['button-show_all']['fr-fr'] = "Montrer Tout";
$text['button-unregister']['en-us'] = "Unregister";
$text['button-unregister']['es-cl'] = "";
$text['button-unregister']['pt-pt'] = "";

View File

@@ -47,8 +47,9 @@ require_once "resources/check_auth.php";
require_once "resources/header.php";
$page["title"] = $text['header-registrations'];
//retrieve profile, if set
//set the variables
$profile = (isset($_REQUEST['profile']) && $_REQUEST['profile'] != '') ? $_REQUEST['profile'] : "internal";
$show = trim($_REQUEST["show"]);
//ajax for refresh
?>
@@ -88,7 +89,7 @@ require_once "resources/check_auth.php";
}
var requestTime = function() {
var url = 'status_registrations_inc.php?profile=<?php echo $profile; ?>';
var url = 'status_registrations_inc.php?profile=<?php echo $profile; ?>&show=<?php echo $show; ?>';
new loadXmlHttp(url, 'ajax_reponse');
setInterval(function(){new loadXmlHttp(url, 'ajax_reponse');}, 1500);
}

View File

@@ -47,6 +47,7 @@ require_once "resources/check_auth.php";
//request profile
$sip_profile_name = trim($_REQUEST["profile"]);
$show = trim($_REQUEST["show"]);
//define variables
$c = 0;
@@ -108,7 +109,7 @@ require_once "resources/check_auth.php";
//remove unrelated domains
if (count($_SESSION["domains"]) > 1) {
if (permission_exists('registration_all')) {
if (permission_exists('registration_all') && $show == "all") {
//show all registrations
}
else {
@@ -117,6 +118,7 @@ require_once "resources/check_auth.php";
}
}
}
//increment the array id
$x++;
}
@@ -125,9 +127,19 @@ require_once "resources/check_auth.php";
//show the registrations
echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\n";
echo "<tr>\n";
echo "<td colspan='4'>\n";
echo "<td colspan='5'>\n";
echo " <b>".$text['header-registrations'].": ".count($registrations)."</b>\n";
echo "</td>\n";
echo "<td align='right'>\n";
if (permission_exists('registration_all')) {
if ($show == "all") {
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='status_registrations.php?show_reg=1&profile=$sip_profile_name'\" value='".$text['button-back']."'>\n";
}
else {
echo " <input type='button' class='btn' name='' alt='".$text['button-show_all']."' onclick=\"window.location='status_registrations.php?show_reg=1&profile=$sip_profile_name&show=all'\" value='".$text['button-show_all']."'>\n";
}
}
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<br />\n";