mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
User Dashboard: Minor layout optimizations.
Follow Me: Added search and minimized paging controls. Extensions: Added minimized paging controls.
This commit is contained in:
@@ -38,6 +38,15 @@ else {
|
||||
$order_by = check_str($_GET["order_by"]);
|
||||
$order = check_str($_GET["order"]);
|
||||
|
||||
//handle search term
|
||||
$search = check_str($_GET["search"]);
|
||||
if (strlen($search) > 0) {
|
||||
$sql_mod = "and ( ";
|
||||
$sql_mod .= "extension like '%".$search."%' ";
|
||||
$sql_mod .= "or description like '%".$search."%' ";
|
||||
$sql_mod .= ") ";
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get($_SESSION['domain']['language']['code'], 'app/calls');
|
||||
@@ -46,18 +55,6 @@ else {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
if ($is_included != "true") {
|
||||
echo " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left'><b>".$text['title']."</b><br>\n";
|
||||
echo " ".$text['description-2']."\n";
|
||||
echo " ".$text['description-3']." \n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo " <br />";
|
||||
}
|
||||
|
||||
$sql = "select * from v_extensions ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and enabled = 'true' ";
|
||||
@@ -77,6 +74,7 @@ else {
|
||||
$sql .= "and extension = 'disabled' ";
|
||||
}
|
||||
}
|
||||
$sql .= $sql_mod; //add search mod from above
|
||||
if (strlen($order_by)> 0) {
|
||||
$sql .= "order by $order_by $order ";
|
||||
}
|
||||
@@ -89,10 +87,19 @@ else {
|
||||
$num_rows = count($result);
|
||||
unset ($prep_statement, $result, $sql);
|
||||
|
||||
$rows_per_page = 150;
|
||||
$param = "";
|
||||
if ($is_included == 'true') {
|
||||
$rows_per_page = 10;
|
||||
if ($num_rows > 10) {
|
||||
echo "<script>document.getElementById('btn_viewall_callrouting').style.display = 'inline';</script>\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$rows_per_page = 150;
|
||||
}
|
||||
$param = "&search=".$search;
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls_mini, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page, true);
|
||||
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
@@ -115,6 +122,7 @@ else {
|
||||
$sql .= "and extension = 'disabled' ";
|
||||
}
|
||||
}
|
||||
$sql .= $sql_mod; //add search mod from above
|
||||
if (strlen($order_by)> 0) {
|
||||
$sql .= "order by $order_by $order ";
|
||||
}
|
||||
@@ -132,6 +140,27 @@ else {
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
if ($is_included != "true") {
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left' width='100%'><b>".$text['title']."</b><br>\n";
|
||||
echo " ".$text['description-2']."\n";
|
||||
echo " ".$text['description-3']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <form method='get' action=''>\n";
|
||||
echo " <td style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
|
||||
echo " <input type='text' class='txt' style='width: 150px' name='search' value='".$search."'>";
|
||||
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
|
||||
if ($paging_controls_mini != '') {
|
||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </form>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br />";
|
||||
}
|
||||
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<th>".$text['table-extension']."</th>\n";
|
||||
@@ -157,20 +186,13 @@ else {
|
||||
unset($sql, $result, $row_count);
|
||||
} //end if results
|
||||
|
||||
if (strlen($paging_controls) > 0) {
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='5' align='left'>\n";
|
||||
echo " <table border='0' width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</table>";
|
||||
echo "<br><br>";
|
||||
echo "<br>";
|
||||
|
||||
if (strlen($paging_controls) > 0 && ($is_included != "true")) {
|
||||
echo "<center>".$paging_controls."</center>\n";
|
||||
echo "<br><br>\n";
|
||||
}
|
||||
|
||||
if ($is_included != "true") {
|
||||
require_once "resources/footer.php";
|
||||
|
||||
@@ -45,6 +45,18 @@ else {
|
||||
$order = check_str($_GET["order"]);
|
||||
}
|
||||
|
||||
//handle search term
|
||||
$search = check_str($_GET["search"]);
|
||||
if (strlen($search) > 0) {
|
||||
$sql_mod = "and ( ";
|
||||
$sql_mod .= "extension like '%".$search."%' ";
|
||||
$sql_mod .= "or call_group like '%".$search."%' ";
|
||||
$sql_mod .= "or user_context like '%".$search."%' ";
|
||||
$sql_mod .= "or enabled like '%".$search."%' ";
|
||||
$sql_mod .= "or description like '%".$search."%' ";
|
||||
$sql_mod .= ") ";
|
||||
}
|
||||
|
||||
require_once "resources/header.php";
|
||||
$document['title'] = $text['title-extensions'];
|
||||
|
||||
@@ -61,15 +73,7 @@ require_once "resources/paging.php";
|
||||
unset($prep_statement, $row);
|
||||
|
||||
//get the number of extensions (reuse $sql from above)
|
||||
if (strlen($search) > 0) {
|
||||
$sql .= "and (";
|
||||
$sql .= " extension like '%".$search."%' ";
|
||||
$sql .= " or call_group like '%".$search."%' ";
|
||||
$sql .= " or user_context like '%".$search."%' ";
|
||||
$sql .= " or enabled like '%".$search."%' ";
|
||||
$sql .= " or description like '%".$search."%' ";
|
||||
$sql .= ") ";
|
||||
}
|
||||
$sql .= $sql_mod; //add search mod from above
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
@@ -85,24 +89,17 @@ require_once "resources/paging.php";
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = 150;
|
||||
$param = "";
|
||||
$param = "&search=".$search;
|
||||
if (!isset($_GET['page'])) { $_GET['page'] = 0; }
|
||||
$_GET['page'] = check_str($_GET['page']);
|
||||
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
|
||||
list($paging_controls_mini, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page, true); //top
|
||||
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); //bottom
|
||||
$offset = $rows_per_page * $_GET['page'];
|
||||
|
||||
//get the extensions
|
||||
$sql = "select * from v_extensions ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
if (strlen($search) > 0) {
|
||||
$sql .= "and (";
|
||||
$sql .= " extension like '%".$search."%' ";
|
||||
$sql .= " or call_group like '%".$search."%' ";
|
||||
$sql .= " or user_context like '%".$search."%' ";
|
||||
$sql .= " or enabled like '%".$search."%' ";
|
||||
$sql .= " or description like '%".$search."%' ";
|
||||
$sql .= ") ";
|
||||
}
|
||||
$sql .= $sql_mod; //add search mod from above
|
||||
if (isset($order_by)) {
|
||||
$sql .= "order by $order_by $order ";
|
||||
}
|
||||
@@ -118,16 +115,19 @@ require_once "resources/paging.php";
|
||||
//show the content
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left'><b>".$text['header-extensions']." (".$num_rows.")</b><br>\n";
|
||||
echo " <td align='left' width='100%'><b>".$text['header-extensions']." (".$num_rows.")</b><br>\n";
|
||||
echo " ".$text['description-extensions']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <form method='get' action=''>\n";
|
||||
echo " <td width='30%' align='right'>\n";
|
||||
echo " <td style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
|
||||
if (if_group("superadmin")) {
|
||||
echo " <input type='button' class='btn' value='".$text['button-export']."' onclick=\"window.location.href='extension_download.php'\">\n";
|
||||
echo " <input type='button' class='btn' style='margin-right: 15px;' value='".$text['button-export']."' onclick=\"window.location.href='extension_download.php'\">\n";
|
||||
}
|
||||
echo " <input type='text' class='txt' style='width: 150px' name='search' value='".$search."'>";
|
||||
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
|
||||
if ($paging_controls_mini != '') {
|
||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </form>\n";
|
||||
echo " </tr>\n";
|
||||
@@ -186,26 +186,23 @@ require_once "resources/paging.php";
|
||||
unset($sql, $extensions, $row_count);
|
||||
} //end if results
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='6' align='left'>\n";
|
||||
echo " <table border='0' width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' class='list_control_icons'>\n";
|
||||
if (permission_exists('extension_add')) {
|
||||
if ($_SESSION['limit']['extensions']['numeric'] == '' || ($_SESSION['limit']['extensions']['numeric'] != '' && $total_extensions < $_SESSION['limit']['extensions']['numeric'])) {
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='20' class='list_control_icons'>\n";
|
||||
echo " <a href='extension_edit.php' alt='".$text['button-add']."'>".$v_link_label_add."</a>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
}
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "<br><br>";
|
||||
|
||||
if (strlen($paging_controls) > 0) {
|
||||
echo "<center>".$paging_controls."</center>\n";
|
||||
}
|
||||
|
||||
echo "<br><br>\n";
|
||||
|
||||
//show the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
@@ -89,7 +89,15 @@ require_once "resources/paging.php";
|
||||
}
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = 10;
|
||||
if ($is_included == 'true') {
|
||||
$rows_per_page = 10;
|
||||
if ($num_rows > 10) {
|
||||
echo "<script>document.getElementById('btn_viewall_ringgroups').style.display = 'inline';</script>\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$rows_per_page = 150;
|
||||
}
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
@@ -126,30 +134,21 @@ require_once "resources/paging.php";
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('ring_group_extension', $text['label-ring-group-extension'], $order_by, $order);
|
||||
//echo th_order_by('ring_group_context', 'Context', $order_by, $order);
|
||||
//echo th_order_by('ring_group_strategy', 'Strategy', $order_by, $order);
|
||||
//echo th_order_by('ring_group_timeout_app', 'Timeout App', $order_by, $order);
|
||||
//echo th_order_by('ring_group_timeout_data', 'Timeout Data', $order_by, $order);
|
||||
//echo th_order_by('ring_group_enabled', $text['label-enabled'], $order_by, $order);
|
||||
echo "<th>".$text['label-tools']."</th>";
|
||||
echo th_order_by('ring_group_name', $text['label-name'], $order_by, $order);
|
||||
echo th_order_by('ring_group_extension', $text['label-extension'], $order_by, $order);
|
||||
echo "<th>".$text['label-tools']."</th>";
|
||||
echo th_order_by('ring_group_description', $text['label-description'], $order_by, $order);
|
||||
echo "<tr>\n";
|
||||
|
||||
if ($result_count > 0) {
|
||||
foreach($result as $row) {
|
||||
echo "<tr >\n";
|
||||
$tr_link = "href='".PROJECT_PATH."/app/ring_groups/ring_group_forward_edit.php?id=".$row['ring_group_uuid']."&return_url=".urlencode($_SERVER['PHP_SELF'])."'";
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_name']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_extension']." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_context']." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_strategy']." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_timeout_app']." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_timeout_data']." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_enabled']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'><a href='".PROJECT_PATH."/app/ring_groups/ring_group_forward_edit.php?id=".$row['ring_group_uuid']."&return_url=".urlencode($_SERVER['PHP_SELF'])."' alt='".$text['link-call-forward']."'>".$text['link-call-forward']."</a></td>\n";
|
||||
echo " <td valign='top' class='row_stylebg'>".$row['ring_group_name']." </td>\n";
|
||||
echo " <td valign='top' class='row_stylebg'>".$row['ring_group_description']." </td>\n";
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
@@ -158,21 +157,11 @@ require_once "resources/paging.php";
|
||||
} //end if results
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='11' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "<br><br>";
|
||||
|
||||
echo "<center>".$paging_controls."</center>\n";
|
||||
|
||||
echo "</div>";
|
||||
|
||||
//include the footer
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -66,9 +66,21 @@
|
||||
require_once "resources/header.php";
|
||||
$document['title'] = $text['title-user_dashboard'];
|
||||
|
||||
echo "<b>".$text['header-user_dashboard']."</b><br>";
|
||||
echo $text['description-user_dashboard'];
|
||||
|
||||
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td valign='top'>";
|
||||
echo " <b>".$text['header-user_dashboard']."</b><br />";
|
||||
echo " ".$text['description-user_dashboard'];
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' style='text-align: right; white-space: nowrap;'>\n";
|
||||
echo " <a href='".PROJECT_PATH."/core/user_settings/user_edit.php'>".$_SESSION["username"]."</a>";
|
||||
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/voicemails/voicemail_messages.php")) {
|
||||
echo " <input type='button' class='btn' value='".$text['button-voicemail_messages']."' style='margin-left: 15px;' onclick=\"document.location.href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php';\">";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br /><br />";
|
||||
|
||||
//display login message
|
||||
if (if_group("superadmin") && $_SESSION['login']['message']['text'] != '') {
|
||||
@@ -76,52 +88,43 @@
|
||||
echo "<div class='login_message' width='100%'><b>".$text['login-message_attention']."</b> ".$_SESSION['login']['message']['text']." (<a href='?msg=dismiss'>".$text['login-message_dismiss']."</a>)</div>";
|
||||
}
|
||||
|
||||
//start the user table
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"7\" cellspacing=\"0\">\n";
|
||||
echo "<tr>\n";
|
||||
echo " <th class='th' colspan='2' align='left'>".$text['title-user-settings']." </th>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " ".$text['label-username']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " <a href='".PROJECT_PATH."/core/user_settings/user_edit.php'>".$_SESSION["username"]."</a> \n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
/*
|
||||
$text['title-user-settings']
|
||||
$text['label-username']
|
||||
$text['label-voicemail']
|
||||
*/
|
||||
|
||||
//voicemail
|
||||
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/voicemails/voicemail_messages.php")) {
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " ".$text['label-voicemail']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " <a href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php'>".$text['label-view-messages']."</a> \n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
//end the table
|
||||
echo "</table>\n";
|
||||
echo "<br />\n";
|
||||
echo "<br />\n";
|
||||
|
||||
//call forward, follow me and dnd
|
||||
//call routing
|
||||
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/calls/calls.php")) {
|
||||
if (permission_exists('follow_me') || permission_exists('call_forward') || permission_exists('do_not_disturb')) {
|
||||
$is_included = "true";
|
||||
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td valign='top'><b>".$text['header-call_routing']."</b><br><br></td>\n";
|
||||
echo " <td valign='top' style='text-align: right;'><input id='btn_viewall_callrouting' type='button' class='btn' style='display: none;' value='".$text['button-view_all']."' onclick=\"document.location.href='".PROJECT_PATH."/app/calls/calls.php';\"></td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
require_once "app/calls/calls.php";
|
||||
echo "<br>\n";
|
||||
}
|
||||
}
|
||||
|
||||
//reload language values
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//ring group forward
|
||||
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/ring_groups/ring_group_forward.php")) {
|
||||
if (permission_exists('ring_group_forward')) { //ring_group_forward
|
||||
$is_included = "true";
|
||||
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td valign='top'><b>".$text['header-ring_groups']."</b><br><br></td>\n";
|
||||
echo " <td valign='top' style='text-align: right;'><input id='btn_viewall_ringgroups' type='button' class='btn' style='display: none;' value='".$text['button-view_all']."' onclick=\"document.location.href='".PROJECT_PATH."/app/ring_groups/ring_group_forward.php';\"></td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
require_once "app/ring_groups/ring_group_forward.php";
|
||||
echo "<br>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,73 +58,71 @@ function paging($num_rows, $param, $rows_per_page, $mini = false) {
|
||||
}
|
||||
|
||||
if ($pagenum > 0) {
|
||||
//echo "currently middepage<br>";
|
||||
$page = $pagenum - 1;
|
||||
$prev = "<input class='btn' type='button' name='next' value='◀' onClick=\"window.location = '".$self."?page=$page".$param."';\">\n";
|
||||
$first = "<input class='btn' type='button' name='last' value='▲' onClick=\"window.location = '".$self."?page=1".$param."';\">\n";
|
||||
$prev = "<input class='btn' type='button' value='◀' alt='".($page+1)."' title='".($page+1)."' onClick=\"window.location = '".$self."?page=$page".$param."';\">\n";
|
||||
$first = "<input class='btn' type='button' value='▲' onClick=\"window.location = '".$self."?page=1".$param."';\">\n";
|
||||
|
||||
}
|
||||
else {
|
||||
//echo "currently on the first page<br>";
|
||||
$prev = "<input class='btn' type='button' disabled name='Prev' value='◀' style='opacity: 0.4; -moz-opacity: 0.4; cursor: default;'>\n";
|
||||
//$first = "<input class='btn' type='button' name='First' value='First'>\n";
|
||||
$prev = "<input class='btn' type='button' disabled value='◀' style='opacity: 0.4; -moz-opacity: 0.4; cursor: default;'>\n";
|
||||
}
|
||||
|
||||
if (($pagenum + 1) < $maxpage) {
|
||||
//echo "middle page<br>";
|
||||
$page = $pagenum + 1;
|
||||
$next = "<input class='btn' type='button' name='next' value='▶' onClick=\"window.location = '".$self."?page=$page".$param."';\">\n";
|
||||
$last = "<input class='btn' type='button' name='last' value='▼' onClick=\"window.location = '".$self."?page=$maxpage".$param."';\">\n";
|
||||
$next = "<input class='btn' type='button' value='▶' alt='".($page+1)."' title='".($page+1)."' onClick=\"window.location = '".$self."?page=$page".$param."';\">\n";
|
||||
$last = "<input class='btn' type='button' value='▼' onClick=\"window.location = '".$self."?page=$maxpage".$param."';\">\n";
|
||||
|
||||
}
|
||||
else {
|
||||
//echo "last page<br>";
|
||||
$last = "<input class='btn' type='button' name='last' value='▼' onClick=\"window.location = '".$self."?page=$maxpage".$param."';\">\n";
|
||||
$next = "<input class='btn' type='button' disabled name='Next' value='▶' style='opacity: 0.4; -moz-opacity: 0.4; cursor: default;'>\n";
|
||||
//$last = "<input class='btn' type='button' name='Last' value='Last'>\n";
|
||||
$last = "<input class='btn' type='button' value='▼' onClick=\"window.location = '".$self."?page=$maxpage".$param."';\">\n";
|
||||
$next = "<input class='btn' type='button' disabled value='▶' style='opacity: 0.4; -moz-opacity: 0.4; cursor: default;'>\n";
|
||||
|
||||
}
|
||||
|
||||
$returnearray = array();
|
||||
$code = '';
|
||||
if ($maxpage > 1) {
|
||||
//$returnearray[] = $first . $prev ." Page $pagenum of $maxpage " . $next . $last;
|
||||
$returnearray[] = "<center nowrap>".$prev.((!$mini) ? " <input id='paging_page_num' class='formfld' style='max-width: 50px; min-width: 50px; text-align: center;' type='text' value='".($pagenum+1)."' onfocus='this.select();' onkeypress='return go(event);'> <strong>".$maxpage."</strong> " : null).$next."</center>\n".
|
||||
"<script>\n".
|
||||
"function go(e) {\n".
|
||||
"var page_num;\n".
|
||||
"page_num = document.getElementById('paging_page_num').value;\n".
|
||||
//define javascript to include
|
||||
$script = "<script>\n".
|
||||
"function go(e) {\n".
|
||||
"var page_num;\n".
|
||||
"page_num = document.getElementById('paging_page_num').value;\n".
|
||||
|
||||
"do_action = false;\n".
|
||||
"if (e != null) {\n".
|
||||
"// called from a form field keypress event\n".
|
||||
"var keyevent;\n".
|
||||
"var keychar;\n".
|
||||
"do_action = false;\n".
|
||||
"if (e != null) {\n".
|
||||
"// called from a form field keypress event\n".
|
||||
"var keyevent;\n".
|
||||
"var keychar;\n".
|
||||
|
||||
"if (window.event) { keyevent = e.keyCode; }\n".
|
||||
"else if (e.which) { keyevent = e.which; }\n".
|
||||
"if (window.event) { keyevent = e.keyCode; }\n".
|
||||
"else if (e.which) { keyevent = e.which; }\n".
|
||||
|
||||
"keychar = keyevent;\n".
|
||||
"if (keychar == 13) {\n".
|
||||
"do_action = true;\n".
|
||||
"keychar = keyevent;\n".
|
||||
"if (keychar == 13) {\n".
|
||||
"do_action = true;\n".
|
||||
"}\n".
|
||||
"else {\n".
|
||||
"keychar;\n".
|
||||
"return true;\n".
|
||||
"}\n".
|
||||
"}\n".
|
||||
"else {\n".
|
||||
"keychar;\n".
|
||||
"return true;\n".
|
||||
"// called from something else (non-keypress)\n".
|
||||
"do_action = true;\n".
|
||||
"}\n".
|
||||
|
||||
"if (do_action) {\n".
|
||||
"// action to peform when enter is hit\n".
|
||||
"if (page_num < 1) { page_num = 1; }\n".
|
||||
"if (page_num > ".$maxpage.") { page_num = ".$maxpage."; }\n".
|
||||
"document.location.href = '".$self."?page='+(--page_num)+'".$param."';\n".
|
||||
"}\n".
|
||||
"}\n".
|
||||
"else {\n".
|
||||
"// called from something else (non-keypress)\n".
|
||||
"do_action = true;\n".
|
||||
"}\n".
|
||||
|
||||
"if (do_action) {\n".
|
||||
"// action to peform when enter is hit\n".
|
||||
"if (page_num < 1) { page_num = 1; }\n".
|
||||
"if (page_num > ".$maxpage.") { page_num = ".$maxpage."; }\n".
|
||||
"document.location.href = '".$self."?page='+(--page_num)+'".$param."';\n".
|
||||
"}\n".
|
||||
"}\n".
|
||||
"</script>\n";
|
||||
"</script>\n";
|
||||
//determine size
|
||||
$code = ($mini) ? $prev.$next."\n".$script : "<center nowrap>".$prev." <input id='paging_page_num' class='formfld' style='max-width: 50px; min-width: 50px; text-align: center;' type='text' value='".($pagenum+1)."' onfocus='this.select();' onkeypress='return go(event);'> <strong>".$maxpage."</strong> ".$next."</center>\n".$script;
|
||||
//add to array
|
||||
$returnearray[] = $code;
|
||||
}
|
||||
else {
|
||||
$returnearray[] = "";
|
||||
|
||||
Reference in New Issue
Block a user