close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Show Hide Advice Sought (not urgent)

Thread began 8/24/2010 10:48 am by neilo | Last modified 8/25/2010 6:33 am by Jason Byrnes | 1197 views | 3 replies |

neilo

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.

Attached Files
gigs_incl.php.txt
Sign in to reply to this post

Jason ByrnesWebAssist

Most likely the value in the database is empty and not 00:00:00.

try using this for the if statement instead:
if ("".$row_calendar['event_time'] ."" != "") { // WebAssist Show If

Sign in to reply to this post

neilo

Jason, once again, many thanks. Your time and skills very much appreciated indeed.

Sign in to reply to this post

Jason ByrnesWebAssist

You're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...