hide some elements when no accounts were found

fixed a HTML error
This commit is contained in:
Roland Gruber 2003-06-10 08:57:29 +00:00
parent aaa1919da8
commit e8f7c09863
2 changed files with 27 additions and 15 deletions

View File

@ -97,8 +97,8 @@ for ($i = 0; $i < sizeof($temp_array); $i++) {
$searchfilter = ""; $searchfilter = "";
for ($k = 0; $k < sizeof($desc_array); $k++) { for ($k = 0; $k < sizeof($desc_array); $k++) {
if ($_POST["filter" . strtolower($attr_array[$k])]) { if ($_POST["filter" . strtolower($attr_array[$k])]) {
$searchfilter = $searchfilter . "&filter" . strtolower($attr_array[$k]) . "=". $searchfilter = $searchfilter . "&amp;filter" . strtolower($attr_array[$k]) . "='".
$_POST["filter" . strtolower($attr_array[$k])]; $_POST["filter" . strtolower($attr_array[$k])] . "'";
} }
} }
@ -130,8 +130,11 @@ else StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences
echo ("<form action=\"listgroups.php\" method=\"post\">\n"); echo ("<form action=\"listgroups.php\" method=\"post\">\n");
// draw navigation bar if group accounts were found
if (sizeof($info) > 0) {
draw_navigation_bar(sizeof($info)); draw_navigation_bar(sizeof($info));
echo ("<br>"); echo ("<br>");
}
// print group table header // print group table header
echo "<table rules=\"all\" class=\"grouplist\" width=\"100%\">\n"; echo "<table rules=\"all\" class=\"grouplist\" width=\"100%\">\n";
@ -206,13 +209,16 @@ for ($i = $table_begin; $i < $table_end; $i++) {
echo ("</table>"); echo ("</table>");
echo ("<br>"); echo ("<br>");
// draw navigation bar if group accounts were found
if (sizeof($info) > 0) {
draw_navigation_bar(sizeof($info)); draw_navigation_bar(sizeof($info));
echo ("<br>\n"); echo ("<br>\n");
echo ("<table align=\"left\" border=\"0\"\n>"); }
echo ("<tr><td align=\"left\"><input type=\"submit\" name=\"new_group\" value=\"" . _("New Group") . "\"></td>\n");
echo ("<td align=\"left\"><input type=\"submit\" name=\"del_group\" value=\"" . _("Delete Group(s)") . "\"></td></tr>\n"); echo ("<p align=\"left\">\n");
echo ("</table>\n"); echo ("<input type=\"submit\" name=\"new_group\" value=\"" . _("New Group") . "\">\n");
if (sizeof($info) > 0) echo ("<input type=\"submit\" name=\"del_group\" value=\"" . _("Delete Group(s)") . "\">\n");
echo ("</p>\n");
echo ("</form>\n"); echo ("</form>\n");
echo "</body></html>\n"; echo "</body></html>\n";

View File

@ -97,8 +97,8 @@ else {
$searchfilter = ""; $searchfilter = "";
for ($k = 0; $k < sizeof($desc_array); $k++) { for ($k = 0; $k < sizeof($desc_array); $k++) {
if ($_POST["filter" . strtolower($attr_array[$k])]) { if ($_POST["filter" . strtolower($attr_array[$k])]) {
$searchfilter = $searchfilter . "&filter" . strtolower($attr_array[$k]) . "=". $searchfilter = $searchfilter . "&amp;filter" . strtolower($attr_array[$k]) . "='".
$_POST["filter" . strtolower($attr_array[$k])]; $_POST["filter" . strtolower($attr_array[$k])] . "'";
} }
} }
@ -136,8 +136,11 @@ else StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences
echo ("<form action=\"listhosts.php\" method=\"post\">\n"); echo ("<form action=\"listhosts.php\" method=\"post\">\n");
// draw navigation bar if host accounts were found
if (sizeof($info) > 0) {
draw_navigation_bar(sizeof($info)); draw_navigation_bar(sizeof($info));
echo ("<br>"); echo ("<br>\n");
}
// print host table header // print host table header
echo "<table rules=\"all\" class=\"hostlist\" width=\"100%\">\n"; echo "<table rules=\"all\" class=\"hostlist\" width=\"100%\">\n";
@ -195,13 +198,16 @@ echo ("</table>");
echo ("<br>"); echo ("<br>");
// draw navigation bar if host accounts were found
if (sizeof($info) > 0) {
draw_navigation_bar(sizeof($info)); draw_navigation_bar(sizeof($info));
echo ("<br>\n"); echo ("<br>\n");
echo ("<table align=\"left\" border=\"0\">\n"); }
echo ("<tr><td align=\"left\"><input type=\"submit\" name=\"new_host\" value=\"" . _("New Host") . "\"></td>\n");
echo ("<td align=\"left\"><input type=\"submit\" name=\"del_host\" value=\"" . _("Delete Host(s)") . "\"></td></tr>\n"); echo ("<p align=\"left\">\n");
echo ("</table>\n"); echo ("<input type=\"submit\" name=\"new_host\" value=\"" . _("New Host") . "\">\n");
if (sizeof($info) > 0) echo ("<input type=\"submit\" name=\"del_host\" value=\"" . _("Delete Host(s)") . "\">\n");
echo ("</p>\n");
echo ("</form>\n"); echo ("</form>\n");
echo "</body></html>\n"; echo "</body></html>\n";