//		case of admins, wo are able to mascarade as other users.
$active_user_id = get_active_user_id();
// array to hold our profile fields
$a = array();
// *******************************************************************
// INITIALIZATION, so to speak
// *******************************************************************
// Basically, if we have a $eid, go ahead an get the data from the database, We might end up
//		replacing that data with data the user is trying to save .. a good baseline, so to speak
if ($eid != '' && $eid != 'new') {
    $event = new Pod('events');
    $event->findRecords('id', -1, "t.id = '{$eid}' and t.vendor = {$active_user_id}");
    $total = $event->getTotalRows();
    if ($total > 0) {
        $event->fetchRecord();
        $a = get_eventfields($event);
    }
    $title = 'Edit Event';
} else {
    $eid = 'new';
    $title = 'New Event';
}
// *******************************************************************
// IS THE USER TRYING TO SAVE THE EVENT???
// *******************************************************************
if ($_POST['submitted'] == "1") {
    $success = false;
    // pull everything off of $_POST into our $a array.
    // we're specifically NOT using $_REQUEST here for a tiny bit of security.
    foreach ($_POST as $key => $value) {
        $a[$key] = htmlspecialchars(stripslashes($value));
include_once 'guide-functions.php';
ao_set_title('Atlanta Bridal Shows, Atlanta Wedding Event, Atlanta Bridal Expos, Atlanta Wedding Trunk Shows');
get_header();
?>
			<div class="post">
				<h2>Bridal Shows and Upcoming Events</h2>
				<p>Browse upcoming Bridal Shows and events happening soon.</p>
<?php 
// get the event list
$e = new Pod('events');
$sqlwhere = "( (approved = 1) AND (date_start >= '" . date("Y-m-d") . "  00:00:00') ) ";
$e->findRecords('t.date_start ASC', -1, $sqlwhere);
if ($e->getTotalRows() > 0) {
    while ($e->fetchRecord()) {
        // get our fields from the POD
        $ae = get_eventfields($e);
        $addr = "{$ae['addr']}, {$ae['city']}, {$ae['stat']} {$ae['zipc']}";
        $nicedate = '<b>' . date("D M j, Y", strtotime($ae['dsta'])) . '</b>';
        if ($ae['dend'] != '0000-00-00 00:00:00' && $ae['dsta'] != $ae['dend']) {
            $nicedate .= ' thru <b>' . date("D M j, Y", strtotime($ae['dend'])) . '</b>';
        }
        echo <<<HEREDOC
\t\t\t<div id="event_{$ae['id']}" class="eventlist_wrap">
\t\t\t\t<div class="eventlist_content">
\t\t\t\t\t<h2 class="eventlist_name">{$ae["name"]}</h2>
\t\t\t\t\t<p class="eventlist_desc">{$ae["desc"]}</p>
\t\t\t\t\t<div class="eventlist_detail">
\t\t\t\t\t\t<div class="eventlist_detailrow">
\t\t\t\t\t\t\t<div class="eventlist_detaillabel">Date(s):</div>
\t\t\t\t\t\t\t<div class="eventlist_detailtext">{$nicedate}</div>
\t\t\t\t\t\t</div>