CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Color Changes and Date issues in PHP

Print topic Send  topic

Author Message
marcwolf


Posts: 361
Posted: 09/19/2005, 4:06 PM

I am trying to adapt and example in the CCS Componets book without much luck and I am hoping that someone can give me some pointer as to what I am doing wrong.

I have 2 hidden files and a label.

One of the hidden fields contains the Priority Code
The other hidden field contains a date

the label will contain the date but colored depending on what the priority setting is.

In the event_date_beforeshow I have the following code

        global $gbrfs_events;  
  
	global $test1;  
	global $test2;  
  
                    // get the date value  
	$test2 = $gbrfs_events->event_date->GetValue();  
  
                  /// check the priority value and color code the output  
	if ($gbrfs_events->priority->GetValue() == 39)  
	{ $test1 = "<font color=RED>".$test2."</font>";}  
  
   	if ($gbrfs_events->priority->GetValue() == 38)  
	{ $test1 = "<font color=YELLOW>".$test2."</font>";}  
  
   	if ($gbrfs_events->priority->GetValue() == 37)  
	{ $test1 = "<font color=GREEN>".$test2."</font>";}  
  
	 if ($gbrfs_events->priority->GetValue() == 36)  
	{ $test1 = "<font color=BLUE>".$test2."</font>";}  
  
// put the result into a HTML label  
 $gbrfs_events->lblDate->SetValue($test1);  
  

Now - it does seem to be changing the color but instead of the date value I get the word..

'Array''

I am really puzzled at this unless PHP is somehow determin that the date value is infact and array. But using Join() does not work.

Any suggestions. Please

Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
View profile  Send private message
feha


Posts: 712
Posted: 09/20/2005, 1:42 AM

why do you use global ?
global $test1;    
	global $test2;    
  
  
try:  
  
        global $gbrfs_events;  
  
	$test1="";  
	$test2="";  
  
                    // get the date value  
	$test2 = $gbrfs_events->event_date->GetValue();  
  
                  /// check the priority value and color code the output  
	if ($gbrfs_events->priority->GetValue() == 39)  
	{ $test1 = "<font color=RED>".$test2."</font>";}  
  
   	elseif ($gbrfs_events->priority->GetValue() == 38)  
	{ $test1 = "<font color=YELLOW>".$test2."</font>";}  
  
   	elseif ($gbrfs_events->priority->GetValue() == 37)  
	{ $test1 = "<font color=GREEN>".$test2."</font>";}  
  
	 elseif ($gbrfs_events->priority->GetValue() == 36)  
	{ $test1 = "<font color=BLUE>".$test2."</font>";}  
	else  
	{ $test1 = "<font color=BLACK>".$test2."</font>";}  
  
// put the result into a HTML label  
 $gbrfs_events->lblDate->SetValue($test1);  
btw what is date format you are reading of ?
_________________
Regards
feha

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


Posts: 361
Posted: 09/21/2005, 4:55 PM

I'm not sure of the 'Date Format' except that any date formats give the same, even then the date format is blank.

I think I have worked out that the Date in CCS/PHP is an array, but I am stumped on how to convert this to a string.

I am a little unsure of the type conversion within PHP esp when dealing the the date object within CCS.

This issue has been driving me crasy for a few night now and I desperately need a solution as it is holding up a project.


If anyone else can help

I need to change the color of a label that has been assigned a Date.

Many thanks

Dave

_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
View profile  Send private message
aradi

Posts: 66
Posted: 09/22/2005, 9:45 AM

Hi,

Have you tried changing the Date label type as Text in the property-data?
I assumed you have the type as Date.
try changing the label property of 'event_date' :
data type=Text
Content = HTML

Regards
View profile  Send private message
feha


Posts: 712
Posted: 09/23/2005, 1:08 PM

I really don't understand how do you get that array ?

Check for date functions here:
http://se2.php.net/manual/en/function.date.php
You might find some solution.
_________________
Regards
feha

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


Posts: 361
Posted: 09/25/2005, 9:15 PM

The array seems to be what CCS calleds a Date object.

Anyway - I have solven this another was by putting a lbel befpore the date field and using that to change the color of the date entry.

Many thanks for your help folks
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
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.