Fifth pass at adding key files
This commit is contained in:
1754
site/roadshow/add.php
Normal file
1754
site/roadshow/add.php
Normal file
File diff suppressed because it is too large
Load Diff
225
site/roadshow/add_X.php
Normal file
225
site/roadshow/add_X.php
Normal file
@ -0,0 +1,225 @@
|
||||
<?PHP
|
||||
|
||||
if (!$_POST){ header('Location: '.$site_url); }
|
||||
|
||||
/*
|
||||
|
||||
FIELD NAMES:
|
||||
roadshow_id
|
||||
roadshow_date
|
||||
roadshow_name
|
||||
roadshow_name_tag
|
||||
roadshow_address
|
||||
roadshow_address_two
|
||||
roadshow_city
|
||||
roadshow_state
|
||||
roadshow_state_tag
|
||||
roadshow_zip
|
||||
roadshow_lat
|
||||
roadshow_lng
|
||||
roadshow_phone
|
||||
roadshow_fax
|
||||
roadshow_email
|
||||
roadshow_website
|
||||
roadshow_stambassador
|
||||
roadshow_stambassador_names
|
||||
roadshow_triclub
|
||||
roadshow_triclub_names
|
||||
roadshow_coach
|
||||
roadshow_coach_names
|
||||
roadshow_racedirector
|
||||
roadshow_racedirector_names
|
||||
roadshow_brewery
|
||||
roadshow_brewery_names
|
||||
roadshow_local
|
||||
roadshow_fitbike
|
||||
roadshow_saddlechange
|
||||
roadshow_motioncapture
|
||||
roadshow_footbed
|
||||
roadshow_wetsuit
|
||||
roadshow_bike
|
||||
roadshow_trispecific
|
||||
roadshow_trispecific_names
|
||||
roadshow_fist
|
||||
roadshow_fist_names
|
||||
roadshow_diagnostic
|
||||
roadshow_shoe
|
||||
roadshow_sock
|
||||
roadshow_apparel_run
|
||||
roadshow_apparel_tri
|
||||
roadshow_swimgear
|
||||
roadshow_bikeaccessory
|
||||
roadshow_bikebody
|
||||
roadshow_bikecomponent
|
||||
roadshow_bikeelectronic
|
||||
roadshow_bikehelmet
|
||||
roadshow_biketrainer
|
||||
roadshow_bikewheel
|
||||
roadshow_runhydrate
|
||||
roadshow_bodycare
|
||||
roadshow_hours
|
||||
roadshow_activity
|
||||
roadshow_submitted_by
|
||||
roadshow_valid
|
||||
roadshow_user_tags
|
||||
|
||||
*/
|
||||
|
||||
/* Need to ltrim and rtrim commas before insertion */
|
||||
|
||||
//Insert into database
|
||||
//$pass = 'abc123';
|
||||
$errmsg = NULL;
|
||||
$insert_success = NULL;
|
||||
//Check for blank fields
|
||||
if ((!$_POST[name])) $errmsg = $errmsg."Road show event name, ";
|
||||
if ($_POST[month]==0) $errmsg = $errmsg.'event month, ';
|
||||
if ($_POST[day]==0) $errmsg = $errmsg.'event day, ';
|
||||
if (!$_POST[city]) $errmsg = $errmsg."City, ";
|
||||
if (!$_POST[state]) $errmsg = $errmsg."State, ";
|
||||
if (!$_POST[address]) $errmsg = $errmsg."Address, ";
|
||||
if ((!$_POST[lat] || !$_POST[lng]) && $_POST[latlng_override] == true) $errmsg = $errmsg."Lat/Lng cannot be left blank if you wish to override address, ";
|
||||
if (!$_POST[phone]) $errmsg = $errmsg."Phone, ";
|
||||
if (!$_POST[email]) $errmsg = $errmsg."Email, ";
|
||||
if (!$_POST[website]) $errmsg = $errmsg."Website, ";
|
||||
//if (!$_POST[hours]) $errmsg = $errmsg."Shop hours, ";
|
||||
if ($_POST[fist] == 1 && !$_POST[fist_names]) $errmsg = $errmsg.'F.I.S.T. Tri fitters names, ';
|
||||
if (strlen($_POST[activity]) < 4) $errmsg = $errmsg."Runs and classes information, ";
|
||||
if (isset($errmsg)) {
|
||||
$errmsg = "The following fields cannot be left blank: ".$errmsg."<br />";
|
||||
$errmsg = rtrim($errmsg, ", ");
|
||||
}
|
||||
|
||||
$start_url = "(http(s)?\:\/\/)?"; // start url
|
||||
$dots = "([\w_-]{2,}\.)+"; // one or more parts containing a '.' at the end
|
||||
$last_part = "([\w_-]{2,})"; // last part doesn't contain a dot
|
||||
$user = "((\/)(\~)[\w_=-]+)?((\/)[\w_=-]+)*"; // maybe subdirectories - possibly with user ~
|
||||
$end = "((\/)|(\/)[\w_-]+\.[\w]{2,})?"; // maybe a slash at the end or slash+file+extension
|
||||
$qstring1 = "((\?[\w_-]+\=([^\#]+)){0,1}"; // querystring - first argument (?a=b)
|
||||
$qstring2 = "(\&[\w_-]+\=([^\#]+))*)?"; // querystring - following arguments (&c=d)
|
||||
$bkmrk = "(#[\w_-]+)?"; // bookmark
|
||||
|
||||
$exp = "/^".$start_url.$dots.$last_part.$user.$end.$qstring1.$qstring2.$bkmrk."$/i";
|
||||
if( !preg_match($exp, $_POST[website]) ) {
|
||||
// Contains invalid characters.
|
||||
$errmsg = $errmsg."Invalid Web Address<br />";
|
||||
}
|
||||
if( preg_match('/[^a-zA-Z0-9\. ]/', $_POST[name]) ) {
|
||||
// Contains invalid characters.
|
||||
$errmsg = $errmsg."Please use only letters and numbers in the name<br />";
|
||||
}
|
||||
|
||||
// begin error message check
|
||||
if(!$errmsg){
|
||||
|
||||
$name = trim($_POST[name]);
|
||||
$name_tag = strtolower(str_replace(" ","", $name));
|
||||
//if(strlen($name_tag) > 12){ //Shorten it
|
||||
$name_tag = substr($name_tag, 0, 12);
|
||||
//} // need to update a typo here in other dbs
|
||||
$address = mysql_escape_string(trim($_POST[address]));
|
||||
$full_address = $address;
|
||||
if (isset($_POST['address_two'])) { $address_two = mysql_escape_string(trim($_POST[address_two])); } else { $address_two = NULL; $full_address = $full_address.", ".$address_two; }
|
||||
$city = mysql_escape_string(trim($_POST[city]));
|
||||
$full_address = $full_address.", ".$city;
|
||||
$state = $_POST[state];
|
||||
$full_address = $full_address.", ".$state;
|
||||
$state_tag = strtolower(str_replace(" ","", $state));
|
||||
$zip = mysql_escape_string(trim($_POST[zip]));
|
||||
$full_address = $full_address." ".$zip;
|
||||
$latlng_override = $_POST[latlng_override];
|
||||
if ($latlng_override == true) {
|
||||
$lat = $_POST[lat];
|
||||
$lng = $_POST[lng];
|
||||
} else {
|
||||
//geocode
|
||||
//echo ($full_address);
|
||||
$geocode_status = geocode($full_address);
|
||||
//echo (is_array($geocode_status));
|
||||
if (is_array($geocode_status)) {
|
||||
$geocode_error = false;
|
||||
$lat = $geocode_status[0];
|
||||
$_POST[lat] = $lat;
|
||||
$lng = $geocode_status[1];
|
||||
$_POST[lng] = $lng;
|
||||
//echo ($lat.", ".$lng);
|
||||
} else {
|
||||
$geocode_error = true;
|
||||
$lat = 0;
|
||||
$_POST[lat] = $lat;
|
||||
$lng = 0;
|
||||
$_POST[lng] = $lng;
|
||||
$geocode_message = $geocode_status;
|
||||
}
|
||||
}
|
||||
$phone = mysql_escape_string(trim($_POST[phone]));
|
||||
$fax = mysql_escape_string(trim($_POST[fax]));
|
||||
$email = mysql_escape_string(trim($_POST[email]));
|
||||
$website = mysql_escape_string(trim($_POST[website]));
|
||||
|
||||
$stambassador = mysql_escape_string(trim($_POST[stambassador]));
|
||||
$stambassador_names = mysql_escape_string(trim($_POST[stambassador_names]));
|
||||
$triclub = mysql_escape_string(trim($_POST[triclub]));
|
||||
$triclub_names = mysql_escape_string(trim($_POST[triclub_names]));
|
||||
$coach = mysql_escape_string(trim($_POST[coach]));
|
||||
$coach_names = mysql_escape_string(trim($_POST[coach_names]));
|
||||
$racedirector = mysql_escape_string(trim($_POST[racedirector]));
|
||||
$racedirector_names = mysql_escape_string(trim($_POST[racedirector_names]));
|
||||
$brewery = mysql_escape_string(trim($_POST[brewery]));
|
||||
$brewery_names = mysql_escape_string(trim($_POST[brewery_names]));
|
||||
$local = mysql_escape_string(trim($_POST[local]));
|
||||
$fitbike = $_POST[fitbike];
|
||||
$saddlechange = $_POST[saddlechange];
|
||||
$motioncapture = $_POST[motioncapture];
|
||||
$footbed = $_POST[footbed];
|
||||
$wetsuit = $_POST[wetsuit];
|
||||
$bike = $_POST[bike];
|
||||
$trispecific = mysql_escape_string(trim($_POST[trispecific]));
|
||||
$trispecific_names = mysql_escape_string(trim($_POST[trispecific_names]));
|
||||
$fist = mysql_escape_string(trim($_POST[fist]));
|
||||
$fist_names = mysql_escape_string(trim($_POST[fist_names]));
|
||||
$diagnostic = $_POST[diagnostic];
|
||||
$shoe = $_POST[shoe];
|
||||
$sock = $_POST[sock];
|
||||
$apparel_run = $_POST[apparel_run];
|
||||
$apparel_tri = $_POST[apparel_tri];
|
||||
$swimgear = $_POST[swimgear];
|
||||
$bikeaccessory = $_POST[bikeaccessory];
|
||||
$bikebody = $_POST[bikebody];
|
||||
$bikecomponent = $_POST[bikecomponent];
|
||||
$bikeelectronic = $_POST[bikeelectronic];
|
||||
$bikehelmet = $_POST[bikehelmet];
|
||||
$biketrainer = $_POST[biketrainer];
|
||||
$bikewheel = $_POST[bikewheel];
|
||||
$runhydrate = $_POST[runhydrate];
|
||||
$bodycare = $_POST[bodycare];
|
||||
$hours = mysql_escape_string(trim($_POST[hours]));
|
||||
|
||||
$activity = mysql_escape_string(nl2br(substr(trim($_POST[activity]), 0, 4096)));
|
||||
|
||||
$hour = $_POST[hour];
|
||||
if($_POST[daypart] == 1){ $hour = $hour + 12; }
|
||||
$minute = $_POST[minute];
|
||||
$year = $_POST[year];
|
||||
$month = $_POST[month];
|
||||
$day = $_POST[day];
|
||||
$date = "$year-$month-$day $hour:$minute:00";
|
||||
|
||||
$submitted_by = $_POST[submitted_by];
|
||||
|
||||
// begin boolean check to see if we should insert the open water event into the dbase
|
||||
if($_POST[insert_roadshow] == true){
|
||||
$sql = "INSERT INTO ".$prefix."Roadshow (roadshow_date, roadshow_name, roadshow_name_tag, roadshow_address, roadshow_address_two, roadshow_city, roadshow_state, roadshow_state_tag, roadshow_zip, roadshow_lat, roadshow_lng, roadshow_phone, roadshow_fax, roadshow_email, roadshow_website, roadshow_stambassador, roadshow_stambassador_names, roadshow_triclub, roadshow_triclub_names, roadshow_coach, roadshow_coach_names, roadshow_racedirector, roadshow_racedirector_names, roadshow_brewery, roadshow_brewery_names, roadshow_local, roadshow_fitbike, roadshow_saddlechange, roadshow_motioncapture, roadshow_footbed, roadshow_wetsuit, roadshow_bike, roadshow_trispecific, roadshow_trispecific_names, roadshow_fist, roadshow_fist_names, roadshow_diagnostic, roadshow_shoe, roadshow_sock, roadshow_apparel_run, roadshow_apparel_tri, roadshow_swimgear, roadshow_bikeaccessory, roadshow_bikebody, roadshow_bikecomponent, roadshow_bikeelectronic, roadshow_bikehelmet, roadshow_biketrainer, roadshow_bikewheel, roadshow_runhydrate, roadshow_bodycare, roadshow_hours, roadshow_activity, roadshow_submitted_by, roadshow_valid) VALUES ('$date', '$name', '$name_tag', '$address', '$address_two', '$city', '$state', '$state_tag', '$zip', '$lat', '$lng', '$phone', '$fax', '$email', '$website', '$stambassador', '$stambassador_names', '$triclub', '$triclub_names', '$coach', '$coach_names', '$racedirector', '$racedirector_names', '$brewery', '$brewery_names', '$local', '$fitbike', '$saddlechange', '$motioncapture', '$footbed', '$wetsuit', '$bike', '$trispecific', '$trispecific_names', '$fist', '$fist_names', '$diagnostic', '$shoe', '$sock', '$apparel_run', '$apparel_tri', '$swimgear', '$bikeaccessory', '$bikebody', '$bikecomponent', '$bikeelectronic', '$bikehelmet', '$biketrainer', '$bikewheel', '$runhydrate', '$bodycare', '$hours', '$activity', $submitted_by, 0)";
|
||||
//echo("roadshow entered!");
|
||||
//echo($sql);
|
||||
mysql_query($sql) OR die(mysql_error());
|
||||
//exit();
|
||||
$insert_success = true;
|
||||
}else{
|
||||
//echo("event NOT entered.");
|
||||
$confirm_roadshow = true;
|
||||
}
|
||||
// end insert check
|
||||
}
|
||||
// end error message check
|
||||
?>
|
19
site/roadshow/ajax.rate.item.php
Normal file
19
site/roadshow/ajax.rate.item.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
require_once("class/rating/classes/include.all.php");
|
||||
|
||||
// Check that the data was sent
|
||||
if (sizeof($_POST) == 0
|
||||
|| $_POST['parent'] == null
|
||||
|| strlen(trim($_POST['parent'])) == 0
|
||||
|| $_POST['item'] == null
|
||||
|| strlen(trim($_POST['item'])) == 0
|
||||
|| $_POST['rating'] == null
|
||||
|| strlen(trim($_POST['rating'])) == 0
|
||||
|| $_POST['classes'] == null
|
||||
|| strlen(trim($_POST['classes'])) == 0)
|
||||
{
|
||||
die("You shouldn't be attempting to access this file in this manner.");
|
||||
}
|
||||
|
||||
echo Rating::RateItem($_POST['parent'], $_POST['item'], $_POST['rating'], $_POST['classes']);
|
||||
?>
|
339
site/roadshow/class/mysql.class.php
Normal file
339
site/roadshow/class/mysql.class.php
Normal file
@ -0,0 +1,339 @@
|
||||
<?PHP
|
||||
###########################################
|
||||
#-----------Users login system------------#
|
||||
###########################################
|
||||
/*=========================================\
|
||||
Author : Mohammed Ahmed(M@@king) \\
|
||||
Version : 1.0 \\
|
||||
Date Created: Aug 20 2005 \\
|
||||
---------------------------- \\
|
||||
Last Update: August 22 2005 \\
|
||||
---------------------------- \\
|
||||
Country : Palestine \\
|
||||
City : Gaza \\
|
||||
E-mail : m@maaking.com \\
|
||||
MSN : m@maaking.com \\
|
||||
AOL-IM : maa2pal \\
|
||||
WWW : http://www.maaking.com \\
|
||||
Mobile/SMS : 00972-599-622235 \\
|
||||
\\
|
||||
===========================================\
|
||||
------------------------------------------*/
|
||||
if (eregi("mysql.class.php", $_SERVER['SCRIPT_NAME'])) {
|
||||
Header("Location: index.php"); die();
|
||||
}
|
||||
//db class
|
||||
if(!defined("SQL_LAYER"))
|
||||
{
|
||||
|
||||
define("SQL_LAYER","mysql");
|
||||
|
||||
class sql_db
|
||||
{
|
||||
|
||||
var $db_connect_id;
|
||||
var $query_result;
|
||||
var $row = array();
|
||||
var $rowset = array();
|
||||
var $num_queries = 0;
|
||||
|
||||
//
|
||||
// Constructor
|
||||
//
|
||||
function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
|
||||
{
|
||||
|
||||
$this->persistency = $persistency;
|
||||
$this->user = $sqluser;
|
||||
$this->password = $sqlpassword;
|
||||
$this->server = $sqlserver;
|
||||
$this->dbname = $database;
|
||||
|
||||
if($this->persistency)
|
||||
{
|
||||
$this->db_connect_id = @mysql_pconnect($this->server, $this->user, $this->password);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db_connect_id = @mysql_connect($this->server, $this->user, $this->password);
|
||||
}
|
||||
if($this->db_connect_id)
|
||||
{
|
||||
if($database != "")
|
||||
{
|
||||
$this->dbname = $database;
|
||||
$dbselect = @mysql_select_db($this->dbname);
|
||||
if(!$dbselect)
|
||||
{
|
||||
@mysql_close($this->db_connect_id);
|
||||
$this->db_connect_id = $dbselect;
|
||||
}
|
||||
}
|
||||
return $this->db_connect_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Other base methods
|
||||
//
|
||||
function sql_close()
|
||||
{
|
||||
if($this->db_connect_id)
|
||||
{
|
||||
if($this->query_result)
|
||||
{
|
||||
@mysql_free_result($this->query_result);
|
||||
}
|
||||
$result = @mysql_close($this->db_connect_id);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Base query method
|
||||
//
|
||||
function sql_query($query = "", $transaction = FALSE)
|
||||
{
|
||||
// Remove any pre-existing queries
|
||||
unset($this->query_result);
|
||||
if($query != "")
|
||||
{
|
||||
|
||||
$this->query_result = @mysql_query($query, $this->db_connect_id);
|
||||
|
||||
}
|
||||
if($this->query_result)
|
||||
{
|
||||
unset($this->row[$this->query_result]);
|
||||
unset($this->rowset[$this->query_result]);
|
||||
return $this->query_result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ( $transaction == END_TRANSACTION ) ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Other query methods
|
||||
//
|
||||
function sql_numrows($query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
if($query_id)
|
||||
{
|
||||
$result = @mysql_num_rows($query_id);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_affectedrows()
|
||||
{
|
||||
if($this->db_connect_id)
|
||||
{
|
||||
$result = @mysql_affected_rows($this->db_connect_id);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_numfields($query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
if($query_id)
|
||||
{
|
||||
$result = @mysql_num_fields($query_id);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_fieldname($offset, $query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
if($query_id)
|
||||
{
|
||||
$result = @mysql_field_name($query_id, $offset);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_fieldtype($offset, $query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
if($query_id)
|
||||
{
|
||||
$result = @mysql_field_type($query_id, $offset);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_fetchrow($query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
if($query_id)
|
||||
{
|
||||
$this->row[$query_id] = @mysql_fetch_array($query_id);
|
||||
return $this->row[$query_id];
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_fetchrowset($query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
if($query_id)
|
||||
{
|
||||
unset($this->rowset[$query_id]);
|
||||
unset($this->row[$query_id]);
|
||||
while($this->rowset[$query_id] = @mysql_fetch_array($query_id))
|
||||
{
|
||||
$result[] = $this->rowset[$query_id];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_fetchfield($field, $rownum = -1, $query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
if($query_id)
|
||||
{
|
||||
if($rownum > -1)
|
||||
{
|
||||
$result = @mysql_result($query_id, $rownum, $field);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(empty($this->row[$query_id]) && empty($this->rowset[$query_id]))
|
||||
{
|
||||
if($this->sql_fetchrow())
|
||||
{
|
||||
$result = $this->row[$query_id][$field];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->rowset[$query_id])
|
||||
{
|
||||
$result = $this->rowset[$query_id][$field];
|
||||
}
|
||||
else if($this->row[$query_id])
|
||||
{
|
||||
$result = $this->row[$query_id][$field];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_rowseek($rownum, $query_id = 0){
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
if($query_id)
|
||||
{
|
||||
$result = @mysql_data_seek($query_id, $rownum);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_nextid(){
|
||||
if($this->db_connect_id)
|
||||
{
|
||||
$result = @mysql_insert_id($this->db_connect_id);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_freeresult($query_id = 0){
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if ( $query_id )
|
||||
{
|
||||
unset($this->row[$query_id]);
|
||||
unset($this->rowset[$query_id]);
|
||||
|
||||
@mysql_free_result($query_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function sql_error($query_id = 0)
|
||||
{
|
||||
$result["message"] = @mysql_error($this->db_connect_id);
|
||||
$result["code"] = @mysql_errno($this->db_connect_id);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
} // class sql_db
|
||||
|
||||
} // if ... define
|
||||
|
||||
?>
|
406
site/roadshow/class/rating/classes/database.class.php
Normal file
406
site/roadshow/class/rating/classes/database.class.php
Normal file
@ -0,0 +1,406 @@
|
||||
<?php
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Database Class
|
||||
//============================================================================
|
||||
// Dependencies:
|
||||
//----------------------------------------------------------------------------
|
||||
// None
|
||||
//============================================================================
|
||||
// Modification History:
|
||||
//----------------------------------------------------------------------------
|
||||
// 2006-11-04: Created
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
class Database extends Error
|
||||
{
|
||||
## CONSTANT VARIABLES
|
||||
const DB_TYPES = 'mysql,mysqli'; // NO SPACES!
|
||||
## END CONSTANT VARIABLES
|
||||
|
||||
## PUBLIC VARIABLES
|
||||
## END PUBLIC VARIABLES
|
||||
|
||||
## PRIVATE VARIABLES
|
||||
private static $host;
|
||||
private static $port;
|
||||
private static $database;
|
||||
private static $username;
|
||||
private static $password;
|
||||
private static $type;
|
||||
private static $connection;
|
||||
private static $savedQueries;
|
||||
private static $savedResults;
|
||||
## END PRIVATE VARIABLES
|
||||
|
||||
## CONSTRUCTOR
|
||||
## END CONSTRUCTOR
|
||||
|
||||
## DECONSTRUCTOR
|
||||
## END DECONSTRUCTOR
|
||||
|
||||
## PUBLIC METHODS
|
||||
// Initialize the Variables
|
||||
// Does not return anything, but acts like a constructor for Static classes
|
||||
public static function Initialize($varType, $varHost, $varPort, $varDatabase, $varUsername, $varPassword)
|
||||
{
|
||||
Error::Initialize();
|
||||
|
||||
if (!self::ValidDatabaseTypes($varType))
|
||||
{
|
||||
Error::LogError("Database Type Invalid", "Database Type must be one of: " . self::DB_TYPES);
|
||||
}
|
||||
|
||||
self::$host = $varHost;
|
||||
self::$port = $varPort;
|
||||
self::$type = strtolower($varType);
|
||||
self::$database = $varDatabase;
|
||||
self::$password = $varPassword;
|
||||
self::$username = $varUsername;
|
||||
self::$savedQueries = array();
|
||||
self::$savedResults = array();
|
||||
self::$connection = self::ConnectToDatabase();
|
||||
|
||||
self::SelectTheDatabase();
|
||||
}
|
||||
|
||||
// DeInitialize the Variables
|
||||
// Does not return anything, but acts like a destructor for Static classes
|
||||
public static function DeInitialize()
|
||||
{
|
||||
// Remove Saved Queries
|
||||
for ($saved = 0; $saved < sizeof(self::$savedQueries); $saved++)
|
||||
{
|
||||
unset(self::$savedQueries[$saved]);
|
||||
}
|
||||
|
||||
// Remove Saved Results
|
||||
for ($saved = 0; $saved < sizeof(self::$savedResults); $saved++)
|
||||
{
|
||||
unset(self::$savedResults[$saved]);
|
||||
}
|
||||
|
||||
// Close the Database Connection
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
@mysql_close(self::$connection) or Error::LogError("MySQL Failed to Close", mysql_error(self::$connection));
|
||||
break;
|
||||
case "mysqli":
|
||||
@mysqli_close(self::$connection) or Error::LogError("MySQL Failed to Close", mysqli_error(self::$connection));
|
||||
break;
|
||||
}
|
||||
|
||||
// Destroy Variables
|
||||
self::$host = null;
|
||||
self::$port = null;
|
||||
self::$type = null;
|
||||
self::$database = null;
|
||||
self::$password = null;
|
||||
self::$username = null;
|
||||
self::$connection = null;
|
||||
self::$savedQueries = null;
|
||||
self::$savedResults = null;
|
||||
Error::DeInitialize();
|
||||
}
|
||||
|
||||
// Database Types
|
||||
// Returns an array of database types
|
||||
public static function DatabaseTypes()
|
||||
{
|
||||
return split(",", self::DB_TYPES);
|
||||
}
|
||||
|
||||
// Build Order By
|
||||
// Returns the SQL Syntax for ORDER BY
|
||||
public static function BuildOrderBy($varColumnName, $varDirection)
|
||||
{
|
||||
$orderby = "";
|
||||
if (self::$connection)
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
case "mysqli":
|
||||
$orderby = "ORDER BY `{$varColumnName}` {$varDirection}";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $orderby;
|
||||
}
|
||||
|
||||
// Build Limit
|
||||
// Returns the SQL Syntax for LIMIT
|
||||
public static function BuildLimit($varStartingRow, $varNumberOfRows)
|
||||
{
|
||||
$limit = "";
|
||||
if (self::$connection)
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
case "mysqli":
|
||||
$limit = "LIMIT {$varStartingRow}, {$varNumberOfRows}";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $limit;
|
||||
}
|
||||
|
||||
// Execute SQL Query
|
||||
// Returns the result of the query, which is typically a resource id
|
||||
public static function ExecuteQuery($sql, $name)
|
||||
{
|
||||
if (self::$connection)
|
||||
{
|
||||
if (strlen(trim($name)) != 0)
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
if (!array_key_exists($name, self::$savedQueries))
|
||||
{
|
||||
self::$savedQueries[$name] = @mysql_query($sql, self::$connection) or Error::LogError("Query Failed", mysql_error(self::$connection));
|
||||
}
|
||||
break;
|
||||
case "mysqli":
|
||||
if (!array_key_exists($name, self::$savedQueries))
|
||||
{
|
||||
self::$savedQueries[$name] = @mysqli_query(self::$connection, $sql) or Error::LogError("Query Failed", mysqli_error(self::$connection));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return self::$savedQueries[$name];
|
||||
}
|
||||
else
|
||||
{
|
||||
Error::LogError("Execute Query Name Missing", "The name parameter was empty, please provide a name for the query.");
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fetch Results
|
||||
// Returns an array of the query results
|
||||
public static function FetchResults($name)
|
||||
{
|
||||
$results = array();
|
||||
if (self::$connection)
|
||||
{
|
||||
if (strlen(trim($name)) != 0 && (array_key_exists($name, self::$savedQueries) || array_key_exists($name, self::$savedResults)))
|
||||
{
|
||||
if (array_key_exists($name, self::$savedQueries))
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
$row = 0;
|
||||
while ($currentResult = @mysql_fetch_assoc(self::$savedQueries[$name]))
|
||||
{
|
||||
$col = 0;
|
||||
foreach ($currentResult as $key => $value)
|
||||
{
|
||||
$results[$row][$col] = $value;
|
||||
$results[$row][$key] = $value;
|
||||
$col++;
|
||||
}
|
||||
|
||||
$row++;
|
||||
}
|
||||
break;
|
||||
case "mysqli":
|
||||
$row = 0;
|
||||
while ($currentResult = @mysqli_fetch_assoc(self::$savedQueries[$name]))
|
||||
{
|
||||
$col = 0;
|
||||
foreach ($currentResult as $key => $value)
|
||||
{
|
||||
$results[$row][$col] = $value;
|
||||
$results[$row][$key] = $value;
|
||||
$col++;
|
||||
}
|
||||
|
||||
$row++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
self::$savedResults[$name] = $results;
|
||||
}
|
||||
else
|
||||
{
|
||||
$results = self::$savedResults[$name];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen(trim($name)) == 0)
|
||||
{
|
||||
Error::LogError("Fetch Results Name Missing", "The name parameter was empty, the name is required so it knows which results to return.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Error::LogError("Fetch Results Name ('{$name}') Not Found", "The name provided did not have any query results associated with it.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
// Free SQL Query Results
|
||||
// Returns nothing
|
||||
public static function FreeResults($name)
|
||||
{
|
||||
if (self::$connection)
|
||||
{
|
||||
if (strlen(trim($name)) != 0 && array_key_exists($name, self::$savedQueries))
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
@mysql_free_result(self::$savedQueries[$name]) or Error::LogError("Free Results Error", mysql_error(self::$connection));
|
||||
unset(self::$savedQueries[$name]);
|
||||
break;
|
||||
case "mysqli":
|
||||
@mysqli_free_result(self::$savedQueries[$name]) or Error::LogError("Free Results Error", mysqli_error(self::$connection));
|
||||
unset(self::$savedQueries[$name]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen(trim($name)) == 0)
|
||||
{
|
||||
Error::LogError("Free Results Name Missing", "The name parameter was empty, the name is required so it knows which results to free up from memory.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Error::LogWarning("Free Results Name ('{$name}') Not Found", "The name provided did not have any query results associated with it.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove Saved Results
|
||||
// Returns nothing
|
||||
public static function RemoveSavedResults($name)
|
||||
{
|
||||
if (strlen(trim($name)) != 0 && array_key_exists($name, self::$savedResults))
|
||||
{
|
||||
unset(self::$savedResults[$name]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen(trim($name)) == 0)
|
||||
{
|
||||
Error::LogError("Remove Saved Result Name Missing", "The name parameter was empty, the name is required so it knows which query to remove.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Error::LogWarning("Remove Saved Result Name ('{$name}') Not Found", "The name provided was not a saved query.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Attempt Connect To Database
|
||||
// Returns true or false depending on if the connection failed or succeeded
|
||||
public static function AttemptConnectToDatabase($varType, $varHost, $varPort, $varDatabase, $varUsername, $varPassword)
|
||||
{
|
||||
self::$type = $varType;
|
||||
self::$host = $varHost;
|
||||
self::$port = $varPort;
|
||||
self::$database = $varDatabase;
|
||||
self::$username = $varUsername;
|
||||
self::$password = $varPassword;
|
||||
|
||||
Error::ClearErrors();
|
||||
self::$connection = self::ConnectToDatabase();
|
||||
|
||||
if (!Error::HasErrors())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// MySQL Version
|
||||
// Returns the mysql version number
|
||||
public static function MysqlVersion()
|
||||
{
|
||||
$version = "";
|
||||
if (self::$connection)
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
$version = mysql_get_server_info(self::$connection);
|
||||
break;
|
||||
case "mysqli":
|
||||
$version = mysqli_get_server_info(self::$connection);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $version;
|
||||
}
|
||||
## END PUBLIC METHODS
|
||||
|
||||
## PRIVATE METHODS
|
||||
// Connect to Database
|
||||
// Returns the database connection resource
|
||||
private static function ConnectToDatabase()
|
||||
{
|
||||
$link = null;
|
||||
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
if (strlen(trim(self::$port)) != 0)
|
||||
{
|
||||
$link = mysql_connect(self::$host . ":" . self::$port, self::$username, self::$password) or Error::LogError("Database Error", mysql_error());
|
||||
}
|
||||
else
|
||||
{
|
||||
$link = mysql_connect(self::$host, self::$username, self::$password) or Error::LogError("Database Error", mysql_error());
|
||||
}
|
||||
break;
|
||||
case "mysqli":
|
||||
$link = mysqli_connect(self::$host, self::$username, self::$password, self::$database, self::$port) or Error::LogError("Database Error", mysqli_connect_error());
|
||||
break;
|
||||
}
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
// Select the Database
|
||||
// Returns nothing
|
||||
private static function SelectTheDatabase()
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
@mysql_select_db(self::$database, self::$connection) or Error::LogError("Database Selection", mysql_error(self::$connection));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Valid Database Types
|
||||
// Returns true or false depending on if the database type is valid
|
||||
private static function ValidDatabaseTypes($varType)
|
||||
{
|
||||
$types = split(',', str_replace(" ", "", self::DB_TYPES));
|
||||
|
||||
return in_array($varType, $types);
|
||||
}
|
||||
## END PRIVATE METHODS
|
||||
|
||||
## PROTECTED METHODS
|
||||
## END PROTECTED METHODS
|
||||
}
|
||||
?>
|
258
site/roadshow/class/rating/classes/error.class.php
Normal file
258
site/roadshow/class/rating/classes/error.class.php
Normal file
@ -0,0 +1,258 @@
|
||||
<?php
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Error Class
|
||||
//============================================================================
|
||||
// Dependencies:
|
||||
//----------------------------------------------------------------------------
|
||||
// none
|
||||
//============================================================================
|
||||
// Modification History:
|
||||
//----------------------------------------------------------------------------
|
||||
// 2006-11-04: Created
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
class Error
|
||||
{
|
||||
## CONSTANT VARIABLES
|
||||
## END CONSTANT VARIABLES
|
||||
|
||||
## PUBLIC VARIABLES
|
||||
## END PUBLIC VARIABLES
|
||||
|
||||
## PRIVATE VARIABLES
|
||||
private static $title;
|
||||
private static $type;
|
||||
private static $description;
|
||||
private static $datetime;
|
||||
|
||||
private static $numErrors;
|
||||
private static $numWarnings;
|
||||
## END PRIVATE VARIABLES
|
||||
|
||||
## CONSTRUCTOR
|
||||
## END CONSTRUCTOR
|
||||
|
||||
## DECONSTRUCTOR
|
||||
## END DECONSTRUCTOR
|
||||
|
||||
## PUBLIC METHODS
|
||||
// Initialize the Variables
|
||||
// Does not return anything, but acts like a constructor for Static classes
|
||||
public static function Initialize()
|
||||
{
|
||||
self::$title = array();
|
||||
self::$type = array();
|
||||
self::$description = array();
|
||||
self::$datetime = array();
|
||||
self::$numErrors = 0;
|
||||
self::$numWarnings = 0;
|
||||
}
|
||||
|
||||
// DeInitialize the Variables
|
||||
// Does not return anything, but acts like a destructor for Static classes
|
||||
public static function DeInitialize()
|
||||
{
|
||||
self::$title = null;
|
||||
self::$type = null;
|
||||
self::$description = null;
|
||||
self::$datetime = null;
|
||||
self::$numErrors = null;
|
||||
self::$numWarnings = null;
|
||||
}
|
||||
|
||||
// Log Error Method (receives Name and Description)
|
||||
// Returns true or false depending on if the logging of the error was successful
|
||||
public static function LogError($varTitle, $varDescription)
|
||||
{
|
||||
// Check Parameters
|
||||
if (strlen(trim($varTitle)) != 0 && strlen(trim($varDescription)) != 0)
|
||||
{
|
||||
array_push(self::$title, $varTitle);
|
||||
array_push(self::$type, "ERROR");
|
||||
array_push(self::$description, $varDescription);
|
||||
array_push(self::$datetime, date("m/d/Y H:i:s"));
|
||||
self::$numErrors++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Show Error Messages
|
||||
// Returns the Error Message Output (in HTML format)
|
||||
public static function ShowErrorMessages()
|
||||
{
|
||||
$output = "";
|
||||
|
||||
// Check to see if 1 error occurred or more than one.
|
||||
if (self::$numErrors > 0)
|
||||
{
|
||||
if (self::$numErrors > 1)
|
||||
{
|
||||
$error = "ERRORS";
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = "ERROR";
|
||||
}
|
||||
|
||||
// Loop through Error Messages
|
||||
for ($i = 0; $i < sizeof(self::$title); $i++)
|
||||
{
|
||||
if (self::$type[$i] == "ERROR")
|
||||
{
|
||||
// Output each individual Error
|
||||
$output .= " <div class=\"divErrorTitle\">\r\n" .
|
||||
" " . self::$title[$i] . "\r\n" .
|
||||
" <span class=\"spnErrorDateTime\">at " . self::$datetime[$i] . "</span>\r\n" .
|
||||
" </div>\r\n" .
|
||||
" <div class=\"divErrorDesc\">" . self::$description[$i] . "<br /><br /></div>\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Write Error Template Output
|
||||
$output = "<div class=\"divErrorBox\">\r\n" .
|
||||
" <div class=\"divErrorBoxTitle\"><img src=\"icons/24-em-cross.png\" align=\"left\" /> {$error}:</div>\r\n" .
|
||||
" <div class=\"divErrors\">\r\n" . $output . "\r\n </div>\r\n" .
|
||||
"</div>\r\n";
|
||||
}
|
||||
|
||||
// Return the Error Message Output
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Retrieve Last Error
|
||||
// Returns the title and description of the last error in an array
|
||||
public static function RetrieveLastError()
|
||||
{
|
||||
$output = array();
|
||||
|
||||
// Check to see if 1 error occurred or more than one.
|
||||
if (self::$numErrors > 0)
|
||||
{
|
||||
for ($i = sizeof(self::$title) - 1; $i >= 0; $i++)
|
||||
{
|
||||
if (self::$type[$i] == "ERROR")
|
||||
{
|
||||
array_push($output, self::$title[$i]);
|
||||
array_push($output, self::$description[$i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Clear Errors
|
||||
// Returns nothing
|
||||
public static function ClearErrors()
|
||||
{
|
||||
self::$numErrors = 0;
|
||||
|
||||
for ($i = 0; $i < sizeof(self::$type); $i++)
|
||||
{
|
||||
if (self::$type[$i] == "ERROR")
|
||||
{
|
||||
self::$title[$i] = null;
|
||||
self::$type[$i] = null;
|
||||
self::$description[$i] = null;
|
||||
self::$datetime[$i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Has Errors
|
||||
// Returns true or false on whether errors exist
|
||||
public static function HasErrors()
|
||||
{
|
||||
if (self::$numErrors > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Log Warning Method (receives Name and Description)
|
||||
// Returns true or false depending on if logging the warning was successful
|
||||
public static function LogWarning($varTitle, $varDescription)
|
||||
{
|
||||
// Check Parameters
|
||||
if (strlen(trim($varTitle)) != 0 && strlen(trim($varDescription)) != 0)
|
||||
{
|
||||
array_push(self::$title, $varTitle);
|
||||
array_push(self::$type, "WARNING");
|
||||
array_push(self::$description, $varDescription);
|
||||
array_push(self::$datetime, date("m/d/Y H:i:s"));
|
||||
self::$numWarnings++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Show Warning Messages
|
||||
// Returns the Warning Message Output (in HTML format)
|
||||
public static function ShowWarningMessages()
|
||||
{
|
||||
$output = "";
|
||||
|
||||
// Check to see if 1 warning occurred or more than one.
|
||||
if (self::$numWarnings > 0)
|
||||
{
|
||||
if (self::$numWarnings > 1)
|
||||
{
|
||||
$warning = "WARNINGS";
|
||||
}
|
||||
else
|
||||
{
|
||||
$warning = "WARNING";
|
||||
}
|
||||
|
||||
// Loop through Warning Messages
|
||||
for ($i = 0; $i < sizeof(self::$title); $i++)
|
||||
{
|
||||
if (self::$type[$i] == "WARNING")
|
||||
{
|
||||
// Output each individual Warning
|
||||
$output .= " <div class=\"divWarningTitle\">\r\n" .
|
||||
" " . self::$title[$i] . "\r\n" .
|
||||
" <span class=\"spnWarningDateTime\">at " . self::$datetime[$i] . "</span>\r\n" .
|
||||
" </div>\r\n" .
|
||||
" <div class=\"divWarningDesc\">" . self::$description[$i] . "<br /><br /></div>\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Write Warning Template Output
|
||||
$output = "<div id=\"divWarningBox\">\r\n" .
|
||||
" <div id=\"divWarningBoxTitle\"><img src=\"designs/icons/24-message-warn.png\" align=\"left\" /> {$warning}:</div>\r\n" .
|
||||
" <div id=\"divWarnings\">\r\n" . $output . "\r\n </div>\r\n" .
|
||||
"</div>\r\n";
|
||||
}
|
||||
|
||||
// Return the Warning Message Output
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Has Warnings
|
||||
// Returns true or false on whether there are any Warnings
|
||||
public static function HasWarnings()
|
||||
{
|
||||
if (self::$numWarnings > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
## END PUBLIC METHODS
|
||||
|
||||
## PRIVATE METHODS
|
||||
## END PRIVATE METHODS
|
||||
|
||||
## PROTECTED METHODS
|
||||
## END PROTECTED METHODS
|
||||
}
|
||||
?>
|
7
site/roadshow/class/rating/classes/include.all.php
Normal file
7
site/roadshow/class/rating/classes/include.all.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
require_once("error.class.php");
|
||||
require_once("database.class.php");
|
||||
require_once("rating.class.php");
|
||||
|
||||
Database::Initialize("mysql", "192.168.1.10", "3306", "slowtwitch", "slowtwitch", "k9volqlAcpq");
|
||||
?>
|
279
site/roadshow/class/rating/classes/rating.class.php
Normal file
279
site/roadshow/class/rating/classes/rating.class.php
Normal file
@ -0,0 +1,279 @@
|
||||
<?php
|
||||
class Rating
|
||||
{
|
||||
## PRIVATE VARIABLES
|
||||
## END PRIVATE VARIABLES
|
||||
|
||||
## PUBLIC METHODS
|
||||
// Output the Rating information
|
||||
// Returns a string of HTML
|
||||
public static function OutputRating($varParent, $varItem)
|
||||
{
|
||||
// Verify $varItem was provided
|
||||
if ($varItem != null && strlen(trim($varItem)) != 0 && $varParent != null && strlen(trim($varParent)) != 0)
|
||||
{
|
||||
// Check if Magic QUotes is ON
|
||||
if (!get_magic_quotes_gpc())
|
||||
{
|
||||
$varItem = addslashes($varItem);
|
||||
$varParent = addslashes($varParent);
|
||||
}
|
||||
|
||||
// Information for the Output
|
||||
$averageStars = Rating::CalculateAverageRating($varParent, $varItem);
|
||||
|
||||
// Check to see that the user has not already rated this item
|
||||
if (Rating::CheckRatingsByIp($varParent, $varItem) == 0)
|
||||
{
|
||||
$classes = "rating " . Rating::ShowStars($averageStars);
|
||||
$cat_info = Rating::FetchCategoryInfo($varItem);
|
||||
|
||||
// Write Output HTML for the Rating Data
|
||||
$output = "\r\n";
|
||||
$output .= "<div style='clear:both;'>{$cat_info['rating_cat_name']}<br></div>\r\n";
|
||||
$output .= "<div style='display: inline;'><div style='float: left;'>{$cat_info['rating_cat_min']} </div><div style='float: left;'><ul class=\"{$classes}\" style='margin: 0px 0px 10px 0px;' id=\"{$varParent}_{$varItem}\">\r\n";
|
||||
$output .= " <li class=\"one\"><a href=\"javascript:RateItem('{$varParent}','{$varItem}', 1);\" title=\"1 Star\">1</a></li>\r\n";
|
||||
$output .= " <li class=\"two\"><a href=\"javascript:RateItem('{$varParent}','{$varItem}', 2);\" title=\"2 Stars\">2</a></li>\r\n";
|
||||
$output .= " <li class=\"three\"><a href=\"javascript:RateItem('{$varParent}','{$varItem}', 3);\" title=\"3 Stars\">3</a></li>\r\n";
|
||||
$output .= " <li class=\"four\"><a href=\"javascript:RateItem('{$varParent}','{$varItem}', 4);\" title=\"4 Stars\">4</a></li>\r\n";
|
||||
$output .= " <li class=\"five\"><a href=\"javascript:RateItem('{$varParent}','{$varItem}', 5);\" title=\"5 Stars\">5</a></li>\r\n";
|
||||
$output .= "</ul></div><div style='float:left;'> {$cat_info['rating_cat_max']}</div></div>\r\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$classes = "rated " . Rating::ShowStars($averageStars);
|
||||
$cat_info = Rating::FetchCategoryInfo($varItem);
|
||||
|
||||
// Write Output HTML for the Rating Data
|
||||
$output = "\r\n";
|
||||
$output .= "<div style='clear:both;'>{$cat_info['rating_cat_name']}<br></div>";
|
||||
$output .= "<div style='display: inline;'><div style='float: left;'>{$cat_info['rating_cat_min']} </div><div style='float: left;'><ul class=\"{$classes}\" id=\"{$varParent}_{$varItem}\" style='margin: 0px 0px 10px 0px;'>\r\n";
|
||||
$output .= " <li class=\"one\">1</li>\r\n";
|
||||
$output .= " <li class=\"two\">2</li>\r\n";
|
||||
$output .= " <li class=\"three\">3</li>\r\n";
|
||||
$output .= " <li class=\"four\">4</li>\r\n";
|
||||
$output .= " <li class=\"five\">5</li>\r\n";
|
||||
$output .= "</ul></div><div style='float:left;'> {$cat_info['rating_cat_max']}</div></div>\r\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = "";
|
||||
// This is a major issue. NO information can be retrieve if an item name is not passed.
|
||||
Error::LogError("Variable Missing", "You must provide the item name for this function to find the average.");
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
public static function OutputParentRating($varParent)
|
||||
{
|
||||
// Verify $varParent was provided
|
||||
if ($varParent != null && strlen(trim($varParent)) != 0)
|
||||
{
|
||||
// Check if Magic QUotes is ON
|
||||
if (!get_magic_quotes_gpc())
|
||||
{
|
||||
$varParent = addslashes($varParent);
|
||||
}
|
||||
|
||||
// Information for the Output
|
||||
$averageStars = Rating::CalculateAverageParentRating($varParent);
|
||||
|
||||
$classes = "rated " . Rating::ShowStars($averageStars);
|
||||
//$parent_info = Rating::FetchParentInfo($varParent);
|
||||
|
||||
// Write Output HTML for the Rating Data
|
||||
$output = "\r\n";
|
||||
//$output .= "<div style='clear:both;'>Overall Rating</div>";
|
||||
$output .= "<div style='height: 16px; width: 80px; position: relative;'><ul class=\"{$classes}\" id=\"{$varParent}\" style='margin: 0px 0px 10px 0px;'>\r\n";
|
||||
$output .= " <li class=\"one\">1</li>\r\n";
|
||||
$output .= " <li class=\"two\">2</li>\r\n";
|
||||
$output .= " <li class=\"three\">3</li>\r\n";
|
||||
$output .= " <li class=\"four\">4</li>\r\n";
|
||||
$output .= " <li class=\"five\">5</li>\r\n";
|
||||
$output .= "</ul></div>\r\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = "";
|
||||
// This is a major issue. NO information can be retrieve if an item name is not passed.
|
||||
Error::LogError("Variable Missing", "You must provide the parent name for this function to find the average.");
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Rate an Item
|
||||
// Returns the name/value pair of new class names and the item name
|
||||
public static function RateItem($varParent, $varItem, $varRating, $varClasses)
|
||||
{
|
||||
$newClassNames = $varClasses;
|
||||
|
||||
// Verify $varName was provided
|
||||
if ($varParent != null && strlen(trim($varParent)) != 0
|
||||
&& $varItem != null && strlen(trim($varItem)) != 0
|
||||
&& $varRating != null && strlen(trim($varRating)) != 0 && is_numeric($varRating)
|
||||
&& $varClasses != null && strlen(trim($varClasses)) != 0)
|
||||
{
|
||||
// Check if Magic Quotes is ON
|
||||
if (!get_magic_quotes_gpc())
|
||||
{
|
||||
$varItem = addslashes($varItem);
|
||||
$varParent = addslashes($varParent);
|
||||
}
|
||||
|
||||
// Check to see that the user has not already rated this item
|
||||
if (Rating::CheckRatingsByIp($varParent, $varItem) == 0)
|
||||
{
|
||||
$ipAddress = $_SERVER['REMOTE_ADDR'];
|
||||
$tempTime = time();
|
||||
|
||||
Database::ExecuteQuery("INSERT INTO `gforum_FittersRating` (`fitter_id_fk`, `category_id_fk`, `rating_vote`, `rating_ip`, `rating_date`) VALUES ('{$varParent}', '{$varItem}', {$varRating}, '{$ipAddress}', '{$tempTime}')", "InsertRating");
|
||||
Database::FetchResults("InsertRating");
|
||||
Database::FreeResults("InsertRating");
|
||||
Database::RemoveSavedResults("InsertRating");
|
||||
|
||||
// Information for the Output
|
||||
$averageStars = Rating::CalculateAverageRating($varParent, $varItem);
|
||||
$newClassNames = "rated " . Rating::ShowStars($averageStars);
|
||||
$averageStars = Rating::CalculateAverageParentRating($varParent);
|
||||
$newClassParent = "rated " . Rating::ShowStars($averageStars);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is a major issue. NOT enough information was sent to log the item
|
||||
Error::LogError("Variable(s) Missing", "You must provide all of the information to log the rating of this item.");
|
||||
}
|
||||
|
||||
// Build Name/Value Pair to return
|
||||
$nameValue = "classes={$newClassNames}&item={$varItem}&parent={$varParent}&parentClass={$newClassParent}";
|
||||
return $nameValue;
|
||||
}
|
||||
## END PUBLIC METHODS
|
||||
|
||||
## PRIVATE METHODS
|
||||
// Fetch Category Names & Min/Max Values
|
||||
private static function FetchCategoryInfo($varItem)
|
||||
{
|
||||
// Query Category Info for a specific Category ID
|
||||
Database::ExecuteQuery("SELECT * FROM `gforum_FittersRatingCategory` WHERE `rating_cat_id`='{$varItem}'", "CategoryInfo");
|
||||
$results = Database::FetchResults("CategoryInfo");
|
||||
Database::FreeResults("CategoryInfo");
|
||||
Database::RemoveSavedResults("CategoryInfo");
|
||||
|
||||
return $results[0];
|
||||
|
||||
}
|
||||
|
||||
// Calculate Average Rating
|
||||
// Returns the number of stars to show
|
||||
private static function CalculateAverageRating($varParent, $varItem)
|
||||
{
|
||||
$averageStars = 0;
|
||||
|
||||
// Query Average Rating for a specific Item
|
||||
Database::ExecuteQuery("SELECT AVG(`rating_vote`) AS `averageRating` FROM `gforum_FittersRating` WHERE `category_id_fk`='{$varItem}' AND `fitter_id_fk`='{$varParent}'", "AverageRating");
|
||||
$results = Database::FetchResults("AverageRating");
|
||||
Database::FreeResults("AverageRating");
|
||||
Database::RemoveSavedResults("AverageRating");
|
||||
|
||||
// Round the Average into a Whole Number
|
||||
if (sizeof($results) == 1)
|
||||
{
|
||||
if ($results[0]['averageRating'] != null)
|
||||
{
|
||||
$averageStars = round($results[0]["averageRating"], 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is simply a warning, as it isn't vital if no results were found, as the item may be new.
|
||||
Error::LogWarning("Rating Data Missing", "No entries were found for '{$varName}', this might be the first entry.");
|
||||
}
|
||||
|
||||
return $averageStars;
|
||||
}
|
||||
|
||||
// Calculate Average Rating
|
||||
// Returns the number of stars to show
|
||||
private static function CalculateAverageParentRating($varParent)
|
||||
{
|
||||
$averageStars = 0;
|
||||
|
||||
// Query Average Rating for a specific Item
|
||||
Database::ExecuteQuery("SELECT AVG(`rating_vote`) AS `averageRating` FROM `gforum_FittersRating` WHERE `fitter_id_fk`='{$varParent}'", "AverageRating");
|
||||
$results = Database::FetchResults("AverageRating");
|
||||
Database::FreeResults("AverageRating");
|
||||
Database::RemoveSavedResults("AverageRating");
|
||||
|
||||
// Round the Average into a Whole Number
|
||||
if (sizeof($results) == 1)
|
||||
{
|
||||
if ($results[0]['averageRating'] != null)
|
||||
{
|
||||
$averageStars = round($results[0]["averageRating"], 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is simply a warning, as it isn't vital if no results were found, as the item may be new.
|
||||
Error::LogWarning("Rating Data Missing", "No entries were found for '{$varName}', this might be the first entry.");
|
||||
}
|
||||
|
||||
return $averageStars;
|
||||
}
|
||||
|
||||
// Show Stars
|
||||
// Returns the class information for the number of stars to show
|
||||
private static function ShowStars($varStars)
|
||||
{
|
||||
// Select the Number of Stars Class
|
||||
switch ($varStars)
|
||||
{
|
||||
case 1:
|
||||
$classes .= "onestar";
|
||||
break;
|
||||
case 2:
|
||||
$classes .= "twostar";
|
||||
break;
|
||||
case 3:
|
||||
$classes .= "threestar";
|
||||
break;
|
||||
case 4:
|
||||
$classes .= "fourstar";
|
||||
break;
|
||||
case 5:
|
||||
$classes .= "fivestar";
|
||||
break;
|
||||
default:
|
||||
$classes .= "nostar";
|
||||
break;
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
// Check Ratings By IP Address
|
||||
// Returns the number of ratings for an item by an ip address
|
||||
private static function CheckRatingsByIp($varParent, $varItem)
|
||||
{
|
||||
$ipAddress = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
Database::ExecuteQuery("SELECT COUNT(*) AS `totalRatings` FROM `gforum_FittersRating` WHERE `category_id_fk`='{$varItem}' AND `fitter_id_fk`='{$varParent}' AND `rating_ip`='{$ipAddress}'", "AlreadyRated");
|
||||
$results = Database::FetchResults("AlreadyRated");
|
||||
Database::FreeResults("AlreadyRated");
|
||||
Database::RemoveSavedResults("AlreadyRated");
|
||||
|
||||
// Check to see that the user has not already rated this item
|
||||
if ($results != null && $results[0]['totalRatings'] != null)
|
||||
{
|
||||
return $results[0]['totalRatings'];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
## END PRIVATE METHODS
|
||||
}
|
||||
?>
|
55
site/roadshow/class/rating/int.to.words.php
Normal file
55
site/roadshow/class/rating/int.to.words.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", 30 => "thirty", 40 => "forty", 50 => "fifty", 60 => "sixty", 70 => "seventy", 80 => "eighty", 90 => "ninety" );
|
||||
|
||||
function int_to_words($x) {
|
||||
global $nwords;
|
||||
|
||||
if(!is_numeric($x))
|
||||
$w = '#';
|
||||
else if(fmod($x, 1) != 0)
|
||||
$w = '#';
|
||||
else {
|
||||
if($x < 0) {
|
||||
$w = 'minus ';
|
||||
$x = -$x;
|
||||
} else
|
||||
$w = '';
|
||||
// ... now $x is a non-negative integer.
|
||||
|
||||
if($x < 21) // 0 to 20
|
||||
$w .= $nwords[$x];
|
||||
else if($x < 100) { // 21 to 99
|
||||
$w .= $nwords[10 * floor($x/10)];
|
||||
$r = fmod($x, 10);
|
||||
if($r > 0)
|
||||
$w .= '-'. $nwords[$r];
|
||||
} else if($x < 1000) { // 100 to 999
|
||||
$w .= $nwords[floor($x/100)] .' hundred';
|
||||
$r = fmod($x, 100);
|
||||
if($r > 0)
|
||||
$w .= ' and '. int_to_words($r);
|
||||
} else if($x < 1000000) { // 1000 to 999999
|
||||
$w .= int_to_words(floor($x/1000)) .' thousand';
|
||||
$r = fmod($x, 1000);
|
||||
if($r > 0) {
|
||||
$w .= ' ';
|
||||
if($r < 100)
|
||||
$w .= 'and ';
|
||||
$w .= int_to_words($r);
|
||||
}
|
||||
} else { // millions
|
||||
$w .= int_to_words(floor($x/1000000)) .' million';
|
||||
$r = fmod($x, 1000000);
|
||||
if($r > 0) {
|
||||
$w .= ' ';
|
||||
if($r < 100)
|
||||
$word .= 'and ';
|
||||
$w .= int_to_words($r);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $w;
|
||||
}
|
||||
|
||||
?>
|
71
site/roadshow/class/rating/rating-example.php
Normal file
71
site/roadshow/class/rating/rating-example.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
require_once("classes/include.all.php");
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>CSS Star Rating System fully functional using AJAX</title>
|
||||
<link type="text/css" href="styles/rating.css" rel="stylesheet" media="all" />
|
||||
<script type="text/javascript" src="scripts/prototype.js"></script>
|
||||
<script type="text/javascript" src="scripts/rating.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h4>Race Rating System:</h4>
|
||||
<?php
|
||||
$ratingData = Rating::OutputParentRating('1');
|
||||
|
||||
if (Error::HasErrors())
|
||||
{
|
||||
echo Error::ShowErrorMessages();
|
||||
Error::ClearErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ratingData;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$ratingData = Rating::OutputRating('1','1');
|
||||
|
||||
if (Error::HasErrors())
|
||||
{
|
||||
echo Error::ShowErrorMessages();
|
||||
Error::ClearErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ratingData;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$ratingData = Rating::OutputRating('1','2');
|
||||
|
||||
if (Error::HasErrors())
|
||||
{
|
||||
echo Error::ShowErrorMessages();
|
||||
Error::ClearErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ratingData;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$ratingData = Rating::OutputRating('1','3');
|
||||
|
||||
if (Error::HasErrors())
|
||||
{
|
||||
echo Error::ShowErrorMessages();
|
||||
Error::ClearErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ratingData;
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
Database::DeInitialize();
|
||||
?>
|
14
site/roadshow/comments_show.php
Normal file
14
site/roadshow/comments_show.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?PHP
|
||||
|
||||
if (eregi("comments_show.php", $_SERVER['SCRIPT_NAME'])) {
|
||||
Header("Location: index.php"); die();
|
||||
}
|
||||
|
||||
$fb_xid = intval(mysql_escape_string($_GET[uid]));
|
||||
|
||||
?>
|
||||
|
||||
<a name="comment"></a>
|
||||
<? /*<div class="fb-comments" data-href="<? echo(curPageURL()); ?>" data-num-posts="5" data-width="500"></div>*/ ?>
|
||||
<? /**<fb:comments href="<? echo(curPageURL()); ?>" num_posts="5" width="500"></fb:comments>**/ ?>
|
||||
<fb:comments href="<? echo(curPageURL()); ?>" num_posts="5" width="622"></fb:comments>
|
312
site/roadshow/config.php
Normal file
312
site/roadshow/config.php
Normal file
@ -0,0 +1,312 @@
|
||||
<?
|
||||
###########################################
|
||||
#-----------Users login system------------#
|
||||
###########################################
|
||||
/*=========================================\
|
||||
Author : Mohammed Ahmed(M@@king) \\
|
||||
Version : 1.0 \\
|
||||
Date Created: Aug 20 2005 \\
|
||||
---------------------------- \\
|
||||
Last Update: August 22 2005 \\
|
||||
---------------------------- \\
|
||||
Country : Palestine \\
|
||||
City : Gaza \\
|
||||
E-mail : m@maaking.com \\
|
||||
MSN : m@maaking.com \\
|
||||
AOL-IM : maa2pal \\
|
||||
WWW : http://www.maaking.com \\
|
||||
Mobile/SMS : 00972-599-622235 \\
|
||||
\\
|
||||
===========================================\
|
||||
------------------------------------------*/
|
||||
// NEED TO CHECK AGAINST SERVER VERSION
|
||||
|
||||
//skip the config file if somebody call it from the browser.
|
||||
session_start();
|
||||
|
||||
if (eregi("config.php", $_SERVER['SCRIPT_NAME'])) {
|
||||
Header("Location: index.php"); die();
|
||||
}
|
||||
|
||||
$main_table = "Roadshow";
|
||||
$resource_table = "Resource";
|
||||
$field_lead = "roadshow_";
|
||||
$from_name = "roadshow";
|
||||
$local_name = "Road Show Events";
|
||||
$local_singular = "Road Show Event";
|
||||
$local_name_lc = "road show events";
|
||||
$local_singular_lc = "road show event";
|
||||
|
||||
$site_url = "/roadshow";
|
||||
include("../local/settings.php");
|
||||
/*
|
||||
|
||||
FIELD NAMES:
|
||||
roadshow_id
|
||||
roadshow_date
|
||||
roadshow_name
|
||||
roadshow_name_tag
|
||||
roadshow_address
|
||||
roadshow_address_two
|
||||
roadshow_city
|
||||
roadshow_state
|
||||
roadshow_state_tag
|
||||
roadshow_zip
|
||||
roadshow_lat
|
||||
roadshow_lng
|
||||
roadshow_phone
|
||||
roadshow_fax
|
||||
roadshow_email
|
||||
roadshow_website
|
||||
roadshow_stambassador
|
||||
roadshow_stambassador_names
|
||||
roadshow_triclub
|
||||
roadshow_triclub_names
|
||||
roadshow_coach
|
||||
roadshow_coach_names
|
||||
roadshow_racedirector
|
||||
roadshow_racedirector_names
|
||||
roadshow_brewery
|
||||
roadshow_brewery_names
|
||||
roadshow_local
|
||||
roadshow_fitbike
|
||||
roadshow_saddlechange
|
||||
roadshow_motioncapture
|
||||
roadshow_footbed
|
||||
roadshow_wetsuit
|
||||
roadshow_bike
|
||||
roadshow_trispecific
|
||||
roadshow_trispecific_names
|
||||
roadshow_fist
|
||||
roadshow_fist_names
|
||||
roadshow_diagnostic
|
||||
roadshow_shoe
|
||||
roadshow_sock
|
||||
roadshow_apparel_run
|
||||
roadshow_apparel_tri
|
||||
roadshow_swimgear
|
||||
roadshow_bikeaccessory
|
||||
roadshow_bikebody
|
||||
roadshow_bikecomponent
|
||||
roadshow_bikeelectronic
|
||||
roadshow_bikehelmet
|
||||
roadshow_biketrainer
|
||||
roadshow_bikewheel
|
||||
roadshow_runhydrate
|
||||
roadshow_bodycare
|
||||
roadshow_hours
|
||||
roadshow_activity
|
||||
roadshow_submitted_by
|
||||
roadshow_valid
|
||||
roadshow_user_tags
|
||||
|
||||
*/
|
||||
|
||||
//change this
|
||||
$site_name = "Slowtwitch.com";
|
||||
$site_email = "rappstar@slowtwitch.com";
|
||||
|
||||
define("MAPS_HOST", "maps.googleapis.com");
|
||||
define("KEY", "AIzaSyA13hZb_mE3Fx3KPevCWrQPERPykhiTIIw");
|
||||
$gmap_key = "AIzaSyAegmr3HHER_6rWivSpfxjvF0Dhv6oZV6I";
|
||||
|
||||
//added new code to fix compatibility issues.
|
||||
//09-Nov-2005
|
||||
$phpver = phpversion();
|
||||
if ($phpver < '4.1.0') {
|
||||
$_GET = $HTTP_GET_VARS;
|
||||
$_POST = $HTTP_POST_VARS;
|
||||
$_SERVER = $HTTP_SERVER_VARS;
|
||||
}
|
||||
if ($phpver >= '4.0.4pl1' && strstr($_SERVER["HTTP_USER_AGENT"],'compatible')) {
|
||||
if (extension_loaded('zlib')) {
|
||||
ob_end_clean();
|
||||
ob_start('ob_gzhandler');
|
||||
}
|
||||
} else if ($phpver > '4.0') {
|
||||
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
|
||||
if (extension_loaded('zlib')) {
|
||||
$do_gzip_compress = TRUE;
|
||||
ob_start(array('ob_gzhandler',5));
|
||||
ob_implicit_flush(0);
|
||||
header('Content-Encoding: gzip');
|
||||
}
|
||||
}
|
||||
}
|
||||
$phpver = explode(".", $phpver);
|
||||
$phpver = "$phpver[0]$phpver[1]";
|
||||
if ($phpver >= 41) {
|
||||
$PHP_SELF = $_SERVER['PHP_SELF'];
|
||||
}
|
||||
|
||||
if (!ini_get("register_globals")) {
|
||||
import_request_variables('GPC');
|
||||
}
|
||||
|
||||
|
||||
include("class/mysql.class.php");
|
||||
$db = new sql_db($dbhost, $dbuname, $dbpass, $dbname, false);
|
||||
if(!$db->db_connect_id) {
|
||||
|
||||
echo "<br><font color=red><h3><br><center>Error:</b><br><hr><br>
|
||||
<b>Connection to database failed</b><br>
|
||||
<br><br><br><br><br><br><br><br><br></b></center>";
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
$statecount = mysql_num_rows(mysql_query("SELECT * FROM gforum_Roadshow WHERE roadshow_valid = 1"));
|
||||
|
||||
$sql = "SELECT * FROM ".$prefix."ResourceStates ORDER BY stateid";
|
||||
$result = mysql_query($sql) OR die(mysql_error());
|
||||
$state_list = array();
|
||||
$state_tag_list = array();
|
||||
while ($row = mysql_fetch_array($result)) {
|
||||
$state_list[$row['stateid']] = $row['statelong'];
|
||||
$state_tag_list[] = $row['statetag'];
|
||||
}
|
||||
|
||||
function curPageURL() {
|
||||
$isHTTPS = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on");
|
||||
$port = (isset($_SERVER["SERVER_PORT"]) && ((!$isHTTPS && $_SERVER["SERVER_PORT"] != "80") || ($isHTTPS && $_SERVER["SERVER_PORT"] != "443")));
|
||||
$port = ($port) ? ':'.$_SERVER["SERVER_PORT"] : '';
|
||||
$url = ($isHTTPS ? 'https://' : 'http://').$_SERVER["SERVER_NAME"].$port.$_SERVER["REQUEST_URI"];
|
||||
return $url;
|
||||
}
|
||||
|
||||
function geocode($address) {
|
||||
// Initialize delay in geocode speed
|
||||
$delay = 0;
|
||||
$base_url = "http://" . MAPS_HOST . "/maps/api/geocode/xml?"; // . "&key=" . KEY;
|
||||
//echo ("Base URL: ".$base_url);
|
||||
|
||||
$status = "";
|
||||
$geocode_pending = true;
|
||||
|
||||
while ($geocode_pending) {
|
||||
$address = str_replace(" ", "+", $address);
|
||||
$address = str_replace("#", "", $address);
|
||||
$address = str_replace("\'", "", $address);
|
||||
$address = str_replace("/", "", $address);
|
||||
$request_url = $base_url . "address=" . $address . "&sensor=false"; //urlencode($address);
|
||||
$request_url = mb_convert_encoding($request_url, "UTF-8", "auto");
|
||||
//echo ($request_url."<br />");
|
||||
// Create cUrl object to grab XML content using $request_url
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, $request_url);
|
||||
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
|
||||
$xmlContent = trim(curl_exec($c));
|
||||
curl_close($c);
|
||||
|
||||
// Create SimpleXML object from XML Content
|
||||
$xml = simplexml_load_string($xmlContent);
|
||||
|
||||
// Print out all of the XML Object
|
||||
//print header("Content-type: text/plain");
|
||||
//print_r($xml);
|
||||
|
||||
$resolution = $xml->result->geometry->location_type;
|
||||
|
||||
$status = $xml->status;
|
||||
if (strcmp($status, "OK") == 0) {
|
||||
// Successful geocode
|
||||
$geocode_pending = false;
|
||||
$lat = $xml->result->geometry->location->lat;
|
||||
$lng = $xml->result->geometry->location->lng;
|
||||
$latlng_array = array($lat, $lng);
|
||||
return ($latlng_array);
|
||||
} elseif (strcmp($status, "OVER_QUERY_LIMIT") == 0) {
|
||||
// failure to geocode
|
||||
$geocode_pending = false;
|
||||
$status = "Road Show Event " . $row['roadshow_name'] . " failed to geocode. ";
|
||||
$status = $status . "Received status " . $status . "</br></br>\n";
|
||||
return ($status);
|
||||
} else {
|
||||
// failure to geocode
|
||||
$geocode_pending = false;
|
||||
$status = "Address " . $address . " failed to geocode. ";
|
||||
$status = $status . "Received status " . $status . "</br></br>\n";
|
||||
return ($status);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Array of states for use in the form
|
||||
/** $state_list = array('AL'=>"Alabama",
|
||||
'AK'=>"Alaska",
|
||||
'AB'=>'Alberta',
|
||||
'AZ'=>"Arizona",
|
||||
'AR'=>"Arkansas",
|
||||
'BC'=>'British Columbia',
|
||||
'CB'=>"Caribbean",
|
||||
'CA'=>"California",
|
||||
'CM'=>"Central America",
|
||||
'CO'=>"Colorado",
|
||||
'CT'=>"Connecticut",
|
||||
'DE'=>"Delaware",
|
||||
'DC'=>"District of Columbia",
|
||||
'FL'=>"Florida",
|
||||
'GA'=>"Georgia",
|
||||
'HI'=>"Hawaii",
|
||||
'ID'=>"Idaho",
|
||||
'IL'=>"Illinois",
|
||||
'IN'=>"Indiana",
|
||||
'IA'=>"Iowa",
|
||||
'KS'=>"Kansas",
|
||||
'KY'=>"Kentucky",
|
||||
'LA'=>"Louisiana",
|
||||
'ME'=>"Maine",
|
||||
'MB'=>'Manitoba',
|
||||
'MD'=>"Maryland",
|
||||
'MA'=>"Massachusetts",
|
||||
'MX'=>"Mexico",
|
||||
'MI'=>"Michigan",
|
||||
'MN'=>"Minnesota",
|
||||
'MS'=>"Mississippi",
|
||||
'MO'=>"Missouri",
|
||||
'MT'=>"Montana",
|
||||
'NE'=>"Nebraska",
|
||||
'NV'=>"Nevada",
|
||||
'NB'=>'New Brunswick',
|
||||
'NL'=>'Newfoundland',
|
||||
'NH'=>"New Hampshire",
|
||||
'NJ'=>"New Jersey",
|
||||
'NM'=>"New Mexico",
|
||||
'NY'=>"New York",
|
||||
'NC'=>"North Carolina",
|
||||
'ND'=>"North Dakota",
|
||||
'NS'=>'Nova Scotia',
|
||||
'OH'=>"Ohio",
|
||||
'OK'=>"Oklahoma",
|
||||
'ON'=>'Ontario',
|
||||
'OR'=>"Oregon",
|
||||
'PA'=>"Pennsylvania",
|
||||
'PE'=>'Prince Edward Island',
|
||||
'QC'=>'Quebec',
|
||||
'RI'=>"Rhode Island",
|
||||
'SK'=>'Saskatchewan',
|
||||
'SC'=>"South Carolina",
|
||||
'SD'=>"South Dakota",
|
||||
'TN'=>"Tennessee",
|
||||
'TX'=>"Texas",
|
||||
'UT'=>"Utah",
|
||||
'VT'=>"Vermont",
|
||||
'VA'=>"Virginia",
|
||||
'WA'=>"Washington",
|
||||
'WV'=>"West Virginia",
|
||||
'WI'=>"Wisconsin",
|
||||
'WY'=>"Wyoming",
|
||||
// New Foreign "States",
|
||||
'UK'=>"United Kingdom",
|
||||
'FR'=>"France",
|
||||
'DE'=>"Germany",
|
||||
'IT'=>"Italy",
|
||||
'CH'=>"Switzerland",
|
||||
'JP'=>"Japan",
|
||||
'AU'=>"Australia",
|
||||
'NZ'=>"New Zealand",
|
||||
'PI'=>"Pacific Islands",
|
||||
'HK'=>"Hong Kong");
|
||||
*/
|
||||
?>
|
33
site/roadshow/delete_X.php
Normal file
33
site/roadshow/delete_X.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?PHP
|
||||
|
||||
include("config.php");
|
||||
|
||||
if (!$_POST){ header('Location: '.$site_url); }
|
||||
|
||||
$sql = "DELETE FROM ".$prefix.$main_table." WHERE ".$field_lead."id = ".$_POST[$field_lead.'id'];
|
||||
|
||||
//echo $sql;
|
||||
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$sql = "DELETE FROM ".$prefix.$main_table."Edits WHERE ".$field_lead."id_fk = ".$_POST[$field_lead.'id'];
|
||||
|
||||
//echo $sql;
|
||||
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$sql = "DELETE FROM ".$prefix.$main_table."Editors WHERE ".$field_lead."id_fk = ".$_POST[$field_lead.'id'];
|
||||
|
||||
//echo $sql;
|
||||
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
|
||||
//$sql = "DELETE FROM ".$prefix.$main_table."Comment WHERE openwater_id_fk = '$_POST[openwater_id]'";
|
||||
//mysql_query($sql) or die(mysql_error());
|
||||
|
||||
//$sql = "DELETE FROM gforum_OpenWaterRating WHERE openwater_id_fk = '$_POST[openwater_id]'";
|
||||
//mysql_query($sql) or die(mysql_error());
|
||||
|
||||
header('Location: '.$site_url);
|
||||
|
||||
?>
|
4
site/roadshow/include_appointment.php
Normal file
4
site/roadshow/include_appointment.php
Normal file
@ -0,0 +1,4 @@
|
||||
<div class="btn-wrapper appform-btn"><a id="roadshow-btn" href="http://booking.slowtwitch.com/a/" class="btn default">Road Show Appointment</a></div>
|
||||
<div id="appform" class="appform" title="Road Show Appointment">
|
||||
<iframe src="http://booking.slowtwitch.com/a/" border="0"></iframe>
|
||||
</div>
|
10
site/roadshow/include_breadcrumb.php
Normal file
10
site/roadshow/include_breadcrumb.php
Normal file
@ -0,0 +1,10 @@
|
||||
<div class="breadcrumb">
|
||||
<a href="<? echo $main_site_url ?>">Home</a> >
|
||||
<a href="<? echo $main_site_url . "/local/" ?>">Local Listings</a> >
|
||||
<? if ( $row[$field_lead.'name'] ) { ?>
|
||||
<a href="<? echo $site_url ?>">Road Show</a>
|
||||
<? } else { ?>
|
||||
<span class="lasttitle">Road Show</span>
|
||||
<? } ?>
|
||||
<? if ($row[$field_lead.'name']) { echo "> " . $row[$field_lead.'name']; } ?>
|
||||
</div>
|
105
site/roadshow/include_buttons.php
Normal file
105
site/roadshow/include_buttons.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?PHP
|
||||
|
||||
if(is_logged_in($user)){
|
||||
$tagtext = "I'm going here";
|
||||
$actionlink = "individual.php?roadshow_id=$row[roadshow_id]&".get_sid();
|
||||
}else{
|
||||
$tagtext = "Log in to tag roadshow event";
|
||||
$actionlink = "http://forum.slowtwitch.com/gforum.cgi?do=login&from=roadshow";
|
||||
$tagstatus = "no";
|
||||
}
|
||||
|
||||
if(is_logged_in($user)){
|
||||
//Get user's uid
|
||||
//$testresults = mysql_query("SELECT user_id FROM ".$prefix."User WHERE user_username=\"$username\"") or die(mysql_error());
|
||||
//$testrow = mysql_fetch_array($testresults);
|
||||
//$useruid = $testrow[user_id];
|
||||
$useruid = base64_decode($_SESSION['user_id']);
|
||||
|
||||
// is the current user the owner of the open water event?
|
||||
$roadshow_submitted_by = FALSE;
|
||||
if($useruid == $row[roadshow_submitted_by]){
|
||||
$roadshow_submitted_by = TRUE;
|
||||
}
|
||||
|
||||
$tagresults = mysql_query("SELECT roadshow_user_tags FROM ".$prefix."Roadshow WHERE roadshow_id=$row[roadshow_id]");
|
||||
$tagrow = mysql_fetch_array($tagresults);
|
||||
$tags = explode(",", $tagrow[roadshow_user_tags]);
|
||||
|
||||
$profileresults = mysql_query("SELECT user_roadshowtags FROM ".$prefix."User WHERE user_id='$useruid'") or die(mysql_error());
|
||||
$profilerow = mysql_fetch_array($profileresults);
|
||||
$profiletags = explode(",", $profilerow[user_roadshowtags]);
|
||||
|
||||
if($_POST[status] == "tag"){
|
||||
//tag the open water event
|
||||
if(array_search($useruid, $tags) == FALSE){
|
||||
array_push($tags, $useruid);
|
||||
}
|
||||
$tags = implode(",", $tags);
|
||||
mysql_query("UPDATE ".$prefix."Roadshow SET roadshow_user_tags='$tags' WHERE roadshow_id=$row[roadshow_id]") or die(mysql_error());
|
||||
$tags = explode(",", $tags);
|
||||
|
||||
if(array_search($row[roadshow_id], $profiletags) == FALSE){
|
||||
array_push($profiletags, $row[roadshow_id]);
|
||||
}
|
||||
$profiletags = implode(",", $profiletags);
|
||||
mysql_query("UPDATE ".$prefix."User SET user_roadshowtags='$profiletags' WHERE user_id='$useruid'") or die(mysql_error());
|
||||
}else if($_POST[status] == "untag"){
|
||||
//untag the open water event
|
||||
$key = array_search($useruid, $tags);
|
||||
unset($tags[$key]);
|
||||
$tags = implode(",", $tags);
|
||||
mysql_query("UPDATE ".$prefix."Roadshow SET roadshow_user_tags='$tags' WHERE roadshow_id=$row[roadshow_id]") or die(mysql_error());
|
||||
$tags = explode(",", $tags);
|
||||
|
||||
$key = array_search($row[roadshow_id], $profiletags);
|
||||
unset($profiletags[$key]);
|
||||
$profiletags = implode(",", $profiletags);
|
||||
mysql_query("UPDATE ".$prefix."User SET user_roadshowtags='$profiletags' WHERE user_id=$useruid");
|
||||
}
|
||||
|
||||
//Is the open water event tagged already?
|
||||
if(array_search($useruid, $tags) !== FALSE){ $swimshere = TRUE; }else{ $swimshere = FALSE; }
|
||||
|
||||
if($swimshere){ $tagstatus = "untag"; $tagtext = "Untag this";}else{ $tagstatus = "tag"; $tagtext = "I'm going here";}
|
||||
}
|
||||
?>
|
||||
|
||||
<div>
|
||||
<form action="<? echo $actionlink; ?>" method="post" style="display: inline;">
|
||||
<input type="hidden" value="<? echo $tagstatus; ?>" name="status" class="btn"/>
|
||||
<input type="submit" value="<? echo $tagtext; ?>" class="nobutton btn" />
|
||||
</form>
|
||||
<form method="post" action="<? echo "individual.php?roadshow_id=$row[roadshow_id]#goinghere"; ?>" style="display: inline;">
|
||||
<input type="submit" value="Who's going here?" class="nobutton btn" />
|
||||
</form>
|
||||
<? /**<form method="post" action="<? echo "individual.php?roadshow_id=$row[roadshow_id]#rate"; ?>" style="display: inline;">
|
||||
<input type="submit" value="Rate this open water event" class="nobutton" />
|
||||
</form> **/?>
|
||||
<? if(is_logged_in($user)){ ?>
|
||||
<form method="post" action="<? echo "individual.php?roadshow_id=$row[roadshow_id]#comment"; ?>" style="display: inline;">
|
||||
<input type="submit" value="Add a comment" class="nobutton btn" />
|
||||
</form>
|
||||
|
||||
<form method="post" action="<? echo "wiki_edit.php?roadshow_id=$row[roadshow_id]"; ?>" style="display: inline;">
|
||||
<input type="submit" value="Wiki-edit this" class="nobutton btn" />
|
||||
</form>
|
||||
|
||||
<? if (is_admin($user)) { ?>
|
||||
|
||||
<form method="post" action="delete_X.php" style="display: inline;">
|
||||
<input type="hidden" name="roadshow_id" value="<? echo($row[roadshow_id]); ?>" class="btn" />
|
||||
<input type="submit" value="DELETE" class="nobutton btn" onclick="return confirm('Are you sure you want to DELETE this open water event?');" />
|
||||
</form>
|
||||
|
||||
<?
|
||||
|
||||
//Get user's username
|
||||
$testresults = mysql_query("SELECT user_username FROM ".$prefix."User WHERE user_id='$row[roadshow_submitted_by]'") or die(mysql_error());
|
||||
$testrow = mysql_fetch_array($testresults);
|
||||
$username = $testrow[user_username];
|
||||
//echo("<br /><br /><strong>Entered By: </strong> <a href='http://forum.slowtwitch.com/gforum.cgi?username=$username;'>$username</a>");
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
59
site/roadshow/include_common_content.php
Normal file
59
site/roadshow/include_common_content.php
Normal file
@ -0,0 +1,59 @@
|
||||
|
||||
|
||||
<body id="home" <? if (eregi("index.php", $_SERVER['SCRIPT_NAME'])) { echo ("onload='initializeRoadshowMap()'"); } ?>>
|
||||
<? include("/var/home/slowtwitch/slowtwitch.com/www/db_templates/fb_sdk.html"); ?>
|
||||
<div id="accessibility"><a href="#content">Skip to Content</a></div>
|
||||
<hr class="hide" />
|
||||
<div id="wrapper">
|
||||
<div id="header">
|
||||
<div id="ad_728x90"><!-- BEGIN ADVERTPRO CODE BLOCK -->
|
||||
|
||||
<!-- Zone ID: 58 -->
|
||||
<!-- Zone Name: Slowtwitch 728x90 -->
|
||||
<!-- Size ID: 19 -->
|
||||
<!-- Size Name: Jumbo Banner -->
|
||||
<!-- Size Width: 728 -->
|
||||
<!-- Size Height: 90 -->
|
||||
|
||||
<SCRIPT language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
document.write('<SCR'+'IPT src="http://reach.slowtwitch.com/servlet/view/banner/javascript/zone?zid=58&pid=0&random='+Math.floor(89999999*Math.random()+10000000)+'&millis='+new Date().getTime()+'&referrer='+escape(document.location)+'" language="JavaScript" type="text/javascript"></SCR'+'IPT>');
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A href="http://reach.slowtwitch.com/servlet/click/zone?zid=58&pid=0&lookup=true&position=1" target="_top">
|
||||
<IMG src="http://reach.slowtwitch.com/servlet/view/banner/image/zone?zid=58&pid=0&position=1" height="90" width="728" hspace="0" vspace="0" border="0" alt="Click Here!">
|
||||
</A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
<!-- END ADVERTPRO CODE BLOCK --></div>
|
||||
<div id="logo"><h1><a href="http://www.slowtwitch.com"><:: Welcome to Slowtwitch.com ::></a></h1></div>
|
||||
</div>
|
||||
|
||||
<? include "/var/home/slowtwitch/slowtwitch.com/www/db_templates/common_nav.html"; ?>
|
||||
|
||||
<hr class="hide" />
|
||||
<div id="ocwrapper" class="clear">
|
||||
<div id="icwrapper" class="clear">
|
||||
|
||||
<div id="leftsidebar">
|
||||
<?
|
||||
include("include_status.php");
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?
|
||||
include("include_navigation.php");
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="contentwrapper" class="shadowleft">
|
||||
<div class="shadowtop"><div class="shadowtopleft"></div><div class="shadowtopright"></div></div>
|
||||
<div class="shadowright">
|
||||
<div id="content">
|
||||
<div class="clear"></div>
|
1
site/roadshow/include_common_footer.php
Normal file
1
site/roadshow/include_common_footer.php
Normal file
@ -0,0 +1 @@
|
||||
<? include("/var/home/slowtwitch/slowtwitch.com/www/db_templates/include_common_footer.php"); ?>
|
84
site/roadshow/include_common_head.php
Normal file
84
site/roadshow/include_common_head.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?
|
||||
|
||||
if (eregi("include_common_head.php", $_SERVER['SCRIPT_NAME'])) {
|
||||
Header("Location: index.php"); die();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<base href="<? echo $site_url ?>/" />
|
||||
|
||||
<title>Slowtwitch.com Roadshow Event Database: <? echo $pagetitle; ?></title>
|
||||
<meta name="KEYWORDS" content="<? echo($meta_keywords); ?>" />
|
||||
<meta name="DESCRIPTION" content="<? echo($meta_description); ?>"/>
|
||||
<meta http-equiv="CONTENT-STYLE-TYPE" content="text/CSS" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<!-- GOOGLE MAPS META TAG -->
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
<!-- END GOOGLE MAPS META TAG -->
|
||||
<? include("/var/home/slowtwitch/slowtwitch.com/www/db_templates/fb_og.php"); ?>
|
||||
<link rel="shortcut icon" href="/favicon.ico" />
|
||||
<link rel="alternate" type="application/rss+xml" title="Slowtwitch.com - RSS" href="/rss" />
|
||||
|
||||
<? include($common_path . "/templates/include_global_head.php"); ?>
|
||||
<? include($common_path . "/templates/google_analytics.html"); ?>
|
||||
<? include($common_path . "/templates/fb_sdk.html"); ?>
|
||||
|
||||
<!-- begin script to create random number for ads -->
|
||||
<script language="Javascript">
|
||||
<!--
|
||||
sgi_ord=Math.random()*10000000000000000;
|
||||
//-->
|
||||
</script>
|
||||
<!-- End random number script -->
|
||||
|
||||
<script type="text/javascript">
|
||||
function showDiv(id)
|
||||
{
|
||||
el = document.getElementById(id);
|
||||
if (el.style.display == 'none')
|
||||
{
|
||||
el.style.display = 'block';
|
||||
} else {
|
||||
el.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function swapImage(imgName, imgSrc)
|
||||
{
|
||||
imgToSwap = document.images[imgName];
|
||||
if (imgSrc.indexOf("/images/buttonMinimize.gif") > 0)
|
||||
{
|
||||
imgToSwap.src = "<? echo($site_url."/images/buttonExpand.gif"); ?>";
|
||||
} else {
|
||||
imgToSwap.src = "<? echo($site_url."/images/buttonMinimize.gif"); ?>";
|
||||
}
|
||||
}
|
||||
|
||||
function checkUncheck() {
|
||||
var argv = checkUncheck.arguments;
|
||||
var chks = document.getElementsByName('states[]');
|
||||
var argc = argv.length;
|
||||
var caller = argv[0];
|
||||
if (caller.checked) {
|
||||
var status = true;
|
||||
} else {
|
||||
var status = false;
|
||||
}
|
||||
for (var i = 1; i < argc; i++) {
|
||||
for (var j = 0; j < chks.length; j++) {
|
||||
if (chks[j].value == argv[i]) { chks[j].checked = status; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<!-- INCLUDE CODE FOR MAP OF ALL FITTERS -->
|
||||
<? if (eregi("index.php", $_SERVER['SCRIPT_NAME'])) { include ("gmaps_allroadshow.js"); } ?>
|
||||
|
||||
</head>
|
34
site/roadshow/include_navigation.php
Normal file
34
site/roadshow/include_navigation.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?PHP
|
||||
|
||||
?>
|
||||
|
||||
<div class="widget">
|
||||
<h2>Road Show Stops</h2>
|
||||
<div class="region-list">
|
||||
<?
|
||||
|
||||
$navsql = "SELECT * FROM gforum_Roadshow WHERE 1=1 ORDER BY roadshow_date ASC";
|
||||
$navresult = mysql_query($navsql) OR die(mysql_error());
|
||||
$prior_city = "";
|
||||
while ($navrow = mysql_fetch_array($navresult)) {
|
||||
$navdatetime = new DateTime($navrow[$field_lead.'date']);
|
||||
$current_city = $navrow[''.$field_lead.'city'];
|
||||
if ($current_city <> $prior_city) {
|
||||
echo ("<div class=\"list-item\">".$navdatetime->format('M j')." ".$navrow[''.$field_lead.'city'].", ".$navrow[''.$field_lead.'state'] . "</div>");
|
||||
} else {
|
||||
echo ("<br>");
|
||||
}
|
||||
echo ("<a style=\"padding-left: 10px;display: inline-block\" href='individual.php?".$field_lead."id=".$navrow[''.$field_lead.'id']."'>");
|
||||
echo ($navrow[''.$field_lead.'name']);
|
||||
echo ("</a>");
|
||||
$prior_city = $current_city;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="advsearch">
|
||||
<br>
|
||||
<a href="<? echo $site_url . '/search.php' ?>">Search</a> <span class="sprite-magnify"> </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
27
site/roadshow/include_share.php
Normal file
27
site/roadshow/include_share.php
Normal file
@ -0,0 +1,27 @@
|
||||
<? /**
|
||||
|
||||
<p>
|
||||
<div style="height: 60px;" >
|
||||
<a href="https://twitter.com/share" class="twitter-share-button" data-via="slowtwitch" data-size="default" data-count="vertical">Tweet</a>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
||||
|
||||
|
||||
<!-- Place this tag where you want the +1 button to render -->
|
||||
<g:plusone size="tall"></g:plusone>
|
||||
|
||||
<!-- Place this render call where appropriate -->
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
||||
po.src = 'https://apis.google.com/js/plusone.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<div class="fb-like" data-href="<? echo(curPageURL()); ?>" data-send="false" data-layout="box_count" data-show-faces="false" data-font="verdana"></div>
|
||||
</div>
|
||||
</p>
|
||||
|
||||
**/
|
||||
|
||||
?>
|
13
site/roadshow/include_sidebar.php
Normal file
13
site/roadshow/include_sidebar.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?
|
||||
$selected_local = 'roadshow';
|
||||
include($common_path . "/templates/include_local_listing.php");
|
||||
?>
|
||||
<div class="widget-divider"></div>
|
||||
<? include("include_status.php"); ?>
|
||||
|
||||
<? include("include_navigation.php"); ?>
|
||||
<div class="widget-divider"></div>
|
||||
|
||||
<div class="advert hide-on-mobile">
|
||||
<? include($common_path . "/ads/ad_300x600.html"); ?>
|
||||
</div>
|
10
site/roadshow/include_status.php
Normal file
10
site/roadshow/include_status.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?
|
||||
if(is_admin()){
|
||||
echo("<br /><strong style=\"text-decoration: underline;\">Admin:</strong>");
|
||||
echo("<br /><a href='add.php'><strong>Add ".$local_singular."</strong></a>");
|
||||
$unvalid_count = mysql_num_rows(mysql_query("SELECT * FROM ".$prefix.$main_table." WHERE ".$field_lead."valid = 0"));
|
||||
echo("<br /><a href='validate.php'><strong>Validate Entries (".$unvalid_count.")</strong></a>");
|
||||
$unvalid_count = mysql_num_rows(mysql_query("SELECT * FROM ".$prefix.$main_table."Edits"));
|
||||
echo("<br /><a href='wiki_validate.php'><strong>Validate Edits (".$unvalid_count.")</strong></a>");
|
||||
}
|
||||
?>
|
72
site/roadshow/index.php
Normal file
72
site/roadshow/index.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?PHP include("config.php");
|
||||
|
||||
// set the page title
|
||||
$pagetitle = "Slowtwitch Road Show Events";
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = "triathlon, trifind, duathlon";
|
||||
$meta_description = "Are you trying to find road show events in near your area? You can browse all road show events organized by states, to find which ones you want to use.";
|
||||
|
||||
?>
|
||||
|
||||
<? 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">Road Show</h1>
|
||||
<hr class="line">
|
||||
|
||||
<h3>Global road show event map</h3>
|
||||
<p>The map below shows the location of all registered Slowtwitch road show events around the globe. You can drag the map, zoom-in, zoom-out, and use any other of the standard Google Maps features. Anywhere you see a red icon, you can click to see the name of that road show event and a street address.</p>
|
||||
<div class="map-container">
|
||||
<div id="map" class="map" data-name="roadshow" data-json="/googlemaps/json/roadshow.json"></div><!--xml relative path from js folder -->
|
||||
</div>
|
||||
<?
|
||||
$num = mysql_num_rows(mysql_query("SELECT roadshow_id FROM ".$prefix."Road Show WHERE roadshow_valid=1"));
|
||||
?>
|
||||
<h3>What if we threw a party and an expo broke out?</h3>
|
||||
<p>That's what the Slowtwitch Road Shows are all about. In 34 locations, 1 Road Show per selected U.S. city, triathletes and tri-curious can see, touch, learn about, and buy compelling stuff made for multisporters. Okay, we confess: lt's totally about wearing out the cash registers. But we'll make it a painless buy. Features of this special day, which is entirely free to attendees:</p>
|
||||
<p>Beer, Free stuff, Demo shoes from popular running shoe brands, On-site race entries (discounts, maybe?), Beer, Slowtwitch staff and notorious Slowtwitch Reader Forum personalities., Cheap stuff, Virtual training and racing demos (Zwift and VirtualTrainer), Food, Beer, Demo bikes from the sport's most important tri bike makers, Lots of inventory in the latest stuff.</p>
|
||||
<div class="advert float-left">
|
||||
<? include($common_path . "/ads/ad_300x250_roadblocks.html"); ?>
|
||||
</div>
|
||||
<h3>Here's who'll you'll meet at Slowtwitch Road Shows:</h3>
|
||||
<p>Slowtwitch staff and regulars including Dan Empfield; Karen Sing; Ian Murray; Steve Fleck; Lars Finanger; Herbert Krabel. And also meet all your local race directors</p>
|
||||
<p>But wait, there's more. Slowtwitch is more than an online magazine and the sport's largest Reader Forum. Its team members provided the templates for the wetsuits you wear and the bikes you ride; and the way you fit aboard those bikes. At most Road Shows you'll see or both of two workstations:</p>
|
||||
<ul>
|
||||
<li><b>Saddle Optimizer</b>: Rides several saddles back-to-back on stationary equipment built for the purpose</li>
|
||||
<li><b>Complete Bike Solver</b>: Discover, in granular details, what tri bikes fit you perfectly.</li>
|
||||
</ul>
|
||||
<p>Some of these activations are available by appointment only. Choose your Road Show, and then choose your appointment (not all special activations and appointments are published; return as your Road Show approaches to make your appointment if it's not listed yet).</p>
|
||||
<p>Visit our Slowtwitch Road Show Facebook page for updates, including itineraries for the Road Show in your townn.</p>
|
||||
|
||||
<? include("include_appointment.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>
|
||||
|
622
site/roadshow/individual.php
Normal file
622
site/roadshow/individual.php
Normal file
@ -0,0 +1,622 @@
|
||||
<?PHP
|
||||
|
||||
include("config.php");
|
||||
require_once("class/rating/classes/include.all.php");
|
||||
|
||||
$idhere = intval(mysql_escape_string($_GET[''.$field_lead.'id']));
|
||||
$results = mysql_query("SELECT * FROM ".$prefix.$main_table." WHERE ".$field_lead."id='".$idhere."' LIMIT 1");
|
||||
$row = mysql_fetch_array($results);
|
||||
if (!$row){header('Location: '.$site_url.'/?error=invalid_id');}
|
||||
|
||||
if($row[$field_lead.'valid'] == 0) {
|
||||
if(!is_admin()){
|
||||
header('Location: '.$site_url);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
// set the page title
|
||||
$pagetitle = $row[$field_lead.'name'];
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = "triathlon, ".$row[$field_lead.'name'].", ".$row[$field_lead.'state'].", slowtwitch road show";
|
||||
$meta_description = "Considering attending ".$row[$field_lead.'name']."? Here is all of the information about this ".$local_singular_lc;
|
||||
|
||||
?>
|
||||
|
||||
<? 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">Road Show</h1>
|
||||
<hr class="line">
|
||||
<div class="details grid">
|
||||
<h2><? echo stripslashes(stripslashes($row[$field_lead.'name'])) ; echo " "; ?></h2>
|
||||
<? if($_GET[wiki_change] == 'success') { ?>
|
||||
<p class="success"><strong>Editor:</strong> your changes have been submitted and will be validated within 24 hours.</p>
|
||||
<? } ?>
|
||||
|
||||
<?
|
||||
$wikiFetchSQL = "SELECT edit_id FROM ".$prefix.$main_table."Edits WHERE ".$field_lead."id_fk = '".intval(mysql_escape_string($_GET[$field_lead.'id']))."'";
|
||||
$boolEdits = mysql_num_rows(mysql_query($wikiFetchSQL));
|
||||
if($boolEdits !== 0 && $_GET[wiki_change] != 'success') { ?>
|
||||
<p class="error"><strong>Group Edits:</strong> there are group edits waiting to be validated.</p>
|
||||
<? } ?>
|
||||
|
||||
|
||||
<div class="col-6-12 address">
|
||||
<? $datetime = new DateTime($row[$field_lead.'date']); ?>
|
||||
Date: <? echo $datetime->format('Y-m-d'); ?><br>
|
||||
Time: <? echo $datetime->format('g:i A'); ?><br>
|
||||
Street Address: <? echo stripslashes(htmlspecialchars($row[$field_lead.'address'])); ?><br>
|
||||
<? if ($row[$field_lead.'address_two'] <> "") {
|
||||
echo("Street Address Two:");
|
||||
echo stripslashes(htmlspecialchars($row[$field_lead.'address_two']));
|
||||
echo("<br>");
|
||||
} ?>
|
||||
City: <? echo stripslashes(htmlspecialchars($row[$field_lead.'city'])); ?><br>
|
||||
State: <? echo stripslashes(htmlspecialchars($row[$field_lead.'state'])); ?><br>
|
||||
Zip/Postal Code: <? echo stripslashes(htmlspecialchars($row[$field_lead.'zip'])); ?>
|
||||
</div>
|
||||
<div class="col-6-12 contact">
|
||||
Phone: <? echo stripslashes(htmlspecialchars($row[$field_lead.'phone'])); ?><br>
|
||||
E-mail: <a href="mailto:<? echo $row[$field_lead.'email']; ?>"><? echo stripslashes(htmlspecialchars($row[$field_lead.'email'])); ?></a><br>
|
||||
<?
|
||||
$substring = "http";
|
||||
if (!is_int(strpos($row[$field_lead.'website'], $substring))) {
|
||||
$row[$field_lead.'website'] = "http://".$row[$field_lead.'website'];
|
||||
}
|
||||
$website = $row[$field_lead.'website'];
|
||||
|
||||
?>
|
||||
Shop Website: <? echo "<a target=\"_blank\" href=\"$website\">$website</a>"; ?>
|
||||
</div>
|
||||
<div class="col-1-1">
|
||||
<? /**START COMMENT BLOCK OUT**/
|
||||
$substring = "http";
|
||||
if (!is_int(strpos($row[$field_lead.'raffle'], $substring))) {
|
||||
$row[$field_lead.'raffle'] = "http://".$row[$field_lead.'raffle'];
|
||||
}
|
||||
$raffle = $row[$field_lead.'raffle'];
|
||||
?>
|
||||
<?
|
||||
$substring = "http";
|
||||
if (!is_int(strpos($row[$field_lead.'facebook'], $substring))) {
|
||||
$row[$field_lead.'facebook'] = "http://".$row[$field_lead.'facebook'];
|
||||
}
|
||||
$facebook = $row[$field_lead.'facebook'];
|
||||
?>
|
||||
Raffle Link: <? echo "<a target=\"_blank\" href=\"$raffle\">$raffle</a>"; ?><br>
|
||||
RSVP on Facebook: <? echo "<a target=\"_blank\" href=\"$facebook\">$facebook</a>"; ?>
|
||||
|
||||
<? /**END COMMENT BLOCK OUT**/ ?>
|
||||
</div>
|
||||
<div class="col-1-1">
|
||||
<? include("include_buttons.php") ?>
|
||||
<? include ('include_share.php'); ?>
|
||||
</div>
|
||||
<div class="col-1-1 detail-block">
|
||||
<h3>Appointment Only Services</h3>
|
||||
<div class="highlight-block">
|
||||
<p><i>Saddle Optimizer</i>: Rides several saddles back-to-back on stationary equipment built for the purpose</p>
|
||||
<p><i>Complete Bike Solver</i>: Discover, in granular details, what tri bikes fit you perfectly.</p>
|
||||
</div>
|
||||
<h3>Brands</h3>
|
||||
<div class="highlight-block">
|
||||
<?
|
||||
$implosion = $row[$field_lead.'apparel_tri'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."ApparelTri WHERE apparel_tri_id IN ($implosion) ORDER BY apparel_tri_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[apparel_tri_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Triathlon Apparel: </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bike'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Bike WHERE bike_id IN ($implosion) ORDER BY bike_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bike_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Bike(s): </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikeaccessory'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeAccessory WHERE bikeaccessory_id IN ($implosion) ORDER BY bikeaccessory_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikeaccessory_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Bike Saddles/Footwear/Aerobars/Bike Hydration: </strong>
|
||||
";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikehelmet'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeHelmet WHERE bikehelmet_id IN ($implosion) ORDER BY bikehelmet_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikehelmet_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Bike Helmets/Eyewear: </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikebody'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeBody WHERE bikebody_id IN ($implosion) ORDER BY bikebody_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikebody_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Bike Nutritionals/Lubricants/Botanicals: </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'biketrainer'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeTrainer WHERE biketrainer_id IN ($implosion) ORDER BY biketrainer_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[biketrainer_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Bike Stationary Trainer(s): </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikeelectronic'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeElectronic WHERE bikeelectronic_id IN ($implosion) ORDER BY bikeelectronic_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikeelectronic_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Bike Electronics/Cameras/Metrics: </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikewheel'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeWheel WHERE bikewheel_id IN ($implosion) ORDER BY bikewheel_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikewheel_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Bike Wheels/Tires: </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikecomponent'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeComponent WHERE bikecomponent_id IN ($implosion) ORDER BY bikecomponent_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikecomponent_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Bike Component(s): </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'sock'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Sock WHERE sock_id IN ($implosion) ORDER BY sock_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[sock_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Sock(s): </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'shoe'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Shoe WHERE shoe_id IN ($implosion) ORDER BY shoe_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[shoe_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Running Shoe(s): </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'apparel_run'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."ApparelRun WHERE apparel_run_id IN ($implosion) ORDER BY apparel_run_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[apparel_run_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Run Apparel: </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'runhydrate'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."RunHydrate WHERE runhydrate_id IN ($implosion) ORDER BY runhydrate_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[runhydrate_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Run Hydration: </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'wetsuit'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Wetsuit WHERE wetsuit_id IN ($implosion) ORDER BY wetsuit_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[wetsuit_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Wetsuit(s): </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'swimgear'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Swimgear WHERE swimgear_id IN ($implosion) ORDER BY swimgear_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[swimgear_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Swim Apparel/Gear: </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bodycare'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Bodycare WHERE bodycare_id IN ($implosion) ORDER BY bodycare_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bodycare_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list <> "") {
|
||||
echo "<br /><strong>Bodycare Tools: </strong>";
|
||||
echo $temp_list;
|
||||
}
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
<h3>Road Show Itinerary</h3>
|
||||
<div class="highlight-block">
|
||||
<p><strong>Itinerary: </strong><? echo stripslashes(stripslashes($row[$field_lead.'activity'])) ?></p>
|
||||
</div>
|
||||
<? include("include_appointment.php") ?>
|
||||
</div>
|
||||
|
||||
<div class="col-1-1">
|
||||
<div id="map" class="map map-single" data-name="single" data-category="roadshow" data-lat="<? echo $row[$field_lead.'lat'] ?>" data-lng="<? echo $row[$field_lead.'lng'] ?>"></div>
|
||||
<div class="map-description">
|
||||
<small>Map location is based off of a geocode of the addressed entered using Google's Google Maps API. If your address does not geocode properly, you can either update the address (we will attempt to re-geocode after any updates to your entry) <strong>or</strong> you can use Google's geocoding tool found here: <a href="http://gmaps-samples.googlecode.com/svn/trunk/geocoder/singlegeocode.html">http://gmaps-samples.googlecode.com/svn/trunk/geocoder/singlegeocode.html</a> to obtain a lat/long for your location and enter that. To use the utility, type in an address that is close to your location and then drag-and-drop the marker to obtain the desired lat/long. If you choose to enter a lat/long, you <strong>must</strong> check the box on the edit page that says, "override geocode with entered lat/long."</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1-1 detail-block">
|
||||
<!-- BEGIN LIST OF USERS -->
|
||||
<a name="goinghere"></a>
|
||||
<?
|
||||
$testresults = mysql_query("SELECT ".$field_lead."user_tags FROM ".$prefix.$main_table." WHERE ".$field_lead."id=".$idhere);
|
||||
$testrow = mysql_fetch_array($testresults) or die(mysql_error());
|
||||
$tags = explode(",", $testrow[$field_lead.'user_tags']);
|
||||
$numcount = count($tags) - 1;
|
||||
if($numcount == 0){ $phrase = "No users have tagged this ".$local_singular_lc." yet."; }
|
||||
else if($numcount == 1){ $phrase = "There is 1 user which has tagged this ".$local_singular_lc.":"; }
|
||||
else{ $phrase = "There are $numcount users which have tagged this ".$local_singular_lc.": "; }
|
||||
echo "<br />";
|
||||
?>
|
||||
<h3><? echo $phrase; ?></h3>
|
||||
<div class="highlight-block">
|
||||
<?
|
||||
//List users
|
||||
$i = 0;
|
||||
foreach($tags as $value){
|
||||
if($i > 0){
|
||||
$tempresults = mysql_query("SELECT user_username FROM ".$prefix."User WHERE user_id='$value'") or die (mysql_error());
|
||||
$temprow = mysql_fetch_array($tempresults);
|
||||
if($i > 1){ echo ", "; }
|
||||
// TODO: SLOWTWITCH EDIT
|
||||
//echo "<a href=\"profiles/$temprow[user_username].html\">$temprow[user_username]</a>";
|
||||
// replace the link above with the link below for integration into gforum
|
||||
echo "<a href=\"http://forum.slowtwitch.com/gforum.cgi?username=$temprow[user_username]&session=".$_SESSION['session_id']."&from=".$from_name."\">$temprow[user_username]</a>";
|
||||
// TODO: SLOWTWITCH EDIT END
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if(count($tags) <= 1){ echo "No users"; }
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1-1 detail-block">
|
||||
<!-- BEGIN LIST OF EDITORS -->
|
||||
<a name="editors"></a>
|
||||
<?
|
||||
$testresults = mysql_query("SELECT * FROM ".$prefix.$main_table."Editors WHERE ".$field_lead."id_fk=".$idhere." ORDER BY edit_timestamp DESC");
|
||||
$numcount = mysql_num_rows($testresults);
|
||||
if($numcount == 0){ $phrase = "No updates have been made this ".$local_singular_lc." yet."; }
|
||||
else if($numcount == 1){ $phrase = "There has been 1 update to this ".$local_singular_lc.":"; }
|
||||
else{ $phrase = "There have been $numcount updates to this ".$local_singular_lc.": "; }
|
||||
echo "<br />";
|
||||
?>
|
||||
<h3><a name="tagged"></a><? echo $phrase; ?></h3>
|
||||
<div class="highlight-block">
|
||||
<?
|
||||
//List users
|
||||
$i = 0;
|
||||
while($row=mysql_fetch_array($testresults)){
|
||||
if($i >= 0){
|
||||
$tempresults = mysql_query("SELECT user_username FROM ".$prefix."User WHERE user_id='$row[user_id_fk]'") or die (mysql_error());
|
||||
$temprow = mysql_fetch_array($tempresults);
|
||||
if($i >= 1){ echo "<br />"; }
|
||||
// TODO: SLOWTWITCH EDIT
|
||||
//echo "<a href=\"profiles/$temprow[user_username].html\">$temprow[user_username]</a>";
|
||||
// replace the link above with the link below for integration into gforum
|
||||
echo "<a href=\"http://forum.slowtwitch.com/gforum.cgi?username=$temprow[user_username]&session=".$_SESSION['session_id']."&from=".$from_name."\">$temprow[user_username]</a> at ".date("F j, Y g:i A", $row[edit_timestamp]);
|
||||
// TODO: SLOWTWITCH EDIT END
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if($numcount <= 0){ echo "No users"; }
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-divider-bottom"></div>
|
||||
<!-- BEGIN COMMENTS -->
|
||||
<? include ('comments_show.php');?>
|
||||
<!-- END COMMENTS -->
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
|
7
site/roadshow/logout.php
Normal file
7
site/roadshow/logout.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?PHP
|
||||
include("config.php");
|
||||
session_unset();
|
||||
session_destroy();
|
||||
$_SESSION = array();
|
||||
header("Location: http://forum.slowtwitch.com/gforum.cgi?do=logout&from=openwater");
|
||||
?>
|
520
site/roadshow/masterbrands.php
Normal file
520
site/roadshow/masterbrands.php
Normal file
@ -0,0 +1,520 @@
|
||||
<?PHP include("config.php");
|
||||
|
||||
// set the page title
|
||||
$pagetitle = "Open Water Events";
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = "triathlon, trifind, duathlon";
|
||||
$meta_description = "Are you trying to find road show events in near your area? You can browse all road show events organized by states, to find which ones you want to use.";
|
||||
|
||||
?>
|
||||
|
||||
<? include("include_common_head.php"); ?>
|
||||
<? include("include_common_content.php"); ?>
|
||||
|
||||
<!-- Start outer -->
|
||||
<div id="outer">
|
||||
|
||||
<!-- BODY -->
|
||||
<div class="content">
|
||||
|
||||
|
||||
<!-- End left column -->
|
||||
<!-- Content col -->
|
||||
|
||||
<strong>BRANDS LISTED BY POPULARITY OF SELECTION</strong><br />
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceFitbike";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_fitbike) AS brand_count FROM gforum_Roadshow WHERE roadshow_fitbike LIKE '%,".$arr_row[fitbike_id]."' OR roadshow_fitbike LIKE '%,".$arr_row[fitbike_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[fitbike_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[fitbike_name]"] == "" OR $holder_array["$arr_row[fitbike_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[fitbike_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "FITBIKE - $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceSaddlechange";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_saddlechange) AS brand_count FROM gforum_Roadshow WHERE roadshow_saddlechange LIKE '%,".$arr_row[saddlechange_id]."' OR roadshow_saddlechange LIKE '%,".$arr_row[saddlechange_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[saddlechange_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[saddlechange_name]"] == "" OR $holder_array["$arr_row[saddlechange_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[saddlechange_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "SADDLE CHANGE - $key: $val<br />";
|
||||
}**/
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceMotioncapture";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_motioncapture) AS brand_count FROM gforum_Roadshow WHERE roadshow_motioncapture LIKE '%,".$arr_row[motioncapture_id]."' OR roadshow_motioncapture LIKE '%,".$arr_row[motioncapture_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[motioncapture_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[motioncapture_name]"] == "" OR $holder_array["$arr_row[motioncapture_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[motioncapture_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "MOTION CAPTURE - $key: $val<br />";
|
||||
}**/
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceCustomfootbed";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_footbed) AS brand_count FROM gforum_Roadshow WHERE roadshow_footbed LIKE '%,".$arr_row[footbed_id]."' OR roadshow_footbed LIKE '%,".$arr_row[footbed_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[footbed_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[footbed_name]"] == "" OR $holder_array["$arr_row[footbed_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[footbed_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "CUSTOM FOOTBED - $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceApparelTri";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_apparel_tri) AS brand_count FROM gforum_Roadshow WHERE roadshow_apparel_tri LIKE '%,".$arr_row[apparel_tri_id]."' OR roadshow_apparel_tri LIKE '%,".$arr_row[apparel_tri_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[apparel_tri_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[apparel_tri_name]"] == "" OR $holder_array["$arr_row[apparel_tri_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[apparel_tri_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "APPAREL TRI - $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceBike";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_bike) AS brand_count FROM gforum_Roadshow WHERE roadshow_bike LIKE '%,".$arr_row[bike_id]."' OR roadshow_bike LIKE '%,".$arr_row[bike_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[bike_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[bike_name]"] == "" OR $holder_array["$arr_row[bike_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[bike_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "BIKES - $key: $val<br />";
|
||||
}**/
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceBikeAccessory";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_bikeaccessory) AS brand_count FROM gforum_Roadshow WHERE roadshow_bikeaccessory LIKE '%,".$arr_row[bikeaccessory_id]."' OR roadshow_bikeaccessory LIKE '%,".$arr_row[bikeaccessory_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[bikeaccessory_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[bikeaccessory_name]"] == "" OR $holder_array["$arr_row[bikeaccessory_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[bikeaccessory_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "ACCESSORY $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceBikeHelmet";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_bikehelmet) AS brand_count FROM gforum_Roadshow WHERE roadshow_bikehelmet LIKE '%,".$arr_row[bikehelmet_id]."' OR roadshow_bikehelmet LIKE '%,".$arr_row[bikehelmet_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[bikehelmet_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[bikehelmet_name]"] == "" OR $holder_array["$arr_row[bikehelmet_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[bikehelmet_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "HELMET $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceBikeBodycare";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_bikebodycare) AS brand_count FROM gforum_Roadshow WHERE roadshow_bikebodycare LIKE '%,".$arr_row[bikebodycare_id]."' OR roadshow_bikebodycare LIKE '%,".$arr_row[bikebodycare_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[bikebodycare_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[bikebodycare_name]"] == "" OR $holder_array["$arr_row[bikebodycare_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[bikebodycare_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "BODYCARE $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceBikeTrainer";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_biketrainer) AS brand_count FROM gforum_Roadshow WHERE roadshow_biketrainer LIKE '%,".$arr_row[biketrainer_id]."' OR roadshow_biketrainer LIKE '%,".$arr_row[biketrainer_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[biketrainer_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[biketrainer_name]"] == "" OR $holder_array["$arr_row[biketrainer_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[biketrainer_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "TRAINER $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceBikeElectronic";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_bikeelectronic) AS brand_count FROM gforum_Roadshow WHERE roadshow_bikeelectronic LIKE '%,".$arr_row[bikeelectronic_id]."' OR roadshow_bikeelectronic LIKE '%,".$arr_row[bikeelectronic_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[bikeelectronic_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[bikeelectronic_name]"] == "" OR $holder_array["$arr_row[bikeelectronic_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[bikeelectronic_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "ELECTRONIC $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceBikeWheel";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_bikewheel) AS brand_count FROM gforum_Roadshow WHERE roadshow_bikewheel LIKE '%,".$arr_row[bikewheel_id]."' OR roadshow_bikewheel LIKE '%,".$arr_row[bikewheel_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[bikewheel_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[bikewheel_name]"] == "" OR $holder_array["$arr_row[bikewheel_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[bikewheel_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "WHEEL $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceBikeComponent";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_bikecomponent) AS brand_count FROM gforum_Roadshow WHERE roadshow_bikecomponent LIKE '%,".$arr_row[bikecomponent_id]."' OR roadshow_bikecomponent LIKE '%,".$arr_row[bikecomponent_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[bikecomponent_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[bikecomponent_name]"] == "" OR $holder_array["$arr_row[bikecomponent_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[bikecomponent_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "COMPONENT $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceSock";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_sock) AS brand_count FROM gforum_Roadshow WHERE roadshow_sock LIKE '%,".$arr_row[sock_id]."' OR roadshow_sock LIKE '%,".$arr_row[sock_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[sock_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[sock_name]"] == "" OR $holder_array["$arr_row[sock_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[sock_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "SOCK $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceShoe";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_shoe) AS brand_count FROM gforum_Roadshow WHERE roadshow_shoe LIKE '%,".$arr_row[shoe_id]."' OR roadshow_shoe LIKE '%,".$arr_row[shoe_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[shoe_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[shoe_name]"] == "" OR $holder_array["$arr_row[shoe_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[shoe_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**foreach ($holder_array as $key => $val) {
|
||||
echo "SHOE $key: $val<br />";
|
||||
}**/
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceApparelRun";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_apparel_run) AS brand_count FROM gforum_Roadshow WHERE roadshow_apparel_run LIKE '%,".$arr_row[apparel_run_id]."' OR roadshow_apparel_run LIKE '%,".$arr_row[apparel_run_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[apparel_run_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[apparel_run_name]"] == "" OR $holder_array["$arr_row[apparel_run_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[apparel_run_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceRunHydrate";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_runhydrate) AS brand_count FROM gforum_Roadshow WHERE roadshow_runhydrate LIKE '%,".$arr_row[runhydrate_id]."' OR roadshow_runhydrate LIKE '%,".$arr_row[runhydrate_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[runhydrate_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[runhydrate_name]"] == "" OR $holder_array["$arr_row[runhydrate_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[runhydrate_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceWetsuit";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_wetsuit) AS brand_count FROM gforum_Roadshow WHERE roadshow_wetsuit LIKE '%,".$arr_row[wetsuit_id]."' OR roadshow_wetsuit LIKE '%,".$arr_row[wetsuit_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[wetsuit_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[wetsuit_name]"] == "" OR $holder_array["$arr_row[wetsuit_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[wetsuit_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceSwimgear";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_swimgear) AS brand_count FROM gforum_Roadshow WHERE roadshow_swimgear LIKE '%,".$arr_row[swimgear_id]."' OR roadshow_swimgear LIKE '%,".$arr_row[swimgear_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[swimgear_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[swimgear_name]"] == "" OR $holder_array["$arr_row[swimgear_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[swimgear_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceBodycare";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_bodycare) AS brand_count FROM gforum_Roadshow WHERE roadshow_bodycare LIKE '%,".$arr_row[bodycare_id]."' OR roadshow_bodycare LIKE '%,".$arr_row[bodycare_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[bodycare_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[bodycare_name]"] == "" OR $holder_array["$arr_row[bodycare_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[bodycare_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$sql_one = "SELECT * FROM gforum_ResourceDiagnostic";
|
||||
//echo $sql_one."<br />";
|
||||
$arr_results = mysql_query($sql_one);
|
||||
while ($arr_row = mysql_fetch_array($arr_results)) {
|
||||
$sql_two = "SELECT COUNT(roadshow_diagnostic) AS brand_count FROM gforum_Roadshow WHERE roadshow_diagnostic LIKE '%,".$arr_row[diagnostic_id]."' OR roadshow_diagnostic LIKE '%,".$arr_row[diagnostic_id].",%'";
|
||||
// echo $sql_two."<br />";
|
||||
$list_results = mysql_query($sql_two);
|
||||
while ($list_row = mysql_fetch_array($list_results)) {
|
||||
//echo $arr_row[diagnostic_name].": ".$list_row[brand_count]."<br />";
|
||||
if ($holder_array["$arr_row[diagnostic_name]"] == "" OR $holder_array["$arr_row[diagnostic_name]"] < $list_row[brand_count]) {
|
||||
$holder_array["$arr_row[diagnostic_name]"] = $list_row[brand_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
arsort($holder_array);
|
||||
foreach ($holder_array as $key => $val) {
|
||||
echo "$key: $val<br />";
|
||||
}
|
||||
unset ($holder_array);
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<!-- End content col -->
|
||||
|
||||
</div>
|
||||
<!-- End BODY -->
|
||||
</div>
|
||||
<!-- End Outer -->
|
||||
|
||||
<? include("include_common_footer.php"); ?>
|
||||
|
85
site/roadshow/phpsqlgeocode_csv.php
Normal file
85
site/roadshow/phpsqlgeocode_csv.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
require("config.php");
|
||||
|
||||
// Opens a connection to a MySQL server
|
||||
/**$connection = mysql_connect($dbhost, $dbuser, $dbpass);
|
||||
if (!$connection) {
|
||||
die("Not connected : " . mysql_error());
|
||||
}
|
||||
|
||||
// Set the active MySQL database
|
||||
$db_selected = mysql_select_db($dbname, $connection);
|
||||
if (!$db_selected) {
|
||||
die("Can\'t use db : " . mysql_error());
|
||||
}**/
|
||||
|
||||
// Select all the rows in the markers table
|
||||
$query = "SELECT * FROM gforum_OpenWater WHERE openwater_lat != 0 AND openwater_lat IS NOT NULL";
|
||||
$result = mysql_query($query);
|
||||
if (!$result) {
|
||||
die("Invalid query: " . mysql_error());
|
||||
}
|
||||
|
||||
// Initialize delay in geocode speed
|
||||
$delay = 0;
|
||||
$base_url = "http://" . MAPS_HOST . "/maps/geo?output=csv&key=" . KEY;
|
||||
|
||||
// Iterate through the rows, geocoding each address
|
||||
while ($row = @mysql_fetch_assoc($result)) {
|
||||
$geocode_pending = true;
|
||||
|
||||
while ($geocode_pending) {
|
||||
$address = "".$row['openwater_address'].", ".$row['openwater_address_two'].", ".$row['openwater_city'].", ".$row['openwater_state']." ".$row['openwater_zip']."";
|
||||
$id = $row["openwater_id"];
|
||||
$request_url = $base_url . "&q=" . urlencode($address);
|
||||
//echo ($request_url);
|
||||
//$csv = file_get_contents($request_url) or die("csv url not loading");
|
||||
|
||||
// Create cUrl object to grab XML content using $request_url
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, $request_url);
|
||||
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
|
||||
$csv = trim(curl_exec($c));
|
||||
curl_close($c);
|
||||
|
||||
$csvSplit = split(",", $csv);
|
||||
$status = $csvSplit[0];
|
||||
$accuracy = $csvSplit[1];
|
||||
$lat = $csvSplit[2];
|
||||
$lng = $csvSplit[3];
|
||||
if (strcmp($status, "200") == 0 && $accuracy >= 5) {
|
||||
// successful geocode
|
||||
$geocode_pending = false;
|
||||
$lat = $csvSplit[2];
|
||||
$lng = $csvSplit[3];
|
||||
|
||||
$query = sprintf("UPDATE gforum_OpenWater " .
|
||||
" SET openwater_lat = '%s', openwater_lng = '%s' " .
|
||||
" WHERE openwater_id = %s LIMIT 1;",
|
||||
mysql_real_escape_string($lat),
|
||||
mysql_real_escape_string($lng),
|
||||
mysql_real_escape_string($id));
|
||||
$update_result = mysql_query($query);
|
||||
if (!$update_result) {
|
||||
die("Invalid query: " . mysql_error());
|
||||
}
|
||||
} else if (strcmp($status, "620") == 0) {
|
||||
// sent geocodes too fast
|
||||
$delay += 100000;
|
||||
} else if ($accuracy < 5) {
|
||||
// failure to geocode
|
||||
$geocode_pending = false;
|
||||
echo "Address " . $address . " did not geocode to great enough accuracy to be useful. ";
|
||||
echo "Accuracy match: " . $accuracy . "
|
||||
\n";
|
||||
} else {
|
||||
// failure to geocode
|
||||
$geocode_pending = false;
|
||||
echo "Address " . $address . " failed to geocode. ";
|
||||
echo "Received status " . $status . "
|
||||
\n";
|
||||
}
|
||||
usleep($delay);
|
||||
}
|
||||
}
|
||||
?>
|
19
site/roadshow/rating/ajax.rate.item.php
Normal file
19
site/roadshow/rating/ajax.rate.item.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
require_once("classes/include.all.php");
|
||||
|
||||
// Check that the data was sent
|
||||
if (sizeof($_POST) == 0
|
||||
|| $_POST['parent'] == null
|
||||
|| strlen(trim($_POST['parent'])) == 0
|
||||
|| $_POST['item'] == null
|
||||
|| strlen(trim($_POST['item'])) == 0
|
||||
|| $_POST['rating'] == null
|
||||
|| strlen(trim($_POST['rating'])) == 0
|
||||
|| $_POST['classes'] == null
|
||||
|| strlen(trim($_POST['classes'])) == 0)
|
||||
{
|
||||
die("You shouldn't be attempting to access this file in this manner.");
|
||||
}
|
||||
|
||||
echo Rating::RateItem($_POST['parent'], $_POST['item'], $_POST['rating'], $_POST['classes']);
|
||||
?>
|
406
site/roadshow/rating/classes/database.class.php
Normal file
406
site/roadshow/rating/classes/database.class.php
Normal file
@ -0,0 +1,406 @@
|
||||
<?php
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Database Class
|
||||
//============================================================================
|
||||
// Dependencies:
|
||||
//----------------------------------------------------------------------------
|
||||
// None
|
||||
//============================================================================
|
||||
// Modification History:
|
||||
//----------------------------------------------------------------------------
|
||||
// 2006-11-04: Created
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
class Database extends Error
|
||||
{
|
||||
## CONSTANT VARIABLES
|
||||
const DB_TYPES = 'mysql,mysqli'; // NO SPACES!
|
||||
## END CONSTANT VARIABLES
|
||||
|
||||
## PUBLIC VARIABLES
|
||||
## END PUBLIC VARIABLES
|
||||
|
||||
## PRIVATE VARIABLES
|
||||
private static $host;
|
||||
private static $port;
|
||||
private static $database;
|
||||
private static $username;
|
||||
private static $password;
|
||||
private static $type;
|
||||
private static $connection;
|
||||
private static $savedQueries;
|
||||
private static $savedResults;
|
||||
## END PRIVATE VARIABLES
|
||||
|
||||
## CONSTRUCTOR
|
||||
## END CONSTRUCTOR
|
||||
|
||||
## DECONSTRUCTOR
|
||||
## END DECONSTRUCTOR
|
||||
|
||||
## PUBLIC METHODS
|
||||
// Initialize the Variables
|
||||
// Does not return anything, but acts like a constructor for Static classes
|
||||
public static function Initialize($varType, $varHost, $varPort, $varDatabase, $varUsername, $varPassword)
|
||||
{
|
||||
Error::Initialize();
|
||||
|
||||
if (!self::ValidDatabaseTypes($varType))
|
||||
{
|
||||
Error::LogError("Database Type Invalid", "Database Type must be one of: " . self::DB_TYPES);
|
||||
}
|
||||
|
||||
self::$host = $varHost;
|
||||
self::$port = $varPort;
|
||||
self::$type = strtolower($varType);
|
||||
self::$database = $varDatabase;
|
||||
self::$password = $varPassword;
|
||||
self::$username = $varUsername;
|
||||
self::$savedQueries = array();
|
||||
self::$savedResults = array();
|
||||
self::$connection = self::ConnectToDatabase();
|
||||
|
||||
self::SelectTheDatabase();
|
||||
}
|
||||
|
||||
// DeInitialize the Variables
|
||||
// Does not return anything, but acts like a destructor for Static classes
|
||||
public static function DeInitialize()
|
||||
{
|
||||
// Remove Saved Queries
|
||||
for ($saved = 0; $saved < sizeof(self::$savedQueries); $saved++)
|
||||
{
|
||||
unset(self::$savedQueries[$saved]);
|
||||
}
|
||||
|
||||
// Remove Saved Results
|
||||
for ($saved = 0; $saved < sizeof(self::$savedResults); $saved++)
|
||||
{
|
||||
unset(self::$savedResults[$saved]);
|
||||
}
|
||||
|
||||
// Close the Database Connection
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
@mysql_close(self::$connection) or Error::LogError("MySQL Failed to Close", mysql_error(self::$connection));
|
||||
break;
|
||||
case "mysqli":
|
||||
@mysqli_close(self::$connection) or Error::LogError("MySQL Failed to Close", mysqli_error(self::$connection));
|
||||
break;
|
||||
}
|
||||
|
||||
// Destroy Variables
|
||||
self::$host = null;
|
||||
self::$port = null;
|
||||
self::$type = null;
|
||||
self::$database = null;
|
||||
self::$password = null;
|
||||
self::$username = null;
|
||||
self::$connection = null;
|
||||
self::$savedQueries = null;
|
||||
self::$savedResults = null;
|
||||
Error::DeInitialize();
|
||||
}
|
||||
|
||||
// Database Types
|
||||
// Returns an array of database types
|
||||
public static function DatabaseTypes()
|
||||
{
|
||||
return split(",", self::DB_TYPES);
|
||||
}
|
||||
|
||||
// Build Order By
|
||||
// Returns the SQL Syntax for ORDER BY
|
||||
public static function BuildOrderBy($varColumnName, $varDirection)
|
||||
{
|
||||
$orderby = "";
|
||||
if (self::$connection)
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
case "mysqli":
|
||||
$orderby = "ORDER BY `{$varColumnName}` {$varDirection}";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $orderby;
|
||||
}
|
||||
|
||||
// Build Limit
|
||||
// Returns the SQL Syntax for LIMIT
|
||||
public static function BuildLimit($varStartingRow, $varNumberOfRows)
|
||||
{
|
||||
$limit = "";
|
||||
if (self::$connection)
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
case "mysqli":
|
||||
$limit = "LIMIT {$varStartingRow}, {$varNumberOfRows}";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $limit;
|
||||
}
|
||||
|
||||
// Execute SQL Query
|
||||
// Returns the result of the query, which is typically a resource id
|
||||
public static function ExecuteQuery($sql, $name)
|
||||
{
|
||||
if (self::$connection)
|
||||
{
|
||||
if (strlen(trim($name)) != 0)
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
if (!array_key_exists($name, self::$savedQueries))
|
||||
{
|
||||
self::$savedQueries[$name] = @mysql_query($sql, self::$connection) or Error::LogError("Query Failed", mysql_error(self::$connection));
|
||||
}
|
||||
break;
|
||||
case "mysqli":
|
||||
if (!array_key_exists($name, self::$savedQueries))
|
||||
{
|
||||
self::$savedQueries[$name] = @mysqli_query(self::$connection, $sql) or Error::LogError("Query Failed", mysqli_error(self::$connection));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return self::$savedQueries[$name];
|
||||
}
|
||||
else
|
||||
{
|
||||
Error::LogError("Execute Query Name Missing", "The name parameter was empty, please provide a name for the query.");
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fetch Results
|
||||
// Returns an array of the query results
|
||||
public static function FetchResults($name)
|
||||
{
|
||||
$results = array();
|
||||
if (self::$connection)
|
||||
{
|
||||
if (strlen(trim($name)) != 0 && (array_key_exists($name, self::$savedQueries) || array_key_exists($name, self::$savedResults)))
|
||||
{
|
||||
if (array_key_exists($name, self::$savedQueries))
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
$row = 0;
|
||||
while ($currentResult = @mysql_fetch_assoc(self::$savedQueries[$name]))
|
||||
{
|
||||
$col = 0;
|
||||
foreach ($currentResult as $key => $value)
|
||||
{
|
||||
$results[$row][$col] = $value;
|
||||
$results[$row][$key] = $value;
|
||||
$col++;
|
||||
}
|
||||
|
||||
$row++;
|
||||
}
|
||||
break;
|
||||
case "mysqli":
|
||||
$row = 0;
|
||||
while ($currentResult = @mysqli_fetch_assoc(self::$savedQueries[$name]))
|
||||
{
|
||||
$col = 0;
|
||||
foreach ($currentResult as $key => $value)
|
||||
{
|
||||
$results[$row][$col] = $value;
|
||||
$results[$row][$key] = $value;
|
||||
$col++;
|
||||
}
|
||||
|
||||
$row++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
self::$savedResults[$name] = $results;
|
||||
}
|
||||
else
|
||||
{
|
||||
$results = self::$savedResults[$name];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen(trim($name)) == 0)
|
||||
{
|
||||
Error::LogError("Fetch Results Name Missing", "The name parameter was empty, the name is required so it knows which results to return.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Error::LogError("Fetch Results Name ('{$name}') Not Found", "The name provided did not have any query results associated with it.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
// Free SQL Query Results
|
||||
// Returns nothing
|
||||
public static function FreeResults($name)
|
||||
{
|
||||
if (self::$connection)
|
||||
{
|
||||
if (strlen(trim($name)) != 0 && array_key_exists($name, self::$savedQueries))
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
@mysql_free_result(self::$savedQueries[$name]) or Error::LogError("Free Results Error", mysql_error(self::$connection));
|
||||
unset(self::$savedQueries[$name]);
|
||||
break;
|
||||
case "mysqli":
|
||||
@mysqli_free_result(self::$savedQueries[$name]) or Error::LogError("Free Results Error", mysqli_error(self::$connection));
|
||||
unset(self::$savedQueries[$name]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen(trim($name)) == 0)
|
||||
{
|
||||
Error::LogError("Free Results Name Missing", "The name parameter was empty, the name is required so it knows which results to free up from memory.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Error::LogWarning("Free Results Name ('{$name}') Not Found", "The name provided did not have any query results associated with it.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove Saved Results
|
||||
// Returns nothing
|
||||
public static function RemoveSavedResults($name)
|
||||
{
|
||||
if (strlen(trim($name)) != 0 && array_key_exists($name, self::$savedResults))
|
||||
{
|
||||
unset(self::$savedResults[$name]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen(trim($name)) == 0)
|
||||
{
|
||||
Error::LogError("Remove Saved Result Name Missing", "The name parameter was empty, the name is required so it knows which query to remove.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Error::LogWarning("Remove Saved Result Name ('{$name}') Not Found", "The name provided was not a saved query.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Attempt Connect To Database
|
||||
// Returns true or false depending on if the connection failed or succeeded
|
||||
public static function AttemptConnectToDatabase($varType, $varHost, $varPort, $varDatabase, $varUsername, $varPassword)
|
||||
{
|
||||
self::$type = $varType;
|
||||
self::$host = $varHost;
|
||||
self::$port = $varPort;
|
||||
self::$database = $varDatabase;
|
||||
self::$username = $varUsername;
|
||||
self::$password = $varPassword;
|
||||
|
||||
Error::ClearErrors();
|
||||
self::$connection = self::ConnectToDatabase();
|
||||
|
||||
if (!Error::HasErrors())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// MySQL Version
|
||||
// Returns the mysql version number
|
||||
public static function MysqlVersion()
|
||||
{
|
||||
$version = "";
|
||||
if (self::$connection)
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
$version = mysql_get_server_info(self::$connection);
|
||||
break;
|
||||
case "mysqli":
|
||||
$version = mysqli_get_server_info(self::$connection);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $version;
|
||||
}
|
||||
## END PUBLIC METHODS
|
||||
|
||||
## PRIVATE METHODS
|
||||
// Connect to Database
|
||||
// Returns the database connection resource
|
||||
private static function ConnectToDatabase()
|
||||
{
|
||||
$link = null;
|
||||
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
if (strlen(trim(self::$port)) != 0)
|
||||
{
|
||||
$link = mysql_connect(self::$host . ":" . self::$port, self::$username, self::$password) or Error::LogError("Database Error", mysql_error());
|
||||
}
|
||||
else
|
||||
{
|
||||
$link = mysql_connect(self::$host, self::$username, self::$password) or Error::LogError("Database Error", mysql_error());
|
||||
}
|
||||
break;
|
||||
case "mysqli":
|
||||
$link = mysqli_connect(self::$host, self::$username, self::$password, self::$database, self::$port) or Error::LogError("Database Error", mysqli_connect_error());
|
||||
break;
|
||||
}
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
// Select the Database
|
||||
// Returns nothing
|
||||
private static function SelectTheDatabase()
|
||||
{
|
||||
switch (self::$type)
|
||||
{
|
||||
case "mysql":
|
||||
@mysql_select_db(self::$database, self::$connection) or Error::LogError("Database Selection", mysql_error(self::$connection));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Valid Database Types
|
||||
// Returns true or false depending on if the database type is valid
|
||||
private static function ValidDatabaseTypes($varType)
|
||||
{
|
||||
$types = split(',', str_replace(" ", "", self::DB_TYPES));
|
||||
|
||||
return in_array($varType, $types);
|
||||
}
|
||||
## END PRIVATE METHODS
|
||||
|
||||
## PROTECTED METHODS
|
||||
## END PROTECTED METHODS
|
||||
}
|
||||
?>
|
258
site/roadshow/rating/classes/error.class.php
Normal file
258
site/roadshow/rating/classes/error.class.php
Normal file
@ -0,0 +1,258 @@
|
||||
<?php
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Error Class
|
||||
//============================================================================
|
||||
// Dependencies:
|
||||
//----------------------------------------------------------------------------
|
||||
// none
|
||||
//============================================================================
|
||||
// Modification History:
|
||||
//----------------------------------------------------------------------------
|
||||
// 2006-11-04: Created
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
class Error
|
||||
{
|
||||
## CONSTANT VARIABLES
|
||||
## END CONSTANT VARIABLES
|
||||
|
||||
## PUBLIC VARIABLES
|
||||
## END PUBLIC VARIABLES
|
||||
|
||||
## PRIVATE VARIABLES
|
||||
private static $title;
|
||||
private static $type;
|
||||
private static $description;
|
||||
private static $datetime;
|
||||
|
||||
private static $numErrors;
|
||||
private static $numWarnings;
|
||||
## END PRIVATE VARIABLES
|
||||
|
||||
## CONSTRUCTOR
|
||||
## END CONSTRUCTOR
|
||||
|
||||
## DECONSTRUCTOR
|
||||
## END DECONSTRUCTOR
|
||||
|
||||
## PUBLIC METHODS
|
||||
// Initialize the Variables
|
||||
// Does not return anything, but acts like a constructor for Static classes
|
||||
public static function Initialize()
|
||||
{
|
||||
self::$title = array();
|
||||
self::$type = array();
|
||||
self::$description = array();
|
||||
self::$datetime = array();
|
||||
self::$numErrors = 0;
|
||||
self::$numWarnings = 0;
|
||||
}
|
||||
|
||||
// DeInitialize the Variables
|
||||
// Does not return anything, but acts like a destructor for Static classes
|
||||
public static function DeInitialize()
|
||||
{
|
||||
self::$title = null;
|
||||
self::$type = null;
|
||||
self::$description = null;
|
||||
self::$datetime = null;
|
||||
self::$numErrors = null;
|
||||
self::$numWarnings = null;
|
||||
}
|
||||
|
||||
// Log Error Method (receives Name and Description)
|
||||
// Returns true or false depending on if the logging of the error was successful
|
||||
public static function LogError($varTitle, $varDescription)
|
||||
{
|
||||
// Check Parameters
|
||||
if (strlen(trim($varTitle)) != 0 && strlen(trim($varDescription)) != 0)
|
||||
{
|
||||
array_push(self::$title, $varTitle);
|
||||
array_push(self::$type, "ERROR");
|
||||
array_push(self::$description, $varDescription);
|
||||
array_push(self::$datetime, date("m/d/Y H:i:s"));
|
||||
self::$numErrors++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Show Error Messages
|
||||
// Returns the Error Message Output (in HTML format)
|
||||
public static function ShowErrorMessages()
|
||||
{
|
||||
$output = "";
|
||||
|
||||
// Check to see if 1 error occurred or more than one.
|
||||
if (self::$numErrors > 0)
|
||||
{
|
||||
if (self::$numErrors > 1)
|
||||
{
|
||||
$error = "ERRORS";
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = "ERROR";
|
||||
}
|
||||
|
||||
// Loop through Error Messages
|
||||
for ($i = 0; $i < sizeof(self::$title); $i++)
|
||||
{
|
||||
if (self::$type[$i] == "ERROR")
|
||||
{
|
||||
// Output each individual Error
|
||||
$output .= " <div class=\"divErrorTitle\">\r\n" .
|
||||
" " . self::$title[$i] . "\r\n" .
|
||||
" <span class=\"spnErrorDateTime\">at " . self::$datetime[$i] . "</span>\r\n" .
|
||||
" </div>\r\n" .
|
||||
" <div class=\"divErrorDesc\">" . self::$description[$i] . "<br /><br /></div>\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Write Error Template Output
|
||||
$output = "<div class=\"divErrorBox\">\r\n" .
|
||||
" <div class=\"divErrorBoxTitle\"><img src=\"icons/24-em-cross.png\" align=\"left\" /> {$error}:</div>\r\n" .
|
||||
" <div class=\"divErrors\">\r\n" . $output . "\r\n </div>\r\n" .
|
||||
"</div>\r\n";
|
||||
}
|
||||
|
||||
// Return the Error Message Output
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Retrieve Last Error
|
||||
// Returns the title and description of the last error in an array
|
||||
public static function RetrieveLastError()
|
||||
{
|
||||
$output = array();
|
||||
|
||||
// Check to see if 1 error occurred or more than one.
|
||||
if (self::$numErrors > 0)
|
||||
{
|
||||
for ($i = sizeof(self::$title) - 1; $i >= 0; $i++)
|
||||
{
|
||||
if (self::$type[$i] == "ERROR")
|
||||
{
|
||||
array_push($output, self::$title[$i]);
|
||||
array_push($output, self::$description[$i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Clear Errors
|
||||
// Returns nothing
|
||||
public static function ClearErrors()
|
||||
{
|
||||
self::$numErrors = 0;
|
||||
|
||||
for ($i = 0; $i < sizeof(self::$type); $i++)
|
||||
{
|
||||
if (self::$type[$i] == "ERROR")
|
||||
{
|
||||
self::$title[$i] = null;
|
||||
self::$type[$i] = null;
|
||||
self::$description[$i] = null;
|
||||
self::$datetime[$i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Has Errors
|
||||
// Returns true or false on whether errors exist
|
||||
public static function HasErrors()
|
||||
{
|
||||
if (self::$numErrors > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Log Warning Method (receives Name and Description)
|
||||
// Returns true or false depending on if logging the warning was successful
|
||||
public static function LogWarning($varTitle, $varDescription)
|
||||
{
|
||||
// Check Parameters
|
||||
if (strlen(trim($varTitle)) != 0 && strlen(trim($varDescription)) != 0)
|
||||
{
|
||||
array_push(self::$title, $varTitle);
|
||||
array_push(self::$type, "WARNING");
|
||||
array_push(self::$description, $varDescription);
|
||||
array_push(self::$datetime, date("m/d/Y H:i:s"));
|
||||
self::$numWarnings++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Show Warning Messages
|
||||
// Returns the Warning Message Output (in HTML format)
|
||||
public static function ShowWarningMessages()
|
||||
{
|
||||
$output = "";
|
||||
|
||||
// Check to see if 1 warning occurred or more than one.
|
||||
if (self::$numWarnings > 0)
|
||||
{
|
||||
if (self::$numWarnings > 1)
|
||||
{
|
||||
$warning = "WARNINGS";
|
||||
}
|
||||
else
|
||||
{
|
||||
$warning = "WARNING";
|
||||
}
|
||||
|
||||
// Loop through Warning Messages
|
||||
for ($i = 0; $i < sizeof(self::$title); $i++)
|
||||
{
|
||||
if (self::$type[$i] == "WARNING")
|
||||
{
|
||||
// Output each individual Warning
|
||||
$output .= " <div class=\"divWarningTitle\">\r\n" .
|
||||
" " . self::$title[$i] . "\r\n" .
|
||||
" <span class=\"spnWarningDateTime\">at " . self::$datetime[$i] . "</span>\r\n" .
|
||||
" </div>\r\n" .
|
||||
" <div class=\"divWarningDesc\">" . self::$description[$i] . "<br /><br /></div>\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Write Warning Template Output
|
||||
$output = "<div id=\"divWarningBox\">\r\n" .
|
||||
" <div id=\"divWarningBoxTitle\"><img src=\"designs/icons/24-message-warn.png\" align=\"left\" /> {$warning}:</div>\r\n" .
|
||||
" <div id=\"divWarnings\">\r\n" . $output . "\r\n </div>\r\n" .
|
||||
"</div>\r\n";
|
||||
}
|
||||
|
||||
// Return the Warning Message Output
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Has Warnings
|
||||
// Returns true or false on whether there are any Warnings
|
||||
public static function HasWarnings()
|
||||
{
|
||||
if (self::$numWarnings > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
## END PUBLIC METHODS
|
||||
|
||||
## PRIVATE METHODS
|
||||
## END PRIVATE METHODS
|
||||
|
||||
## PROTECTED METHODS
|
||||
## END PROTECTED METHODS
|
||||
}
|
||||
?>
|
7
site/roadshow/rating/classes/include.all.php
Normal file
7
site/roadshow/rating/classes/include.all.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
require_once("error.class.php");
|
||||
require_once("database.class.php");
|
||||
require_once("rating.class.php");
|
||||
|
||||
Database::Initialize("mysql", "192.168.1.10", "3306", "slowtwitch", "slowtwitch", "k9volqlAcpq");
|
||||
?>
|
279
site/roadshow/rating/classes/rating.class.php
Normal file
279
site/roadshow/rating/classes/rating.class.php
Normal file
@ -0,0 +1,279 @@
|
||||
<?php
|
||||
class Rating
|
||||
{
|
||||
## PRIVATE VARIABLES
|
||||
## END PRIVATE VARIABLES
|
||||
|
||||
## PUBLIC METHODS
|
||||
// Output the Rating information
|
||||
// Returns a string of HTML
|
||||
public static function OutputRating($varParent, $varItem)
|
||||
{
|
||||
// Verify $varItem was provided
|
||||
if ($varItem != null && strlen(trim($varItem)) != 0 && $varParent != null && strlen(trim($varParent)) != 0)
|
||||
{
|
||||
// Check if Magic QUotes is ON
|
||||
if (!get_magic_quotes_gpc())
|
||||
{
|
||||
$varItem = addslashes($varItem);
|
||||
$varParent = addslashes($varParent);
|
||||
}
|
||||
|
||||
// Information for the Output
|
||||
$averageStars = Rating::CalculateAverageRating($varParent, $varItem);
|
||||
|
||||
// Check to see that the user has not already rated this item
|
||||
if (Rating::CheckRatingsByIp($varParent, $varItem) == 0)
|
||||
{
|
||||
$classes = "rating " . Rating::ShowStars($averageStars);
|
||||
$cat_info = Rating::FetchCategoryInfo($varItem);
|
||||
|
||||
// Write Output HTML for the Rating Data
|
||||
$output = "\r\n";
|
||||
$output .= "<div style='clear:both;'>{$cat_info['rating_cat_name']}<br></div>\r\n";
|
||||
$output .= "<div style='display: inline;'><div style='float: left;'>{$cat_info['rating_cat_min']} </div><div style='float: left;'><ul class=\"{$classes}\" style='margin: 0px 0px 10px 0px;' id=\"{$varParent}_{$varItem}\">\r\n";
|
||||
$output .= " <li class=\"one\"><a href=\"javascript:RateItem('{$varParent}','{$varItem}', 1);\" title=\"1 Star\">1</a></li>\r\n";
|
||||
$output .= " <li class=\"two\"><a href=\"javascript:RateItem('{$varParent}','{$varItem}', 2);\" title=\"2 Stars\">2</a></li>\r\n";
|
||||
$output .= " <li class=\"three\"><a href=\"javascript:RateItem('{$varParent}','{$varItem}', 3);\" title=\"3 Stars\">3</a></li>\r\n";
|
||||
$output .= " <li class=\"four\"><a href=\"javascript:RateItem('{$varParent}','{$varItem}', 4);\" title=\"4 Stars\">4</a></li>\r\n";
|
||||
$output .= " <li class=\"five\"><a href=\"javascript:RateItem('{$varParent}','{$varItem}', 5);\" title=\"5 Stars\">5</a></li>\r\n";
|
||||
$output .= "</ul></div><div style='float:left;'> {$cat_info['rating_cat_max']}</div></div>\r\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$classes = "rated " . Rating::ShowStars($averageStars);
|
||||
$cat_info = Rating::FetchCategoryInfo($varItem);
|
||||
|
||||
// Write Output HTML for the Rating Data
|
||||
$output = "\r\n";
|
||||
$output .= "<div style='clear:both;'>{$cat_info['rating_cat_name']}<br></div>";
|
||||
$output .= "<div style='display: inline;'><div style='float: left;'>{$cat_info['rating_cat_min']} </div><div style='float: left;'><ul class=\"{$classes}\" id=\"{$varParent}_{$varItem}\" style='margin: 0px 0px 10px 0px;'>\r\n";
|
||||
$output .= " <li class=\"one\">1</li>\r\n";
|
||||
$output .= " <li class=\"two\">2</li>\r\n";
|
||||
$output .= " <li class=\"three\">3</li>\r\n";
|
||||
$output .= " <li class=\"four\">4</li>\r\n";
|
||||
$output .= " <li class=\"five\">5</li>\r\n";
|
||||
$output .= "</ul></div><div style='float:left;'> {$cat_info['rating_cat_max']}</div></div>\r\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = "";
|
||||
// This is a major issue. NO information can be retrieve if an item name is not passed.
|
||||
Error::LogError("Variable Missing", "You must provide the item name for this function to find the average.");
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
public static function OutputParentRating($varParent)
|
||||
{
|
||||
// Verify $varParent was provided
|
||||
if ($varParent != null && strlen(trim($varParent)) != 0)
|
||||
{
|
||||
// Check if Magic QUotes is ON
|
||||
if (!get_magic_quotes_gpc())
|
||||
{
|
||||
$varParent = addslashes($varParent);
|
||||
}
|
||||
|
||||
// Information for the Output
|
||||
$averageStars = Rating::CalculateAverageParentRating($varParent);
|
||||
|
||||
$classes = "rated " . Rating::ShowStars($averageStars);
|
||||
//$parent_info = Rating::FetchParentInfo($varParent);
|
||||
|
||||
// Write Output HTML for the Rating Data
|
||||
$output = "\r\n";
|
||||
//$output .= "<div style='clear:both;'>Overall Rating</div>";
|
||||
$output .= "<div style='height: 16px; width: 80px; position: relative;'><ul class=\"{$classes}\" id=\"{$varParent}\" style='margin: 0px 0px 10px 0px;'>\r\n";
|
||||
$output .= " <li class=\"one\">1</li>\r\n";
|
||||
$output .= " <li class=\"two\">2</li>\r\n";
|
||||
$output .= " <li class=\"three\">3</li>\r\n";
|
||||
$output .= " <li class=\"four\">4</li>\r\n";
|
||||
$output .= " <li class=\"five\">5</li>\r\n";
|
||||
$output .= "</ul></div>\r\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = "";
|
||||
// This is a major issue. NO information can be retrieve if an item name is not passed.
|
||||
Error::LogError("Variable Missing", "You must provide the parent name for this function to find the average.");
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Rate an Item
|
||||
// Returns the name/value pair of new class names and the item name
|
||||
public static function RateItem($varParent, $varItem, $varRating, $varClasses)
|
||||
{
|
||||
$newClassNames = $varClasses;
|
||||
|
||||
// Verify $varName was provided
|
||||
if ($varParent != null && strlen(trim($varParent)) != 0
|
||||
&& $varItem != null && strlen(trim($varItem)) != 0
|
||||
&& $varRating != null && strlen(trim($varRating)) != 0 && is_numeric($varRating)
|
||||
&& $varClasses != null && strlen(trim($varClasses)) != 0)
|
||||
{
|
||||
// Check if Magic Quotes is ON
|
||||
if (!get_magic_quotes_gpc())
|
||||
{
|
||||
$varItem = addslashes($varItem);
|
||||
$varParent = addslashes($varParent);
|
||||
}
|
||||
|
||||
// Check to see that the user has not already rated this item
|
||||
if (Rating::CheckRatingsByIp($varParent, $varItem) == 0)
|
||||
{
|
||||
$ipAddress = $_SERVER['REMOTE_ADDR'];
|
||||
$tempTime = time();
|
||||
|
||||
Database::ExecuteQuery("INSERT INTO `gforum_FittersRating` (`rating_fitter_id`, `rating_category_id`, `rating_vote`, `rating_ip`, `rating_date`) VALUES ('{$varParent}', '{$varItem}', {$varRating}, '{$ipAddress}', '{$tempTime}')", "InsertRating");
|
||||
Database::FetchResults("InsertRating");
|
||||
Database::FreeResults("InsertRating");
|
||||
Database::RemoveSavedResults("InsertRating");
|
||||
|
||||
// Information for the Output
|
||||
$averageStars = Rating::CalculateAverageRating($varParent, $varItem);
|
||||
$newClassNames = "rated " . Rating::ShowStars($averageStars);
|
||||
$averageStars = Rating::CalculateAverageParentRating($varParent);
|
||||
$newClassParent = "rated " . Rating::ShowStars($averageStars);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is a major issue. NOT enough information was sent to log the item
|
||||
Error::LogError("Variable(s) Missing", "You must provide all of the information to log the rating of this item.");
|
||||
}
|
||||
|
||||
// Build Name/Value Pair to return
|
||||
$nameValue = "classes={$newClassNames}&item={$varItem}&parent={$varParent}&parentClass={$newClassParent}";
|
||||
return $nameValue;
|
||||
}
|
||||
## END PUBLIC METHODS
|
||||
|
||||
## PRIVATE METHODS
|
||||
// Fetch Category Names & Min/Max Values
|
||||
private static function FetchCategoryInfo($varItem)
|
||||
{
|
||||
// Query Category Info for a specific Category ID
|
||||
Database::ExecuteQuery("SELECT * FROM `gforum_FittersRatingCategory` WHERE `rating_cat_id`='{$varItem}'", "CategoryInfo");
|
||||
$results = Database::FetchResults("CategoryInfo");
|
||||
Database::FreeResults("CategoryInfo");
|
||||
Database::RemoveSavedResults("CategoryInfo");
|
||||
|
||||
return $results[0];
|
||||
|
||||
}
|
||||
|
||||
// Calculate Average Rating
|
||||
// Returns the number of stars to show
|
||||
private static function CalculateAverageRating($varParent, $varItem)
|
||||
{
|
||||
$averageStars = 0;
|
||||
|
||||
// Query Average Rating for a specific Item
|
||||
Database::ExecuteQuery("SELECT AVG(`rating_vote`) AS `averageRating` FROM `gforum_FittersRating` WHERE `rating_category_id`='{$varItem}' AND `rating_fitter_id`='{$varParent}'", "AverageRating");
|
||||
$results = Database::FetchResults("AverageRating");
|
||||
Database::FreeResults("AverageRating");
|
||||
Database::RemoveSavedResults("AverageRating");
|
||||
|
||||
// Round the Average into a Whole Number
|
||||
if (sizeof($results) == 1)
|
||||
{
|
||||
if ($results[0]['averageRating'] != null)
|
||||
{
|
||||
$averageStars = round($results[0]["averageRating"], 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is simply a warning, as it isn't vital if no results were found, as the item may be new.
|
||||
Error::LogWarning("Rating Data Missing", "No entries were found for '{$varName}', this might be the first entry.");
|
||||
}
|
||||
|
||||
return $averageStars;
|
||||
}
|
||||
|
||||
// Calculate Average Rating
|
||||
// Returns the number of stars to show
|
||||
private static function CalculateAverageParentRating($varParent)
|
||||
{
|
||||
$averageStars = 0;
|
||||
|
||||
// Query Average Rating for a specific Item
|
||||
Database::ExecuteQuery("SELECT AVG(`rating_vote`) AS `averageRating` FROM `gforum_FittersRating` WHERE `rating_fitter_id`='{$varParent}'", "AverageRating");
|
||||
$results = Database::FetchResults("AverageRating");
|
||||
Database::FreeResults("AverageRating");
|
||||
Database::RemoveSavedResults("AverageRating");
|
||||
|
||||
// Round the Average into a Whole Number
|
||||
if (sizeof($results) == 1)
|
||||
{
|
||||
if ($results[0]['averageRating'] != null)
|
||||
{
|
||||
$averageStars = round($results[0]["averageRating"], 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is simply a warning, as it isn't vital if no results were found, as the item may be new.
|
||||
Error::LogWarning("Rating Data Missing", "No entries were found for '{$varName}', this might be the first entry.");
|
||||
}
|
||||
|
||||
return $averageStars;
|
||||
}
|
||||
|
||||
// Show Stars
|
||||
// Returns the class information for the number of stars to show
|
||||
private static function ShowStars($varStars)
|
||||
{
|
||||
// Select the Number of Stars Class
|
||||
switch ($varStars)
|
||||
{
|
||||
case 1:
|
||||
$classes .= "onestar";
|
||||
break;
|
||||
case 2:
|
||||
$classes .= "twostar";
|
||||
break;
|
||||
case 3:
|
||||
$classes .= "threestar";
|
||||
break;
|
||||
case 4:
|
||||
$classes .= "fourstar";
|
||||
break;
|
||||
case 5:
|
||||
$classes .= "fivestar";
|
||||
break;
|
||||
default:
|
||||
$classes .= "nostar";
|
||||
break;
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
// Check Ratings By IP Address
|
||||
// Returns the number of ratings for an item by an ip address
|
||||
private static function CheckRatingsByIp($varParent, $varItem)
|
||||
{
|
||||
$ipAddress = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
Database::ExecuteQuery("SELECT COUNT(*) AS `totalRatings` FROM `gforum_FittersRating` WHERE `rating_category_id`='{$varItem}' AND `rating_fitter_id`='{$varParent}' AND `rating_ip`='{$ipAddress}'", "AlreadyRated");
|
||||
$results = Database::FetchResults("AlreadyRated");
|
||||
Database::FreeResults("AlreadyRated");
|
||||
Database::RemoveSavedResults("AlreadyRated");
|
||||
|
||||
// Check to see that the user has not already rated this item
|
||||
if ($results != null && $results[0]['totalRatings'] != null)
|
||||
{
|
||||
return $results[0]['totalRatings'];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
## END PRIVATE METHODS
|
||||
}
|
||||
?>
|
55
site/roadshow/rating/int.to.words.php
Normal file
55
site/roadshow/rating/int.to.words.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", 30 => "thirty", 40 => "forty", 50 => "fifty", 60 => "sixty", 70 => "seventy", 80 => "eighty", 90 => "ninety" );
|
||||
|
||||
function int_to_words($x) {
|
||||
global $nwords;
|
||||
|
||||
if(!is_numeric($x))
|
||||
$w = '#';
|
||||
else if(fmod($x, 1) != 0)
|
||||
$w = '#';
|
||||
else {
|
||||
if($x < 0) {
|
||||
$w = 'minus ';
|
||||
$x = -$x;
|
||||
} else
|
||||
$w = '';
|
||||
// ... now $x is a non-negative integer.
|
||||
|
||||
if($x < 21) // 0 to 20
|
||||
$w .= $nwords[$x];
|
||||
else if($x < 100) { // 21 to 99
|
||||
$w .= $nwords[10 * floor($x/10)];
|
||||
$r = fmod($x, 10);
|
||||
if($r > 0)
|
||||
$w .= '-'. $nwords[$r];
|
||||
} else if($x < 1000) { // 100 to 999
|
||||
$w .= $nwords[floor($x/100)] .' hundred';
|
||||
$r = fmod($x, 100);
|
||||
if($r > 0)
|
||||
$w .= ' and '. int_to_words($r);
|
||||
} else if($x < 1000000) { // 1000 to 999999
|
||||
$w .= int_to_words(floor($x/1000)) .' thousand';
|
||||
$r = fmod($x, 1000);
|
||||
if($r > 0) {
|
||||
$w .= ' ';
|
||||
if($r < 100)
|
||||
$w .= 'and ';
|
||||
$w .= int_to_words($r);
|
||||
}
|
||||
} else { // millions
|
||||
$w .= int_to_words(floor($x/1000000)) .' million';
|
||||
$r = fmod($x, 1000000);
|
||||
if($r > 0) {
|
||||
$w .= ' ';
|
||||
if($r < 100)
|
||||
$word .= 'and ';
|
||||
$w .= int_to_words($r);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $w;
|
||||
}
|
||||
|
||||
?>
|
71
site/roadshow/rating/rating-example.php
Normal file
71
site/roadshow/rating/rating-example.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
require_once("classes/include.all.php");
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>CSS Star Rating System fully functional using AJAX</title>
|
||||
<link type="text/css" href="styles/rating.css" rel="stylesheet" media="all" />
|
||||
<script type="text/javascript" src="scripts/prototype.js"></script>
|
||||
<script type="text/javascript" src="scripts/rating.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h4>Race Rating System:</h4>
|
||||
<?php
|
||||
$ratingData = Rating::OutputParentRating('1');
|
||||
|
||||
if (Error::HasErrors())
|
||||
{
|
||||
echo Error::ShowErrorMessages();
|
||||
Error::ClearErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ratingData;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$ratingData = Rating::OutputRating('1','1');
|
||||
|
||||
if (Error::HasErrors())
|
||||
{
|
||||
echo Error::ShowErrorMessages();
|
||||
Error::ClearErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ratingData;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$ratingData = Rating::OutputRating('1','2');
|
||||
|
||||
if (Error::HasErrors())
|
||||
{
|
||||
echo Error::ShowErrorMessages();
|
||||
Error::ClearErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ratingData;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$ratingData = Rating::OutputRating('1','3');
|
||||
|
||||
if (Error::HasErrors())
|
||||
{
|
||||
echo Error::ShowErrorMessages();
|
||||
Error::ClearErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ratingData;
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
Database::DeInitialize();
|
||||
?>
|
99
site/roadshow/regionlist.php
Normal file
99
site/roadshow/regionlist.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?PHP include("config.php");
|
||||
|
||||
$results = mysql_query("SELECT regionlong FROM ".$prefix."ResourceRegions WHERE regionid = '".mysql_real_escape_string($_GET[region])."' LIMIT 1") OR die ( header('Location: '.$site_url.'?mysql_error'));
|
||||
|
||||
if (mysql_num_rows($results) == 0) {
|
||||
header('Location: '.$site_url.'?mysql_error');
|
||||
}
|
||||
|
||||
$row = mysql_fetch_array($results);
|
||||
$regionname = $row['regionlong'];
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix.$main_table." AS gf
|
||||
RIGHT JOIN ".$prefix."ResourceStates AS gts
|
||||
ON gts.regionid = '".mysql_real_escape_string($_GET[region])."' AND gf.".$field_lead."state_tag = gts.statetag
|
||||
WHERE gf.".$field_lead."valid = 1 ORDER BY gf.".$field_lead."name ASC") OR die(mysql_error());
|
||||
|
||||
$none = FALSE;
|
||||
if (mysql_num_rows($results) == 0) {
|
||||
$none = TRUE;
|
||||
}
|
||||
|
||||
// set the page title
|
||||
$pagetitle = $regionname;
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = $local_name_lc." in ".$regionname;
|
||||
$meta_description = "Trying to find ".$local_name_lc." in ".$regionname."? Here is a listing of all ".$regionname.$local_name_lc.".";
|
||||
?>
|
||||
|
||||
<? include("include_common_head.php"); ?>
|
||||
<? include("include_common_content.php"); ?>
|
||||
|
||||
<!-- Start outer -->
|
||||
<div id="outer">
|
||||
|
||||
<!-- BODY -->
|
||||
<div class="content">
|
||||
<!-- LEFT COLUMN -->
|
||||
|
||||
<!-- End left column -->
|
||||
<!-- Content col -->
|
||||
|
||||
<h1 class="content-title"><strong><? echo ($regionname." ".$local_name); ?></strong></h1>
|
||||
<div class="indent">
|
||||
<?
|
||||
if($none == TRUE){
|
||||
echo ("No ".$local_name_lc." have been entered yet for ".$regionname.".");
|
||||
}
|
||||
?>
|
||||
<table border="0" cellspacing="0" cellpadding="1" width="580">
|
||||
<?
|
||||
$x = 0;
|
||||
while($row = mysql_fetch_array($results)){
|
||||
$x++;
|
||||
if($x % 2 == 0){ $bg = '#dddddd'; }else{ $bg = '#eeeeee'; }
|
||||
?>
|
||||
<tr bgcolor="<? echo "$bg"; ?>"><td><br><a class="sub-hdr" style="margin-left: 5px;" href="<? echo ("individual.php?".$field_lead."id=".$row[''.$field_lead.'id'].""); ?>"><? echo $row[''.$field_lead.'name']; ?></a></td></tr>
|
||||
|
||||
<tr bgcolor="<? echo "$bg"; ?>">
|
||||
<td><strong class="indent">Address:</strong> <?
|
||||
echo ($row[''.$field_lead.'address']);
|
||||
if($row[''.$field_lead.'address_two']) {
|
||||
echo ("<br /><span class='indent'>".$row[''.$field_lead.'address_two']."</span>");
|
||||
}
|
||||
echo("<br /><span class='indent'>".$row[''.$field_lead.'city'].", ".$row[''.$field_lead.'state']." ".$row[''.$field_lead.'zip']."</span>");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr bgcolor="<? echo "$bg"; ?>">
|
||||
<td><strong class="indent"><?
|
||||
echo ("Phone: </strong>".$row[''.$field_lead.'phone']."<br /><strong class='indent'>Fax/Alt Phone: </strong>". $row[''.$field_lead.'fax']."");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="<? echo "$bg"; ?>">
|
||||
<td>
|
||||
<div class="indent">
|
||||
<strong>Email:</strong> <? echo "<a href='mailto:".$row[''.$field_lead.'email']."'>".$row[''.$field_lead.'email']."</a>"; ?><br />
|
||||
<strong>Website:</strong> <? echo "<a href='".$row[''.$field_lead.'website']."' target='_blank'>".$row[''.$field_lead.'website']."</a>"; ?>
|
||||
<br />
|
||||
<? echo ("<a class='nav' href='individual.php?".$field_lead."id=".$row[''.$field_lead.'id']."'>More information</a>"); ?>
|
||||
<br /><br />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<? } ?>
|
||||
</table>
|
||||
</div>
|
||||
<!-- End content col -->
|
||||
|
||||
</div>
|
||||
<!-- End BODY -->
|
||||
</div>
|
||||
<!-- End Outer -->
|
||||
|
||||
<? include("include_common_footer.php"); ?>
|
||||
|
641
site/roadshow/search.php
Normal file
641
site/roadshow/search.php
Normal file
@ -0,0 +1,641 @@
|
||||
<?PHP include("config.php");
|
||||
|
||||
// set the page title
|
||||
$pagetitle = "Search The Database";
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = "search triathlons";
|
||||
$meta_description = "Do you want to search for triathlons in our online multisport calendar? Then use this form to enter your criteria.";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
//Array of states for use in the form
|
||||
|
||||
$state_list = mysql_query("SELECT * FROM gforum_ResourceStates");
|
||||
|
||||
?>
|
||||
|
||||
<? 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>Search For A Roadshow Event</h1>
|
||||
<hr class="line">
|
||||
<p>If you would like to search for a roadshow event, please use the form below. None of the fields are mandatory. Checking no box "selects all." Checking regions selects all states in that region. Checking any state's box selects or deselects that state.</p>
|
||||
<? if ( $errmsg ) { ?>
|
||||
<p class="error"><? echo $errmsg; ?></p>
|
||||
<? } ?>
|
||||
<form enctype="multipart/form-data" action="search_X.php" method="post" name="searchform">
|
||||
<div class="dtable form">
|
||||
<div class="drow">
|
||||
<div class="dcell name">Date Override</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<input type="checkbox" name="futuredates" value="1"> Yes
|
||||
[overrides keyword search default and allows you to use the date boxes below. Also resets default search to start with today's date.]
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Start Date</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<select name="aftermonth">
|
||||
<option value="0">Month
|
||||
<option value="01">January
|
||||
<option value="02">February
|
||||
<option value="03">March
|
||||
<option value="04">April
|
||||
<option value="05">May
|
||||
<option value="06">June
|
||||
<option value="07">July
|
||||
<option value="08">August
|
||||
<option value="09">September
|
||||
<option value="10">October
|
||||
<option value="11">November
|
||||
<option value="12">December
|
||||
</select>
|
||||
<select name="afterday">
|
||||
<option value="0">Day
|
||||
<? for ($i = 1; $i <= 31; $i++) { echo ("<option value='".sprintf('%02d', $i)."'>$i"); } ?>
|
||||
</select>
|
||||
<select name="afteryear">
|
||||
<option value="0">Year
|
||||
</select><br>[Leave blank for today's date]
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">End Date</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<select name="beforemonth">
|
||||
<option value="0">Month
|
||||
<option value="01">January
|
||||
<option value="02">February
|
||||
<option value="03">March
|
||||
<option value="04">April
|
||||
<option value="05">May
|
||||
<option value="06">June
|
||||
<option value="07">July
|
||||
<option value="08">August
|
||||
<option value="09">September
|
||||
<option value="10">October
|
||||
<option value="11">November
|
||||
<option value="12">December
|
||||
</select>
|
||||
<select name="beforeday">
|
||||
<option value="0">Day
|
||||
<? for ($i = 1; $i <= 31; $i++) { echo ("<option value='".sprintf('%02d', $i)."'>$i"); } ?>
|
||||
</select>
|
||||
<select name="beforeyear">
|
||||
<option value="2016" selected>2016
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<h3>Local Assets</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Slowtwitch Ambassador(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<input type="checkbox" name="stambassador" value="1">Yes
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Tri Club(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<input type="checkbox" name="triclub" value="1">Yes
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Coach(es)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<input type="checkbox" name="coach" value="1">Yes
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Race Director(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<input type="checkbox" name="racedirector" value="1">Yes
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Brewery(ies)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<input type="checkbox" name="brewery" value="1">Yes
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Fit Bikes</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[fitbike])){ $explosion = explode(",", $_POST[fitbike]); } else { $explosion = $_POST[fitbike]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceFitbike ORDER BY fitbike_name ASC");
|
||||
|
||||
echo("<p><input type=\"checkbox\" name=\"fitbike[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"fitbike[]\" value=\"$row[fitbike_id]\" ");
|
||||
if (in_array($row[fitbike_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[fitbike_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Saddle Quick Change</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[saddlechange])){ $explosion = explode(",", $_POST[saddlechange]); } else { $explosion = $_POST[saddlechange]; }
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceSaddlechange ORDER BY saddlechange_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"saddlechange[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"saddlechange[]\" value=\"$row[saddlechange_id]\" ");
|
||||
if (in_array($row[saddlechange_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[saddlechange_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Motion Capture Systems</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[motioncapture])){ $explosion = explode(",", $_POST[motioncapture]); } else { $explosion = $_POST[motioncapture]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceMotioncapture ORDER BY motioncapture_name ASC");
|
||||
|
||||
echo("<p><input type=\"checkbox\" name=\"motioncapture[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"motioncapture[]\" value=\"$row[motioncapture_id]\" ");
|
||||
if (in_array($row[motioncapture_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[motioncapture_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Custom Footbeds</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[footbed])){ $explosion = explode(",", $_POST[footbed]); } else { $explosion = $_POST[footbed]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceCustomfootbed ORDER BY footbed_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"footbed[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"footbed[]\" value=\"$row[footbed_id]\" ");
|
||||
if (in_array($row[footbed_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[footbed_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<h3>Brands</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Tri Apparel</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[apparel_tri])){ $explosion = explode(",", $_POST[apparel_tri]); } else { $explosion = $_POST[apparel_tri]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceApparelTri ORDER BY apparel_tri_name ASC");
|
||||
|
||||
echo("<p><input type=\"checkbox\" name=\"apparel_tri[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"apparel_tri[]\" value=\"$row[apparel_tri_id]\" ");
|
||||
if (in_array($row[apparel_tri_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[apparel_tri_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Brands</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[bike])){ $explosion = explode(",", $_POST[bike]); } else { $explosion = $_POST[bike]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceBike ORDER BY bike_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"bike[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"bike[]\" value=\"$row[bike_id]\" ");
|
||||
if (in_array($row[bike_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[bike_name]</span>\n");
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Saddles/Footwear/Aerobars/Bike Hydration</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[bikeaccessory])){ $explosion = explode(",", $_POST[bikeaccessory]); } else { $explosion = $_POST[bikeaccessory]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceBikeAccessory ORDER BY bikeaccessory_name ASC");
|
||||
|
||||
echo("<p><input type=\"checkbox\" name=\"bikeaccessory[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"bikeaccessory[]\" value=\"$row[bikeaccessory_id]\" ");
|
||||
if (in_array($row[bikeaccessory_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[bikeaccessory_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Helmets/Eyewear</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[bikehelmet])){ $explosion = explode(",", $_POST[bikehelmet]); } else { $explosion = $_POST[bikehelmet]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceBikeHelmet ORDER BY bikehelmet_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"bikehelmet[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"bikehelmet[]\" value=\"$row[bikehelmet_id]\" ");
|
||||
if (in_array($row[bikehelmet_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[bikehelmet_name]</span>\n");
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Nutritionals/Lubricants/Botanicals</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[bikebody])){ $explosion = explode(",", $_POST[bikebody]); } else { $explosion = $_POST[bikebody]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceBikeBody ORDER BY bikebody_name ASC");
|
||||
|
||||
echo("<p><input type=\"checkbox\" name=\"bikebody[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"bikebody[]\" value=\"$row[bikebody_id]\" ");
|
||||
if (in_array($row[bikebody_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[bikebody_name]</span>\n");
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Stationary Trainers</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[biketrainer])){ $explosion = explode(",", $_POST[biketrainer]); } else { $explosion = $_POST[biketrainer]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceBikeTrainer ORDER BY biketrainer_name ASC");
|
||||
|
||||
$i = 0;
|
||||
echo("<tr>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
if(!($i%4)) echo "</tr><tr>";
|
||||
echo("<td width=\"25%\"><input type=\"checkbox\" name=\"biketrainer[]\" value=\"$row[biketrainer_id]\" ");
|
||||
if (in_array($row[biketrainer_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[biketrainer_name]</td>\n");
|
||||
$i++;
|
||||
}
|
||||
if(!($i%4)) echo "</tr><tr>";
|
||||
echo("<td width=\"25%\"><input type=\"checkbox\" name=\"biketrainer[]\" value=\"999\" ><strong>ANY</strong></td>
|
||||
");
|
||||
echo("</tr>");
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Electronics/Cameras/Metrics</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[bikeelectronic])){ $explosion = explode(",", $_POST[bikeelectronic]); } else { $explosion = $_POST[bikeelectronic]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceBikeElectronic ORDER BY bikeelectronic_name ASC");
|
||||
|
||||
echo("<p><input type=\"checkbox\" name=\"bikeelectronic[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"bikeelectronic[]\" value=\"$row[bikeelectronic_id]\" ");
|
||||
if (in_array($row[bikeelectronic_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[bikeelectronic_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Wheels/Tires</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[bikewheel])){ $explosion = explode(",", $_POST[bikewheel]); } else { $explosion = $_POST[bikewheel]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceBikeWheel ORDER BY bikewheel_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"bikewheel[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"bikewheel[]\" value=\"$row[bikewheel_id]\" ");
|
||||
if (in_array($row[bikewheel_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[bikewheel_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Components</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[bikecomponent])){ $explosion = explode(",", $_POST[bikecomponent]); } else { $explosion = $_POST[bikecomponent]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceBikeComponent ORDER BY bikecomponent_name ASC");
|
||||
|
||||
echo("<p><input type=\"checkbox\" name=\"bikecomponent[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span span=\"col\"><input type=\"checkbox\" name=\"bikecomponent[]\" value=\"$row[bikecomponent_id]\" ");
|
||||
if (in_array($row[bikecomponent_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[bikecomponent_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Socks</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[sock])){ $explosion = explode(",", $_POST[sock]); } else { $explosion = $_POST[sock]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceSock ORDER BY sock_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"sock[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"sock[]\" value=\"$row[sock_id]\" ");
|
||||
if (in_array($row[sock_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[sock_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Running Shoes</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[shoe])){ $explosion = explode(",", $_POST[shoe]); } else { $explosion = $_POST[shoe]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceShoe ORDER BY shoe_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"shoe[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"shoe[]\" value=\"$row[shoe_id]\" ");
|
||||
if (in_array($row[shoe_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[shoe_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Run Apparel</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[apparel_run])){ $explosion = explode(",", $_POST[apparel_run]); } else { $explosion = $_POST[apparel_run]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceApparelRun ORDER BY apparel_run_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"apparel_run[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"apparel_run[]\" value=\"$row[apparel_run_id]\" ");
|
||||
if (in_array($row[apparel_run_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[apparel_run_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Run Hydration</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[runhydrate])){ $explosion = explode(",", $_POST[runhydrate]); } else { $explosion = $_POST[runhydrate]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceRunHydrate ORDER BY runhydrate_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"runhydrate[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"runhydrate[]\" value=\"$row[runhydrate_id]\" ");
|
||||
if (in_array($row[runhydrate_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[runhydrate_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Wetsuits</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[wetsuit])){ $explosion = explode(",", $_POST[wetsuit]); } else { $explosion = $_POST[wetsuit]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceWetsuit ORDER BY wetsuit_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"wetsuit[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"wetsuit[]\" value=\"$row[wetsuit_id]\" ");
|
||||
if (in_array($row[wetsuit_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[wetsuit_name]</span>\n");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Swim Apparel/Gear</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[swimgear])){ $explosion = explode(",", $_POST[swimgear]); } else { $explosion = $_POST[swimgear]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceSwimgear ORDER BY swimgear_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"swimgear[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"swimgear[]\" value=\"$row[swimgear_id]\" ");
|
||||
if (in_array($row[swimgear_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[swimgear_name]</span>\n");
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Body Care Tools</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[bodycare])){ $explosion = explode(",", $_POST[bodycare]); } else { $explosion = $_POST[bodycare]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceBodycare ORDER BY bodycare_name ASC");
|
||||
echo("<p><input type=\"checkbox\" name=\"bodycare[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"bodycare[]\" value=\"$row[bodycare_id]\" ");
|
||||
if (in_array($row[bodycare_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[bodycare_name]</span>\n");
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<h3>Technology, Community & Education</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Key Tri-Specific Contact(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<input type="checkbox" name="trispecific" value="1">Yes
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Diagnostic Equipment</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$explosion = array("");
|
||||
if (!is_array($_POST[diagnostic])){ $explosion = explode(",", $_POST[diagnostic]); } else { $explosion = $_POST[diagnostic]; }
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix."ResourceDiagnostic ORDER BY diagnostic_name ASC");
|
||||
|
||||
echo("<p><input type=\"checkbox\" name=\"diagnostic[]\" value=\"999\" ><strong>ANY</strong></p>");
|
||||
while ($row = mysql_fetch_array($results)) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"diagnostic[]\" value=\"$row[diagnostic_id]\" ");
|
||||
if (in_array($row[diagnostic_id], $explosion)){ echo "checked "; }
|
||||
echo(">$row[diagnostic_name]</span>\n");
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Region</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<p>[Selecting a region will select all states in that region. You can then deselect or select any additional states. Only the selected states will be included in your search. Leaving all boxes blank will select races in all states.]</p>
|
||||
<?
|
||||
$regions = array();
|
||||
$regionsql = "SELECT gts.statetag AS statetag, gtr.regionlong AS regionlong
|
||||
FROM gforum_TriathlonsStates AS gts
|
||||
LEFT JOIN gforum_TriathlonsRegions AS gtr
|
||||
ON gts.regionid = gtr.regionid
|
||||
ORDER BY gtr.regionlong";
|
||||
|
||||
$region_list = mysql_query($regionsql);
|
||||
|
||||
//use loop for check box array
|
||||
while($row = mysql_fetch_array($region_list)){
|
||||
if (!is_array($regions[$row[regionlong]])) { $regions[$row[regionlong]] = array(); }
|
||||
array_push($regions[$row[regionlong]], $row[statetag]);
|
||||
}
|
||||
|
||||
foreach($regions AS $region => $statetag) {
|
||||
echo("<span class=\"col\"><input type=\"checkbox\" name=\"region\" value=\"$region\" onClick=\"javascript: checkUncheck(this,'".implode("', '", $statetag)."');\">$region</span>\n");
|
||||
$i++;
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">State</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value states">
|
||||
<? //use loop for check box array
|
||||
while($row = mysql_fetch_array($state_list)){
|
||||
echo "<span class=\"col\"><input type='checkbox' id='states' name='states[]' value=\"$row[statetag]\"> $row[statelong]</span>\n";
|
||||
}
|
||||
?>
|
||||
<p>[Leave blank to select all.]</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow actions">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<input type="submit" value="Search" class="btn">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</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>
|
517
site/roadshow/search_X.php
Normal file
517
site/roadshow/search_X.php
Normal file
@ -0,0 +1,517 @@
|
||||
<?PHP
|
||||
|
||||
/** TO DO **
|
||||
|
||||
openwater_distance
|
||||
openwater_distance_units
|
||||
openwater_water_type
|
||||
openwater_water_body
|
||||
openwater_event_type
|
||||
openwater_temperature
|
||||
openwater_temperature_units
|
||||
openwater_wetsuit_legal
|
||||
openwater_wetsuit_allowed
|
||||
|
||||
************/
|
||||
|
||||
include("config.php");
|
||||
|
||||
if (!$_POST){ header('Location: '.$site_url); }
|
||||
|
||||
// build the SQL query
|
||||
$sql = "SELECT * FROM ".$prefix.$main_table." WHERE ".$field_lead."valid = 1";
|
||||
|
||||
if (isset($_POST[stambassador])) {
|
||||
$sql = $sql." AND ".$field_lead."stambassador = 1";
|
||||
}
|
||||
if (isset($_POST[triclub])) {
|
||||
$sql = $sql." AND ".$field_lead."triclub = 1";
|
||||
}
|
||||
if (isset($_POST[coach])) {
|
||||
$sql = $sql." AND ".$field_lead."coach = 1";
|
||||
}
|
||||
if (isset($_POST[racedirector])) {
|
||||
$sql = $sql." AND ".$field_lead."racedirector = 1";
|
||||
}
|
||||
if (isset($_POST[brewery])) {
|
||||
$sql = $sql." AND ".$field_lead."brewery = 1";
|
||||
}
|
||||
if (isset($_POST[trispecific])) {
|
||||
$sql = $sql." AND ".$field_lead."trispecific = 1";
|
||||
}
|
||||
if (isset($_POST[fist])) {
|
||||
$sql = $sql." AND ".$field_lead."fist = 1";
|
||||
}
|
||||
|
||||
if (isset($_POST[fitbike])) {
|
||||
if (in_array("999", $_POST[fitbike])) {
|
||||
$sql = $sql." AND roadshow_fitbike <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[fitbike] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_fitbike LIKE '%,$value' OR roadshow_fitbike LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[fitbike] AS $value) {
|
||||
$sql = $sql." AND roadshow_fitbike LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[saddlechange])) {
|
||||
if (in_array("999", $_POST[saddlechange])) {
|
||||
$sql = $sql." AND roadshow_saddlechange <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[saddlechange] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_saddlechange LIKE '%,$value' OR roadshow_saddlechange LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[saddlechange] AS $value) {
|
||||
$sql = $sql." AND roadshow_saddlechange LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[motioncapture])) {
|
||||
if (in_array("999", $_POST[motioncapture])) {
|
||||
$sql = $sql." AND roadshow_motioncapture <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[motioncapture] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_motioncapture LIKE '%,$value' OR roadshow_motioncapture LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[motioncapture] AS $value) {
|
||||
$sql = $sql." AND roadshow_motioncapture LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[footbed])) {
|
||||
if (in_array("999", $_POST[footbed])) {
|
||||
$sql = $sql." AND roadshow_footbed <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[footbed] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_footbed LIKE '%,$value' OR roadshow_footbed LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[footbed] AS $value) {
|
||||
$sql = $sql." AND roadshow_footbed LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[wetsuit])) {
|
||||
if (in_array("999", $_POST[wetsuit])) {
|
||||
$sql = $sql." AND roadshow_wetsuit <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[wetsuit] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_wetsuit LIKE '%,$value' OR roadshow_wetsuit LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[wetsuit] AS $value) {
|
||||
$sql = $sql." AND roadshow_wetsuit LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[bike])) {
|
||||
if (in_array("999", $_POST[bike])) {
|
||||
$sql = $sql." AND roadshow_bike <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[bike] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql."roadshow_bike LIKE '%,$value' OR roadshow_bike LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[bike] AS $value) {
|
||||
$sql = $sql." AND roadshow_bike LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[diagnostic])) {
|
||||
if (in_array("999", $_POST[diagnostic])) {
|
||||
$sql = $sql." AND roadshow_diagnostic <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[diagnostic] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_diagnostic LIKE '%,$value' OR roadshow_diagnostic LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[diagnostic] AS $value) {
|
||||
$sql = $sql." AND roadshow_diagnostic LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[shoe])) {
|
||||
if (in_array("999", $_POST[shoe])) {
|
||||
$sql = $sql." AND roadshow_shoe <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[shoe] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_shoe LIKE '%,$value' OR roadshow_shoe LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[shoe] AS $value) {
|
||||
$sql = $sql." AND roadshow_shoe LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[sock])) {
|
||||
if (in_array("999", $_POST[sock])) {
|
||||
$sql = $sql." AND roadshow_sock <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[sock] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_sock LIKE '%,$value' OR roadshow_sock LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[sock] AS $value) {
|
||||
$sql = $sql." AND roadshow_sock LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[apparel_run])) {
|
||||
if (in_array("999", $_POST[apparel_run])) {
|
||||
$sql = $sql." AND roadshow_apparel_run <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[apparel_run] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_apparel_run LIKE '%,$value' OR roadshow_apparel_run LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[apparel_run] AS $value) {
|
||||
$sql = $sql." AND roadshow_apparel_run LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[apparel_tri])) {
|
||||
if (in_array("999", $_POST[apparel_tri])) {
|
||||
$sql = $sql." AND roadshow_apparel_tri <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[apparel_tri] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_apparel_tri LIKE '%,$value' OR roadshow_apparel_tri LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[apparel_tri] AS $value) {
|
||||
$sql = $sql." AND roadshow_apparel_tri LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[swimgear])) {
|
||||
if (in_array("999", $_POST[swimgear])) {
|
||||
$sql = $sql." AND roadshow_swimgear <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[swimgear] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_swimgear LIKE '%,$value' OR roadshow_swimgear LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[swimgear] AS $value) {
|
||||
$sql = $sql." AND roadshow_swimgear LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[bikeaccessory])) {
|
||||
if (in_array("999", $_POST[bikeaccessory])) {
|
||||
$sql = $sql." AND roadshow_bikeaccessory <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[bikeaccessory] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_bikeaccessory LIKE '%,$value' OR roadshow_bikeaccessory LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[bikeaccessory] AS $value) {
|
||||
$sql = $sql." AND roadshow_bikeaccessory LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[bikebody])) {
|
||||
if (in_array("999", $_POST[bikebody])) {
|
||||
$sql = $sql." AND roadshow_bikebody <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[bikebody] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_bikebody LIKE '%,$value' OR roadshow_bikebody LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[bikebody] AS $value) {
|
||||
$sql = $sql." AND roadshow_bikebody LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[bikecomponent])) {
|
||||
if (in_array("999", $_POST[bikecomponent])) {
|
||||
$sql = $sql." AND roadshow_bikecomponent <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[bikecomponent] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_bikecomponent LIKE '%,$value' OR roadshow_bikecomponent LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[bikecomponent] AS $value) {
|
||||
$sql = $sql." AND roadshow_bikecomponent LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[bikeelectronic])) {
|
||||
if (in_array("999", $_POST[bikeelectronic])) {
|
||||
$sql = $sql." AND roadshow_bikeelectronic <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[bikeelectronic] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_bikeelectronic LIKE '%,$value' OR roadshow_bikeelectronic LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[bikeelectronic] AS $value) {
|
||||
$sql = $sql." AND roadshow_bikeelectronic LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[bikehelmet])) {
|
||||
if (in_array("999", $_POST[bikehelmet])) {
|
||||
$sql = $sql." AND roadshow_bikehelmet <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[bikehelmet] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_bikehelmet LIKE '%,$value' OR roadshow_bikehelmet LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[bikehelmet] AS $value) {
|
||||
$sql = $sql." AND roadshow_bikehelmet LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[biketrainer])) {
|
||||
if (in_array("999", $_POST[biketrainer])) {
|
||||
$sql = $sql." AND roadshow_biketrainer <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[biketrainer] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_biketrainer LIKE '%,$value' OR roadshow_biketrainer LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[biketrainer] AS $value) {
|
||||
$sql = $sql." AND roadshow_biketrainer LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[bikewheel])) {
|
||||
if (in_array("999", $_POST[bikewheel])) {
|
||||
$sql = $sql." AND roadshow_bikewheel <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[bikewheel] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_bikewheel LIKE '%,$value' OR roadshow_bikewheel LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[bikewheel] AS $value) {
|
||||
$sql = $sql." AND roadshow_bikewheel LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[runhydrate])) {
|
||||
if (in_array("999", $_POST[runhydrate])) {
|
||||
$sql = $sql." AND roadshow_runhydrate <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[runhydrate] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_runhydrate LIKE '%,$value' OR roadshow_runhydrate LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[runhydrate] AS $value) {
|
||||
$sql = $sql." AND roadshow_runhydrate LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
if (isset($_POST[bodycare])) {
|
||||
if (in_array("999", $_POST[bodycare])) {
|
||||
$sql = $sql." AND roadshow_bodycare <> '0'";
|
||||
} else {
|
||||
$sql = $sql." AND ( ";
|
||||
$flag = 0;
|
||||
foreach ($_POST[bodycare] AS $value) {
|
||||
if ($flag == 1){
|
||||
$sql = $sql." OR ";
|
||||
}
|
||||
$sql = $sql." roadshow_bodycare LIKE '%,$value' OR roadshow_bodycare LIKE '%,$value,%'";
|
||||
$flag = 1;
|
||||
}
|
||||
$sql = $sql.")";
|
||||
/**foreach ($_POST[bodycare] AS $value) {
|
||||
$sql = $sql." AND roadshow_bodycare LIKE '%,$value,%'";
|
||||
}**/}
|
||||
}
|
||||
|
||||
// add date range
|
||||
if (isset($_POST['futuredates']) OR $_POST['keyword'] == "") {
|
||||
if ($_POST[aftermonth] != 0 AND $_POST[afterday] != 0) {
|
||||
$afterdate = "$_POST[afteryear]-$_POST[aftermonth]-$_POST[afterday]";
|
||||
$sql = $sql." AND date >= '$afterdate'"; }
|
||||
else { $sql = $sql." AND ".$field_lead."date >= NOW()"; }
|
||||
if ($_POST[beforemonth] != 0 AND $_POST[beforeday] != 0) {
|
||||
$beforedate = "$_POST[beforeyear]-$_POST[beforemonth]-$_POST[beforeday]";
|
||||
$sql = $sql." AND ".$field_lead."date <= '$beforedate'";
|
||||
}
|
||||
} else {
|
||||
$last_year = time() - 365*24*60*60;
|
||||
$sql = $sql." AND date >= '".date('Y-m-d', $last_year)."'";
|
||||
}
|
||||
|
||||
// regions are checkboxes that then check off all states within that region
|
||||
// add states
|
||||
if (isset($_POST[states])) {
|
||||
$glue = "','";
|
||||
$statelist = "('".implode($glue, $_POST[states])."')";
|
||||
$sql = $sql." AND ".$field_lead."state_tag IN $statelist";
|
||||
}
|
||||
|
||||
$sql = $sql." ORDER BY ".$field_lead."date ASC";
|
||||
|
||||
//echo $sql;
|
||||
//exit();
|
||||
|
||||
$results = mysql_query($sql);
|
||||
|
||||
$none = FALSE;
|
||||
if (mysql_num_rows($results) == 0) {
|
||||
$none = TRUE;
|
||||
}
|
||||
$race_count = mysql_num_rows($results);
|
||||
|
||||
|
||||
// set the page title
|
||||
$pagetitle = "Search Results";
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = "roadshow events in matching a user's search query.";
|
||||
$meta_description = "A list of matching roadshow events.";
|
||||
?>
|
||||
|
||||
<? 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">
|
||||
<h1><? echo $race_count ?> Roadshow Events Match Your Search</h1>
|
||||
<hr class="line">
|
||||
<? if ($none == TRUE) {
|
||||
echo "<p>No races match your search</p>";
|
||||
}
|
||||
?>
|
||||
<ul>
|
||||
<? while($row = mysql_fetch_array($results)) { ?>
|
||||
<li>
|
||||
<p>
|
||||
<a class="sub-hdr" href="<? echo "individual.php?roadshow_id=$row[roadshow_id]"; ?>"><? echo $row[roadshow_name]; ?></a><br>
|
||||
<strong>Address:</strong> <? echo ("$row[roadshow_address]"); if($row[roadshow_address_two]) { echo (" - $row[roadshow_address_two]"); } echo(", $row[roadshow_city], $row[roadshow_state] $row[roadshow_zip]"); ?><br>
|
||||
<strong>Date:</strong> <? echo $row[roadshow_date]; ?><br />
|
||||
<a href="<? echo "individual.php?roadshow_id=$row[roadshow_id]"; ?>">More information</a>
|
||||
</p>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
|
||||
</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>
|
101
site/roadshow/statelist.php
Normal file
101
site/roadshow/statelist.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?PHP include("config.php");
|
||||
|
||||
if (!isset($_GET['state']) || !in_array($_GET['state'], $state_tag_list)) {
|
||||
header('Location: '.$site_url.'/?error=no_state');
|
||||
}
|
||||
|
||||
$results = mysql_query("SELECT statelong FROM ".$prefix."ResourceStates WHERE statetag = '".mysql_escape_string($_GET['state'])."' LIMIT 1") OR die(mysql_error());
|
||||
|
||||
if (mysql_num_rows($results) == 0) {
|
||||
header('Location: '.$site_url.'?mysql_error');
|
||||
}
|
||||
|
||||
$row = mysql_fetch_array($results);
|
||||
$statename = $row['statelong'];
|
||||
|
||||
$results = mysql_query("SELECT * FROM ".$prefix.$main_table." WHERE ".$field_lead."state_tag='".mysql_escape_string($_GET['state'])."' AND ".$field_lead."valid=1 ORDER BY ".$field_lead."name ASC");
|
||||
|
||||
$none = FALSE;
|
||||
if (mysql_num_rows($results) == 0) {
|
||||
$none = TRUE;
|
||||
}
|
||||
|
||||
// set the page title
|
||||
$pagetitle = $statename;
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = $local_name_lc." in ".$statename;
|
||||
$meta_description = "Trying to find ".$local_name_lc." in ".$statename."? Here is a listing of all ".$statename." ".$local_name_lc.". Users can even rate and comment on these ".$local_name_lc.".";
|
||||
|
||||
?>
|
||||
|
||||
<? include("include_common_head.php"); ?>
|
||||
<? include("include_common_content.php"); ?>
|
||||
|
||||
<!-- Start outer -->
|
||||
<div id="outer">
|
||||
|
||||
<!-- BODY -->
|
||||
<div class="content">
|
||||
<!-- LEFT COLUMN -->
|
||||
|
||||
<!-- End left column -->
|
||||
<!-- Content col -->
|
||||
|
||||
<h1 class="content-title"><strong><? echo ($statename." ".$local_name); ?></strong></h1>
|
||||
<div class="indent">
|
||||
<?
|
||||
if($none == TRUE){
|
||||
echo ("No ".$local_name_lc." have been entered yet for ".$statename.".");
|
||||
}
|
||||
?>
|
||||
<table border="0" cellspacing="0" cellpadding="1" width="580">
|
||||
<?
|
||||
$x = 0;
|
||||
while($row = mysql_fetch_array($results)){
|
||||
$x++;
|
||||
if($x % 2 == 0){ $bg = '#dddddd'; }else{ $bg = '#eeeeee'; }
|
||||
?>
|
||||
<tr bgcolor="<? echo "$bg"; ?>"><td><br><a class="sub-hdr" style="margin-left: 5px;" href="<? echo ("individual.php?".$field_lead."id=".$row[''.$field_lead.'id'].""); ?>"><? echo $row[''.$field_lead.'name']; ?></a></td></tr>
|
||||
|
||||
<tr bgcolor="<? echo "$bg"; ?>">
|
||||
<td><strong class="indent">Address:</strong> <?
|
||||
echo ($row[''.$field_lead.'address']);
|
||||
if($row[''.$field_lead.'address_two']) {
|
||||
echo ("<br /><span class='indent'>".$row[''.$field_lead.'address_two']."</span>");
|
||||
}
|
||||
echo("<br /><span class='indent'>".$row[''.$field_lead.'city'].", ".$row[''.$field_lead.'state']." ".$row[''.$field_lead.'zip']."</span>");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr bgcolor="<? echo "$bg"; ?>">
|
||||
<td><strong class="indent"><?
|
||||
echo ("Phone: </strong>".$row[''.$field_lead.'phone']."<br /><strong class='indent'>Fax/Alt Phone: </strong>". $row[''.$field_lead.'fax']."");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="<? echo "$bg"; ?>">
|
||||
<td>
|
||||
<div class="indent">
|
||||
<strong>Email:</strong> <? echo "<a href='mailto:".$row[''.$field_lead.'email']."'>".$row[''.$field_lead.'email']."</a>"; ?><br />
|
||||
<strong>Website:</strong> <? echo "<a href='".$row[''.$field_lead.'website']."' target='_blank'>".$row[''.$field_lead.'website']."</a>"; ?>
|
||||
<br />
|
||||
<? echo ("<a class='nav' href='individual.php?".$field_lead."id=".$row[''.$field_lead.'id']."'>More information</a>"); ?>
|
||||
<br /><br />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<? } ?>
|
||||
</table>
|
||||
</div>
|
||||
<!-- End content col -->
|
||||
|
||||
</div>
|
||||
<!-- End BODY -->
|
||||
</div>
|
||||
<!-- End Outer -->
|
||||
|
||||
<? include("include_common_footer.php"); ?>
|
||||
|
103
site/roadshow/top.php
Normal file
103
site/roadshow/top.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?PHP include("config.php");
|
||||
require_once("class/rating/classes/include.all.php");
|
||||
include("class/rating/int.to.words.php");
|
||||
|
||||
$results = mysql_query("SELECT COUNT(DISTINCT(gfr.rating_ip)) AS respondents, ROUND(AVG(gfr.rating_vote), 2) AS score, COUNT(gfr.rating_vote) AS votes, gf.openwater_id, gf.openwater_name, gf.openwater_address, gf.openwater_address_two, gf.openwater_city, gf.openwater_state, gf.openwater_zip, gf.openwater_phone, gf.openwater_fax, gf.openwater_email, gf.openwater_website, gf.openwater_certifications, gf.openwater_fitbikes FROM ".$prefix."OpenWaterRating AS gfr RIGHT JOIN ".$prefix."OpenWater AS gf ON gf.openwater_id = gfr.openwater_id_fk GROUP BY gfr.openwater_id_fk HAVING COUNT(gfr.rating_vote) > 10 ORDER BY score DESC, votes DESC LIMIT 10") OR die(mysql_error());
|
||||
|
||||
$none = FALSE;
|
||||
if (mysql_num_rows($results) == 0) {
|
||||
$none = TRUE;
|
||||
}
|
||||
|
||||
// set the page title
|
||||
$pagetitle = "Top Bike Fitters";
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = "top ranked open water events";
|
||||
$meta_description = "Top ranked open water events based on rankings submitted by the user.";
|
||||
?>
|
||||
|
||||
<? include("include_common_head.php"); ?>
|
||||
<? include("include_common_content.php"); ?>
|
||||
|
||||
<!-- Start outer -->
|
||||
<div id="outer">
|
||||
|
||||
<!-- BODY -->
|
||||
<div class="content">
|
||||
<!-- LEFT COLUMN -->
|
||||
|
||||
<!-- End left column -->
|
||||
<!-- Content col -->
|
||||
|
||||
<h1 class="content-title"><strong>Top Ranked Open Water Events</strong></h1>
|
||||
<div class="indent">
|
||||
<?
|
||||
if($none == TRUE){
|
||||
echo "No open water events have enough votes yet.";
|
||||
}
|
||||
?>
|
||||
<table border="0" cellspacing="0" cellpadding="1" width="580">
|
||||
<?
|
||||
$x = 0;
|
||||
while($row = mysql_fetch_array($results)){
|
||||
$x++;
|
||||
if($x % 2 == 0){ $bg = '#dddddd'; }else{ $bg = '#eeeeee'; }
|
||||
?>
|
||||
<tr bgcolor="<? echo "$bg"; ?>"><td><br><a class="sub-hdr" style="margin-left: 5px;" href="<? echo "individual.php?openwater_id=$row[openwater_id]"; ?>"><? echo $x.". ".$row[openwater_name]; ?></a><div style="padding-left: 5px;">(Avg. rating <? echo($row[score]); ?> based on <? echo(int_to_words($row[respondents])); if($row[respondents] == 1) { echo(" respondent"); } else { echo(" respondents"); } ?>)</div>
|
||||
<div style="padding-left: 5px;"><?
|
||||
|
||||
$foo = $row[openwater_id];
|
||||
|
||||
$ratingData = Rating::OutputParentRating("$foo");
|
||||
|
||||
if (Error::HasErrors())
|
||||
{
|
||||
echo Error::ShowErrorMessages();
|
||||
Error::ClearErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ratingData;
|
||||
}
|
||||
?></div>
|
||||
<br />
|
||||
</td></tr>
|
||||
|
||||
<tr bgcolor="<? echo "$bg"; ?>"><td>
|
||||
<?
|
||||
|
||||
if (fist_equipped($row[openwater_id]) == "fist_equipped") { echo("<img src='http://www.slowtwitch.com/openwater/images/fist_equipped.gif' style='padding-top: 2px; padding-bottom: 5px;' class='indent'>");}
|
||||
|
||||
if (fist_equipped($row[openwater_id]) == "super_fist") { echo("<br /><img src='http://www.slowtwitch.com/openwater/images/super_fist.gif' style='padding-top: 2px; padding-bottom: 5px;' class='indent'>");}
|
||||
|
||||
?>
|
||||
</td></tr>
|
||||
|
||||
<tr bgcolor="<? echo "$bg"; ?>"><td><strong class="indent">Address:</strong> <? echo ("$row[openwater_address]"); if($row[openwater_address_two]) { echo ("<br /><span class='indent'>$row[openwater_address_two]</span>"); } echo("<br /><span class='indent'>$row[openwater_city], $row[openwater_state] $row[openwater_zip]</span>"); ?></td></tr>
|
||||
<tr bgcolor="<? echo "$bg"; ?>"><td><strong class="indent">
|
||||
<?
|
||||
|
||||
echo "Phone: </strong>$row[openwater_phone]<br /><strong class='indent'>Fax/Alt Phone: </strong> $row[openwater_fax]";
|
||||
|
||||
?>
|
||||
</td></tr>
|
||||
<tr bgcolor="<? echo "$bg"; ?>"><td><div class="indent">
|
||||
<strong>Email:</strong> <? echo "<a href='mailto:$row[openwater_email]'>$row[openwater_email]</a>"; ?><br />
|
||||
<strong>Website:</strong> <? echo "<a href='$row[openwater_website]' target='_blank'>$row[openwater_website]</a>"; ?>
|
||||
<br>
|
||||
<a class="nav" href="<? echo "individual.php?openwater_id=$row[openwater_id]"; ?>">More information</a>
|
||||
<br /><br /></div></td></tr>
|
||||
<? } ?>
|
||||
</table>
|
||||
</div>
|
||||
<!-- End content col -->
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End BODY -->
|
||||
</div>
|
||||
<!-- End Outer -->
|
||||
|
||||
<? include("include_common_footer.php"); ?>
|
||||
|
118
site/roadshow/validate.php
Normal file
118
site/roadshow/validate.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?PHP
|
||||
|
||||
include("config.php");
|
||||
|
||||
if(!is_admin()) {
|
||||
header('Location: '.$site_url);
|
||||
exit();
|
||||
}
|
||||
|
||||
// Query to fetch non-validated races:
|
||||
$results = mysql_query("SELECT * FROM ".$prefix.$main_table." WHERE ".$field_lead."valid=0 ORDER BY ".$field_lead."name ASC");
|
||||
|
||||
// check to see if set is empty
|
||||
$none = FALSE;
|
||||
if (mysql_num_rows($results) == 0) { $none = TRUE; }
|
||||
|
||||
// set the page title
|
||||
$pagetitle = "Admin: ".$local_name." Validation";
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = "";
|
||||
$meta_description = "";
|
||||
?>
|
||||
|
||||
<? 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">
|
||||
<h1>Unvalidated <? echo ($local_name); ?></h1>
|
||||
<form method="post" action="validate_X.php" enctype="multipart/form-data">
|
||||
<?
|
||||
if($none == TRUE){
|
||||
echo "<p>There are no ".$local_name_lc." waiting to be validated.</p>";
|
||||
}
|
||||
?>
|
||||
<div class="dtable form">
|
||||
<? while($row = mysql_fetch_array($results)) { ?>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Name</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<a href="<? echo ("individual.php?".$field_lead."id=".$row[''.$field_lead.'id'].""); ?>"><? echo $row[''.$field_lead.'name']; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Address</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
echo ($row[''.$field_lead.'address']);
|
||||
if($row[''.$field_lead.'address_two']) {
|
||||
echo ("<br />".$row[''.$field_lead.'address_two']);
|
||||
}
|
||||
echo("<br />".$row[''.$field_lead.'city'].", ".$row[''.$field_lead.'state']." ".$row[''.$field_lead.'zip']);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Phone</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
echo ($row[''.$field_lead.'phone']."<br />Fax/Alt Phone: ". $row[''.$field_lead.'fax']."");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">E-mail</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo "<a href='mailto:".$row[''.$field_lead.'email']."'>".$row[''.$field_lead.'email']."</a>"; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Website</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo "<a href='".$row[''.$field_lead.'website']."' target='_blank'>".$row[''.$field_lead.'website']."</a>"; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<input type="checkbox" value="<? echo($row[''.$field_lead.'id']); ?>" name="validate[]"> Validate this <? echo $local_singular_lc; ?>. <input type="checkbox" value="<? echo($row[''.$field_lead.'id']); ?>" name="delete[]"> Delete this <? echo $local_singular_lc; ?>.
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
</div>
|
||||
|
||||
<div class="btn-wrapper"><input type="submit" value="Validate Selected <? echo ($local_name); ?>" class="btn"></div>
|
||||
</form>
|
||||
</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>
|
35
site/roadshow/validate_X.php
Normal file
35
site/roadshow/validate_X.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?PHP
|
||||
|
||||
include("config.php");
|
||||
|
||||
if (!$_POST){ header('Location: '.$site_url); }
|
||||
|
||||
// error checking
|
||||
if(!isset($_POST)) exit();
|
||||
|
||||
if (isset($_POST[delete])) {
|
||||
// convert the array to a SQL friendly format
|
||||
$deleteList = "(".implode(",", $_POST[delete]).")";
|
||||
|
||||
// build the SQL query to delete the edits that are bad
|
||||
$sql = "DELETE FROM ".$prefix.$main_table." WHERE ".$field_lead."id IN $deleteList";
|
||||
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
}
|
||||
|
||||
if (isset($_POST[validate])) {
|
||||
// convert the array to a SQL friendly format
|
||||
$idlist = "(".implode(",", $_POST[validate]).")";
|
||||
|
||||
// build the SQL query
|
||||
$sql = "UPDATE ".$prefix.$main_table."
|
||||
SET ".$field_lead."valid = 1
|
||||
WHERE ".$field_lead."id IN $idlist;";
|
||||
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
|
||||
}
|
||||
|
||||
header('Location: '.$site_url.'/validate.php');
|
||||
|
||||
?>
|
20
site/roadshow/wiki_buttons.php
Normal file
20
site/roadshow/wiki_buttons.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?PHP
|
||||
|
||||
if (eregi("wiki_buttons.php", $_SERVER['SCRIPT_NAME'])) {
|
||||
Header("Location: index.php"); die();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p>
|
||||
<form method="post" action="wiki_validate_X.php" style="display: inline;">
|
||||
<input type="hidden" name="validate[]" value="<? echo($row[edit_id]); ?>" />
|
||||
<input type="submit" value="Validate This Edit" class="btn" onclick="return confirm('Are you sure you want to VALIDATE this <? echo ($local_singular_lc); ?>?');" />
|
||||
</form>
|
||||
|
||||
<form method="post" action="wiki_validate_X.php" style="display: inline;">
|
||||
<input type="hidden" name="delete[]" value="<? echo($row[edit_id]); ?>" />
|
||||
<input type="submit" value="Delete This Edit" class="btn" onclick="return confirm('Are you sure you want to DELETE this <? echo ($local_singular_lc); ?>?');" />
|
||||
</form>
|
||||
|
||||
</p>
|
1835
site/roadshow/wiki_edit.php
Normal file
1835
site/roadshow/wiki_edit.php
Normal file
File diff suppressed because it is too large
Load Diff
250
site/roadshow/wiki_edit_X.php
Normal file
250
site/roadshow/wiki_edit_X.php
Normal file
@ -0,0 +1,250 @@
|
||||
<?PHP
|
||||
|
||||
if (!$_POST){ header('Location: '.$site_url.'/?error=no_post'); }
|
||||
|
||||
/*
|
||||
|
||||
FIELD NAMES:
|
||||
roadshow_id
|
||||
roadshow_date
|
||||
roadshow_name
|
||||
roadshow_name_tag
|
||||
roadshow_address
|
||||
roadshow_address_two
|
||||
roadshow_city
|
||||
roadshow_state
|
||||
roadshow_state_tag
|
||||
roadshow_zip
|
||||
roadshow_lat
|
||||
roadshow_lng
|
||||
roadshow_phone
|
||||
roadshow_fax
|
||||
roadshow_email
|
||||
roadshow_website
|
||||
roadshow_facebook
|
||||
roadshow_raffle
|
||||
roadshow_stambassador
|
||||
roadshow_stambassador_names
|
||||
roadshow_triclub
|
||||
roadshow_triclub_names
|
||||
roadshow_coach
|
||||
roadshow_coach_names
|
||||
roadshow_racedirector
|
||||
roadshow_racedirector_names
|
||||
roadshow_brewery
|
||||
roadshow_brewery_names
|
||||
roadshow_local
|
||||
roadshow_fitbike
|
||||
roadshow_saddlechange
|
||||
roadshow_motioncapture
|
||||
roadshow_footbed
|
||||
roadshow_wetsuit
|
||||
roadshow_bike
|
||||
roadshow_trispecific
|
||||
roadshow_trispecific_names
|
||||
roadshow_fist
|
||||
roadshow_fist_names
|
||||
roadshow_diagnostic
|
||||
roadshow_shoe
|
||||
roadshow_sock
|
||||
roadshow_apparel_run
|
||||
roadshow_apparel_tri
|
||||
roadshow_swimgear
|
||||
roadshow_bikeaccessory
|
||||
roadshow_bikebody
|
||||
roadshow_bikecomponent
|
||||
roadshow_bikeelectronic
|
||||
roadshow_bikehelmet
|
||||
roadshow_biketrainer
|
||||
roadshow_bikewheel
|
||||
roadshow_runhydrate
|
||||
roadshow_bodycare
|
||||
roadshow_hours
|
||||
roadshow_activity
|
||||
roadshow_submitted_by
|
||||
roadshow_valid
|
||||
roadshow_user_tags
|
||||
|
||||
*/
|
||||
|
||||
/* Need to ltrim and rtrim commas before insertion */
|
||||
|
||||
//Insert into database
|
||||
//$pass = 'abc123';
|
||||
$errmsg = NULL;
|
||||
$insert_success = NULL;
|
||||
//Check for blank fields
|
||||
if ((!$_POST[name])) $errmsg = $errmsg."Road show event name, ";
|
||||
if ($_POST[month]==0) $errmsg = $errmsg.'event month, ';
|
||||
if ($_POST[day]==0) $errmsg = $errmsg.'event day, ';
|
||||
if (!$_POST[city]) $errmsg = $errmsg."City, ";
|
||||
if (!$_POST[state]) $errmsg = $errmsg."State, ";
|
||||
if (!$_POST[address]) $errmsg = $errmsg."Address, ";
|
||||
if ((!$_POST[lat] || !$_POST[lng]) && $_POST[latlng_override] == true) $errmsg = $errmsg."Lat/Lng cannot be left blank if you wish to override address, ";
|
||||
if (!$_POST[phone]) $errmsg = $errmsg."Phone, ";
|
||||
if (!$_POST[email]) $errmsg = $errmsg."Email, ";
|
||||
if (!$_POST[website]) $errmsg = $errmsg."Website, ";
|
||||
//if (!$_POST[hours]) $errmsg = $errmsg."Shop hours, ";
|
||||
if ($_POST[fist] == 1 && !$_POST[fist_names]) $errmsg = $errmsg.'F.I.S.T. Tri fitters names, ';
|
||||
if (strlen($_POST[activity]) < 4) $errmsg = $errmsg."Runs and classes information, ";
|
||||
if (isset($errmsg)) {
|
||||
$errmsg = "The following fields cannot be left blank: ".$errmsg."<br />";
|
||||
$errmsg = rtrim($errmsg, ", ");
|
||||
}
|
||||
|
||||
$start_url = "(http(s)?\:\/\/)?"; // start url
|
||||
$dots = "([\w_-]{2,}\.)+"; // one or more parts containing a '.' at the end
|
||||
$last_part = "([\w_-]{2,})"; // last part doesn't contain a dot
|
||||
$user = "((\/)(\~)[\w_=-]+)?((\/)[\w_=-]+)*"; // maybe subdirectories - possibly with user ~
|
||||
$end = "((\/)|(\/)[\w_-]+\.[\w]{2,})?"; // maybe a slash at the end or slash+file+extension
|
||||
$qstring1 = "((\?[\w_-]+\=([^\#]+)){0,1}"; // querystring - first argument (?a=b)
|
||||
$qstring2 = "(\&[\w_-]+\=([^\#]+))*)?"; // querystring - following arguments (&c=d)
|
||||
$bkmrk = "(#[\w_-]+)?"; // bookmark
|
||||
|
||||
$exp = "/^".$start_url.$dots.$last_part.$user.$end.$qstring1.$qstring2.$bkmrk."$/i";
|
||||
if( !preg_match($exp, $_POST[website]) ) {
|
||||
// Contains invalid characters.
|
||||
$errmsg = $errmsg."Invalid Web Address<br />";
|
||||
}
|
||||
if( !preg_match($exp, $_POST[facebook]) ) {
|
||||
// Contains invalid characters.
|
||||
$errmsg = $errmsg."Invalid Web Address<br />";
|
||||
}
|
||||
if( !preg_match($exp, $_POST[raffle]) ) {
|
||||
// Contains invalid characters.
|
||||
$errmsg = $errmsg."Invalid Web Address<br />";
|
||||
}
|
||||
if( preg_match('/[^a-zA-Z0-9\. ]/', $_POST[name]) ) {
|
||||
// Contains invalid characters.
|
||||
$errmsg = $errmsg."Please use only letters and numbers in the name<br />";
|
||||
}
|
||||
|
||||
// begin error message check
|
||||
if(!$errmsg){
|
||||
|
||||
$name = trim($_POST[name]);
|
||||
$name_tag = strtolower(str_replace(" ","", $name));
|
||||
//if(strlen($name_tag) > 12){ //Shorten it
|
||||
$name_tag = substr($name_tag, 0, 12);
|
||||
//} // need to update a typo here in other dbs
|
||||
$address = mysql_escape_string(trim($_POST[address]));
|
||||
$full_address = $address;
|
||||
if (isset($_POST['address_two'])) { $address_two = mysql_escape_string(trim($_POST[address_two])); } else { $address_two = NULL; $full_address = $full_address.", ".$address_two; }
|
||||
$city = mysql_escape_string(trim($_POST[city]));
|
||||
$full_address = $full_address.", ".$city;
|
||||
$state = $_POST[state];
|
||||
$full_address = $full_address.", ".$state;
|
||||
$state_tag = strtolower(str_replace(" ","", $state));
|
||||
$zip = mysql_escape_string(trim($_POST[zip]));
|
||||
$full_address = $full_address." ".$zip;
|
||||
$latlng_override = $_POST[latlng_override];
|
||||
if ($latlng_override == true) {
|
||||
$lat = $_POST[lat];
|
||||
$lng = $_POST[lng];
|
||||
} else {
|
||||
//geocode
|
||||
//echo ($full_address);
|
||||
$geocode_status = geocode($full_address);
|
||||
//echo (is_array($geocode_status));
|
||||
if (is_array($geocode_status)) {
|
||||
$geocode_error = false;
|
||||
$lat = $geocode_status[0];
|
||||
$_POST[lat] = $lat;
|
||||
$lng = $geocode_status[1];
|
||||
$_POST[lng] = $lng;
|
||||
//echo ($lat.", ".$lng);
|
||||
} else {
|
||||
$geocode_error = true;
|
||||
$lat = 0;
|
||||
$_POST[lat] = $lat;
|
||||
$lng = 0;
|
||||
$_POST[lng] = $lng;
|
||||
$geocode_message = $geocode_status;
|
||||
}
|
||||
}
|
||||
$phone = mysql_escape_string(trim($_POST[phone]));
|
||||
$fax = mysql_escape_string(trim($_POST[fax]));
|
||||
$email = mysql_escape_string(trim($_POST[email]));
|
||||
$website = mysql_escape_string(trim($_POST[website]));
|
||||
$raffle = mysql_escape_string(trim($_POST[raffle]));
|
||||
$facebook = mysql_escape_string(trim($_POST[facebook]));
|
||||
|
||||
$stambassador = mysql_escape_string(trim($_POST[stambassador]));
|
||||
$stambassador_names = mysql_escape_string(trim($_POST[stambassador_names]));
|
||||
$triclub = mysql_escape_string(trim($_POST[triclub]));
|
||||
$triclub_names = mysql_escape_string(trim($_POST[triclub_names]));
|
||||
$coach = mysql_escape_string(trim($_POST[coach]));
|
||||
$coach_names = mysql_escape_string(trim($_POST[coach_names]));
|
||||
$racedirector = mysql_escape_string(trim($_POST[racedirector]));
|
||||
$racedirector_names = mysql_escape_string(trim($_POST[racedirector_names]));
|
||||
$brewery = mysql_escape_string(trim($_POST[brewery]));
|
||||
$brewery_names = mysql_escape_string(trim($_POST[brewery_names]));
|
||||
$local = mysql_escape_string(trim($_POST[local]));
|
||||
$fitbike = $_POST[fitbike];
|
||||
$saddlechange = $_POST[saddlechange];
|
||||
$motioncapture = $_POST[motioncapture];
|
||||
$footbed = $_POST[footbed];
|
||||
$wetsuit = $_POST[wetsuit];
|
||||
$bike = $_POST[bike];
|
||||
$trispecific = mysql_escape_string(trim($_POST[trispecific]));
|
||||
$trispecific_names = mysql_escape_string(trim($_POST[trispecific_names]));
|
||||
$fist = mysql_escape_string(trim($_POST[fist]));
|
||||
$fist_names = mysql_escape_string(trim($_POST[fist_names]));
|
||||
$diagnostic = $_POST[diagnostic];
|
||||
$shoe = $_POST[shoe];
|
||||
$sock = $_POST[sock];
|
||||
$apparel_run = $_POST[apparel_run];
|
||||
$apparel_tri = $_POST[apparel_tri];
|
||||
$swimgear = $_POST[swimgear];
|
||||
$bikeaccessory = $_POST[bikeaccessory];
|
||||
$bikebody = $_POST[bikebody];
|
||||
$bikecomponent = $_POST[bikecomponent];
|
||||
$bikeelectronic = $_POST[bikeelectronic];
|
||||
$bikehelmet = $_POST[bikehelmet];
|
||||
$biketrainer = $_POST[biketrainer];
|
||||
$bikewheel = $_POST[bikewheel];
|
||||
$runhydrate = $_POST[runhydrate];
|
||||
$bodycare = $_POST[bodycare];
|
||||
$hours = mysql_escape_string(trim($_POST[hours]));
|
||||
|
||||
$activity = mysql_escape_string(nl2br(substr(trim($_POST[activity]), 0, 4096)));
|
||||
|
||||
$hour = $_POST[hour];
|
||||
if($_POST[daypart] == 1){ $hour = $hour + 12; }
|
||||
$minute = $_POST[minute];
|
||||
$year = $_POST[year];
|
||||
$month = $_POST[month];
|
||||
$day = $_POST[day];
|
||||
$date = "$year-$month-$day $hour:$minute:00";
|
||||
|
||||
$submitted_by = $_POST[submitted_by];
|
||||
|
||||
$id = $_POST[$field_lead.'id'];
|
||||
$edited_by = $_POST['edited_by'];
|
||||
$edit_timestamp = time();
|
||||
|
||||
// BEGIN CONFIRM ENTRY CHECK
|
||||
if($_POST[insert_roadshow] == true){
|
||||
if(isset($_POST[new_roadshow])){
|
||||
$sql = "INSERT INTO ".$prefix."Roadshow (roadshow_date, roadshow_name, roadshow_name_tag, roadshow_address, roadshow_address_two, roadshow_city, roadshow_state, roadshow_state_tag, roadshow_zip, roadshow_lat, roadshow_lng, roadshow_phone, roadshow_fax, roadshow_email, roadshow_website, roadshow_raffle, roadshow_facebook, roadshow_stambassador, roadshow_stambassador_names, roadshow_triclub, roadshow_triclub_names, roadshow_coach, roadshow_coach_names, roadshow_racedirector, roadshow_racedirector_names, roadshow_brewery, roadshow_brewery_names, roadshow_local, roadshow_fitbike, roadshow_saddlechange, roadshow_motioncapture, roadshow_footbed, roadshow_wetsuit, roadshow_bike, roadshow_trispecific, roadshow_trispecific_names, roadshow_fist, roadshow_fist_names, roadshow_diagnostic, roadshow_shoe, roadshow_sock, roadshow_apparel_run, roadshow_apparel_tri, roadshow_swimgear, roadshow_bikeaccessory, roadshow_bikebody, roadshow_bikecomponent, roadshow_bikeelectronic, roadshow_bikehelmet, roadshow_biketrainer, roadshow_bikewheel, roadshow_runhydrate, roadshow_bodycare, roadshow_hours, roadshow_activity, roadshow_submitted_by, roadshow_valid) VALUES ('$date', '$name', '$name_tag', '$address', '$address_two', '$city', '$state', '$state_tag', '$zip', '$lat', '$lng', '$phone', '$fax', '$email', '$website', '$raffle', '$facebook', '$stambassador', '$stambassador_names', '$triclub', '$triclub_names', '$coach', '$coach_names', '$racedirector', '$racedirector_names', '$brewery', '$brewery_names', '$local', '$fitbike', '$saddlechange', '$motioncapture', '$footbed', '$wetsuit', '$bike', '$trispecific', '$trispecific_names', '$fist', '$fist_names', '$diagnostic', '$shoe', '$sock', '$apparel_run', '$apparel_tri', '$swimgear', '$bikeaccessory', '$bikebody', '$bikecomponent', '$bikeelectronic', '$bikehelmet', '$biketrainer', '$bikewheel', '$runhydrate', '$bodycare', '$hours', '$activity', $submitted_by, 0)";
|
||||
//echo("new open water event entered!");
|
||||
//echo($sql);
|
||||
mysql_query($sql) OR die(mysql_error());
|
||||
//header('Location: '.$site_url.'/add.php?confirmed=yes');
|
||||
} elseif(isset($_POST[save_changes])) {
|
||||
$sql = "INSERT INTO ".$prefix."RoadshowEdits (roadshow_id_fk, edit_user_id_fk, edit_timestamp, roadshow_date, roadshow_name, roadshow_name_tag, roadshow_address, roadshow_address_two, roadshow_city, roadshow_state, roadshow_state_tag, roadshow_zip, roadshow_lat, roadshow_lng, roadshow_phone, roadshow_fax, roadshow_email, roadshow_website, roadshow_raffle, roadshow_facebook, roadshow_stambassador, roadshow_stambassador_names, roadshow_triclub, roadshow_triclub_names, roadshow_coach, roadshow_coach_names, roadshow_racedirector, roadshow_racedirector_names, roadshow_brewery, roadshow_brewery_names, roadshow_local, roadshow_fitbike, roadshow_saddlechange, roadshow_motioncapture, roadshow_footbed, roadshow_wetsuit, roadshow_bike, roadshow_trispecific, roadshow_trispecific_names, roadshow_fist, roadshow_fist_names, roadshow_diagnostic, roadshow_shoe, roadshow_sock, roadshow_apparel_run, roadshow_apparel_tri, roadshow_swimgear, roadshow_bikeaccessory, roadshow_bikebody, roadshow_bikecomponent, roadshow_bikeelectronic, roadshow_bikehelmet, roadshow_biketrainer, roadshow_bikewheel, roadshow_runhydrate, roadshow_bodycare, roadshow_hours, roadshow_activity, roadshow_submitted_by, roadshow_valid) VALUES ('$id', '$edited_by', '$edit_timestamp', '$date', '$name', '$name_tag', '$address', '$address_two', '$city', '$state', '$state_tag', '$zip', '$lat', '$lng', '$phone', '$fax', '$email', '$website', '$raffle', '$facebook', '$stambassador', '$stambassador_names', '$triclub', '$triclub_names', '$coach', '$coach_names', '$racedirector', '$racedirector_names', '$brewery', '$brewery_names', '$local', '$fitbike', '$saddlechange', '$motioncapture', '$footbed', '$wetsuit', '$bike', '$trispecific', '$trispecific_names', '$fist', '$fist_names', '$diagnostic', '$shoe', '$sock', '$apparel_run', '$apparel_tri', '$swimgear', '$bikeaccessory', '$bikebody', '$bikecomponent', '$bikeelectronic', '$bikehelmet', '$biketrainer', '$bikewheel', '$runhydrate', '$bodycare', '$hours', '$activity', $submitted_by, 0)";
|
||||
//echo("edit to open water event entered!");
|
||||
echo($sql);
|
||||
mysql_query($sql) OR die(mysql_error());
|
||||
header('Location: '.$site_url.'/individual.php?roadshow_id='.$id.'&wiki_change=success');
|
||||
} else {
|
||||
header('Location: '.$site_url.'/individual.php?roadshow_id='.$id.'&changes=failure');
|
||||
}
|
||||
} else {
|
||||
//echo("open water event NOT entered.");
|
||||
$confirm_roadshow = true;
|
||||
}
|
||||
// END CONFIRM ENTRY CHECK
|
||||
}
|
||||
// END ERROR MESSAGE CHECK
|
||||
?>
|
134
site/roadshow/wiki_validate.php
Normal file
134
site/roadshow/wiki_validate.php
Normal file
@ -0,0 +1,134 @@
|
||||
<?PHP include("config.php");
|
||||
|
||||
if(!is_admin()) {
|
||||
header('Location:'.$site_url.'/');
|
||||
exit();
|
||||
}
|
||||
|
||||
// Query to fetch non-validated roadshow events:
|
||||
$results = mysql_query("SELECT * FROM ".$prefix.$main_table."Edits ORDER BY edit_timestamp ASC");
|
||||
|
||||
// check to see if set is empty
|
||||
$none = FALSE;
|
||||
if (mysql_num_rows($results) == 0) { $none = TRUE; }
|
||||
|
||||
// set the page title
|
||||
$pagetitle = "Admin: ".$local_singular." Validation";
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = "";
|
||||
$meta_description = "";
|
||||
?>
|
||||
|
||||
<? 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">
|
||||
<h1>Unvalidated Public Edits</h1>
|
||||
<form method="post" action="wiki_validate_X.php" enctype="multipart/form-data">
|
||||
<? if ($none == TRUE) {
|
||||
echo "<p>There are no edits waiting to be validated.</p>";
|
||||
} ?>
|
||||
|
||||
<div class="dtable form">
|
||||
<?
|
||||
$x = 0;
|
||||
while($row = mysql_fetch_array($results)){
|
||||
$x++;
|
||||
if($x % 2 == 0){ $bg = '#dddddd'; }else{ $bg = '#eeeeee'; }
|
||||
|
||||
$arrEditors = mysql_fetch_array(mysql_query("SELECT user_username FROM ".$prefix."User WHERE user_id = ".$row[edit_user_id_fk]." LIMIT 1"));
|
||||
|
||||
$editor_user_username = $arrEditors[user_username];
|
||||
|
||||
$boolEditorIsOwner = false;
|
||||
if ($row['edit_user_id_fk'] == $row[$field_lead.'submitted_by']) { $boolEditorIsOwner = true; }
|
||||
?>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Name</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<a href="<? echo "wiki_view.php?edit_id=$row[edit_id]"; ?>"><? echo $row[$field_lead.'name']; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Edited on</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo date("F j, Y", $row[edit_timestamp]); ?> by <? echo "<a href=\"http://forum.slowtwitch.com/gforum.cgi?username=".$editor_user_username.";\" target=\"_blank\">".$editor_user_username."</a>"; if ($boolEditorIsOwner) { echo " (original ".$local_singular_lc." submitter)"; } else { echo ""; } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Info</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
if(strlen($row[$field_lead.'info']) > 400){
|
||||
$phrase = "…";
|
||||
}
|
||||
else {
|
||||
$phrase = "";
|
||||
}
|
||||
|
||||
echo substr(htmlspecialchars(strip_tags(stripslashes($row[$field_lead.'info']))), 0, 160)."…";
|
||||
echo $phrase;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Location</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
if(strlen($row[$field_lead.'info']) > 400){
|
||||
$phrase = "…";
|
||||
}
|
||||
else{
|
||||
$phrase = "";
|
||||
}
|
||||
|
||||
echo substr(htmlspecialchars(strip_tags(stripslashes($row[$field_lead.'info']))), 0, 160)."…";
|
||||
echo $phrase;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<input type="checkbox" value="<? echo($row[edit_id]); ?>" name="validate[]"> Validate this edit. <input type="checkbox" value="<? echo($row[edit_id]); ?>" name="delete[]"> Delete this edit.<br /></div></td></tr>
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
</div>
|
||||
|
||||
<div class="btn-wrapper">
|
||||
<input type="submit" value="Process Selected Roadshow Events" class="btn">
|
||||
</div>
|
||||
</form>
|
||||
</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>
|
174
site/roadshow/wiki_validate_X.php
Normal file
174
site/roadshow/wiki_validate_X.php
Normal file
@ -0,0 +1,174 @@
|
||||
<?PHP
|
||||
|
||||
// do I need to do additional security checks to make sure the script is being called appropriately?
|
||||
|
||||
/*
|
||||
|
||||
FIELD NAMES:
|
||||
roadshow_id
|
||||
roadshow_date
|
||||
roadshow_name
|
||||
roadshow_name_tag
|
||||
roadshow_address
|
||||
roadshow_address_two
|
||||
roadshow_city
|
||||
roadshow_state
|
||||
roadshow_state_tag
|
||||
roadshow_zip
|
||||
roadshow_lat
|
||||
roadshow_lng
|
||||
roadshow_phone
|
||||
roadshow_fax
|
||||
roadshow_email
|
||||
roadshow_website
|
||||
roadshow_raffle
|
||||
roadshow_facebook
|
||||
roadshow_stambassador
|
||||
roadshow_stambassador_names
|
||||
roadshow_triclub
|
||||
roadshow_triclub_names
|
||||
roadshow_coach
|
||||
roadshow_coach_names
|
||||
roadshow_racedirector
|
||||
roadshow_racedirector_names
|
||||
roadshow_brewery
|
||||
roadshow_brewery_names
|
||||
roadshow_local
|
||||
roadshow_fitbike
|
||||
roadshow_saddlechange
|
||||
roadshow_motioncapture
|
||||
roadshow_footbed
|
||||
roadshow_wetsuit
|
||||
roadshow_bike
|
||||
roadshow_trispecific
|
||||
roadshow_trispecific_names
|
||||
roadshow_fist
|
||||
roadshow_fist_names
|
||||
roadshow_diagnostic
|
||||
roadshow_shoe
|
||||
roadshow_sock
|
||||
roadshow_apparel_run
|
||||
roadshow_apparel_tri
|
||||
roadshow_swimgear
|
||||
roadshow_bikeaccessory
|
||||
roadshow_bikebody
|
||||
roadshow_bikecomponent
|
||||
roadshow_bikeelectronic
|
||||
roadshow_bikehelmet
|
||||
roadshow_biketrainer
|
||||
roadshow_bikewheel
|
||||
roadshow_runhydrate
|
||||
roadshow_bodycare
|
||||
roadshow_hours
|
||||
roadshow_activity
|
||||
roadshow_submitted_by
|
||||
roadshow_valid
|
||||
roadshow_user_tags
|
||||
|
||||
*/
|
||||
|
||||
include("config.php");
|
||||
|
||||
if (!$_POST){ header('Location: '.$site_url.'/'); }
|
||||
|
||||
// error checking
|
||||
if(!isset($_POST)) exit();
|
||||
|
||||
if (isset($_POST[delete])) {
|
||||
// convert the array to a SQL friendly format
|
||||
$deleteList = "(".implode(",", $_POST[delete]).")";
|
||||
|
||||
// build the SQL query to delete the edits that are bad
|
||||
$sql = "DELETE FROM ".$prefix."RoadshowEdits WHERE edit_id IN $deleteList";
|
||||
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
}
|
||||
|
||||
if (isset($_POST[validate])) {
|
||||
// convert the array to a SQL friendly format
|
||||
$validateList = "(".implode(",", $_POST[validate]).")";
|
||||
|
||||
$sql = "SELECT * FROM ".$prefix."RoadshowEdits WHERE edit_id IN $validateList";
|
||||
|
||||
$results = mysql_query($sql) OR die(mysql_error());
|
||||
|
||||
// Loop through roadshow events shifting edits over
|
||||
while($row = mysql_fetch_array($results)) {
|
||||
$sql = "UPDATE ".$prefix."Roadshow
|
||||
SET
|
||||
roadshow_date = '".mysql_escape_string($row[roadshow_date])."',
|
||||
roadshow_name = '".mysql_escape_string($row[roadshow_name])."',
|
||||
roadshow_name_tag = '".mysql_escape_string($row[roadshow_name_tag])."',
|
||||
roadshow_address = '".mysql_escape_string($row[roadshow_address])."',
|
||||
roadshow_address_two = '".mysql_escape_string($row[roadshow_address_two])."',
|
||||
roadshow_city = '".mysql_escape_string($row[roadshow_city])."',
|
||||
roadshow_state = '".mysql_escape_string($row[roadshow_state])."',
|
||||
roadshow_state_tag = '".mysql_escape_string($row[roadshow_state_tag])."',
|
||||
roadshow_zip = '".mysql_escape_string($row[roadshow_zip])."',
|
||||
roadshow_lat = '".mysql_escape_string($row[roadshow_lat])."',
|
||||
roadshow_lng = '".mysql_escape_string($row[roadshow_lng])."',
|
||||
roadshow_phone = '".mysql_escape_string($row[roadshow_phone])."',
|
||||
roadshow_fax = '".mysql_escape_string($row[roadshow_fax])."',
|
||||
roadshow_email = '".mysql_escape_string($row[roadshow_email])."',
|
||||
roadshow_website = '".mysql_escape_string($row[roadshow_website])."',
|
||||
roadshow_raffle = '".mysql_escape_string($row[roadshow_raffle])."',
|
||||
roadshow_facebook = '".mysql_escape_string($row[roadshow_facebook])."',
|
||||
roadshow_stambassador = '".mysql_escape_string($row[roadshow_stambassador])."',
|
||||
roadshow_stambassador_names = '".mysql_escape_string($row[roadshow_stambassador_names])."',
|
||||
roadshow_triclub = '".mysql_escape_string($row[roadshow_triclub])."',
|
||||
roadshow_triclub_names = '".mysql_escape_string($row[roadshow_triclub_names])."',
|
||||
roadshow_coach = '".mysql_escape_string($row[roadshow_coach])."',
|
||||
roadshow_coach_names = '".mysql_escape_string($row[roadshow_coach_names])."',
|
||||
roadshow_racedirector = '".mysql_escape_string($row[roadshow_racedirector])."',
|
||||
roadshow_racedirector_names = '".mysql_escape_string($row[roadshow_racedirector_names])."',
|
||||
roadshow_brewery = '".mysql_escape_string($row[roadshow_brewery])."',
|
||||
roadshow_brewery_names = '".mysql_escape_string($row[roadshow_brewery_names])."',
|
||||
roadshow_local = '".mysql_escape_string($row[roadshow_local])."',
|
||||
roadshow_fitbike = '".mysql_escape_string($row[roadshow_fitbike])."',
|
||||
roadshow_saddlechange = '".mysql_escape_string($row[roadshow_saddlechange])."',
|
||||
roadshow_motioncapture = '".mysql_escape_string($row[roadshow_motioncapture])."',
|
||||
roadshow_footbed = '".mysql_escape_string($row[roadshow_footbed])."',
|
||||
roadshow_wetsuit = '".mysql_escape_string($row[roadshow_wetsuit])."',
|
||||
roadshow_bike = '".mysql_escape_string($row[roadshow_bike])."',
|
||||
roadshow_trispecific = '".mysql_escape_string($row[roadshow_trispecific])."',
|
||||
roadshow_trispecific_names = '".mysql_escape_string($row[roadshow_trispecific_names])."',
|
||||
roadshow_fist = '".mysql_escape_string($row[roadshow_fist])."',
|
||||
roadshow_fist_names = '".mysql_escape_string($row[roadshow_fist_names])."',
|
||||
roadshow_diagnostic = '".mysql_escape_string($row[roadshow_diagnostic])."',
|
||||
roadshow_shoe = '".mysql_escape_string($row[roadshow_shoe])."',
|
||||
roadshow_sock = '".mysql_escape_string($row[roadshow_sock])."',
|
||||
roadshow_apparel_run = '".mysql_escape_string($row[roadshow_apparel_run])."',
|
||||
roadshow_apparel_tri = '".mysql_escape_string($row[roadshow_apparel_tri])."',
|
||||
roadshow_swimgear = '".mysql_escape_string($row[roadshow_swimgear])."',
|
||||
roadshow_bikeaccessory = '".mysql_escape_string($row[roadshow_bikeaccessory])."',
|
||||
roadshow_bikebody = '".mysql_escape_string($row[roadshow_bikebody])."',
|
||||
roadshow_bikecomponent = '".mysql_escape_string($row[roadshow_bikecomponent])."',
|
||||
roadshow_bikeelectronic = '".mysql_escape_string($row[roadshow_bikeelectronic])."',
|
||||
roadshow_bikehelmet = '".mysql_escape_string($row[roadshow_bikehelmet])."',
|
||||
roadshow_biketrainer = '".mysql_escape_string($row[roadshow_biketrainer])."',
|
||||
roadshow_bikewheel = '".mysql_escape_string($row[roadshow_bikewheel])."',
|
||||
roadshow_runhydrate = '".mysql_escape_string($row[roadshow_runhydrate])."',
|
||||
roadshow_bodycare = '".mysql_escape_string($row[roadshow_bodycare])."',
|
||||
roadshow_hours = '".mysql_escape_string($row[roadshow_hours])."',
|
||||
roadshow_activity = '".mysql_escape_string($row[roadshow_activity])."',
|
||||
roadshow_submitted_by = '".mysql_escape_string($row[roadshow_submitted_by])."',
|
||||
roadshow_user_tags = '".mysql_escape_string($row[roadshow_user_tags])."'
|
||||
WHERE roadshow_id = '$row[roadshow_id_fk]'";
|
||||
//echo $sql;
|
||||
//exit();
|
||||
mysql_query($sql) OR die(mysql_error());
|
||||
|
||||
$sql = "INSERT INTO ".$prefix."RoadshowEditors (roadshow_id_fk, user_id_fk, edit_timestamp) VALUES ('$row[roadshow_id_fk]', '$row[edit_user_id_fk]', '$row[edit_timestamp]')";
|
||||
mysql_query($sql) OR die(mysql_error());
|
||||
|
||||
$sql = "DELETE FROM ".$prefix."RoadshowEdits WHERE edit_id = $row[edit_id]";
|
||||
mysql_query($sql) OR die(mysql_error());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
header('Location: '.$site_url.'/wiki_validate.php');
|
||||
|
||||
?>
|
867
site/roadshow/wiki_view.php
Normal file
867
site/roadshow/wiki_view.php
Normal file
@ -0,0 +1,867 @@
|
||||
<?PHP
|
||||
|
||||
if (!is_numeric($_GET[edit_id])) { header('Location:'.$site_url.'/?error=invalid_id'); }
|
||||
|
||||
include("config.php");
|
||||
|
||||
// only admins can validate
|
||||
if(!is_admin()) {
|
||||
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."RoadshowEdits 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[$field_lead.'name'];
|
||||
|
||||
// set meta tags
|
||||
$meta_keywords = "triathlon, ".$row[$field_lead.'name'].", ".$row[$field_lead.'state']." roadshow events";
|
||||
$meta_description = "Considering participating in ".$row[$field_lead.'name']."? Here is all of the information about this roadshow event.";
|
||||
?>
|
||||
|
||||
<? 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">
|
||||
<?
|
||||
$sqlWikiFetch = "SELECT user_username FROM ".$prefix."User WHERE user_id = ".mysql_escape_string($row[edit_user_id_fk])." LIMIT 1";
|
||||
|
||||
$arrUser = mysql_fetch_array(mysql_query($sqlWikiFetch));
|
||||
|
||||
$strEditor = $arrUser[user_username];
|
||||
?>
|
||||
|
||||
<div class="dtable form">
|
||||
<div class="drow">
|
||||
<div class="dcell name">Editor</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo "<a href=\"http://forum.slowtwitch.com/gforum.cgi?username=".$strEditor.";\" target=\"_blank\">".$strEditor."</a>"; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Edit Date</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo date("F j, Y", $row[edit_timestamp]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Date</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? // we need to convert the datetime to individual parts //
|
||||
$datetime = new DateTime($row[$field_lead.'date']);
|
||||
?>
|
||||
<? echo $datetime->format('Y-m-d'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Time</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo $datetime->format('g:i A'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Street Address</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo stripslashes(htmlspecialchars($row[$field_lead.'address'])); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Street Address Two</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo stripslashes(htmlspecialchars($row[$field_lead.'address_two'])); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">City</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo stripslashes(htmlspecialchars($row[$field_lead.'city'])); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">State</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo stripslashes(htmlspecialchars($row[$field_lead.'state'])); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Zip/Postal Code</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo stripslashes(htmlspecialchars($row[$field_lead.'zip'])); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Phone</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo stripslashes(htmlspecialchars($row[$field_lead.'phone'])); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Fax/Alt. Phone</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo stripslashes(htmlspecialchars($row[$field_lead.'fax'])); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">E-mail</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<a href="mailto:<? echo $row[$field_lead.'email']; ?>"><? echo stripslashes(htmlspecialchars($row[$field_lead.'email'])); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Website</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
$substring = "http";
|
||||
if (!is_int(strpos($row[$field_lead.'website'], $substring))) {
|
||||
$row[$field_lead.'website'] = "http://".$row[$field_lead.'website'];
|
||||
}
|
||||
$website = $row[$field_lead.'website'];
|
||||
?>
|
||||
<? echo "<a target=\"_blank\" href=\"$website\">$website</a>"; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<h3>Local Assets</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Slowtwitch Ambassador(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? if ($row[$field_lead.'stambassador'] == 0) { echo "None"; } else { echo "Yes, Their Names - "; echo stripslashes($row[$field_lead.'stambassador_names']); } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Tri Club(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? if ($row[$field_lead.'triclub'] == 0) { echo "None"; } else { echo "Yes, Their Names - "; echo stripslashes($row[$field_lead.'triclub_names']); } ?> <br />
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Coach(es)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? if ($row[$field_lead.'coach'] == 0) { echo "None"; } else { echo "Yes, Their Names - "; echo stripslashes($row[$field_lead.'coach_names']); } ?> <br />
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Race Director(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? if ($row[$field_lead.'racedirector'] == 0) { echo "None"; } else { echo "Yes, Their Names - "; echo stripslashes($row[$field_lead.'racedirector_names']); } ?> <br />
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Brewery(ies)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? if ($row[$field_lead.'brewery'] == 0) { echo "None"; } else { echo "Yes, Their Names - "; echo stripslashes($row[$field_lead.'brewery_names']); } ?> <br />
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Other</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? if ($row[$field_lead.'local'] != "") { echo stripslashes(htmlspecialchars($row[$field_lead.'local'])); } else { echo "No other local assets specified."; } ?><br />
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Fitbike(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'fitbike'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Fitbike WHERE fitbike_id IN ($implosion) ORDER BY fitbike_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[fitbike_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Saddle Quick Change</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'saddlechange'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Saddlechange WHERE saddlechange_id IN ($implosion) ORDER BY saddlechange_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[saddlechange_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Motion Capture System(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'motioncapture'];
|
||||
$temp_list = "";
|
||||
if ($implosion) {
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Motioncapture WHERE motioncapture_id IN ($implosion) ORDER BY motioncapture_name ASC");
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[motioncapture_name], ";
|
||||
}
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Custom Footbed(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'footbed'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Customfootbed WHERE footbed_id IN ($implosion) ORDER BY footbed_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[footbed_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<h3>Brands</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Triathlon Apparel</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'apparel_tri'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."ApparelTri WHERE apparel_tri_id IN ($implosion) ORDER BY apparel_tri_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[apparel_tri_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bike'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Bike WHERE bike_id IN ($implosion) ORDER BY bike_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bike_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Saddles/Footwear/Aerobars/Bike Hydration</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikeaccessory'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeAccessory WHERE bikeaccessory_id IN ($implosion) ORDER BY bikeaccessory_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikeaccessory_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Helmets/Eyewear</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikehelmet'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeHelmet WHERE bikehelmet_id IN ($implosion) ORDER BY bikehelmet_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikehelmet_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Nutritionals/Lubricants/Botanicals</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikebody'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeBody WHERE bikebody_id IN ($implosion) ORDER BY bikebody_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikebody_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Stationary Trainer(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'biketrainer'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeTrainer WHERE biketrainer_id IN ($implosion) ORDER BY biketrainer_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[biketrainer_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Electronics/Cameras/Metrics</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikeelectronic'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeElectronic WHERE bikeelectronic_id IN ($implosion) ORDER BY bikeelectronic_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikeelectronic_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Wheels/Tires</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikewheel'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeWheel WHERE bikewheel_id IN ($implosion) ORDER BY bikewheel_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikewheel_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bike Component(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bikecomponent'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."BikeComponent WHERE bikecomponent_id IN ($implosion) ORDER BY bikecomponent_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bikecomponent_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Socks</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'sock'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Sock WHERE sock_id IN ($implosion) ORDER BY sock_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[sock_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Running Shoe(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'shoe'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Shoe WHERE shoe_id IN ($implosion) ORDER BY shoe_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[shoe_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Run Apparel</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'apparel_run'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."ApparelRun WHERE apparel_run_id IN ($implosion) ORDER BY apparel_run_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[apparel_run_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Run Hydration</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'runhydrate'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."RunHydrate WHERE runhydrate_id IN ($implosion) ORDER BY runhydrate_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[runhydrate_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Wetsuit(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'wetsuit'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Wetsuit WHERE wetsuit_id IN ($implosion) ORDER BY wetsuit_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[wetsuit_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Swim Apparel/Gear</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'swimgear'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Swimgear WHERE swimgear_id IN ($implosion) ORDER BY swimgear_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[swimgear_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Bodycare Tools</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'bodycare'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Bodycare WHERE bodycare_id IN ($implosion) ORDER BY bodycare_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[bodycare_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<h3>Technology, Community & Education</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Key Tri-Specific Contact(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? if ($row[$field_lead.'trispecific'] == 0) { echo "None"; } else { echo "Yes, Their Names - "; echo stripslashes($row[$field_lead.'trispecific_names']); } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">F.I.S.T. Tri Fitters(s)</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? if ($row[$field_lead.'fist'] == 0) { echo "None"; } else { echo "Yes, Their Names - "; echo stripslashes($row[$field_lead.'fist_names']); } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Diagnostic Tools</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
|
||||
$implosion = $row[$field_lead.'diagnostic'];
|
||||
|
||||
$sql = ("SELECT * FROM ".$prefix.$resource_table."Diagnostic WHERE diagnostic_id IN ($implosion) ORDER BY diagnostic_name ASC");
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$results = mysql_query($sql) or die(mysql_error());
|
||||
|
||||
$temp_list = "";
|
||||
while ($temp_row = mysql_fetch_array($results)) {
|
||||
$temp_list = $temp_list."$temp_row[diagnostic_name], ";
|
||||
}
|
||||
$temp_list = rtrim($temp_list, ', ');
|
||||
if ($temp_list == "") { $temp_list = "none specified";}
|
||||
|
||||
echo $temp_list;
|
||||
|
||||
$temp_list = "";
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<h3>Social</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Shop Hours</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo stripslashes(htmlspecialchars($row[$field_lead.'hours'])); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow">
|
||||
<div class="dcell name">Runs & Classes</div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<? echo stripslashes(stripslashes($row[$field_lead.'activity'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drow actions">
|
||||
<div class="dcell name"></div>
|
||||
<div class="dcell divider"></div>
|
||||
<div class="dcell value">
|
||||
<?
|
||||
// wiki control buttons
|
||||
include("wiki_buttons.php")
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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>
|
Reference in New Issue
Block a user