Location: PHPKode > scripts > Very Simple Events List > very-simple-events-list/index.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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Events</title>
<link rel="stylesheet" href="styles.css" type="text/css">
</head>

<!--
Very Simple Events List v1.01
Copyright (C) 2006  Eric Kittell, hide@address.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

Mar 15, 2006 version 1.01 added minutes, option to hide time, and put events table rendering into external function
-->

<body>
<BR>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="7" align="center" class="highlight">
UPCOMING EVENTS 
</td>
</tr>
<tr><td colspan='7' height='0px'></td></tr>
<?php
include 'config.php';
include 'library/opendb.php';
include 'library/timeFunctions.php';
include 'library/displayFunctions.php';

$query  = "SELECT * FROM events ORDER BY date, time";
$result = mysql_query($query);

while($row = mysql_fetch_assoc($result))
{
	if ($row['date'] >= date('Y-m-d'))
	{
displayEvents($row);
echo "</tr><tr><td colspan='7' height='0px'></td></tr>";
	}
} 


?>
</table>
<BR>
<BR>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="7" align="center" class="highlight">
PAST EVENTS 
</td>
</tr>

<tr><td colspan='7' height='0px'></td></tr>
<?php


$query  = "SELECT * FROM events ORDER BY date DESC, time DESC";
$result = mysql_query($query);

while($row = mysql_fetch_assoc($result))
{
	if ($row['date'] <= date('Y-m-d'))
	{
displayEvents($row);
echo "</tr><tr><td colspan='7' height='0px'></td></tr>";
	}
} 

include 'library/closedb.php';
?>
</table>
</body>
</html>
Return current item: Very Simple Events List