CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 PHP manually calc based on other fields?

Print topic Send  topic

Author Message
Chris
Posted: 05/23/2003, 12:56 PM

I have been working through the tutorials.
But my app needs to be PHP.

Here's my problem. I have a date field that I use the date picker on.
I have a label field called Weekend. I need to calculate the Weekend number
for the field called Weekend anytime the date changes.
Prior to CCS I used this code
$timestamp = strtotime($sdate);
$WeekNum = strftime("%V", $timestamp);

Now, using CCS how do I use the date that is in my date field called
shootdate and calculate the weekend number and put it in the display field
called Weekend?

Thanks

Dave Rexel
Posted: 05/23/2003, 1:45 PM

Assume a container (grid/record) named mycontainer
You have your components shootdate and Weekend in mycontainer

Now you could write the following custom code using your previous logic

$timestamp = strtotime($sdate);
$WeekNum = strftime("%V", $timestamp);

AS

Global $mycontainer
$timestamp = strtotime($mycontainer->shootdate->GetValue());
$mycontainer->Weekend->SetValue(strftime("%V", $timestamp));

Inserting this code in the scope of the above variables (eg Before Show
event) should realise your logic

Dave



"Chris" <cgchris99@insightbb.com> wrote in message
news:baludv$b9q$1@news.codecharge.com...
> I have been working through the tutorials.
> But my app needs to be PHP.
>
> Here's my problem. I have a date field that I use the date picker on.
> I have a label field called Weekend. I need to calculate the Weekend
number
> for the field called Weekend anytime the date changes.
> Prior to CCS I used this code
> $timestamp = strtotime($sdate);
> $WeekNum = strftime("%V", $timestamp);
>
> Now, using CCS how do I use the date that is in my date field called
> shootdate and calculate the weekend number and put it in the display field
> called Weekend?
>
> Thanks
>
>


   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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