mirror of
https://codeberg.org/mclemens/tsmmonitor2.git
synced 2025-01-18 13:16:23 -05:00
- Added drop-down selection for number of lines/rows to display per page.
This commit is contained in:
parent
ed9b42ff44
commit
73befaaa6e
@ -241,7 +241,6 @@ class TSMMonitor {
|
|||||||
$pp = '<<';
|
$pp = '<<';
|
||||||
|
|
||||||
if($this->page != 1) {
|
if($this->page != 1) {
|
||||||
//$fp = '<a class="tablefooter" href="'.$self.'?'.$urlappend.'&page=1">'.$fp.'</a>';
|
|
||||||
$fp = $navelement.'1">'.$fp.'</a>';
|
$fp = $navelement.'1">'.$fp.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,10 +281,23 @@ class TSMMonitor {
|
|||||||
$numbers .= ' '.$navelement.$i.'">'.$i.'</a> ';
|
$numbers .= ' '.$navelement.$i.'">'.$i.'</a> ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$lines = array ("20", "50", "100", "200", "500");
|
||||||
|
$linesel = $_SESSION["lines"][$this->GETVars['qq']];
|
||||||
|
if ($linesel == "") $linesel = "20";
|
||||||
|
$linebox = "<form action=".$_SERVER['PHP_SELF']."?q=".$this->GETVars['qq']."&m=".$this->GETVars['menu']."&s=".$this->GETVars['server']." method='post'><select name='lpp' size=1 onChange='submit();' class='button topnavbutton'>";
|
||||||
|
|
||||||
|
foreach ($lines as $line) {
|
||||||
|
$linebox .= '<option value="'.$line.'"';
|
||||||
|
if ($linesel == $line) {$linebox.= "SELECTED";}
|
||||||
|
$linebox .= '> '.$line.' </option>';
|
||||||
|
}
|
||||||
|
$linebox .= "</select></form>";
|
||||||
|
|
||||||
if ($end > 1) {
|
if ($end > 1) {
|
||||||
return $fp.' '.$pp.' '.$numbers.' '.$np.' '.$lp;
|
return '<div>'.$fp.' '.$pp.' '.$numbers.' '.$np.' '.$lp.'</div><div id="tnbox2">'.$linebox.'</div>';
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return '<div id="tnbox2">'.$linebox.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -842,10 +854,16 @@ class TSMMonitor {
|
|||||||
$_SESSION["lastsql"] = $sql;
|
$_SESSION["lastsql"] = $sql;
|
||||||
if ($sqlres) $this->message = $sql;
|
if ($sqlres) $this->message = $sql;
|
||||||
|
|
||||||
|
if ($_SESSION["lines"][$this->GETVars['qq']] != "") {
|
||||||
|
$lpp = $_SESSION["lines"][$this->GETVars['qq']];
|
||||||
|
} else {
|
||||||
|
$lpp = 20;
|
||||||
|
}
|
||||||
|
|
||||||
if ($bContinue) {
|
if ($bContinue) {
|
||||||
if ($type == "table") {
|
if ($type == "table") {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$rs = $this->fetchSplitArrayDB($sql,20);
|
$rs = $this->fetchSplitArrayDB($sql,$lpp);
|
||||||
|
|
||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
$color = "";
|
$color = "";
|
||||||
|
12
index.php
12
index.php
@ -160,12 +160,22 @@ include_once "includes/page_head.php";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$lines = $_POST["lpp"];
|
||||||
|
if ($lines != "") {
|
||||||
|
if (!isset($_SESSION["lines"])){
|
||||||
|
$temp = array();
|
||||||
|
$temp[$tsmmonitor->GETVars['qq']] = $lines;
|
||||||
|
$_SESSION["lines"] = $temp;
|
||||||
|
} else {
|
||||||
|
$_SESSION["lines"][$tsmmonitor->GETVars['qq']] = $lines;
|
||||||
|
}
|
||||||
|
}
|
||||||
echo "<table class='zebra'>";
|
echo "<table class='zebra'>";
|
||||||
$thead = $tsmmonitor->getTableheader();
|
$thead = $tsmmonitor->getTableheader();
|
||||||
echo $thead;
|
echo $thead;
|
||||||
echo $tsmmonitor->execute('table');
|
echo $tsmmonitor->execute('table');
|
||||||
$nav = $tsmmonitor->showPageNavigation("40");
|
$nav = $tsmmonitor->showPageNavigation("40");
|
||||||
if ($nav!="") {
|
if ($nav != "") {
|
||||||
echo "<tr><td colspan='".substr_count($thead, "<th>")."' align='center' class='footer'><a class='navhead'>".$nav."</a></td></tr>";
|
echo "<tr><td colspan='".substr_count($thead, "<th>")."' align='center' class='footer'><a class='navhead'>".$nav."</a></td></tr>";
|
||||||
}
|
}
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
Loading…
Reference in New Issue
Block a user