<?PHP 

	if (!is_numeric($_GET[edit_id])) { header('Location:'.$site_url.'/?error=invalid_id'); }
	  
	include("config.php");
	
	// only admins can validate
	if(!is_admin($user)){
		header('Location:'.$site_url.'/');
		exit();
	}
	
	// get the info for the edit based on ID
	// if the ID isn't valid, punt the user
	$edit_id_here = intval(mysql_escape_string($_GET[edit_id]));
	$results = mysql_query("SELECT * FROM ".$prefix."TriclubsEdits WHERE edit_id = '".$edit_id_here."'");
	$row = mysql_fetch_array($results);
	if (!$row) { header('Location:'.$site_url.'/?error=no_entry'); }
	
	// set the page title
	$pagetitle = $row[triclub_name];
	
	// set meta tags
	$meta_keywords = "triathlon, ".$row[triclub_name].", ".$row[triclub_state]." triathlon triclub";
	$meta_description = "Considering joining ".$row[triclub_name]."? Here is all of the information about this triclub.";
	
	include("include_common_head.php");

?>


<body class="listings">
  <? include($common_path . "/ads/ad_wallpaper.html"); ?>

  <div class="container">
    <? include($common_path . "/templates/include_header.php"); ?>
    <div class="main">
      <div class="contentwrapper clearfix">
        <? include("include_breadcrumb.php"); ?>

        <section class="section listings section-has-widgets">
          <div class="sidebar-b">
            <? include("include_sidebar.php"); ?>
          </div>

          <div class="content content-has-widgets">
            <div class="grid">

              <div class="clearfix">
<h2 style="display: inline; height: 16px; margin-bottom: 20px;"><!-- class="content-title"--><? echo stripslashes($row[triclub_name]) ; echo " "; ?></h2>

<? 

	// wiki control buttons
	include("wiki_buttons.php") 

?>

<div style="margin-top: 10px;">


<?
	$sqlWikiFetch = "SELECT user_username FROM ".$prefix."User WHERE user_id = ".mysql_escape_string($row[editor_user_id_fk])." LIMIT 1";
	
	$arrUser = mysql_fetch_array(mysql_query($sqlWikiFetch));
	
	$strEditor = $arrUser[user_username];
 ?>
<strong>Editor:</strong> <? echo "<a href=\"http://forum.slowtwitch.com/gforum.cgi?username=".$strEditor.";\" target=\"_blank\">".$strEditor."</a>"; ?>
<br />

<strong>Edit Date:</strong> <? echo date("F j, Y", $row[edit_timestamp]); ?>
<br />

<strong>Street Address: </strong><? echo stripslashes(htmlspecialchars($row[triclub_address])); ?>
<br />
<strong>Street Address Two: </strong><? echo stripslashes(htmlspecialchars($row[triclub_address_two])); ?>
<br />
<strong>City: </strong><? echo stripslashes(htmlspecialchars($row[triclub_city])); ?>
<br />
<strong>State: </strong><? echo stripslashes(htmlspecialchars($row[triclub_state])); ?>
<br />
<strong>Zip/Postal Code: </strong><? echo stripslashes(htmlspecialchars($row[triclub_zip])); ?>
<br />
<strong>E-mail: </strong><a href="mailto:<? echo $row[triclub_email]; ?>"><? echo stripslashes(htmlspecialchars($row[triclub_email])); ?></a>
<br />
<strong>Website: </strong><a href="<? echo $row[triclub_website]; ?>" target="_blank"><? echo $row[triclub_website]; ?></a>

<br />
<br />

<div class="indentlarge">
<? 
for ($i = 0; $i < 33; $i++) echo("*"); 
echo (" MEMBERSHIP ");
for ($i = 0; $i < 33; $i++) echo("*"); 
?>
</div>

<br />
<strong>Club President: </strong><? echo stripslashes(htmlspecialchars($row[triclub_president])); ?>
<br />
<strong>Board Member(s): </strong><? if ($row[triclub_board] == 0) { echo "None"; } else { echo "Yes, Their Names - "; echo stripslashes($row[triclub_board_names]); } ?> 
<br />
<strong>Total Membership: </strong><? echo $row[triclub_membership]; ?>
<br />
<strong>Club Dues: </strong><? echo stripslashes(htmlspecialchars($row[triclub_dues]));  ?>

<br /><br />
<div class="indentlarge">
<? 
for ($i = 0; $i < 80; $i++) echo("*"); 
?>
</div>
<br />
<strong>Club Info: </strong><? echo stripslashes(stripslashes($row[triclub_info])) ?>
<br /><br />
<strong>Club Sponsors: </strong><? echo stripslashes(stripslashes($row[triclub_sponsors])) ?>
<br /><br />
<strong>Club Discounts: </strong><? echo stripslashes(stripslashes($row[triclub_discounts])) ?>
<br /><br />
<strong>Directions to Meeting Location(s): </strong><? echo stripslashes(stripslashes($row[triclub_directions])); ?>
<br /><br />
<strong>Club Workout Schedule: </strong><? echo stripslashes(stripslashes($row[triclub_workouts])); ?>
<br /><br />
<strong>Club Meetings &amp; Events Schedule: </strong><? echo stripslashes(stripslashes($row[triclub_meetings])); ?>
<br /><br />
<strong>Directions to Workouts &amp; Meeting Location(s): </strong><? echo stripslashes(stripslashes($row[triclub_directions])); ?>

<br />

</div>

              </div><!-- end col-2/3 -->

            </div><!-- end grid -->
          </div><!-- end content -->
        </section>


      </div><!-- end contentwrapper -->
    </div> <!-- end main -->

  <? include($common_path . "/templates/include_footer.php") ?>
  </div> <!-- container  -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>
