event signup date equal to or greater than now, otherwise do not show event signup

5 posts by 2 authors in: Forums > CMS Builder
Last Post: June 17, 2015   (RSS)

By Mikey - June 14, 2015

In response to: [url "http://www.interactivetools.com/forum/forum-posts.php?postNum=2234791#post2234791"]removeDate and mySQL count[/url], ...

I'm trying to show on event signups that have a date equal to or greater than now, but I can't seem to get this figured out. Anyone have any suggestions? Below is my code.

<?php // load records from 'event_signups'
  list($event_signupsRecords, $event_signupsMetaData) = getRecords(array(
    'tableName'   => 'event_signups',
    'loadUploads' => true,
    'where'       => "registrant_user_number = '". $CURRENT_USER['num'] ."' AND reminder_sent = '0'",
//'where' => 'Date > NOW()', // shows only events that have not expired
    'allowSearch' => false,
  ));
?>


<?php foreach ($event_signupsRecords as $record): ?>
<?php /*?><?php if ($record['event_date'] = 'Date > NOW()'): ?><?php */?>
        
<?php //Get the current time and date in SQL format
$currentDate = date('D, M jS, Y g:i:s a'); 
if ($record['event_date'] >= '$currentDate'): ?>
        
<div>        
<h6><?php echo $record['event_name:label'] ?></h6>
<div><?php echo date("D, M jS, Y g:i:s a", strtotime($record['event_date'])) ?></div>
            
<?php if ($record['event_summary']): ?>
<div><?php echo htmlencode($record['event_summary']) ?></div>
<?php endif ?>
</div>
<?php endif ?>
<?php endforeach ?>

By Mikey - June 17, 2015 - edited: June 17, 2015

Correct - events equal to or greater than todays date, including the requirements of the line of code below.

'where' => "registrant_user_number = '". mysql_escape($CURRENT_USER['num']) ."' AND reminder_sent = '0' AND `event_date` >= TIMESTAMP(CURDATE(), '00:00:00')",

Works like a charm! Thanks Dave!

By Dave - June 17, 2015

Ok, great.  So it works? 

Dave Edis - Senior Developer
interactivetools.com

By Mikey - June 17, 2015

Yep - works great.

Thanks for the help with this Dave.

Zick