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

 Adding 7 days to a Dlookup date

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 08/20/2007, 6:34 PM

I have a cool function compares two date fields and decides which one to put in the component:

$Component->SetValue( $Container->date_fallisma2->GetValue());

if ($Container->school_enr_date2->GetValue() < $Container->date_fallisma2->GetValue())
$Component->SetValue( $Container->date_fallisma2->GetValue());

if ($Container->school_enr_date2->GetValue() > $Container->date_fallisma2->GetValue())
$Component->SetValue( $Container->school_enr_date2->GetValue());

What I need is for it to add 7 days to the value school_enr_date ( The school just adopted a policy that after a student enrolls, they are not "officialy" enrolled until 7 days has passed.

The part of code where school_enr_date is prepped in a Dlookup here:


global $DBConnection1;
$Page = CCGetParentPage($sender);
$ccs_result = CCDLookUp('school_enr_date', 'classlist', "student_id=". CCGetFromGet("stud_id",0), $Page->Connections["Connection1"]);
$ccs_result = CCParseDate($ccs_result, array("yyyy", "-", "mm", "-", "dd"));
$Container->school_enr_date2->SetValue($ccs_result);


Where and how do I add the +7 days? I have tried a few things but my syntax is all wrong. I assume it has to happen before the CCParseDate..?




_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
wkempees
Posted: 08/21/2007, 4:09 AM

It's all a matter of 1,2,3
1:
http://forums.codecharge.com/posts.php?post_id=89870&s_keyword=CCDateAdd
2:
http://forums.codecharge.com/posts.php?post_id=89900&s_keyword=CCDateAdd
3:
  
 $Component->SetValue( $Container->date_fallisma2->GetValue());  
  
 if ($Container->school_enr_date2->GetValue() <   
$Container->date_fallisma2->GetValue())  
   $Component->SetValue( $Container->date_fallisma2->GetValue());  
  
 if ($Container->school_enr_date2->GetValue() >   
$Container->date_fallisma2->GetValue())  
    $Component->SetValue( $Container->school_enr_date2->GetValue());  
  
 $Component->SetValue(CCDateAdd( $Component->GetValue(), '+7 days') );  
  

You might want to check if it is not continuously adding 7 days everytime
you go through the form.

Walter

"ckroon" <ckroon@forum.codecharge> schreef in bericht
news:546ca410a8d42a@news.codecharge.com...
>I have a cool function compares two date fields and decides which one to
>put in
> the component:
>
> $Component->SetValue( $Container->date_fallisma2->GetValue());
>
> if ($Container->school_enr_date2->GetValue() <
> $Container->date_fallisma2->GetValue())
> $Component->SetValue( $Container->date_fallisma2->GetValue());
>
> if ($Container->school_enr_date2->GetValue() >
> $Container->date_fallisma2->GetValue())
> $Component->SetValue( $Container->school_enr_date2->GetValue());
>
> What I need is for it to add 7 days to the value school_enr_date ( The
> school
> just adopted a policy that after a student enrolls, they are not
> "officialy"
> enrolled until 7 days has passed.
>
> The part of code where school_enr_date is prepped in a Dlookup here:
>
>
> global $DBConnection1;
> $Page = CCGetParentPage($sender);
> $ccs_result = CCDLookUp('school_enr_date', 'classlist', "student_id=".
> CCGetFromGet("stud_id",0), $Page->Connections["Connection1"]);
> $ccs_result = CCParseDate($ccs_result, array("yyyy", "-", "mm", "-",
> "dd"));
> $Container->school_enr_date2->SetValue($ccs_result);
>
>
> Where and how do I add the +7 days? I have tried a few things but my
> syntax is
> all wrong. I assume it has to happen before the CCParseDate..?
>
>
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>


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.

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.