Location: PHPKode > projects > GolfstatsPHP > golfstatsphp_3.0/tournament.php
<?
include("dbasecon.inc.php");
include("session.inc.php");
include ("header.php");
include ("statscoursefunctions.inc.php");



//get list of tourneys

$tourneysql="select *,date_format(date,'%d/%m/%Y') as real_date from tourney
					order by date ASC";
				$tourneyquery=mysql_query($tourneysql);
				$tourneyrow=mysql_fetch_array($tourneyquery);
				$tourneyexist=mysql_numrows($tourneyquery);


?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<? showheader("View Tournaments"); ?>


<? echo "<p class='error'>".$error."<p>"; ?>

<b class="error">Click on the tournament for details.</b><p>




<u><b>Tournaments: <? echo $tourneyexist; ?></b></u>

<p>
<?
if ($tourneyexist) {

?>

<table border=1 width="90%">
<tr class="menu-bg">
<td>Date</td><td>Tournament</td><td>Type</td><td>Location</td><td>Champion</td><td>Score</td><td>Purse</td>
</tr>




<?



//OK, populate the drop down on the row.
do {


extract($tourneyrow);

//first get the userid's name
$namesql="select name, surname from users_tour
								 where userid='$championid'";
				$namequery=mysql_query($namesql);
				$namerow=mysql_fetch_array($namequery);
				$nameexist=mysql_numrows($namequery);

//then get the venue
$venuesql="select coursename from courses
								 where courseid='$tourneyvenue'";
				$venuequery=mysql_query($venuesql);
				$venuerow=mysql_fetch_array($venuequery);
				$venueexist=mysql_numrows($venuequery);
				
extract($namerow);
extract($venuerow);

echo "<tr class='bg2'><td>$real_date</td><td><a href='tournament2.php?tourney_id=$tourneyid'>$tourneyname</a></td>
<td>$tourneytype</td><td><a href='statscourse2.php?courseid=$tourneyvenue&action=view'>$coursename</a></td>
<td><a href='players2.php?userid=$championid&action=details&fullname=$name $surname'>$name $surname</a></td><td>$championscore</td><td>\$$tourneypurse</td>";
echo "</tr>";

$total_gross=0;
$total_net=0;
																																															
}while ($tourneyrow=mysql_fetch_array($tourneyquery));
 //endwhile


echo "</table>";








} else {

echo "<b>There are no tournaments available."; 
}
?>


<? showfooter(); ?>


Return current item: GolfstatsPHP