<?php
$action = $_GET[action];
$section = $_GET[s];
$checked = $_GET[checked];
$disputeid = $_GET[disputeid];
if(isset($action) && $action == "delete") {
$sql = $db->query("DELETE FROM dkp_disputes WHERE id=\"$disputeid\"");
if($sql) {
systemMessage("Dispute Deleted", "This dispute has been removed from the database.");
}
}
elseif(isset($checked) && $checked == "true") {
$sql = $db->query("UPDATE dkp_disputes SET checked=1 WHERE id=\"$disputeid\"");
if($sql) {
systemMessage("Dispute Verified", "This dispute has been verified, and will no longer be shown as a new dispute.");
}
}
else {
?>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td bgcolor="#003366"><font color="#FFFFFF" size="2" face="Tahoma"><strong>Disputes</strong></font></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td colspan="7" bgcolor="#003366"><font color="#CCCCCC" size="1" face="Tahoma"><strong>Details</strong></font></td>
</tr>
<tr>
<td width="15%" bgcolor="#999999"><u><strong><font size="1" face="Tahoma">Character</font></strong></u></td>
<td width="15%" bgcolor="#999999"><u><strong><font size="1" face="Tahoma">Raid Date</font></strong></u></td>
<td width="15%" bgcolor="#999999"><u><strong><font size="1" face="Tahoma">Event</font></strong></u></td>
<td width="15%" bgcolor="#999999"><u><strong><font size="1" face="Tahoma">Class Points</font></strong></u></td>
<td width="15%" bgcolor="#999999"><u><strong><font size="1" face="Tahoma">General Points</font></strong></u></td>
<td width="15%" bgcolor="#999999"><u><strong><font size="1" face="Tahoma">Disputed</font></strong></u></td>
<td width="15%" bgcolor="#999999"><div align="center"><u><strong><font size="1" face="Tahoma">Delete</font></strong></u></div></td>
</tr>
<?php
$sql = $db->query("SELECT * FROM dkp_disputes ORDER BY checked ASC, id DESC");
if($db->count_rows($sql) > 0) {
while($row = mysql_fetch_array($sql)) {
$character = @mysql_result($db->query("SELECT name FROM dkp_users WHERE id=\"$row[userid]\""), 0);
$event = @mysql_result($db->query("SELECT raid FROM dkp_sessions WHERE id=\"$row[sessionid]\""), 0);
$raiddate = $row[raiddate];
$class_points = $row[class_points];
$general_points = $row[general_points];
$disputed = $row[dateadded];
$disputeid = $row[id];
$description = $row[description];
$checked = $row[checked];
$color1 = "#CCCCCC";
$color2 = "#D7D7D7";
$row_color = ($row_count % 2) ? $color1 : $color2;
$row_count++;
?>
<tr bgcolor="<?php echo $row_color; ?>" onMouseover="fixedtooltip('<font color=\'#000000\' size=\'1\' face=\'Tahoma\'><b><u>Description</u>:<br><?php echo addslashes($description); ?></b></font>', this, event, '350px')" onMouseout="delayhidetip()">
<td> <strong><font size="1" face="Tahoma">
<?php if($checked == 1) { echo $character; } else { echo "<a name'$disputeid' href='?d=admin&s=disputes&checked=true&disputeid=$disputeid#$disputeid'><font color='#000000'>$character</font></a> <font color='#006600'>[new]</font>"; }?>
</font></strong></td>
<td><strong><font size="1" face="Tahoma"><?php echo $raiddate; ?></font></strong></td>
<td><strong><font size="1" face="Tahoma"><?php echo $event; ?></font></strong></td>
<td><strong><font size="1" face="Tahoma"><?php echo $class_points; ?></font></strong></td>
<td><strong><font size="1" face="Tahoma"><?php echo $general_points; ?></font></strong></td>
<td><strong><font size="1" face="Tahoma"><?php echo $disputed; ?></font></strong></td>
<td><div align="center"><strong><font size="1" face="Tahoma">[ <a href="?d=admin&s=disputes&action=delete&disputeid=<?php echo $disputeid; ?>"><font color="#000000">x</font></a>
]</font></strong></div></td>
</tr>
<?php
}
}
else {
?>
<tr bgcolor="#CCCCCC">
<td colspan="7"><font color="#000000" size="1" face="Tahoma"><strong>There are no disputes currently recorded.</strong></font></td>
</tr>
<?php
}
?>
</table>
<?php
}
?>