CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [Resolved] Hide a panel according to TIme value

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 07/17/2008, 2:39 PM

Small dilemma here.. I ma trying to get events to order by time properly on a calendar.
I have them ordered by event_time ASC which is fine.. but a lot of events don't have a time so that field is left blank.
This messes up the order.
So I thought I would default that field to midnight : 12:00:00 that way those events would never get in front of events that had a start time.
Except that the time 12:00:00 would then show up next to these events.
So.. put the time in a panel.... with the following code on the calendars 'Before Show Event' Event.

$gettime=$calendar_main->EventTime->GetValue();  
if ($gettime == "12:00:00")  
 $calendar_main->Panel1->Visible = False;  
 else  
 $calendar_main->Panel1->Visible = True;

No go.
Whats the trick?

Thanks!
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
mentecky

Posts: 321
Posted: 07/17/2008, 4:21 PM

Hey ckroon!

I haven't been here in a while... bad week.

I have 2 suggestions. First, depending on your DB, 12:00:00 would be noon usually. Midnight is usually 00:00:00, but that would make those items first in the list. You probably want 23:59:59 for defaults to make them last.

Second, in your code try:
$gettime=$calendar_main->EventTime->GetText();    
if (date("H:i:s:", strtotime($gettime)) == "23:59:59")    
 $calendar_main->Panel1->Visible = False;    
 else    
 $calendar_main->Panel1->Visible = True;

There's probably an easier way but I hate dates. :-D

Rick
_________________
http://www.ccselite.com
View profile  Send private message
mbishop1980

Posts: 31
Posted: 07/17/2008, 4:28 PM

Rick,
Would he want to put this in the Before Show Day. I had to do that on a previous post of making panels appear and disappear.

_________________
Thanks,
Eric
View profile  Send private message
mentecky

Posts: 321
Posted: 07/17/2008, 4:33 PM

Quote mbishop1980:
Rick,
Would he want to put this in the Before Show Day. I had to do that on a previous post of making panels appear and disappear.

Yes. Good point. You have to set the value for EVERY day or the first time it goes false it will be hidden for the rest of the calendar.

Rick
_________________
http://www.ccselite.com
View profile  Send private message
ckroon

Posts: 869
Posted: 07/17/2008, 4:45 PM

Bingo!
Thanks to you both!
Smileys all around!

:-D 8-) :*)
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
mentecky

Posts: 321
Posted: 07/17/2008, 5:05 PM

ckroon,

Glad we could help!

Rick
_________________
http://www.ccselite.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.