Skip to content
Snippets Groups Projects
Commit d4df8e85 authored by Robert Anderson's avatar Robert Anderson
Browse files

Added check for empty list

parent cf354883
No related branches found
No related tags found
No related merge requests found
......@@ -80,7 +80,13 @@ printHeader(array(
$sql = "SELECT ID, Name, Priority, Disabled, Comment FROM ${DB_TABLE_PREFIX}groups ORDER BY ID";
$res = $db->query($sql);
$rownums = 0;
while ($row = $res->fetchObject()) {
if ($row->id != NULL) {
$rownums = $rownums + 1;
} else {
$rownums = $rownums - 1;
}
?>
<tr class="resultsitem">
<td><input type="radio" name="group_id" value="<?php echo $row->id ?>" /></td>
......@@ -92,13 +98,19 @@ printHeader(array(
<?php
}
$res->closeCursor();
if ($rownums <= 0) {
?>
<tr>
<td class="textcenter">Group list is empty</td>
</tr>
<?php
}
unset($rownums);
?>
</table>
</form>
<?php
printFooter();
# vim: ts=4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment