iSwifter
12-03-2015, 11:52 PM
So the eventstoday shows only one event.
<?php
require_once( "../_inc/glob.php" );
?>
<!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" xml:lang="en">
<head>
<title>radiPanel Events Timetable</title>
<style type="text/css" media="screen">
form {
padding: 0;
margin: 0;
}
.wrappereventstoday {
background-color: #fcfcfc;
width: 450px;
margin: auto;
padding: 5px;
margin-top: 15px;
}
.contents {
padding: 5px;
}
.good, .bad {
padding: 5px;
margin-bottom: 5px;
}
.good strong, .bad strong {
font-size: 14px;
font-weight: bold;
}
.good {
background-color: #d9ffcf;
border-color: #ade5a3;
color: #1b801b;
}
.bad {
border-radius: 3px;
color: #FFF;
text-shadow: #AC4131 1px 1px;
margin-top: 10px;
background: #e66c6c;
padding: 5px;
height: auto;
border: solid 1px #c05b5b;
border-bottom: solid 2px #c05b5b;
font-family: Tahoma, Geneva, sans-serif;
font-size: 11px;
width: 97%;
body,td,th {
font-family: Tahoma, Geneva, sans-serif;
color: #616161;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
body,td,th {
font-family: Tahoma, Geneva, sans-serif;
font-size: 11px;
color: #616161;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<img src="img/alts/eventssmall.gif" align="right" />
Below is the events timetable. Here, it displays the events that will be taking place today! This timetable is automatically updated, so you will always know when your favourite event is on!<br />
<div class="eventssmall"></div>
<?php
$today_date = date( 'N' );
$query = $db->query( "SELECT * FROM events WHERE day = '{$today_date}'" );
$num = $db->num( $query );
$events = array();
while( $array = $db->assoc( $query ) ) {
$time = strtotime( "{$array['time']} november {$i} 2010" );
$events[$time] = $array['id'];
}
arsort( $events );
?>
<?php
if( $num != 0 ) {
?>
<style type="text/css">
body,td,th {
font-family: Tahoma, Geneva, sans-serif;
font-size: 11px;
color: #616161;
}
</style>
<table width="100%" cellpadding="3" cellspacing="1">
<tr style="background: #e9e9e9; font-weight: bold;">
<td width="40%">
Event Name
</td>
<td width="25%">
Host
</td>
<td width="20%">
Hotel
</td>
<td width="15%">
Time
</td>
</tr>
<?php
foreach( $events as $key => $value ) {
$query2 = $db->query( "SELECT * FROM events WHERE id = '{$value}'" );
$array2 = $db->assoc( $query2 );
?>
<tr style="background: #f3f3f3;">
<td width="40%">
<?php
echo $array2['name'];
?>
</td>
<td width="25%">
<?php
echo $array2['host'];
?>
</td>
<td width="20%">
<?php
echo $array2['hotel'];
?>
</td>
<td width="15%">
<?php
echo $array2['time'];
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
} else {
echo "<div class=bad>";
echo "<center>";
echo "<b>";
echo "Sorry";
echo "</b>";
echo "</br>";
echo "There are no events for today!";
echo "</center>";
echo "</div>";
}
?>
</div>
<a href="#?events-week" onclick="javascript:ajaxpage('../panel/_frontend/events.php', 'content');" style="margin: 5px 0 0 0; float: right;">Full Events Timetable »</a>
</body>
</html>
<?php
require_once( "../_inc/glob.php" );
?>
<!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" xml:lang="en">
<head>
<title>radiPanel Events Timetable</title>
<style type="text/css" media="screen">
form {
padding: 0;
margin: 0;
}
.wrappereventstoday {
background-color: #fcfcfc;
width: 450px;
margin: auto;
padding: 5px;
margin-top: 15px;
}
.contents {
padding: 5px;
}
.good, .bad {
padding: 5px;
margin-bottom: 5px;
}
.good strong, .bad strong {
font-size: 14px;
font-weight: bold;
}
.good {
background-color: #d9ffcf;
border-color: #ade5a3;
color: #1b801b;
}
.bad {
border-radius: 3px;
color: #FFF;
text-shadow: #AC4131 1px 1px;
margin-top: 10px;
background: #e66c6c;
padding: 5px;
height: auto;
border: solid 1px #c05b5b;
border-bottom: solid 2px #c05b5b;
font-family: Tahoma, Geneva, sans-serif;
font-size: 11px;
width: 97%;
body,td,th {
font-family: Tahoma, Geneva, sans-serif;
color: #616161;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
body,td,th {
font-family: Tahoma, Geneva, sans-serif;
font-size: 11px;
color: #616161;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<img src="img/alts/eventssmall.gif" align="right" />
Below is the events timetable. Here, it displays the events that will be taking place today! This timetable is automatically updated, so you will always know when your favourite event is on!<br />
<div class="eventssmall"></div>
<?php
$today_date = date( 'N' );
$query = $db->query( "SELECT * FROM events WHERE day = '{$today_date}'" );
$num = $db->num( $query );
$events = array();
while( $array = $db->assoc( $query ) ) {
$time = strtotime( "{$array['time']} november {$i} 2010" );
$events[$time] = $array['id'];
}
arsort( $events );
?>
<?php
if( $num != 0 ) {
?>
<style type="text/css">
body,td,th {
font-family: Tahoma, Geneva, sans-serif;
font-size: 11px;
color: #616161;
}
</style>
<table width="100%" cellpadding="3" cellspacing="1">
<tr style="background: #e9e9e9; font-weight: bold;">
<td width="40%">
Event Name
</td>
<td width="25%">
Host
</td>
<td width="20%">
Hotel
</td>
<td width="15%">
Time
</td>
</tr>
<?php
foreach( $events as $key => $value ) {
$query2 = $db->query( "SELECT * FROM events WHERE id = '{$value}'" );
$array2 = $db->assoc( $query2 );
?>
<tr style="background: #f3f3f3;">
<td width="40%">
<?php
echo $array2['name'];
?>
</td>
<td width="25%">
<?php
echo $array2['host'];
?>
</td>
<td width="20%">
<?php
echo $array2['hotel'];
?>
</td>
<td width="15%">
<?php
echo $array2['time'];
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
} else {
echo "<div class=bad>";
echo "<center>";
echo "<b>";
echo "Sorry";
echo "</b>";
echo "</br>";
echo "There are no events for today!";
echo "</center>";
echo "</div>";
}
?>
</div>
<a href="#?events-week" onclick="javascript:ajaxpage('../panel/_frontend/events.php', 'content');" style="margin: 5px 0 0 0; float: right;">Full Events Timetable »</a>
</body>
</html>