diff --git a/webgui/box.php b/webgui/box.php index 23ff10a..ff7ab54 100644 --- a/webgui/box.php +++ b/webgui/box.php @@ -115,9 +115,8 @@ foreach ($res as $row) { echo "\n"; } // Table summary -echo "\n"; -echo '', sprintf(_('%d records'), count($res)), '', "\n"; -echo "\n"; +$numrows = count($res); +table_rec_summary($i, $numrows, $numrows, 5); echo "\n"; form_add_button('box.php'); diff --git a/webgui/cable.php b/webgui/cable.php index cc4d3a5..f15a756 100644 --- a/webgui/cable.php +++ b/webgui/cable.php @@ -153,9 +153,7 @@ foreach ($res as $row) { echo "\n"; } // Table summary -echo "\n"; -echo '', sprintf(_('%d records'), count($res)), '', "\n"; -echo "\n"; +table_rec_summary($i0, $i, $numrows, 6); echo "\n"; form_add_button($g_scriptname); diff --git a/webgui/checklist.php b/webgui/checklist.php index 9f04b7e..a16b57a 100644 --- a/webgui/checklist.php +++ b/webgui/checklist.php @@ -93,9 +93,7 @@ foreach ($res as $row) { echo "\n"; } // Table summary -echo "\n"; -echo '', sprintf(_('%d records'), count($res)), '', "\n"; -echo "\n"; +table_rec_summary($i0, $i, $numrows, 6); echo "\n"; form_add_button($g_scriptname); diff --git a/webgui/company.php b/webgui/company.php index e032298..350db6e 100644 --- a/webgui/company.php +++ b/webgui/company.php @@ -223,9 +223,7 @@ foreach ($res as $row) { echo "\n"; } // Table summary -echo "\n"; -echo '', sprintf(_('Records %d to %d of %d'), $i0, $i, $numrows), '', "\n"; -echo "\n"; +table_rec_summary($i0, $i, $numrows, 6); echo "\n"; echo $pagination; diff --git a/webgui/documents.php b/webgui/documents.php index b5b7812..d7156c3 100644 --- a/webgui/documents.php +++ b/webgui/documents.php @@ -398,9 +398,7 @@ foreach ($res as $row) { echo "\n"; } // Table summary -echo "\n"; -echo '', sprintf(_('Records %d to %d of %d'), $i0, $i, $numrows), '', "\n"; -echo "\n"; +table_rec_summary($i0, $i, $numrows, 6); echo "\n"; echo $pagination; diff --git a/webgui/dropdown.php b/webgui/dropdown.php index ae7b8db..de858a9 100644 --- a/webgui/dropdown.php +++ b/webgui/dropdown.php @@ -28,7 +28,7 @@ function create_ddval_form($script, $ddid, $formtype, $row=NULL) { echo '
'; echo '
', "\n"; + echo '>', "\n"; // all other fields in secondary row echo '
'; @@ -36,17 +36,17 @@ function create_ddval_form($script, $ddid, $formtype, $row=NULL) { echo '
'; echo '
', "\n"; + echo '>
', "\n"; echo '
'; echo '
', "\n"; + echo '>', "\n"; echo '
'; echo '
', "\n"; + echo '>', "\n"; echo ''; // finish row @@ -187,11 +187,12 @@ echo '', _('Short'), ""; echo '', _('Color'), ""; echo '', _('Sort'), ""; echo '', _('Flags'), ""; -echo "\n"; echo "\n"; echo "\n"; +$i = 0; foreach ($sth->fetchAll() as $row) { + $i++; $flags = explode(',', $row['flags']); $fixed = in_array('fixed', $flags); echo ''; @@ -207,6 +208,7 @@ foreach ($sth->fetchAll() as $row) { echo '', ($fixed ? '' : ''), ''; echo "\n"; } +table_rec_summary(1, $i, $i, 6); echo "\n"; echo '', _('Back'), "\n"; @@ -236,7 +238,9 @@ echo "\n"; echo "\n"; echo "\n"; +$i = 0; foreach ($sth->fetchAll() as $row) { + $i++; echo ''; if ($row['ddval'] == $v) { echo '', $row['ddval'], ''; @@ -270,6 +274,7 @@ if ($v == -2) { echo "\n"; echo ""; } +table_rec_summary(1, $i, $i, 6); echo "\n"; echo '', _('Add'), "\n"; diff --git a/webgui/equipment.php b/webgui/equipment.php index 9e4d269..bb73ab4 100644 --- a/webgui/equipment.php +++ b/webgui/equipment.php @@ -387,12 +387,9 @@ foreach ($res as $row) { echo "\n"; echo "\n"; } -?> - - - - -\n"; + echo $pagination; form_add_button($g_scriptname); diff --git a/webgui/fuse.php b/webgui/fuse.php index 0715755..6bd568e 100644 --- a/webgui/fuse.php +++ b/webgui/fuse.php @@ -178,9 +178,7 @@ foreach ($res as $row) { echo "\n"; } // Table summary -echo "\n"; -echo '', sprintf(_('%d records'), count($res)), '', "\n"; -echo "\n"; +table_rec_summary($i0, $i, $numrows, 6); echo "\n"; form_add_button($g_scriptname); diff --git a/webgui/globals.inc b/webgui/globals.inc index d4ec8e4..d3e2ccc 100644 --- a/webgui/globals.inc +++ b/webgui/globals.inc @@ -1328,6 +1328,19 @@ function get_pagination($script, $param, $page, $lastpage, $small=false) { return $out; } +function table_rec_summary($start, $end, $total, $cols) { + // common summary table footer for data tables + echo "\n"; + echo ' '; + if ($total > 0) { + echo sprintf(_('Records %d to %d of %d'), $start, $end, $total); + } else { + echo _('No records found'); + } + echo "\n"; + echo "\n"; +} + function pdf_get_pagecount($filename) { $pages = exec("/usr/bin/mutool show $filename Root/Pages/Count", $output, $retval); // TODO error checking diff --git a/webgui/index.php b/webgui/index.php index 80f7a9d..029ceb8 100644 --- a/webgui/index.php +++ b/webgui/index.php @@ -135,7 +135,10 @@ $sth = $pdo->query("SELECT vid, vesselname, model FROM vessel ORDER BY vid"); $res = $sth->fetchAll(); foreach ($res as $row) { echo ' \n"; } ?> @@ -154,7 +157,7 @@ echo '