<?php
require_once("include/includes.php");
$m = new MasterClass;
$events = $m->getEvents();
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <?php
    include('./include/header/header.php');
    ?>
    <title>Upcoming Events</title>
    <meta name="description" content="A list of events both past and present form men, women and families.">
    <meta name="keywords" content="events, upcoming events, events for families, family learning, events for women">
    <meta name="author" content="WebDuckDesigns MN">
    <meta name="robots" content="index,follow">
</head>

<body>
    <?php
    include('./include/header/navigation.php');
    ?>
    <section class="container-fluid inner-banner" style="background-image: url(<?php echo WEBSITE_ADDY; ?>/assets/images/banner.png);">
        <div class="container">
            <div class="row d-flex align-items-center">
                <div class="col-lg-12 col-12 mx-auto d-block">
                    <div class="content">
                        <h3>Lakes LifeCare Center</h3>
                        <h1>Upcoming Events</h1>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="container-fluid custom-website">
        <div class="container">
            <div class="row d-flex align-items-center">
                <div class="col-lg-12 col-12">
                    <h3 class="sec-h3">Upcoming Events</h3>
                    <h2 class="sec-h2 mt-lg-0 mt-2">For Women, Men & Families</h2>
                    <div class="inner-bline cbg-secondary"></div>
                    <?php
                      if($events[0]['Nbr'] != ''){

                        echo '<ul class="inner-listing">';
                        for($y=0;$y<count($events);$y++){

                            echo '<li style="padding: 10px;">';
                            echo '<img src="'.WEBSITE_ADDY.'/images/events/'.$events[$y]['Img'].'" class="listing-img" title="'.$events[$y]['Name'].' Image"/>';
                            echo '<h4>'.$events[$y]['Name'].'</h4>';
                            echo '<p><strong>Start Date:</strong> '.date("m-d-Y",$events[$y]['Start_Date']);
                            if($events[$y]['End_Date'] != '' && $events[$y]['End_Date'] != 0){

                                echo '<br/><strong>End Date:</strong> '.date("m-d-Y",$events[$y]['End_Date']);

                            }
                            echo '</p>';
                            echo '<a href="'.WEBSITE_ADDY.'/event-details.php?Id='.$events[$y]['Nbr'].'" title="'.$events[$y]['Name'].' Details">';
                            echo '<input type="button" class="listing-btn" value="Details"/>';
                            echo '</a>'; 
                            echo '</li>';


                        }
                        echo '</ul>';

                      }else{

                        echo '<ul class="inner-listing">';
                        echo '<li style="padding: 10px;">';
                        echo '<p>There are no events to list at this time.</p>';
                        echo '</li>';
                        echo '</ul>';


                      } 
                    ?>
                </div>
            </div>
        </div>
    </section>
    <?php
    include('./include/footer/footer.php');
    ?>