Location: PHPKode > projects > Guild DKP System > dkpsystem1.4/includes/points.php
<table width="100%" border="0" cellspacing="1" cellpadding="3">
  <tr> 
    <td bgcolor="#003366"><font size="2"><strong><font color="#FFFFFF">Points 
      :: </font> <font size="1"> </font><font size="2"><strong><font size="1"> 
      <?php
$sql = $db->query("SELECT * FROM dkp_classes");
while($class_row = mysql_fetch_array($sql)) {
	$classid = $class_row[id];
	$class_name = $class_row['class'];
	//class colors
	if(strtolower($class_name) == "druid") { $class_color = COLOR_DRUID; }
	elseif(strtolower($class_name) == "hunter") { $class_color = COLOR_HUNTER; }
	elseif(strtolower($class_name) == "mage") { $class_color = COLOR_MAGE; }
	elseif(strtolower($class_name) == "paladin") { $class_color = COLOR_PALADIN; }
	elseif(strtolower($class_name) == "priest") { $class_color = COLOR_PRIEST; }
	elseif(strtolower($class_name) == "rogue") { $class_color = COLOR_ROGUE; }
	elseif(strtolower($class_name) == "shaman") { $class_color = COlOR_SHAMAN; }
	elseif(strtolower($class_name) == "warlock") { $class_color = COLOR_WARLOCK; }
	elseif(strtolower($class_name) == "warrior") { $class_color = COLOR_WARRIOR; }
	else { $class_color = COLOR_DEFAULT; }
	$font_color = $class_color;
	echo "<a href='#$class_name'><font color='$font_color'>$class_name</font></a> ";
}
?>
      <font color="#FFFFFF" face="Tahoma"><a href="javascript:popUp('quickview.php');">Quick 
      View</a></font></font></strong></font></strong></font></td>
  </tr>
</table>
<?php
$sql = $db->query("SELECT * FROM dkp_classes");
while($class_row = mysql_fetch_array($sql)) {
	$classid = $class_row[id];
	$class_name = $class_row['class'];
?>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
  <tr bgcolor="#003366"> 
    <td colspan="4"><font color="#CCCCCC" size="1"><strong><a name="<?php echo $class_name; ?>"><?php echo $class_name; ?></a></strong></font></td>
  </tr>
  <tr bgcolor="#999999"> 
    <td width="55%"><strong><font size="1"><u>Character</u></font></strong></td>
    <td width="10%"> 
      <div align="left"><strong><font size="1"><u>Class Points</u></font></strong></div></td>
    <td width="15%"> 
      <div align="left"><strong><font size="1"><u>General Points</u></font></strong></div></td>
    <td width="10%"> 
      <div align="left"><strong><font size="1"><u>Last Active</u></font></strong></div></td>
  </tr>
  <?php
	$sql2 = $db->query("SELECT * FROM dkp_users WHERE class=\"$classid\" ORDER BY class_points DESC, name ASC");
	if($db->count_rows($sql2) > 0) {
		while($row = mysql_fetch_array($sql2)) {
			$id = $row[id];
			$character = $row[name];
			$class_points = $row[class_points];
			$general_points = $row[class_points_general];
			$last_active = $row[last_raid_date];
			
			$color1 = "#CCCCCC";
			$color2 = "#D7D7D7";
			$row_color = ($row_count % 2) ? $color1 : $color2;
			$row_count++;
?>
  <tr bgcolor="<?php echo $row_color; ?>" onmouseover="this.style.backgroundColor='#BEBEBE';" onmouseout="this.style.backgroundColor='<?php echo $row_color; ?>';"> 
    <td><strong><font size="1"><a href="javascript:popUp('includes/playerhistory.php?id=<?php echo $id; ?>')"><font color="black"><?php echo $character; ?></font></a></font></strong></td>
    <td> <div align="left"><strong><font size="1"><?php echo $class_points; ?></font></strong></div></td>
    <td> <div align="left"><strong><font size="1"><?php echo $general_points; ?></font></strong></div></td>
    <td> <div align="left"><strong><font size="1"><?php echo $last_active; ?></font></strong></div></td>
  </tr>
  <?php
		}
	}
	else {
?>
  <tr bgcolor="#CCCCCC"> 
    <td colspan="4"><img src="images/arrow.gif" width="20" height="10"><strong><font size="1"> 
      </font></strong><font size="1"><strong>No players in this category.</strong></font></td>
  </tr>
  <?php
	}
?>
</table>
<?php
}
?>
Return current item: Guild DKP System