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

added check for empty list

parent 9a3519b1
No related branches found
No related tags found
No related merge requests found
......@@ -75,37 +75,49 @@ printHeader(array(
</tr>
<?php
$_SESSION['attr_user_id'] = $_POST['user_id'];
if (isset($_SESSION['attr_user_id'])) {
if (isset($_POST['user_id'])) {
$temp = $_SESSION['attr_user_id'];
$sql = "SELECT ID, Name, Operator, Value, Disabled FROM ${DB_TABLE_PREFIX}user_attributes WHERE UserID = $temp ORDER BY ID";
$res = $db->query($sql);
if ($res) {
while ($row = $res->fetchObject()) {
$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="attr_id" value="<?php echo $row->id ?>"/><?php echo $row->id ?></td>
<td><?php echo $row->name ?></td>
<td><?php echo $row->operator ?></td>
<td><?php echo $row->value ?></td>
<td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no' ?></td>
</tr>
<tr class="resultsitem">
<td><input type="radio" name="attr_id" value="<?php echo $row->id ?>"/><?php echo $row->id ?></td>
<td><?php echo $row->name ?></td>
<td><?php echo $row->operator ?></td>
<td><?php echo $row->value ?></td>
<td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no' ?></td>
</tr>
<?php
}
$res->closeCursor();
}
$res->closeCursor();
if ($rownums <= 0) {
?>
</table>
</form>
<p />
<tr>
<td colspan="5" class="textcenter">Group attribute list is empty</td>
</tr>
<?php
} else {
}
unset($rownums);
} else {
?>
<div class="warning">Invocation error, no user ID selected</div>
<tr class="resultitem">
<td colspan="5" class="textcenter">No User ID selected</td>
</tr>
<?php
}
}
?>
</table>
</form>
<?php
printFooter();
......
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