Added pagination in custom graphics. Ticket #3886.

This commit is contained in:
Daniel Maya 2016-06-30 08:46:52 +02:00
parent e67c35f8f2
commit 00b17f5eda

View File

@ -135,6 +135,9 @@ if ($multiple_delete) {
$graphs = custom_graphs_get_user ($config['id_user'], false, true, "RR"); $graphs = custom_graphs_get_user ($config['id_user'], false, true, "RR");
$offset = (int) get_parameter ("offset");
ui_pagination (count($graphs));
if (!empty ($graphs)) { if (!empty ($graphs)) {
$table = new stdClass(); $table = new stdClass();
@ -159,8 +162,10 @@ if (!empty ($graphs)) {
$table->size[4] = '90px'; $table->size[4] = '90px';
} }
$table->data = array (); $table->data = array ();
foreach ($graphs as $graph) { $result_graphs = array_slice($graphs, $offset, $config['block_size']);
foreach ($result_graphs as $graph) {
$data = array (); $data = array ();
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='. $data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.
@ -185,9 +190,9 @@ if (!empty ($graphs)) {
array_push ($table->data, $data); array_push ($table->data, $data);
} }
if (!empty($graphs)){ if (!empty($result_graphs)){
echo "<form method='post' style='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>"; echo "<form method='post' style='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table ($table); html_print_table ($table);
@ -205,7 +210,7 @@ if (!empty ($graphs)) {
echo "</form>"; echo "</form>";
} }
echo "</div>"; echo "</div>";
ui_pagination (count($graphs));
} }
else { else {
require_once ($config['homedir'] . "/general/firts_task/custom_graphs.php"); require_once ($config['homedir'] . "/general/firts_task/custom_graphs.php");