<div class="event-content">
                                                <div class="content-dropcap">
                                                    <h3>Event Details</h3>
                                                    <?php 
echo $eventObj->description;
?>
                                                </div>
                                               
                                                <div class="event-cta"> </div>
                                                <div class="related-event ">
                                                    <h3>Other Events</h3>
                                                    <div class="ev-content">
                                                        <div class="row">
                                                            <?php 
$otherEventObj = new Event($dbObj);
foreach ($otherEventObj->fetchRaw("*", " id != {$eventObj->id} AND status =1 ", " RAND() LIMIT 2 ") as $otherEvent) {
    $eventData = array('id' => 'id', 'name' => 'name', 'image' => 'image', 'description' => 'description', 'location' => 'location', 'dateTime' => 'date_time', 'status' => 'status');
    foreach ($eventData as $key => $value) {
        switch ($key) {
            case 'image':
                $otherEventObj->{$key} = MEDIA_FILES_PATH1 . 'event/' . $otherEvent[$value];
                break;
            default:
                $otherEventObj->{$key} = $otherEvent[$value];
                break;
        }
    }
    ?>
                                                            <div class="col-md-6 col-sm-6 related-item">
                                                                <div class="thumb">
                                                                    <a href="<?php 
                        <div class="clearfix"></div>
                            
                    </div>
                    <?php 
}
?>
                </div>
            </div>
        </div>
        <div id="advanced-recent-posts-2" class=" col-md-12  widget advanced_recent_posts_widget">
            <div class=" widget-inner">
                <div class="uni-lastest">
                    <h2 class="widget-title maincolor2">Upcoming Events</h2>
                    <?php 
$sideEventObj = new Event($dbObj);
foreach ($sideEventObj->fetchRaw("*", " NOW() <= date_time AND status = 1 ", " RAND() LIMIT 4 ") as $sideEvent) {
    $dateTimeObj = explode(' ', $sideEvent['date_time']);
    $dateParam = explode('/', $dateTimeObj[0]);
    $dateObj = DateTime::createFromFormat('!m', $dateParam[1]);
    $sideEvent['date_time'] = '<i class="fa fa-calendar"></i> ' . $dateParam[2] . ' ' . substr($dateObj->format('F'), 0, 3) . ', ' . $dateParam[0] . '. <br/><i class="fa fa-clock-o"></i> ' . $dateTimeObj[1];
    ?>
                    <div class="item">
                        <div class="thumb item-thumbnail">
                            <a href="<?php 
    echo SITE_URL;
    ?>
event/<?php 
    echo $sideEvent['id'] . '/' . StringManipulator::slugify($sideEvent['name']);
    ?>
/" title="<?php 
    echo $sideEvent['name'];
            </div>
            <!--/page-heading-->

            <?php 
include 'includes/sidebar-top.php';
?>
            <!--/Top sidebar-->    
            <div id="body" >
                <div class="container">
                    <div class="content-pad-3x">
                        <div class="row">
                            <div id="content" class="col-md-12">
                                <div class="project-listing">
                                    <div class="row">
                                        <?php 
foreach ($eventObj->fetchRaw("*", " status = 1 AND date_time >= NOW() ", " RAND() ") as $event) {
    $eventData = array('id' => 'id', 'name' => 'name', 'image' => 'image', 'description' => 'description', 'location' => 'location', 'dateTime' => 'date_time');
    foreach ($eventData as $key => $value) {
        switch ($key) {
            case 'image':
                $eventObj->{$key} = MEDIA_FILES_PATH1 . 'event/' . $event[$value];
                break;
            default:
                $eventObj->{$key} = $event[$value];
                break;
        }
    }
    ?>
                                        <div class="col-md-3">
                                            <div class="project-item main-color-1-bg-hover project-item-1600">
                                                    <div class="item-thumbnail dark-div">
Example #4
0
//Set up page as a web page
$thisPage = new WebPage();
//Create new instance of webPage class
$dbObj = new Database();
//Instantiate database
$thisPage->dbObj = $dbObj;
$courseObj = new Course($dbObj);
$categoryObj = new CourseCategory($dbObj);
$eventObj = new Event($dbObj);
$quoteObj = new Quote($dbObj);
$eventTime = '';
include 'includes/other-settings.php';
require 'includes/page-properties.php';
//get the course id; if failed redirect to course-categories page
$thisEventId = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT) ? filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT) : $thisPage->redirectTo('index');
foreach ($eventObj->fetchRaw("*", " id = {$thisEventId} ") as $event) {
    $eventData = array('id' => 'id', 'name' => 'name', 'image' => 'image', 'description' => 'description', 'location' => 'location', 'dateTime' => 'date_time', 'status' => 'status');
    foreach ($eventData as $key => $value) {
        switch ($key) {
            case 'image':
                $eventObj->{$key} = MEDIA_FILES_PATH1 . 'event/' . $event[$value];
                break;
            case 'status':
                if ($event[$value] == 0) {
                    $thisPage->redirectTo('index');
                }
                break;
            case 'dateTime':
                $dateTimeParam = explode(' ', $event[$value]);
                $eventTime = $dateTimeParam[1];
                $dateParam = explode('/', $dateTimeParam[0]);