<?php
//Include Common Files @1-2200A134
define("RelativePath", ".");
define("PathToCurrentPage", "/");
define("FileName", "PR_Deduction_Types.php");
include(RelativePath . "/Common.php");
include(RelativePath . "/Template.php");
include(RelativePath . "/Sorter.php");
include(RelativePath . "/Navigator.php");
include(RelativePath . "/SM_SubMenuControl.php");
//End Include Common Files
class clsRecorddeduction1 { //deduction1 Class @51-88879534
//Variables @51-D6FF3E86
// Public variables
var $ComponentType = "Record";
var $ComponentName;
var $Parent;
var $HTMLFormAction;
var $PressedButton;
var $Errors;
var $ErrorBlock;
var $FormSubmitted;
var $FormEnctype;
var $Visible;
var $IsEmpty;
var $CCSEvents = "";
var $CCSEventResult;
var $RelativePath = "";
var $InsertAllowed = false;
var $UpdateAllowed = false;
var $DeleteAllowed = false;
var $ReadAllowed = false;
var $EditMode = false;
var $ds;
var $DataSource;
var $ValidatingControls;
var $Controls;
var $Attributes;
// Class variables
//End Variables
//Class_Initialize Event @51-E4701E44
function clsRecorddeduction1($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->Visible = true;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record deduction1/Error";
$this->DataSource = new clsdeduction1DataSource($this);
$this->ds = & $this->DataSource;
$this->ReadAllowed = true;
$this->Visible = (CCSecurityAccessCheck("1;2;3") == "success");
if($this->Visible)
{
$this->ReadAllowed = $this->ReadAllowed && CCUserInGroups(CCGetGroupID(), "1;2;3");
$this->InsertAllowed = CCUserInGroups(CCGetGroupID(), "1;3");
$this->UpdateAllowed = CCUserInGroups(CCGetGroupID(), "1;3");
$this->DeleteAllowed = CCUserInGroups(CCGetGroupID(), "2;3");
$this->ComponentName = "deduction1";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$CCSForm = split(":", CCGetFromGet("ccsForm", ""), 2);
if(sizeof($CCSForm) == 1)
$CCSForm[1] = "";
list($FormName, $FormMethod) = $CCSForm;
$this->EditMode = ($FormMethod == "Edit");
$this->FormEnctype = "application/x-www-form-urlencoded";
$this->FormSubmitted = ($FormName == $this->ComponentName);
$Method = $this->FormSubmitted ? ccsPost : ccsGet;
$this->DedId = & new clsControl(ccsTextBox, "DedId", "Ded Id", ccsText, "", CCGetRequestParam("DedId", $Method, NULL), $this);
$this->Descr = & new clsControl(ccsTextBox, "Descr", "Descr", ccsText, "", CCGetRequestParam("Descr", $Method, NULL), $this);
$this->BaseType = & new clsControl(ccsListBox, "BaseType", "Base Type", ccsText, "", CCGetRequestParam("BaseType", $Method, NULL), $this);
$this->BaseType->DSType = dsListOfValues;
$this->BaseType->Values = array(array("A", "Deduction Amount"), array("G", "Gross"), array("S", "Std Earning"));
$this->DedType = & new clsControl(ccsListBox, "DedType", "Ded Type", ccsText, "", CCGetRequestParam("DedType", $Method, NULL), $this);
$this->DedType->DSType = dsListOfValues;
$this->DedType->Values = array(array("P", "Pension"), array("S", "State"), array("L", "Local"), array("O", "Other"));
$this->CalcMthd = & new clsControl(ccsListBox, "CalcMthd", "Calc Mthd", ccsText, "", CCGetRequestParam("CalcMthd", $Method, NULL), $this);
$this->CalcMthd->DSType = dsListOfValues;
$this->CalcMthd->Values = array(array("A", "Fixed Amount"), array("P", "Fixed Percentage"), array("R", "Fixed Rate"), array("T", "Rate Table"));
$this->VendId = & new clsControl(ccsListBox, "VendId", "Vend Id", ccsText, "", CCGetRequestParam("VendId", $Method, NULL), $this);
$this->VendId->DSType = dsTable;
$this->VendId->DataSource = new clsDBCoopWorksConn();
$this->VendId->ds = & $this->VendId->DataSource;
$this->VendId->DataSource->SQL = "SELECT * \n" .
"FROM vendor {SQL_Where} {SQL_OrderBy}";
list($this->VendId->BoundColumn, $this->VendId->TextColumn, $this->VendId->DBFormat) = array("VendId", "Name", "");
$this->VendId->DataSource->Parameters["urlClassID"] = CCGetFromGet("ClassID", NULL);
$this->VendId->DataSource->wp = new clsSQLParameters();
$this->VendId->DataSource->wp->AddParameter("1", "urlClassID", ccsText, "", "", $this->VendId->DataSource->Parameters["urlClassID"], MEMBER, false);
$this->VendId->DataSource->wp->Criterion[1] = $this->VendId->DataSource->wp->Operation(opNotEqual, "ClassID", $this->VendId->DataSource->wp->GetDBValue("1"), $this->VendId->DataSource->ToSQL($this->VendId->DataSource->wp->GetDBValue("1"), ccsText),false);
$this->VendId->DataSource->Where =
$this->VendId->DataSource->wp->Criterion[1];
$this->CalYr = & new clsControl(ccsTextBox, "CalYr", "Cal Yr", ccsText, "", CCGetRequestParam("CalYr", $Method, NULL), $this);
$this->CalYr->Required = true;
$this->WthldAcct = & new clsControl(ccsListBox, "WthldAcct", "Wthld Acct", ccsText, "", CCGetRequestParam("WthldAcct", $Method, NULL), $this);
$this->WthldAcct->DSType = dsProcedure;
$this->WthldAcct->DataSource = new clsDBCoopWorksConn();
$this->WthldAcct->ds = & $this->WthldAcct->DataSource;
list($this->WthldAcct->BoundColumn, $this->WthldAcct->TextColumn, $this->WthldAcct->DBFormat) = array("acct", "description", "");
$this->WthldAcct->DataSource->SQL = "CALL SM_AllAcctList (" . ");";
$this->WthldAcct->Required = true;
$this->FxdPctRate = & new clsControl(ccsTextBox, "FxdPctRate", "Fxd Pct Rate", ccsFloat, "", CCGetRequestParam("FxdPctRate", $Method, NULL), $this);
$this->ExpAcct = & new clsControl(ccsListBox, "ExpAcct", "Exp Acct", ccsText, "", CCGetRequestParam("ExpAcct", $Method, NULL), $this);
$this->ExpAcct->DSType = dsProcedure;
$this->ExpAcct->DataSource = new clsDBCoopWorksConn();
$this->ExpAcct->ds = & $this->ExpAcct->DataSource;
list($this->ExpAcct->BoundColumn, $this->ExpAcct->TextColumn, $this->ExpAcct->DBFormat) = array("acct", "description", "");
$this->ExpAcct->DataSource->SQL = "CALL SM_ExpenseAcctList (" . ");";
$this->ExpAcct->Required = true;
$this->EmpleeDed = & new clsControl(ccsCheckBox, "EmpleeDed", "Emplee Ded", ccsInteger, "", CCGetRequestParam("EmpleeDed", $Method, NULL), $this);
$this->EmpleeDed->CheckedValue = $this->EmpleeDed->GetParsedValue(1);
$this->EmpleeDed->UncheckedValue = $this->EmpleeDed->GetParsedValue(0);
$this->Button_Insert = & new clsButton("Button_Insert", $Method, $this);
$this->Button_Update = & new clsButton("Button_Update", $Method, $this);
$this->Button_Delete = & new clsButton("Button_Delete", $Method, $this);
$this->Button_Cancel = & new clsButton("Button_Cancel", $Method, $this);
}
}
//End Class_Initialize Event
//Initialize Method @51-1C785E24
function Initialize()
{
if(!$this->Visible)
return;
$this->DataSource->Parameters["urlDedId"] = CCGetFromGet("DedId", NULL);
}
//End Initialize Method
//Validate Method @51-15BDB7DB
function Validate()
{
global $CCSLocales;
$Validation = true;
$Where = "";
$Validation = ($this->DedId->Validate() && $Validation);
$Validation = ($this->Descr->Validate() && $Validation);
$Validation = ($this->BaseType->Validate() && $Validation);
$Validation = ($this->DedType->Validate() && $Validation);
$Validation = ($this->CalcMthd->Validate() && $Validation);
$Validation = ($this->VendId->Validate() && $Validation);
$Validation = ($this->CalYr->Validate() && $Validation);
$Validation = ($this->WthldAcct->Validate() && $Validation);
$Validation = ($this->FxdPctRate->Validate() && $Validation);
$Validation = ($this->ExpAcct->Validate() && $Validation);
$Validation = ($this->EmpleeDed->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this);
$Validation = $Validation && ($this->DedId->Errors->Count() == 0);
$Validation = $Validation && ($this->Descr->Errors->Count() == 0);
$Validation = $Validation && ($this->BaseType->Errors->Count() == 0);
$Validation = $Validation && ($this->DedType->Errors->Count() == 0);
$Validation = $Validation && ($this->CalcMthd->Errors->Count() == 0);
$Validation = $Validation && ($this->VendId->Errors->Count() == 0);
$Validation = $Validation && ($this->CalYr->Errors->Count() == 0);
$Validation = $Validation && ($this->WthldAcct->Errors->Count() == 0);
$Validation = $Validation && ($this->FxdPctRate->Errors->Count() == 0);
$Validation = $Validation && ($this->ExpAcct->Errors->Count() == 0);
$Validation = $Validation && ($this->EmpleeDed->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @51-B33A955B
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->DedId->Errors->Count());
$errors = ($errors || $this->Descr->Errors->Count());
$errors = ($errors || $this->BaseType->Errors->Count());
$errors = ($errors || $this->DedType->Errors->Count());
$errors = ($errors || $this->CalcMthd->Errors->Count());
$errors = ($errors || $this->VendId->Errors->Count());
$errors = ($errors || $this->CalYr->Errors->Count());
$errors = ($errors || $this->WthldAcct->Errors->Count());
$errors = ($errors || $this->FxdPctRate->Errors->Count());
$errors = ($errors || $this->ExpAcct->Errors->Count());
$errors = ($errors || $this->EmpleeDed->Errors->Count());
$errors = ($errors || $this->Errors->Count());
$errors = ($errors || $this->DataSource->Errors->Count());
return $errors;
}
//End CheckErrors Method
//MasterDetail @51-ED598703
function SetPrimaryKeys($keyArray)
{
$this->PrimaryKeys = $keyArray;
}
function GetPrimaryKeys()
{
return $this->PrimaryKeys;
}
function GetPrimaryKey($keyName)
{
return $this->PrimaryKeys[$keyName];
}
//End MasterDetail
//Operation Method @51-FD852FF7
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
$this->DataSource->Prepare();
if(!$this->FormSubmitted) {
$this->EditMode = $this->DataSource->AllParametersSet;
return;
}
if($this->FormSubmitted) {
$this->PressedButton = $this->EditMode ? "Button_Update" : "Button_Insert";
if($this->Button_Insert->Pressed) {
$this->PressedButton = "Button_Insert";
} else if($this->Button_Update->Pressed) {
$this->PressedButton = "Button_Update";
} else if($this->Button_Delete->Pressed) {
$this->PressedButton = "Button_Delete";
} else if($this->Button_Cancel->Pressed) {
$this->PressedButton = "Button_Cancel";
}
}
$Redirect = $FileName . "?" . CCGetQueryString("QueryString", array("ccsForm"));
if($this->PressedButton == "Button_Delete" && $this->DeleteAllowed) {
if(!CCGetEvent($this->Button_Delete->CCSEvents, "OnClick", $this->Button_Delete) || !$this->DeleteRow()) {
$Redirect = "";
}
} else if($this->PressedButton == "Button_Cancel") {
$Redirect = $FileName . "?" . CCGetQueryString("QueryString", array("ccsForm", "DedId"));
if(!CCGetEvent($this->Button_Cancel->CCSEvents, "OnClick", $this->Button_Cancel)) {
$Redirect = "";
}
} else if($this->Validate()) {
if($this->PressedButton == "Button_Insert" && $this->InsertAllowed) {
if(!CCGetEvent($this->Button_Insert->CCSEvents, "OnClick", $this->Button_Insert) || !$this->InsertRow()) {
$Redirect = "";
}
} else if($this->PressedButton == "Button_Update" && $this->UpdateAllowed) {
if(!CCGetEvent($this->Button_Update->CCSEvents, "OnClick", $this->Button_Update) || !$this->UpdateRow()) {
$Redirect = "";
}
}
} else {
$Redirect = "";
}
if ($Redirect)
$this->DataSource->close();
}
//End Operation Method
//InsertRow Method @51-E8D2A3D8
function InsertRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this);
if(!$this->InsertAllowed) return false;
$this->DataSource->DedId->SetValue($this->DedId->GetValue(true));
$this->DataSource->Descr->SetValue($this->Descr->GetValue(true));
$this->DataSource->BaseType->SetValue($this->BaseType->GetValue(true));
$this->DataSource->DedType->SetValue($this->DedType->GetValue(true));
$this->DataSource->CalcMthd->SetValue($this->CalcMthd->GetValue(true));
$this->DataSource->VendId->SetValue($this->VendId->GetValue(true));
$this->DataSource->CalYr->SetValue($this->CalYr->GetValue(true));
$this->DataSource->WthldAcct->SetValue($this->WthldAcct->GetValue(true));
$this->DataSource->FxdPctRate->SetValue($this->FxdPctRate->GetValue(true));
$this->DataSource->ExpAcct->SetValue($this->ExpAcct->GetValue(true));
$this->DataSource->EmpleeDed->SetValue($this->EmpleeDed->GetValue(true));
$this->DataSource->Insert();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this);
return (!$this->CheckErrors());
}
//End InsertRow Method
//UpdateRow Method @51-D1062176
function UpdateRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this);
if(!$this->UpdateAllowed) return false;
$this->DataSource->DedId->SetValue($this->DedId->GetValue(true));
$this->DataSource->Descr->SetValue($this->Descr->GetValue(true));
$this->DataSource->BaseType->SetValue($this->BaseType->GetValue(true));
$this->DataSource->DedType->SetValue($this->DedType->GetValue(true));
$this->DataSource->CalcMthd->SetValue($this->CalcMthd->GetValue(true));
$this->DataSource->VendId->SetValue($this->VendId->GetValue(true));
$this->DataSource->CalYr->SetValue($this->CalYr->GetValue(true));
$this->DataSource->WthldAcct->SetValue($this->WthldAcct->GetValue(true));
$this->DataSource->FxdPctRate->SetValue($this->FxdPctRate->GetValue(true));
$this->DataSource->ExpAcct->SetValue($this->ExpAcct->GetValue(true));
$this->DataSource->EmpleeDed->SetValue($this->EmpleeDed->GetValue(true));
$this->DataSource->Update();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this);
return (!$this->CheckErrors());
}
//End UpdateRow Method
//DeleteRow Method @51-299D98C3
function DeleteRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeDelete", $this);
if(!$this->DeleteAllowed) return false;
$this->DataSource->Delete();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterDelete", $this);
return (!$this->CheckErrors());
}
//End DeleteRow Method
//Show Method @51-3F4935C9
function Show()
{
global $CCSUseAmp;
global $Tpl;
global $FileName;
global $CCSLocales;
$Error = "";
if(!$this->Visible)
return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->BaseType->Prepare();
$this->DedType->Prepare();
$this->CalcMthd->Prepare();
$this->VendId->Prepare();
$this->WthldAcct->Prepare();
$this->ExpAcct->Prepare();
$RecordBlock = "Record " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $RecordBlock;
$this->EditMode = $this->EditMode && $this->ReadAllowed;
if($this->EditMode) {
if($this->DataSource->Errors->Count()){
$this->Errors->AddErrors($this->DataSource->Errors);
$this->DataSource->Errors->clear();
}
$this->DataSource->Open();
if($this->DataSource->Errors->Count() == 0 && $this->DataSource->next_record()) {
$this->DataSource->SetValues();
if(!$this->FormSubmitted){
$this->DedId->SetValue($this->DataSource->DedId->GetValue());
$this->Descr->SetValue($this->DataSource->Descr->GetValue());
$this->BaseType->SetValue($this->DataSource->BaseType->GetValue());
$this->DedType->SetValue($this->DataSource->DedType->GetValue());
$this->CalcMthd->SetValue($this->DataSource->CalcMthd->GetValue());
$this->VendId->SetValue($this->DataSource->VendId->GetValue());
$this->CalYr->SetValue($this->DataSource->CalYr->GetValue());
$this->WthldAcct->SetValue($this->DataSource->WthldAcct->GetValue());
$this->FxdPctRate->SetValue($this->DataSource->FxdPctRate->GetValue());
$this->ExpAcct->SetValue($this->DataSource->ExpAcct->GetValue());
$this->EmpleeDed->SetValue($this->DataSource->EmpleeDed->GetValue());
}
} else {
$this->EditMode = false;
}
}
if($this->FormSubmitted || $this->CheckErrors()) {
$Error = "";
$Error = ComposeStrings($Error, $this->DedId->Errors->ToString());
$Error = ComposeStrings($Error, $this->Descr->Errors->ToString());
$Error = ComposeStrings($Error, $this->BaseType->Errors->ToString());
$Error = ComposeStrings($Error, $this->DedType->Errors->ToString());
$Error = ComposeStrings($Error, $this->CalcMthd->Errors->ToString());
$Error = ComposeStrings($Error, $this->VendId->Errors->ToString());
$Error = ComposeStrings($Error, $this->CalYr->Errors->ToString());
$Error = ComposeStrings($Error, $this->WthldAcct->Errors->ToString());
$Error = ComposeStrings($Error, $this->FxdPctRate->Errors->ToString());
$Error = ComposeStrings($Error, $this->ExpAcct->Errors->ToString());
$Error = ComposeStrings($Error, $this->EmpleeDed->Errors->ToString());
$Error = ComposeStrings($Error, $this->Errors->ToString());
$Error = ComposeStrings($Error, $this->DataSource->Errors->ToString());
$Tpl->SetVar("Error", $Error);
$Tpl->Parse("Error", false);
}
$CCSForm = $this->EditMode ? $this->ComponentName . ":" . "Edit" : $this->ComponentName;
$this->HTMLFormAction = $FileName . "?" . CCAddParam(CCGetQueryString("QueryString", ""), "ccsForm", $CCSForm);
$Tpl->SetVar("Action", !$CCSUseAmp ? $this->HTMLFormAction : str_replace("&", "&", $this->HTMLFormAction));
$Tpl->SetVar("HTMLFormName", $this->ComponentName);
$Tpl->SetVar("HTMLFormEnctype", $this->FormEnctype);
$this->Button_Insert->Visible = !$this->EditMode && $this->InsertAllowed;
$this->Button_Update->Visible = $this->EditMode && $this->UpdateAllowed;
$this->Button_Delete->Visible = $this->EditMode && $this->DeleteAllowed;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
$this->Attributes->Show();
if(!$this->Visible) {
$Tpl->block_path = $ParentPath;
return;
}
$this->DedId->Show();
$this->Descr->Show();
$this->BaseType->Show();
$this->DedType->Show();
$this->CalcMthd->Show();
$this->VendId->Show();
$this->CalYr->Show();
$this->WthldAcct->Show();
$this->FxdPctRate->Show();
$this->ExpAcct->Show();
$this->EmpleeDed->Show();
$this->Button_Insert->Show();
$this->Button_Update->Show();
$this->Button_Delete->Show();
$this->Button_Cancel->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
} //End deduction1 Class @51-FCB6E20C
class clsdeduction1DataSource extends clsDBCoopWorksConn { //deduction1DataSource Class @51-8F7BA75A
//DataSource Variables @51-EF7CC2D4
var $Parent = "";
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $InsertParameters;
var $UpdateParameters;
var $DeleteParameters;
var $wp;
var $AllParametersSet;
var $InsertFields = array();
var $UpdateFields = array();
// Datasource fields
var $DedId;
var $Descr;
var $BaseType;
var $DedType;
var $CalcMthd;
var $VendId;
var $CalYr;
var $WthldAcct;
var $FxdPctRate;
var $ExpAcct;
var $EmpleeDed;
//End DataSource Variables
//DataSourceClass_Initialize Event @51-55EB398E
function clsdeduction1DataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Record deduction1/Error";
$this->Initialize();
$this->DedId = new clsField("DedId", ccsText, "");
$this->Descr = new clsField("Descr", ccsText, "");
$this->BaseType = new clsField("BaseType", ccsText, "");
$this->DedType = new clsField("DedType", ccsText, "");
$this->CalcMthd = new clsField("CalcMthd", ccsText, "");
$this->VendId = new clsField("VendId", ccsText, "");
$this->CalYr = new clsField("CalYr", ccsText, "");
$this->WthldAcct = new clsField("WthldAcct", ccsText, "");
$this->FxdPctRate = new clsField("FxdPctRate", ccsFloat, "");
$this->ExpAcct = new clsField("ExpAcct", ccsText, "");
$this->EmpleeDed = new clsField("EmpleeDed", ccsInteger, "");
$this->InsertFields["DedId"] = array("Name" => "DedId", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->InsertFields["Descr"] = array("Name" => "Descr", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->InsertFields["BaseType"] = array("Name" => "BaseType", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->InsertFields["DedType"] = array("Name" => "DedType", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->InsertFields["CalcMthd"] = array("Name" => "CalcMthd", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->InsertFields["VendId"] = array("Name" => "VendId", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->InsertFields["CalYr"] = array("Name" => "CalYr", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->InsertFields["WthldAcct"] = array("Name" => "WthldAcct", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->InsertFields["FxdPctRate"] = array("Name" => "FxdPctRate", "Value" => "", "DataType" => ccsFloat, "OmitIfEmpty" => 1);
$this->InsertFields["ExpAcct"] = array("Name" => "ExpAcct", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->InsertFields["EmpleeDed"] = array("Name" => "EmpleeDed", "Value" => "", "DataType" => ccsInteger);
$this->UpdateFields["DedId"] = array("Name" => "DedId", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->UpdateFields["Descr"] = array("Name" => "Descr", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->UpdateFields["BaseType"] = array("Name" => "BaseType", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->UpdateFields["DedType"] = array("Name" => "DedType", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->UpdateFields["CalcMthd"] = array("Name" => "CalcMthd", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->UpdateFields["VendId"] = array("Name" => "VendId", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->UpdateFields["CalYr"] = array("Name" => "CalYr", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->UpdateFields["WthldAcct"] = array("Name" => "WthldAcct", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->UpdateFields["FxdPctRate"] = array("Name" => "FxdPctRate", "Value" => "", "DataType" => ccsFloat, "OmitIfEmpty" => 1);
$this->UpdateFields["ExpAcct"] = array("Name" => "ExpAcct", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
$this->UpdateFields["EmpleeDed"] = array("Name" => "EmpleeDed", "Value" => "", "DataType" => ccsInteger);
}
//End DataSourceClass_Initialize Event
//Prepare Method @51-6F2306E6
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urlDedId", ccsText, "", "", $this->Parameters["urlDedId"], "", false);
$this->AllParametersSet = $this->wp->AllParamsSet();
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "DedId", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @51-84FB5379
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->SQL = "SELECT * \n\n" .
"FROM deduction {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
$this->PageSize = 1;
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @51-D4B9E1CF
function SetValues()
{
$this->DedId->SetDBValue($this->f("DedId"));
$this->Descr->SetDBValue($this->f("Descr"));
$this->BaseType->SetDBValue($this->f("BaseType"));
$this->DedType->SetDBValue($this->f("DedType"));
$this->CalcMthd->SetDBValue($this->f("CalcMthd"));
$this->VendId->SetDBValue($this->f("VendId"));
$this->CalYr->SetDBValue($this->f("CalYr"));
$this->WthldAcct->SetDBValue($this->f("WthldAcct"));
$this->FxdPctRate->SetDBValue(trim($this->f("FxdPctRate")));
$this->ExpAcct->SetDBValue($this->f("ExpAcct"));
$this->EmpleeDed->SetDBValue(trim($this->f("EmpleeDed")));
}
//End SetValues Method
//Insert Method @51-20848439
function Insert()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent);
$this->InsertFields["DedId"]["Value"] = $this->DedId->GetDBValue(true);
$this->InsertFields["Descr"]["Value"] = $this->Descr->GetDBValue(true);
$this->InsertFields["BaseType"]["Value"] = $this->BaseType->GetDBValue(true);
$this->InsertFields["DedType"]["Value"] = $this->DedType->GetDBValue(true);
$this->InsertFields["CalcMthd"]["Value"] = $this->CalcMthd->GetDBValue(true);
$this->InsertFields["VendId"]["Value"] = $this->VendId->GetDBValue(true);
$this->InsertFields["CalYr"]["Value"] = $this->CalYr->GetDBValue(true);
$this->InsertFields["WthldAcct"]["Value"] = $this->WthldAcct->GetDBValue(true);
$this->InsertFields["FxdPctRate"]["Value"] = $this->FxdPctRate->GetDBValue(true);
$this->InsertFields["ExpAcct"]["Value"] = $this->ExpAcct->GetDBValue(true);
$this->InsertFields["EmpleeDed"]["Value"] = $this->EmpleeDed->GetDBValue(true);
$this->SQL = CCBuildInsert("deduction", $this->InsertFields, $this);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteInsert", $this->Parent);
if($this->Errors->Count() == 0 && $this->CmdExecution) {
$this->query($this->SQL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteInsert", $this->Parent);
}
}
//End Insert Method
//Update Method @51-3B0E1F9B
function Update()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent);
$this->UpdateFields["DedId"]["Value"] = $this->DedId->GetDBValue(true);
$this->UpdateFields["Descr"]["Value"] = $this->Descr->GetDBValue(true);
$this->UpdateFields["BaseType"]["Value"] = $this->BaseType->GetDBValue(true);
$this->UpdateFields["DedType"]["Value"] = $this->DedType->GetDBValue(true);
$this->UpdateFields["CalcMthd"]["Value"] = $this->CalcMthd->GetDBValue(true);
$this->UpdateFields["VendId"]["Value"] = $this->VendId->GetDBValue(true);
$this->UpdateFields["CalYr"]["Value"] = $this->CalYr->GetDBValue(true);
$this->UpdateFields["WthldAcct"]["Value"] = $this->WthldAcct->GetDBValue(true);
$this->UpdateFields["FxdPctRate"]["Value"] = $this->FxdPctRate->GetDBValue(true);
$this->UpdateFields["ExpAcct"]["Value"] = $this->ExpAcct->GetDBValue(true);
$this->UpdateFields["EmpleeDed"]["Value"] = $this->EmpleeDed->GetDBValue(true);
$this->SQL = CCBuildUpdate("deduction", $this->UpdateFields, $this);
$this->SQL = CCBuildSQL($this->SQL, $this->Where, "");
if (!strlen($this->Where) && $this->Errors->Count() == 0)
$this->Errors->addError($CCSLocales->GetText("CCS_CustomOperationError_MissingParameters"));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate", $this->Parent);
if($this->Errors->Count() == 0 && $this->CmdExecution) {
$this->query($this->SQL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteUpdate", $this->Parent);
}
}
//End Update Method
//Delete Method @51-7442D78D
function Delete()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent);
$this->SQL = "DELETE FROM deduction";
$this->SQL = CCBuildSQL($this->SQL, $this->Where, "");
if (!strlen($this->Where) && $this->Errors->Count() == 0)
$this->Errors->addError($CCSLocales->GetText("CCS_CustomOperationError_MissingParameters"));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteDelete", $this->Parent);
if($this->Errors->Count() == 0 && $this->CmdExecution) {
$this->query($this->SQL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteDelete", $this->Parent);
}
}
//End Delete Method
} //End deduction1DataSource Class @51-FCB6E20C
class clsGriddeduction { //deduction class @2-A89778BD
//Variables @2-AC1EDBB9
// Public variables
var $ComponentType = "Grid";
var $ComponentName;
var $Visible;
var $Errors;
var $ErrorBlock;
var $ds;
var $DataSource;
var $PageSize;
var $IsEmpty;
var $ForceIteration = false;
var $HasRecord = false;
var $SorterName = "";
var $SorterDirection = "";
var $PageNumber;
var $RowNumber;
var $ControlsVisible = array();
var $CCSEvents = "";
var $CCSEventResult;
var $RelativePath = "";
var $Attributes;
// Grid Controls
var $StaticControls;
var $RowControls;
//End Variables
//Class_Initialize Event @2-68A02A82
function clsGriddeduction($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "deduction";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid deduction";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clsdeductionDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 100;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("<p>Form: Grid " . $this->ComponentName . "<br>Error: (CCS06) Invalid page size.</p>");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->Visible = (CCSecurityAccessCheck("1;2;3") == "success");
$this->Detail = & new clsControl(ccsLink, "Detail", "Detail", ccsText, "", CCGetRequestParam("Detail", ccsGet, NULL), $this);
$this->Detail->Page = "PR_Deduction_Types.php";
$this->DedId = & new clsControl(ccsLabel, "DedId", "DedId", ccsText, "", CCGetRequestParam("DedId", ccsGet, NULL), $this);
$this->VendId = & new clsControl(ccsLabel, "VendId", "VendId", ccsText, "", CCGetRequestParam("VendId", ccsGet, NULL), $this);
$this->Descr = & new clsControl(ccsLabel, "Descr", "Descr", ccsText, "", CCGetRequestParam("Descr", ccsGet, NULL), $this);
$this->CalYr = & new clsControl(ccsLabel, "CalYr", "CalYr", ccsText, "", CCGetRequestParam("CalYr", ccsGet, NULL), $this);
$this->BaseType = & new clsControl(ccsLabel, "BaseType", "BaseType", ccsText, "", CCGetRequestParam("BaseType", ccsGet, NULL), $this);
$this->CalcMthd = & new clsControl(ccsLabel, "CalcMthd", "CalcMthd", ccsText, "", CCGetRequestParam("CalcMthd", ccsGet, NULL), $this);
$this->EmpleeDed = & new clsControl(ccsLabel, "EmpleeDed", "EmpleeDed", ccsInteger, "", CCGetRequestParam("EmpleeDed", ccsGet, NULL), $this);
$this->DedType = & new clsControl(ccsLabel, "DedType", "DedType", ccsText, "", CCGetRequestParam("DedType", ccsGet, NULL), $this);
$this->WthldAcct = & new clsControl(ccsLabel, "WthldAcct", "WthldAcct", ccsText, "", CCGetRequestParam("WthldAcct", ccsGet, NULL), $this);
$this->ExpAcct = & new clsControl(ccsLabel, "ExpAcct", "ExpAcct", ccsText, "", CCGetRequestParam("ExpAcct", ccsGet, NULL), $this);
$this->deduction_TotalRecords = & new clsControl(ccsLabel, "deduction_TotalRecords", "deduction_TotalRecords", ccsText, "", CCGetRequestParam("deduction_TotalRecords", ccsGet, NULL), $this);
$this->deduction_Insert = & new clsControl(ccsLink, "deduction_Insert", "deduction_Insert", ccsText, "", CCGetRequestParam("deduction_Insert", ccsGet, NULL), $this);
$this->deduction_Insert->Parameters = CCGetQueryString("QueryString", array("DedId", "ccsForm"));
$this->deduction_Insert->Page = "PR_Deduction_Types.php";
$this->Navigator = & new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpCentered, $this);
$this->Navigator->PageSizes = array("1", "5", "10", "25", "50");
}
//End Class_Initialize Event
//Initialize Method @2-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @2-09767EC5
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["Detail"] = $this->Detail->Visible;
$this->ControlsVisible["DedId"] = $this->DedId->Visible;
$this->ControlsVisible["VendId"] = $this->VendId->Visible;
$this->ControlsVisible["Descr"] = $this->Descr->Visible;
$this->ControlsVisible["CalYr"] = $this->CalYr->Visible;
$this->ControlsVisible["BaseType"] = $this->BaseType->Visible;
$this->ControlsVisible["CalcMthd"] = $this->CalcMthd->Visible;
$this->ControlsVisible["EmpleeDed"] = $this->EmpleeDed->Visible;
$this->ControlsVisible["DedType"] = $this->DedType->Visible;
$this->ControlsVisible["WthldAcct"] = $this->WthldAcct->Visible;
$this->ControlsVisible["ExpAcct"] = $this->ExpAcct->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->Detail->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->Detail->Parameters = CCAddParam($this->Detail->Parameters, "DedId", $this->DataSource->f("DedId"));
$this->DedId->SetValue($this->DataSource->DedId->GetValue());
$this->VendId->SetValue($this->DataSource->VendId->GetValue());
$this->Descr->SetValue($this->DataSource->Descr->GetValue());
$this->CalYr->SetValue($this->DataSource->CalYr->GetValue());
$this->BaseType->SetValue($this->DataSource->BaseType->GetValue());
$this->CalcMthd->SetValue($this->DataSource->CalcMthd->GetValue());
$this->EmpleeDed->SetValue($this->DataSource->EmpleeDed->GetValue());
$this->DedType->SetValue($this->DataSource->DedType->GetValue());
$this->WthldAcct->SetValue($this->DataSource->WthldAcct->GetValue());
$this->ExpAcct->SetValue($this->DataSource->ExpAcct->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->Detail->Show();
$this->DedId->Show();
$this->VendId->Show();
$this->Descr->Show();
$this->CalYr->Show();
$this->BaseType->Show();
$this->CalcMthd->Show();
$this->EmpleeDed->Show();
$this->DedType->Show();
$this->WthldAcct->Show();
$this->ExpAcct->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
else { // Show NoRecords block if no records are found
$this->Attributes->Show();
$Tpl->parse("NoRecords", false);
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$this->Navigator->PageNumber = $this->DataSource->AbsolutePage;
$this->Navigator->PageSize = $this->PageSize;
if ($this->DataSource->RecordsCount == "CCS not counted")
$this->Navigator->TotalPages = $this->DataSource->AbsolutePage + ($this->DataSource->next_record() ? 1 : 0);
else
$this->Navigator->TotalPages = $this->DataSource->PageCount();
if ($this->Navigator->TotalPages <= 1) {
$this->Navigator->Visible = false;
}
$this->deduction_TotalRecords->Show();
$this->deduction_Insert->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @2-FF007350
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->Detail->Errors->ToString());
$errors = ComposeStrings($errors, $this->DedId->Errors->ToString());
$errors = ComposeStrings($errors, $this->VendId->Errors->ToString());
$errors = ComposeStrings($errors, $this->Descr->Errors->ToString());
$errors = ComposeStrings($errors, $this->CalYr->Errors->ToString());
$errors = ComposeStrings($errors, $this->BaseType->Errors->ToString());
$errors = ComposeStrings($errors, $this->CalcMthd->Errors->ToString());
$errors = ComposeStrings($errors, $this->EmpleeDed->Errors->ToString());
$errors = ComposeStrings($errors, $this->DedType->Errors->ToString());
$errors = ComposeStrings($errors, $this->WthldAcct->Errors->ToString());
$errors = ComposeStrings($errors, $this->ExpAcct->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End deduction Class @2-FCB6E20C
class clsdeductionDataSource extends clsDBCoopWorksConn { //deductionDataSource Class @2-EBBA4A02
//DataSource Variables @2-134DAB6A
var $Parent = "";
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $CountSQL;
var $wp;
// Datasource fields
var $DedId;
var $VendId;
var $Descr;
var $CalYr;
var $BaseType;
var $CalcMthd;
var $EmpleeDed;
var $DedType;
var $WthldAcct;
var $ExpAcct;
//End DataSource Variables
//DataSourceClass_Initialize Event @2-2C1C7609
function clsdeductionDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid deduction";
$this->Initialize();
$this->DedId = new clsField("DedId", ccsText, "");
$this->VendId = new clsField("VendId", ccsText, "");
$this->Descr = new clsField("Descr", ccsText, "");
$this->CalYr = new clsField("CalYr", ccsText, "");
$this->BaseType = new clsField("BaseType", ccsText, "");
$this->CalcMthd = new clsField("CalcMthd", ccsText, "");
$this->EmpleeDed = new clsField("EmpleeDed", ccsInteger, "");
$this->DedType = new clsField("DedType", ccsText, "");
$this->WthldAcct = new clsField("WthldAcct", ccsText, "");
$this->ExpAcct = new clsField("ExpAcct", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @2-43197056
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "DedId";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @2-14D6CD9D
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
}
//End Prepare Method
//Open Method @2-3E910214
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM deduction";
$this->SQL = "SELECT DedId, BaseType, CalcMthd, CalYr, DedGrpID, DedType, Descr, EmpleeDed, FxdPctRate, VendId, WthldAcct, WthldSub, ExpAcct, ExpSub \n\n" .
"FROM deduction {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @2-41E84AA1
function SetValues()
{
$this->DedId->SetDBValue($this->f("DedId"));
$this->VendId->SetDBValue($this->f("VendId"));
$this->Descr->SetDBValue($this->f("Descr"));
$this->CalYr->SetDBValue($this->f("CalYr"));
$this->BaseType->SetDBValue($this->f("BaseType"));
$this->CalcMthd->SetDBValue($this->f("CalcMthd"));
$this->EmpleeDed->SetDBValue(trim($this->f("EmpleeDed")));
$this->DedType->SetDBValue($this->f("DedType"));
$this->WthldAcct->SetDBValue($this->f("WthldAcct"));
$this->ExpAcct->SetDBValue($this->f("ExpAcct"));
}
//End SetValues Method
} //End deductionDataSource Class @2-FCB6E20C
//Initialize Page @1-6A45C35D
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
$Attributes = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = FileName;
$Redirect = "";
$TemplateFileName = "PR_Deduction_Types.html";
$BlockToParse = "main";
$TemplateEncoding = "UTF-8";
$ContentType = "text/html";
$PathToRoot = "./";
$Charset = $Charset ? $Charset : "utf-8";
//End Initialize Page
//Authenticate User @1-946ECC7A
CCSecurityRedirect("1;2;3", "");
//End Authenticate User
//Include events file @1-D3DA9D6A
include_once("./PR_Deduction_Types_events.php");
//End Include events file
//Before Initialize @1-E870CEBC
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage);
//End Before Initialize
//Initialize Objects @1-65A9FD88
$DBCoopWorksConn = new clsDBCoopWorksConn();
$MainPage->Connections["CoopWorksConn"] = & $DBCoopWorksConn;
$Attributes = new clsAttributes("page:");
$MainPage->Attributes = & $Attributes;
// Controls
$deduction1 = & new clsRecorddeduction1("", $MainPage);
$deduction = & new clsGriddeduction("", $MainPage);
$MainPage->deduction1 = & $deduction1;
$MainPage->deduction = & $deduction;
$deduction1->Initialize();
$deduction->Initialize();
BindEvents();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
if ($Charset) {
header("Content-Type: " . $ContentType . "; charset=" . $Charset);
} else {
header("Content-Type: " . $ContentType);
}
//End Initialize Objects
//Initialize HTML Template @1-A06E9207
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
$Tpl = new clsTemplate($FileEncoding, $TemplateEncoding);
$Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "UTF-8", "replace");
$Tpl->block_path = "/$BlockToParse";
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
$Attributes->SetValue("pathToRoot", "");
$Attributes->Show();
//End Initialize HTML Template
//Execute Components @1-19AF09FE
$deduction1->Operation();
//End Execute Components
//Go to destination page @1-317F9CC0
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBCoopWorksConn->close();
header("Location: " . $Redirect);
unset($deduction1);
unset($deduction);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-8B21E94C
$deduction1->Show();
$deduction->Show();
$Tpl->block_path = "";
$Tpl->Parse($BlockToParse, false);
if (!isset($main_block)) $main_block = $Tpl->GetVar($BlockToParse);
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
if ($CCSEventResult) echo $main_block;
//End Show Page
//Unload Page @1-2D110AC4
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBCoopWorksConn->close();
unset($deduction1);
unset($deduction);
unset($Tpl);
//End Unload Page
?>