|
Where is Van?
// ----------------------------------------------
// SHOW ALL EVENTS
// ----------------------------------------------
if ($eventid == ""){
// MySQL - Get All Events
$sql = mysql_query("SELECT * FROM schedule ORDER BY startdate DESC");
$num = mysql_num_rows($sql);
$count = 0;
if ($num > 0){
for ($i = 0; $i < $num; $i++){
$id = mysql_result($sql,$i,'id');
$title = mysql_result($sql,$i,'title');
$location = mysql_result($sql,$i,'location');
$city = mysql_result($sql,$i,'city');
$state = mysql_result($sql,$i,'state');
$text = mysql_result($sql,$i,'text');
$website = mysql_result($sql,$i,'website');
$startdate = mysql_result($sql,$i,'startdate');
$enddate = mysql_result($sql,$i,'enddate');
// format website
if($website != '' && strpos("---".$website,"http:") == false && strpos("---".$website,"https:") == false){
$website = "http://".$website;
}
// counts the number of events listed
$count++;
?>
|
// One Day Event
if (date('M j, Y',strtotime($startdate)) == date('M j, Y',strtotime($enddate))) {
?> echo date('M j, Y',strtotime($startdate)); ?>
}
// Multiple Day Event
else {
// Takes Place in Same Month
if (date('M,Y',strtotime($startdate)) == date('M,Y',strtotime($enddate))) {
?> echo date('M j',strtotime($startdate)); ?> - echo date('j, Y',strtotime($enddate)); ?>
}
else {
?> echo date('M j, Y',strtotime($startdate)); ?> - echo date('M j, Y',strtotime($enddate)); ?>
}
}
// Show Event Time
if(date('H',strtotime($startdate)) != "00" && date('H',strtotime($enddate)) != "00"){
?>
echo date('g:i a',strtotime($startdate)); ?> - echo date('g:i a',strtotime($enddate)); ?>
}
?>
|
if($title != "") { ?>
echo $title; ?>
} ?>
if($text != "" && $text != " ") { ?>
echo $text; ?>
} ?>
|
if($location != "") { ?>
echo $location; ?>
} ?>
if($city != "" && $state != "") { ?>
echo $city.", ".$state; ?>
} else { ?>
if ($city != "") { ?>
echo $city; ?>
} ?>
if ($state != "") { ?>
echo $state; ?>
} ?>
} ?>
|
if ($website != ""){ ?>
event link
} else { ?>
} ?>
|
}
}
// Show if no events were listed
if ($count == 0) {
echo '
----------- There are currently no Upcoming Events to display -----------
| ';
}
}
// ----------------------------------------------
// INDIVIDUAL EVENT
// ----------------------------------------------
else {
// MySQL - Get Individual Event
$sql = mysql_query("SELECT * FROM schedule WHERE id='$eventid'");
$num = mysql_num_rows($sql);
if ($num > 0){
// Get Event Information
$id = mysql_result($sql,0,'id');
$title = mysql_result($sql,0,'title');
$location = mysql_result($sql,0,'location');
$city = mysql_result($sql,0,'city');
$state = mysql_result($sql,0,'state');
$text = mysql_result($sql,0,'text');
$website = mysql_result($sql,0,'website');
$startdate = mysql_result($sql,0,'startdate');
$enddate = mysql_result($sql,0,'enddate');
// format website
if($website != '' && strpos("---".$website,"http:") == false && strpos("---".$website,"https:") == false){
$website = "http://".$website;
}
?>
|
// One Day Event
if (date('M j, Y',strtotime($startdate)) == date('M j, Y',strtotime($enddate))) {
?> echo date('M j, Y',strtotime($startdate)); ?>
}
// Multiple Day Event
else {
// Takes Place in Same Month
if (date('M,Y',strtotime($startdate)) == date('M,Y',strtotime($enddate))) {
?> echo date('M j',strtotime($startdate)); ?> - echo date('j, Y',strtotime($enddate)); ?>
}
else {
?> echo date('M j, Y',strtotime($startdate)); ?> - echo date('M j, Y',strtotime($enddate)); ?>
}
}
// Show Event Time
if(date('H',strtotime($startdate)) != "00" && date('H',strtotime($enddate)) != "00"){
?>
echo date('g:i a',strtotime($startdate)); ?> - echo date('g:i a',strtotime($enddate)); ?>
}
?>
|
if($title != "") { ?>
echo $title; ?>
} ?>
if($text != "" && $text != " ") { ?>
echo $text; ?>
} ?>
|
if($location != "") { ?>
echo $location; ?>
} ?>
if($city != "" && $state != "") { ?>
echo $city.", ".$state; ?>
} else { ?>
if ($city != "") { ?>
echo $city; ?>
} ?>
if ($state != "") { ?>
echo $state; ?>
} ?>
} ?>
|
if ($website != ""){ ?>
event link
} else { ?>
} ?>
|
}
}
?>
// Link back to All Events
if ($eventid != ""){
?>
« Back to Events
}
?>
|
|