CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 before update get Weeknum from mysql date?

Print topic Send  topic

Author Message
Chris
Posted: 05/23/2003, 5:53 PM

Ok, I am new to codecharge studio. I am having a heck of time trying to get
this working.

Somehow before the update occurs, I need to use the shootdate (which is a
mysql date) to get the weeknumber.
I did this via dreamweaver and php before but I can't figure out how to do
it or where to put the code for it in codecharge studio.

I have tried setting the variable in before build update
global $schedule;
$schedule->weekend->setvalue(123); //for testing

This produces and error
undefined property at line 32
cannot add header information - headers already sent by
(filename_maint_events.php....)

this is my old code from dreamweaver
$timestamp = strtotime($date);
$hdnWeekNum = strftime("%V", $timestamp);

This doesn't work because codecharge brings the date in kind of strange.
the strtotime is expecting day month year with spaces

thanks for any help



Chris
Posted: 05/23/2003, 7:13 PM

I have some of it figured out but it still doesn't quite work.

Here's my current code
$teststr=$schedule->shootdate->getvalue();
$monthstr = $teststr[2];
$datestr = $teststr[3];
$yearstr = $teststr[1];
$strdate = $monthstr."/".$datestr."/".$yearstr; //mnth/day/year

$timestamp = strtotime($strdate);
$weekend = strftime("%V",$timestamp);
$testdate = strftime("%m/%d/%y",$timestamp);

$schedule->Weekend->setvalue($weekend); // This works now too if I put a
static like (123);


The only one that doesn't produce the expected result is $weekend (which is
the one I need)
I did a echo of $timestamp, $weekend, $testdate
Timestamp = 02/16/2003
weekend =
$testdate =02/16/03

I even updated the version of PHP on my testing pc just to be safe.

Any ideas?

Thx


"Chris" <cgchris99@insightbb.com> wrote in message
news:bamfq8$g0h$1@news.codecharge.com...
> Ok, I am new to codecharge studio. I am having a heck of time trying to
get
> this working.
>
> Somehow before the update occurs, I need to use the shootdate (which is a
> mysql date) to get the weeknumber.
> I did this via dreamweaver and php before but I can't figure out how to do
> it or where to put the code for it in codecharge studio.
>
> I have tried setting the variable in before build update
> global $schedule;
> $schedule->weekend->setvalue(123); //for testing
>
> This produces and error
> undefined property at line 32
> cannot add header information - headers already sent by
> (filename_maint_events.php....)
>
> this is my old code from dreamweaver
> $timestamp = strtotime($date);
> $hdnWeekNum = strftime("%V", $timestamp);
>
> This doesn't work because codecharge brings the date in kind of strange.
> the strtotime is expecting day month year with spaces
>
> thanks for any help
>
>
>
>


   


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

MS Access to Web

Convert MS Access to Web.
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.