Jump to content

RussBM

New Members
  • Posts

    1
  • Joined

  • Last visited

RussBM's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. RussBM

    MR

    What I need to do is display those returned events that fall between an open and a close date (between a two-week period for example 2022 08 15 to 2022 08 30) and if they do, I want to show and Register button that takes user to a registration page and if it is not true is show the user a Registration button that is not active that says "Registration Not Open". Right now, if one event is true and the rest are false, it will still return all are open for registration by showing the "Register" button for all returned events. The SQL is supposed to return the EventOpenDate (date event registration open) and EventCloseDate (date event registration is closed) and evaluated each returned event separately and show register button if the date falls between when the registration opens and when it is closed. ''' enter code here <div class="upcomming-events-area off-white ptb100"> <div class="container"> <div class="row"> <div class="col-xs-12"> <h1 class="section-title">Available Sporting Events for Registration <?php /*echo ($_SESSION['usrid'])*/?></h1> </div> <div class="total-upcomming-event col-md-12 col-sm-12 col-xs-12"> <?php // Fetching Upcoming events user has NOT signed up for (all-events.php line 69 - Updated 6/25/2021) $isactive=1; //$uid=$_SESSION['usrid']; $sql = "SELECT EventName, EventLocation, EventStartDate, EventEndDate, EventOpenDate, EventCloseDate, EventImage,id FROM tblevents WHERE NOT EXISTS (SELECT tblbookings.EventId, tblbookings.UserId FROM tblbookings WHERE tblbookings.EventId = tblevents.id AND tblbookings.UserId = $_SESSION[usrid] /*AND tblbookings.bookingtatus = confirmed*/) AND IsActive=:isactive /*AND EventStartOpenDate => now() AND EventCloseDate => now() */ ORDER BY EventOpenDate DESC"; /*ORDER BY EventStartDate ASC "*/ $query = $dbh -> prepare($sql); $query->bindParam(':isactive',$isactive,PDO::PARAM_STR); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); $cnt=1; if($query->rowCount() > 0) { foreach($results as $row) { ?> <div class="single-upcomming shadow-box"> <div class="col-md-4 hidden-sm col-xs-12"> <div class="sue-pic"> <img src="admin/eventimages/<?php echo htmlentities($row->EventImage);?>" alt="<?php echo htmlentities($row->EventName);?>" style="border:#000 1px solid"> </div> <div class="sue-date-time text-center"> <span><?php echo htmlentities($row->EventStartDate);?></span>To <span><?php echo htmlentities($row->EventEndDate);?></span> </div> <div class="sue-date-time text-center"> <span><?php echo htmlentities($row->EventOpenDate);?></span>To <span><?php echo htmlentities($row->EventCloseDate);?></span> </div> </div> <div class="col-md-3 col-sm-5 col-xs-12"> <div class="uc-event-title"> <div class="uc-icon"><i class="zmdi zmdi-globe-alt"></i></div> <a href="#"><?php echo htmlentities($row->EventName);?></a><br> <a href="#"><?php if($row > 1) echo ('Pending'); else echo htmlentities($row->BookingStatus);?></a> </div> </div> <div class="col-md-2 col-sm-3 col-xs-12"> <div class="venu-no"> <p>Location : <?php echo htmlentities($row->EventLocation);?></p> </div> </div> <?php if (($currentDate >= $EventOpenDate) && ($EventCloseDate <= $currentDate)){?> <div class="col-md-3 col-sm-4 col-xs-12"> <div class="upcomming-ticket text-center"> <a href="event-details.php?evntid=<?php echo htmlentities($row->id);?>" class="btn-def bnt-2 small">Registration</a> </div> </div> <?php }else{ ?> <div class="col-md-3 col-sm-4 col-xs-12"> <div class="upcomming-ticket text-center"> <a class="btn-def bnt-2 small">Registration not Open</a> </div> </div> <?php } ?> </div> <?php } } else { ?> <p>No Record Found - (Make sure you are logged in to see the events)</p> <?php } ?> <hr /> </div> </div> </div> </div>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.