- Make the user list a little cleaner for multiple-role users. It makes the

code ugly however :(
This commit is contained in:
dave 2009-02-11 08:07:04 +00:00
parent 1b4e596a0f
commit 959f45d725

View File

@ -175,31 +175,30 @@ function toggleoptions()
$completeno=0;
while($r=mysql_fetch_assoc($q))
{
echo "<tr><td>";
$types = split(',', $r['types']);
$span = count($types) > 1 ? "rowspan=\"".count($types)."\"" : '';
echo "<tr><td $span>";
echo "<a href=\"#\" onclick=\"return openeditor({$r['id']})\">{$r['firstname']} {$r['lastname']}</a>";
echo "</td>";
echo "<td>{$r['email']}</td>";
echo "<td $span>{$r['email']}</td>";
echo "<td>{$r['year']}</td>";
echo "<td $span>{$r['year']}</td>";
echo "<td>";
$types = split(',', $r['types']);
foreach($types as $t) echo $user_what[$t]."<br />";
echo "</td>";
echo "<td>";
$first = true;
foreach($types as $t) {
if(!$first) echo '</tr><tr>';
echo "<td>{$user_what[$t]}</td>";
echo "<td>";
if($r["{$t}_active"] == 'yes') {
echo "<div class=\"happy\" align=\"center\">".i18n("yes")."</div>";
} else {
echo "<div class=\"error\" align=\"center\">".i18n("no")."</div>";
}
}
echo "</td>";
echo "</td>";
echo "<td>";
foreach($types as $t) {
echo "<td>";
if($r["{$t}_complete"] == 'yes') {
echo "<div class=\"happy\" align=\"center\">".i18n("yes")."</div>";
$completeyes++;
@ -207,13 +206,19 @@ function toggleoptions()
echo "<div class=\"error\" align=\"center\">".i18n("no")."</div>";
$completeno++;
}
echo "</td>";
if($first) {
/* Finish off the the first line */
echo "<td $span align=\"center\">";
echo "<a href=\"#\" onclick=\"return openeditor({$r['id']})\"><img border=0 src=\"{$config['SFIABDIRECTORY']}/images/16/edit.{$config['icon_extension']}\"></a>&nbsp;";
echo "<a onclick=\"return confirmClick('Are you sure you completely delete this user?')\" href=\"user_list.php?action=remove&uid={$r['id']}\"><img border=0 src=\"{$config['SFIABDIRECTORY']}/images/16/button_cancel.{$config['icon_extension']}\"></a>";
echo "</td>";
}
$first = false;
}
echo "</td>";
echo "<td align=\"center\">";
echo "<a href=\"#\" onclick=\"return openeditor({$r['id']})\"><img border=0 src=\"{$config['SFIABDIRECTORY']}/images/16/edit.{$config['icon_extension']}\"></a>&nbsp;";
echo "<a onclick=\"return confirmClick('Are you sure you completely delete this user?')\" href=\"user_list.php?action=remove&uid={$r['id']}\"><img border=0 src=\"{$config['SFIABDIRECTORY']}/images/16/button_cancel.{$config['icon_extension']}\"></a>";
echo "</td>";
echo "</tr>";
echo '</tr>';
}
echo "</table>";