Location: PHPKode > projects > Guild DKP System > dkpsystem1.4/includes/playerhistory.php
<?php
require("../config.php");
$id = $_GET[id];
$sql = $db->query("SELECT * FROM dkp_users WHERE id=\"$id\"");
if($db->count_rows($sql) > 0) {
	while($row = @mysql_fetch_array($sql)) {
		$events = $row[events];
		$userid = $row[id];
		$character = $row[name];
		$classid = $row['class'];
		$class = @mysql_result($db->query("SELECT class FROM dkp_classes WHERE id=\"$classid\""), 0);
		$class_points = $row[class_points];
		$general_points = $row[class_points_general];
		$last_raid = $row[last_raid_date];
	}
	$sql2 = $db->query("SELECT occurances FROM dkp_stats");
	while($row = mysql_fetch_array($sql2)) {
		$occurances = $row[occurances];
		$totalEvents = $occurances + $totalEvents;
	}
	if($events != 0) { $attendance = round(($events / $totalEvents) * 100); }
	else { $attendance = 0; }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Player History</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#CCCCCC" text="#000000" link="#CCCCCC" vlink="#CCCCCC" alink="#CCCCCC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="1" cellpadding="3">
  <tr>
    <td bgcolor="#E9E9E9"><table width="100%" border="0" cellspacing="1" cellpadding="3">
        <tr> 
          <td bgcolor="#003366"><font color="#FFFFFF" size="2" face="Tahoma"><strong>Player 
            History</strong></font></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="1" cellpadding="3">
        <tr bgcolor="#003366"> 
          <td colspan="2"><font color="#CCCCCC" size="1" face="Tahoma"><strong>General 
            Details</strong></font></td>
        </tr>
        <tr> 
          <td width="20%" bgcolor="#999999"><strong><font color="#000000" size="1" face="Tahoma">Character</font></strong></td>
          <td width="80%" bgcolor="#CCCCCC"><strong><font color="#000000" size="1" face="Tahoma"><?php echo $character; ?></font></strong></td>
        </tr>
        <tr> 
          <td bgcolor="#999999"><strong><font color="#000000" size="1" face="Tahoma">Class 
            Points</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font size="1" face="Tahoma"><?php echo $class_points; ?></font></strong></td>
        </tr>
        <tr> 
          <td bgcolor="#999999"><strong><font color="#000000" size="1" face="Tahoma">General 
            Points</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font size="1" face="Tahoma"><?php echo $general_points; ?></font></strong></td>
        </tr>
        <tr> 
          <td bgcolor="#999999"><strong><font color="#000000" size="1" face="Tahoma">Last 
            Active</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font size="1" face="Tahoma"><?php echo $last_raid; ?></font></strong></td>
        </tr>
        <tr>
          <td bgcolor="#999999"><font color="#000000" size="1" face="Tahoma"><strong>Attendance</strong></font></td>
          <td bgcolor="#CCCCCC"> 
            <table width="200" border="0" cellpadding="0" cellspacing="1">
              <tr> 
                <td width="160" bgcolor="#999999"> 
                  <table width="<?php echo $attendance; ?>%" height="15" border="0" cellpadding="1" cellspacing="1">
                    <tr> 
                      <td bgcolor="#CCCCCC"> 
                        <div align="center"><font color="#FFFFFF" size="1" face="Tahoma"></font></div></td>
                    </tr>
                  </table>
                </td>
                <td bgcolor="#CCCCCC"><div align="center"><font color="#000000" size="1" face="Tahoma"><strong><?php echo $attendance; ?>%</strong></font> 
                  </div></td>
              </tr>
            </table>
            
          </td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="1" cellpadding="3">
        <tr> 
          <td colspan="3" bgcolor="#003366"><font color="#CCCCCC" size="1" face="Tahoma"><strong>Event 
            History</strong></font></td>
        </tr>
        <tr> 
          <td width="60%" bgcolor="#999999"><strong><font color="#000000" size="1" face="Tahoma">Description</font></strong></td>
          <td width="10%" bgcolor="#999999"> <div align="left"><font color="#000000"><strong><font size="1" face="Tahoma">Value</font></strong></font></div></td>
          <td width="30%" bgcolor="#999999"> <div align="left"><font color="#000000"><strong><font size="1" face="Tahoma">Timestamp</font></strong></font></div></td>
        </tr>
        <?php
$sql = $db->query("SELECT * FROM dkp_realadjustments WHERE userid=\"$userid\" ORDER BY id DESC");
if($db->count_rows($sql) > 0) {
	while($row = @mysql_fetch_array($sql)) {
		$description = $row[reason];
		$value = $row[value];
		$timestamp = $row[stamp];
		$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 color="#000000" size="1" face="Tahoma"><?php echo $description; ?></font></strong></td>
          <td><div align="left"><strong><font color="#000000" size="1" face="Tahoma"><?php echo $value; ?></font></strong></div></td>
          <td><div align="left"><strong><font color="#000000" size="1" face="Tahoma"><?php echo $timestamp; ?></font></strong></div></td>
        </tr>
        <?php
	}
}
else {
?>
        <tr bgcolor="#CCCCCC"> 
          <td colspan="3"><font size="1" face="Tahoma"><img src="../images/arrow.gif" width="20" height="10"><strong> 
            There are no events reported for this user.</strong></font></td>
        </tr>
        <?php
}
?>
        <tr bgcolor="#003366"> 
          <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td><div align="center"><font color="#CCCCCC" size="1" face="Tahoma"><strong>Guild 
                    DKP System v1.4.0 :: <a href="mailto:hide@address.com">Written 
                    by Dexter Brock</a> :: Copyright &copy; 2006 DKPTracker.com</strong></font></div></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
Return current item: Guild DKP System