Show Hide Advice Sought (not urgent)
Hello,
I have a recordset which fetches values from a db, one field of which is 'eventTime' , there is a div (gigTime) which displays the time:
<div class="gigTime" id="GigTime"><?php echo date('g:ia',strtotime($row_calendar['event_time'])); ?></div>
In the database, the time function displays (for example) 09:44:00 - but I have set it to show (for example) 9:44pm.
All is fine, but if no time is entered into the record (i.e. if it is an all-day event) then the time of the gig is shown as 12.00am (or 00:00:00).
So I want to be able to show/hide the div gigTime depending on the eventTime value, i.e. IF the time as returned by the query equals 00:00:00 or 12.00am, then the div should be hidden (and if it doesn't equal 00:00:00 or 12.00am, then it is shown).
I have tried sorting this with the WebAssist 'Show if' server behavior:
<?php
if ("".$row_calendar['event_time'] ."" != "00:00:00") { // WebAssist Show If
?>
<div class="gigTime" id="gigTime"><?php echo date('g:ia',strtotime($row_calendar['event_time'])); ?></div>
<?php
} // ("".$row_calendar['event_time'] ."" != "00:00:00")
?>
I have aslo tried it with 12.00am, and with == instead of != but I can't get it to work.
This is where my tag-line pays off. Advice would be appreciated.
Ta.