<?php require_once('Connections/LocalPHP.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_LocalPHP, $LocalPHP);
$query_rs_events = "SELECT * FROM events WHERE event_date >= now() ORDER BY event_date ASC";
$rs_events = mysql_query($query_rs_events, $LocalPHP) or die(mysql_error());
$row_rs_events = mysql_fetch_assoc($rs_events);
$totalRows_rs_events = mysql_num_rows($rs_events);

mysql_select_db($database_LocalPHP, $LocalPHP);
$query_rs_classes = "SELECT * FROM classes ORDER BY class_name ASC";
$rs_classes = mysql_query($query_rs_classes, $LocalPHP) or die(mysql_error());
$row_rs_classes = mysql_fetch_assoc($rs_classes);
$totalRows_rs_classes = mysql_num_rows($rs_classes);
?>
<!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"><!-- InstanceBegin template="/Templates/mygreen_temp_17.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>GreenStart Association - Green Events and Classes</title>
<!-- InstanceEndEditable -->
<link href="mygreen_styles.css" rel="stylesheet" type="text/css" />
<link href="print_styles.css" rel="stylesheet" type="text/css" media="print" />
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>

<body>

<div class="container">
  <div id="logo"><img src="images/butterfly-ovr.gif" width="170" height="150" alt="GreenStart Logo" /></div>
  <div class="header"><!-- end .header --><a name="top" id="top"></a></div>
  <div id="h-navbar"><a href="#">Home</a> | <a href="about_us.html">About Us</a> | <a href="contact_us.html">Contact Us</a></div>
  <!-- InstanceBeginEditable name="SideContent" -->
  <div class="sidebar1"><!-- #BeginLibraryItem "/Library/vertical-nav.lbi" -->
<ul id="MenuBar1" class="MenuBarVertical">
  <li><a href="news.html">Green News</a></li>
  <li><a href="products.php">Green Products</a></li>
  <li><a class="MenuBarItemSubmenu" href="events.php">Green Events</a>
    <ul>
      <li><a href="events.php#calendar">2010 Events Calendar</a></li>
      <li><a href="events.php#classes">2010 Class Schedule</a></li>
    </ul>
  </li>
  <li><a href="travel.html">Green Travel</a></li>
  <li><a href="tips.html">Green Tips</a></li>
</ul>
<!-- #EndLibraryItem --><img src="" alt="" name="Sidebar" width="180" height="150" class="hide4hh" id="Sidebar" />
    <p class="hide4hh">Add caption here.</p>
    <!-- end .sidebar1 -->
  </div>
  <!-- InstanceEndEditable --><!-- InstanceBeginEditable name="MainContent" -->
  <div class="content">
    <h1>Green Events and Classes</h1>
    <table id="calendar"><caption>2010 Events Calendar</caption>
      <tr>
        <th class="w100">Date</th>
        <th>Event</th>
        <th>Location</th>
        <th class="cost">Cost</th>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_rs_events['event_date']; ?></td>
          <td><?php echo $row_rs_events['event_name']; ?></td>
          <td><?php echo $row_rs_events['event_location']; ?></td>
          <td class="cost">$<?php echo $row_rs_events['event_cost']; ?></td>
        </tr>
        <?php } while ($row_rs_events = mysql_fetch_assoc($rs_events)); ?>
    </table>
    <p> </p>
    
    <p class="ctr"><a href="#top">Return to top</a></p>
    <table id="classes"><caption>2010 Class Schedule</caption>
      <tr>
        <th class="w150">Class</th>
        <th>Description</th>
        <th class="length">Length</th>
        <th class="day">Day</th>
        <th class="cost">Cost</th>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_rs_classes['class_name']; ?></td>
          <td><?php echo $row_rs_classes['class_desc']; ?></td>
          <td class="length"><?php echo $row_rs_classes['class_length']; ?></td>
          <td class="day"><?php echo $row_rs_classes['class_day']; ?></td>
          <td class="cost">$<?php echo $row_rs_classes['class_cost']; ?></td>
        </tr>
        <?php } while ($row_rs_classes = mysql_fetch_assoc($rs_classes)); ?>
    </table>
    <p class="ctr"><a href="#top">Return to top </a>    <!-- end .content -->  </p>
  </div>
  <!-- InstanceEndEditable -->
  <div class="footer">
    <p>Copyright 2010 Meridien GreenStart, All rights reserved.</p>
    <!-- end .footer --></div>
<!-- end .container --></div>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($rs_events);

mysql_free_result($rs_classes);
?>
