<?php
	if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
?>

&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo $g_options["imgdir"]; ?>/downarrow.gif" width=9 height=6 border=0 align="middle" alt="downarrow.gif"><b>&nbsp;<a href="<?php echo $g_options["scripturl"]; ?>?mode=admin&task=tools_editdetails">Edit Player or Clan Details</a></b><br>

<img src="<?php echo $g_options["imgdir"]; ?>/spacer.gif" width=1 height=8 border=0><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo $g_options["imgdir"]; ?>/downarrow.gif" width=9 height=6 border=0 align="middle" alt="downarrow.gif"><b>&nbsp;<?php echo "Edit Clan #$id"; ?></b><p>

<form method="POST" action="<?php echo $g_options["scripturl"] . "?mode=admin&task=$selTask&id=$id"; ?>">
<?php
	$proppage = new PropertyPage("hlstats_Clans", "clanId", $id, array(
		new PropertyPage_Group("Profile", array(
			new PropertyPage_Property("name", "Clan Name", "text"),
			new PropertyPage_Property("homepage", "Homepage URL", "text")
		))
	));
	
	
	if ($HTTP_POST_VARS)
	{
		$proppage->update();
		message("success", "Profile updated successfully.");
	}
	
	
	
	$result = $db->query("
		SELECT
			*
		FROM
			hlstats_Clans
		WHERE
			clanId='$id'
	");
	if ($db->num_rows() < 1) die("No clan exists with ID #$id");
	
	$data = $db->fetch_array($result);
	
	echo $g_options["font_title"];
	echo $data["tag"];
	echo $g_options["fontend_title"];
	
	echo $g_options["font_normal"];
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
		. "<a href=\"" . $g_options["scripturl"] . "?mode=claninfo&clan=$id" . "\">"
		. "(View Clan Details)</a>";
	echo $g_options["fontend_normal"];
?><p>

<table width="60%" align="center" border=0 cellspacing=0 cellpadding=0>
<tr>
	<td><?php
		echo $g_options["font_normal"];
		$proppage->draw($data);
		echo $g_options["fontend_normal"];
?>
	<center><input type="submit" value="  Apply  " class="submit"></center></td>
</tr>
</table>
</form>

