discourse-legacysite-perl/site/racecalendar/regionlist.php

92 lines
3.8 KiB
PHP
Raw Normal View History

2024-06-17 12:42:14 +00:00
<?PHP include("config.php");
require_once("rating/classes/include.all.php");
$regionid = mysql_escape_string($_GET[region]);
$results = mysql_query("SELECT regionlong FROM gforum_TriathlonsRegions WHERE regionid = $regionid LIMIT 1");
$row = mysql_fetch_array($results);
$regionname = $row[regionlong];
/*$results = mysql_query("SELECT gtr.regionlong, gt.onetype, gt.twotype, threetype, oneunit, twounit, threeunit, name, nametag, gt.statetag, swim, bike, run, city, state, uid, UNIX_TIMESTAMP(date) as foo FROM gforum_TriathlonsRegions WHERE gtr.regionid = ".intval(mysql_escape_string($_GET[region]))." LEFT JOIN gforum_TriathlonsStates AS gts ON gts.regionid = gtr.regionid LEFT JOIN gforum_Triathlons AS gt ON gt.statetag = gts.statetag AND valid=1 AND date > '2008-01-01' ORDER BY gt.date ASC");*/
$results = mysql_query("SELECT gt.onetype, gt.twotype, gt.threetype, gt.oneunit, gt.twounit, gt.threeunit, gt.name, gt.nametag, gt.statetag, gt.swim, gt.bike, gt.run, gt.city, gt.state, gt.uid, UNIX_TIMESTAMP(gt.date) as foo
FROM gforum_Triathlons AS gt
RIGHT JOIN gforum_TriathlonsStates AS gts
ON gts.regionid = '".intval(mysql_escape_string($_GET[region]))."' AND gt.statetag = gts.statetag
WHERE valid = 1 AND date > '".$min_date."' ORDER BY gt.date ASC");
$none = FALSE;
if (mysql_num_rows($results) == 0) {
$none = TRUE;
}
/*$results = mysql_query("SELECT onetype, twotype, threetype, oneunit, twounit, threeunit, name, nametag, statetag, swim, bike, run, city, state, uid, UNIX_TIMESTAMP(date) as foo FROM gforum_Triathlons RIGHT JOIN WHERE regionid='$_GET[region]' AND valid=1 AND date > '2008-01-01' ORDER BY date ASC");**/
// set the page title
$pagetitle = $regionname;
$selected_item = mysql_escape_string($_GET[region]);
// set meta tags
$meta_keywords = "triathlons in ".$regionname;
$meta_description = "Trying to find triathlons or duathlons in ".$regionname."? Here is a listing of all ".$regionname." triathlons. Users can even rate and comment on races.";
?>
<? 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 section-static remove-sidebar">
<div class="sidebar-b">
<? include("include_sidebar.php"); ?>
</div>
<div class="content content-has-widgets">
<div class="grid">
<div class="clearfix">
<h1 class="float-left">Triathlons</h1>
<a href="<? echo $site_url ?>" class="btn btn-white float-right">Back</a>
<? if (is_logged_in($user)) { ?>
<a href="<? echo $site_url . "/add.php" ?>" class="btn btn-white float-right">Add Race</a>
<? } ?>
<hr class="line" />
<? include("../runshops/include_region_list.php"); ?>
<h2><? echo $regionname ?> Region</h2>
<hr />
<?
if($none == TRUE){
echo "<p>No triathlons have been entered yet for $regionname.</p>";
}
?>
<? while ($row = mysql_fetch_array($results)) {
include("include_race.php");
} ?>
</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>