User Dashboard: Minor layout optimizations.

Follow Me: Added search and minimized paging controls.
Extensions: Added minimized paging controls.
This commit is contained in:
reliberate
2016-03-03 19:01:58 -07:00
parent 768347451d
commit 39a31432ba
6 changed files with 860 additions and 818 deletions

View File

@@ -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>&nbsp;</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";

View File

@@ -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>&nbsp;</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";

View File

@@ -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']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_extension']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_context']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_strategy']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_timeout_app']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_timeout_data']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_enabled']."&nbsp;</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']."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg'>".$row['ring_group_description']."&nbsp;</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>&nbsp;</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>&nbsp;</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

View File

@@ -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>&nbsp;&nbsp;".$_SESSION['login']['message']['text']."&nbsp;&nbsp;(<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']." &nbsp;</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";
}
}

View File

@@ -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='&#9664;' onClick=\"window.location = '".$self."?page=$page".$param."';\">\n";
$first = "<input class='btn' type='button' name='last' value='&#9650;' onClick=\"window.location = '".$self."?page=1".$param."';\">\n";
$prev = "<input class='btn' type='button' value='&#9664;' alt='".($page+1)."' title='".($page+1)."' onClick=\"window.location = '".$self."?page=$page".$param."';\">\n";
$first = "<input class='btn' type='button' value='&#9650;' 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='&#9664;' 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='&#9664;' 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='&#9654;' onClick=\"window.location = '".$self."?page=$page".$param."';\">\n";
$last = "<input class='btn' type='button' name='last' value='&#9660;' onClick=\"window.location = '".$self."?page=$maxpage".$param."';\">\n";
$next = "<input class='btn' type='button' value='&#9654;' alt='".($page+1)."' title='".($page+1)."' onClick=\"window.location = '".$self."?page=$page".$param."';\">\n";
$last = "<input class='btn' type='button' value='&#9660;' onClick=\"window.location = '".$self."?page=$maxpage".$param."';\">\n";
}
else {
//echo "last page<br>";
$last = "<input class='btn' type='button' name='last' value='&#9660;' onClick=\"window.location = '".$self."?page=$maxpage".$param."';\">\n";
$next = "<input class='btn' type='button' disabled name='Next' value='&#9654;' 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='&#9660;' onClick=\"window.location = '".$self."?page=$maxpage".$param."';\">\n";
$next = "<input class='btn' type='button' disabled value='&#9654;' 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) ? "&nbsp;&nbsp;&nbsp;<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);'>&nbsp;&nbsp;<strong>".$maxpage."</strong>&nbsp;&nbsp;&nbsp;&nbsp;" : 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."&nbsp;&nbsp;&nbsp;<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);'>&nbsp;&nbsp;<strong>".$maxpage."</strong>&nbsp;&nbsp;&nbsp;&nbsp;".$next."</center>\n".$script;
//add to array
$returnearray[] = $code;
}
else {
$returnearray[] = "";