CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Passing System date and time functions in CCS (Please Help!!!!) Resolved

Print topic Send  topic

Author Message
codebang

Posts: 74
Posted: 01/02/2009, 1:40 AM

i have this set of code, which u will see below.i want to do the following and please help me out!!!!.
i want to add the system YEAR automatically instead of changing it every year.
Below u will see what i mean.


function InsertRow()

{

$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this);

if(!$this->InsertAllowed) return false;

// Setting Up the Job Number Value

$job_no="";

$job_no="SUD-09-";

$last_id=0;



$db= new clsDBTCSS();

$qry="Select cnt from job_plan_cnt";



$db->query($qry);

$result=$db->next_record();

if($result){

$last_id=$db->f("cnt");

$last_id=$last_id+1;

}



// Getting the Rig Name

$user_rig_name=$this->rig_name->GetValue(true);

$pos=strpos($user_rig_name,"");

$rig_name=substr($user_rig_name,$pos);

// Forming the Job Number

$job_no="SUD-09-".$rig_name."-".$last_id;

echo "New Job No:".$job_no;

// Updating the Last Id Value

$upd_qry="update job_plan_cnt set cnt=".$last_id;

// echo "New Job No:".$job_no;

$db->query($upd_qry);



// Closing the Database Connection

$db->close();

Ok...

now on the Job no u will notice ""SUD-09"..
This 09 should be automatically programmed to get the system year.

So can anyone help... PLEASE!!!!!

Salah Hafiz Midhat.

View profile  Send private message
damian

Posts: 838
Posted: 01/02/2009, 4:23 AM

// Setting Up the Job Number Value  
$job_no="SUD-".date("y");  

case sensitive.... Y is 4 digit year, y is 2 digit year.....



_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
codebang

Posts: 74
Posted: 01/02/2009, 9:27 AM

Man i dunno how to thank u...

Thank u very much...

U r an amazing person


Thank u very much.

Salah Hafiz.
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.