weir-07
05-10-2009, 02:28 PM
Hey guys!
I have the following bit of code for a "Members List" type thing at the moment.
<table width="100%" border="0" cellspacing="2" cellpadding="1" style="border:#036 solid 1px;">
<tr>
<td bgcolor="#003366"><strong>Rank</strong></td>
<td bgcolor="#003366"><strong>Handle</strong></td>
<td bgcolor="#003366"><strong>Affiliation</strong></td>
<td bgcolor="#003366"><strong>Status</strong></td>
</tr>
<?php
mysql_select_db($database_STC, $STC);
$query_members = "SELECT accounts.*,rank FROM accounts join ranks on accounts.cl = ranks.cl WHERE accounts.cl > '0' ORDER BY ranks.cl DESC";
$members = mysql_query($query_members, $STC) or die(mysql_error());
$totalRows_members = mysql_num_rows($members);
while ($row_members = mysql_fetch_assoc($members)) { ?><tr>
<td width="190" align="left" valign="middle" style="border:#069 solid 1px;"><?php echo ucwords($row_members['rank']); ?> (CL<?php echo $row_members['cl']; ?>)</td>
<td align="left" valign="middle" style="border:#069 solid 1px;">
<a href=profile.php?username=<?php echo $row_members['username']; ?> target=_blank style="text-decoration:none; color:#39F"><?php echo ucwords($row_members['handle']); ?></a>
</td>
<td width="100" align="left" valign="middle" style="border:#069 solid 1px;"><?php echo ucwords($row_members['affiliation']); ?></td>
<td width="100" align="left" valign="middle" style="border:#069 solid 1px;">
<font color="<? if ($row_members['status'] == "active") { echo "#33CC33"; }
if ($row_members['status'] == "registered") { echo "#6699FF"; }
if ($row_members['status'] == "confirmed") { echo "#6666CC"; }
if ($row_members['status'] == "suspended") { echo "#CC0000"; }
if ($row_members['status'] == "on leave") { echo "#999999"; }
if ($row_members['status'] == "extended leave") { echo "#666666"; } ?>">
<?php echo ucwords($row_members['status']); ?></font></td>
</tr><?php } ?>
And would like to apply a "Clearance Level" filter without having to create separate database entries and just using the data already pulled.
What i mean by this is instead of the current set up where all the data just displays i would like to have headings of:
Clearance Level 19:
- List members
Clearance Level 18:
- List members
Does anybody know if this is possible?
I had a fiddle with it but i'm not too sure if it can even be done... :confused:
I have the following bit of code for a "Members List" type thing at the moment.
<table width="100%" border="0" cellspacing="2" cellpadding="1" style="border:#036 solid 1px;">
<tr>
<td bgcolor="#003366"><strong>Rank</strong></td>
<td bgcolor="#003366"><strong>Handle</strong></td>
<td bgcolor="#003366"><strong>Affiliation</strong></td>
<td bgcolor="#003366"><strong>Status</strong></td>
</tr>
<?php
mysql_select_db($database_STC, $STC);
$query_members = "SELECT accounts.*,rank FROM accounts join ranks on accounts.cl = ranks.cl WHERE accounts.cl > '0' ORDER BY ranks.cl DESC";
$members = mysql_query($query_members, $STC) or die(mysql_error());
$totalRows_members = mysql_num_rows($members);
while ($row_members = mysql_fetch_assoc($members)) { ?><tr>
<td width="190" align="left" valign="middle" style="border:#069 solid 1px;"><?php echo ucwords($row_members['rank']); ?> (CL<?php echo $row_members['cl']; ?>)</td>
<td align="left" valign="middle" style="border:#069 solid 1px;">
<a href=profile.php?username=<?php echo $row_members['username']; ?> target=_blank style="text-decoration:none; color:#39F"><?php echo ucwords($row_members['handle']); ?></a>
</td>
<td width="100" align="left" valign="middle" style="border:#069 solid 1px;"><?php echo ucwords($row_members['affiliation']); ?></td>
<td width="100" align="left" valign="middle" style="border:#069 solid 1px;">
<font color="<? if ($row_members['status'] == "active") { echo "#33CC33"; }
if ($row_members['status'] == "registered") { echo "#6699FF"; }
if ($row_members['status'] == "confirmed") { echo "#6666CC"; }
if ($row_members['status'] == "suspended") { echo "#CC0000"; }
if ($row_members['status'] == "on leave") { echo "#999999"; }
if ($row_members['status'] == "extended leave") { echo "#666666"; } ?>">
<?php echo ucwords($row_members['status']); ?></font></td>
</tr><?php } ?>
And would like to apply a "Clearance Level" filter without having to create separate database entries and just using the data already pulled.
What i mean by this is instead of the current set up where all the data just displays i would like to have headings of:
Clearance Level 19:
- List members
Clearance Level 18:
- List members
Does anybody know if this is possible?
I had a fiddle with it but i'm not too sure if it can even be done... :confused: