CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 RETURN VALUE FOR ALL ROW

Print topic Send  topic

Author Message
popularanky

Posts: 53
Posted: 01/14/2011, 1:37 AM

I have the below php code. All I want is for a Display field to Display "TODAY" if the postDate is equal to CurrentDate but the code is returning "TODAY" on all Row. Even on past date.

Can anyone help me out.

global $employee_transfer1;  
$employee_transfer1->display->SetValue("Today");  
if ($employee_transfer1->postDate->GetValue() == date())   
{  
$employee_transfer1->display->Visible = true;  
}  
else  
{  
$employee_transfer1->display->Visible = false;  
}

_________________
EKERE UBONG UBONG
IT Officer
CognitiveDrive
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 01/17/2011, 9:00 AM

popularanky,
Your code looks good. My next question would be are you sure that your if statement is working properly? You might need to echo out the values to determine if it is working properly. If it is then the next thing to verify is if the controls visible property is working. You might want to set it to a default value of false to make sure it is working properly. Please let us know what happens??
View profile  Send private message
popularanky

Posts: 53
Posted: 01/18/2011, 12:24 AM

Thanks mamboBROWN,

The truth is I don't even know if the control is working. I have made all the display control visible and the parameters are all correct.

I think the IF statement is wrong. Cause it keep returning the value for all rows
_________________
EKERE UBONG UBONG
IT Officer
CognitiveDrive
View profile  Send private message
feha


Posts: 712
Posted: 01/18/2011, 4:25 AM

The problem you have is the dates formats might no be the same ...

not equal ...


_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
damian

Posts: 838
Posted: 01/21/2011, 9:55 PM

change the visible = true/false around and see what output you get.
as feha also suggests check date format is consistently defined in all appropriate places.
_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
popularanky

Posts: 53
Posted: 01/25/2011, 4:30 AM

I have done all that. The Date type is also correct. I just don't know what is happening.
_________________
EKERE UBONG UBONG
IT Officer
CognitiveDrive
View profile  Send private message
damian

Posts: 838
Posted: 01/25/2011, 5:27 AM

hi there - you have done all what?
no one has a silver bullet to solve your problem. the suggestion to recheck your date formats in all areas of the application is particularly valid. date formats are so easy to miss or get wrong.
also change your statement from true to false and/or vice-versa and see if your output changes.
simply saying i have tried all that wont help anyone help you?

_________________
if you found this post useful take the time to help someone else.... :)
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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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