Viewing file: radgroupreply_maint.php (21.3 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//Include Common Files @1-0FDED6C6
define("RelativePath", ".");
define("PathToCurrentPage", "/");
define("FileName", "radgroupreply_maint.php");
include(RelativePath . "/Common.php");
include(RelativePath . "/Template.php");
include(RelativePath . "/Sorter.php");
include(RelativePath . "/Navigator.php");
//End Include Common Files
//Include Page implementation @12-3DD2EFDC
include_once(RelativePath . "/Header.php");
//End Include Page implementation
class clsRecordradgroupreply { //radgroupreply Class @2-418016D0
//Variables @2-F607D3A5
// Public variables
var $ComponentType = "Record";
var $ComponentName;
var $Parent;
var $HTMLFormAction;
var $PressedButton;
var $Errors;
var $ErrorBlock;
var $FormSubmitted;
var $FormEnctype;
var $Visible;
var $Recordset;
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;
// Class variables
//End Variables
//Class_Initialize Event @2-ABA337EA
function clsRecordradgroupreply($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->Visible = true;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record radgroupreply/Error";
$this->DataSource = new clsradgroupreplyDataSource($this);
$this->ds = & $this->DataSource;
$this->InsertAllowed = true;
$this->UpdateAllowed = true;
$this->DeleteAllowed = true;
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "radgroupreply";
$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->GroupName = & new clsControl(ccsTextBox, "GroupName", "Group Name", ccsText, "", CCGetRequestParam("GroupName", $Method), $this);
$this->GroupName->Required = true;
$this->Attribute = & new clsControl(ccsTextBox, "Attribute", "Attribute", ccsText, "", CCGetRequestParam("Attribute", $Method), $this);
$this->Attribute->Required = true;
$this->op = & new clsControl(ccsTextBox, "op", "Op", ccsText, "", CCGetRequestParam("op", $Method), $this);
$this->op->Required = true;
$this->f_Value_1 = & new clsControl(ccsTextBox, "f_Value_1", "F Value 1", ccsText, "", CCGetRequestParam("f_Value_1", $Method), $this);
$this->f_Value_1->Required = true;
$this->prio = & new clsControl(ccsTextBox, "prio", "Prio", ccsInteger, "", CCGetRequestParam("prio", $Method), $this);
$this->prio->Required = true;
$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);
}
}
//End Class_Initialize Event
//Initialize Method @2-7410BFC5
function Initialize()
{
if(!$this->Visible)
return;
$this->DataSource->Parameters["urlid"] = CCGetFromGet("id", "");
}
//End Initialize Method
//Validate Method @2-58EF81AF
function Validate()
{
global $CCSLocales;
$Validation = true;
$Where = "";
$Validation = ($this->GroupName->Validate() && $Validation);
$Validation = ($this->Attribute->Validate() && $Validation);
$Validation = ($this->op->Validate() && $Validation);
$Validation = ($this->f_Value_1->Validate() && $Validation);
$Validation = ($this->prio->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this);
$Validation = $Validation && ($this->GroupName->Errors->Count() == 0);
$Validation = $Validation && ($this->Attribute->Errors->Count() == 0);
$Validation = $Validation && ($this->op->Errors->Count() == 0);
$Validation = $Validation && ($this->f_Value_1->Errors->Count() == 0);
$Validation = $Validation && ($this->prio->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-3D28EF19
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->GroupName->Errors->Count());
$errors = ($errors || $this->Attribute->Errors->Count());
$errors = ($errors || $this->op->Errors->Count());
$errors = ($errors || $this->f_Value_1->Errors->Count());
$errors = ($errors || $this->prio->Errors->Count());
$errors = ($errors || $this->Errors->Count());
$errors = ($errors || $this->DataSource->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-CB7FF9A8
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";
}
}
$Redirect = "radgroupreply_list.php" . "?" . CCGetQueryString("QueryString", array("ccsForm"));
if($this->PressedButton == "Button_Delete") {
if(!CCGetEvent($this->Button_Delete->CCSEvents, "OnClick", $this->Button_Delete) || !$this->DeleteRow()) {
$Redirect = "";
}
} else if($this->Validate()) {
if($this->PressedButton == "Button_Insert") {
if(!CCGetEvent($this->Button_Insert->CCSEvents, "OnClick", $this->Button_Insert) || !$this->InsertRow()) {
$Redirect = "";
}
} else if($this->PressedButton == "Button_Update") {
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 @2-6B511F2F
function InsertRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this);
if(!$this->InsertAllowed) return false;
$this->DataSource->GroupName->SetValue($this->GroupName->GetValue());
$this->DataSource->Attribute->SetValue($this->Attribute->GetValue());
$this->DataSource->op->SetValue($this->op->GetValue());
$this->DataSource->f_Value_1->SetValue($this->f_Value_1->GetValue());
$this->DataSource->prio->SetValue($this->prio->GetValue());
$this->DataSource->Insert();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this);
return (!$this->CheckErrors());
}
//End InsertRow Method
//UpdateRow Method @2-C5CF6050
function UpdateRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this);
if(!$this->UpdateAllowed) return false;
$this->DataSource->GroupName->SetValue($this->GroupName->GetValue());
$this->DataSource->Attribute->SetValue($this->Attribute->GetValue());
$this->DataSource->op->SetValue($this->op->GetValue());
$this->DataSource->f_Value_1->SetValue($this->f_Value_1->GetValue());
$this->DataSource->prio->SetValue($this->prio->GetValue());
$this->DataSource->Update();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this);
return (!$this->CheckErrors());
}
//End UpdateRow Method
//DeleteRow Method @2-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 @2-953190E3
function Show()
{
global $Tpl;
global $FileName;
global $CCSLocales;
$Error = "";
if(!$this->Visible)
return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$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->GroupName->SetValue($this->DataSource->GroupName->GetValue());
$this->Attribute->SetValue($this->DataSource->Attribute->GetValue());
$this->op->SetValue($this->DataSource->op->GetValue());
$this->f_Value_1->SetValue($this->DataSource->f_Value_1->GetValue());
$this->prio->SetValue($this->DataSource->prio->GetValue());
}
} else {
$this->EditMode = false;
}
}
if($this->FormSubmitted || $this->CheckErrors()) {
$Error = "";
$Error = ComposeStrings($Error, $this->GroupName->Errors->ToString());
$Error = ComposeStrings($Error, $this->Attribute->Errors->ToString());
$Error = ComposeStrings($Error, $this->op->Errors->ToString());
$Error = ComposeStrings($Error, $this->f_Value_1->Errors->ToString());
$Error = ComposeStrings($Error, $this->prio->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", $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);
if(!$this->Visible) {
$Tpl->block_path = $ParentPath;
return;
}
$this->GroupName->Show();
$this->Attribute->Show();
$this->op->Show();
$this->f_Value_1->Show();
$this->prio->Show();
$this->Button_Insert->Show();
$this->Button_Update->Show();
$this->Button_Delete->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
} //End radgroupreply Class @2-FCB6E20C
class clsradgroupreplyDataSource extends clsDBConnection1 { //radgroupreplyDataSource Class @2-36F6C2E2
//DataSource Variables @2-836C4B56
var $Parent = "";
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $InsertParameters;
var $UpdateParameters;
var $DeleteParameters;
var $wp;
var $AllParametersSet;
// Datasource fields
var $GroupName;
var $Attribute;
var $op;
var $f_Value_1;
var $prio;
//End DataSource Variables
//DataSourceClass_Initialize Event @2-9D8DDE7C
function clsradgroupreplyDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Record radgroupreply/Error";
$this->Initialize();
$this->GroupName = new clsField("GroupName", ccsText, "");
$this->Attribute = new clsField("Attribute", ccsText, "");
$this->op = new clsField("op", ccsText, "");
$this->f_Value_1 = new clsField("f_Value_1", ccsText, "");
$this->prio = new clsField("prio", ccsInteger, "");
}
//End DataSourceClass_Initialize Event
//Prepare Method @2-35B33087
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urlid", ccsInteger, "", "", $this->Parameters["urlid"], "", false);
$this->AllParametersSet = $this->wp->AllParamsSet();
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @2-77FE3301
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->SQL = "SELECT * " .
"FROM radgroupreply {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 @2-686AC100
function SetValues()
{
$this->GroupName->SetDBValue($this->f("GroupName"));
$this->Attribute->SetDBValue($this->f("Attribute"));
$this->op->SetDBValue($this->f("op"));
$this->f_Value_1->SetDBValue($this->f("`Value`"));
$this->prio->SetDBValue(trim($this->f("prio")));
}
//End SetValues Method
//Insert Method @2-9AAAFD1A
function Insert()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent);
$this->SQL = "INSERT INTO radgroupreply ("
. "GroupName, "
. "Attribute, "
. "op, "
. "`Value`, "
. "prio"
. ") VALUES ("
. $this->ToSQL($this->GroupName->GetDBValue(), $this->GroupName->DataType) . ", "
. $this->ToSQL($this->Attribute->GetDBValue(), $this->Attribute->DataType) . ", "
. $this->ToSQL($this->op->GetDBValue(), $this->op->DataType) . ", "
. $this->ToSQL($this->f_Value_1->GetDBValue(), $this->f_Value_1->DataType) . ", "
. $this->ToSQL($this->prio->GetDBValue(), $this->prio->DataType)
. ")";
$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 @2-3454190E
function Update()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent);
$this->SQL = "UPDATE radgroupreply SET "
. "GroupName=" . $this->ToSQL($this->GroupName->GetDBValue(), $this->GroupName->DataType) . ", "
. "Attribute=" . $this->ToSQL($this->Attribute->GetDBValue(), $this->Attribute->DataType) . ", "
. "op=" . $this->ToSQL($this->op->GetDBValue(), $this->op->DataType) . ", "
. "`Value`=" . $this->ToSQL($this->f_Value_1->GetDBValue(), $this->f_Value_1->DataType) . ", "
. "prio=" . $this->ToSQL($this->prio->GetDBValue(), $this->prio->DataType);
$this->SQL = CCBuildSQL($this->SQL, $this->Where, "");
$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 @2-4A98A8A3
function Delete()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent);
$this->SQL = "DELETE FROM radgroupreply";
$this->SQL = CCBuildSQL($this->SQL, $this->Where, "");
$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 radgroupreplyDataSource Class @2-FCB6E20C
//Include Page implementation @13-58DBA1E3
include_once(RelativePath . "/Footer.php");
//End Include Page implementation
//Initialize Page @1-5981A657
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = FileName;
$Redirect = "";
$TemplateFileName = "radgroupreply_maint.html";
$BlockToParse = "main";
$TemplateEncoding = "CP1252";
$PathToRoot = "./";
//End Initialize Page
//Initialize Objects @1-7CDE7346
$DBConnection1 = new clsDBConnection1();
$MainPage->Connections["Connection1"] = & $DBConnection1;
// Controls
$Header = & new clsHeader("", "Header", $MainPage);
$Header->Initialize();
$radgroupreply = & new clsRecordradgroupreply("", $MainPage);
$Footer = & new clsFooter("", "Footer", $MainPage);
$Footer->Initialize();
$MainPage->Header = & $Header;
$MainPage->radgroupreply = & $radgroupreply;
$MainPage->Footer = & $Footer;
$radgroupreply->Initialize();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
$Charset = $Charset ? $Charset : "windows-1252";
if ($Charset)
header("Content-Type: text/html; charset=" . $Charset);
//End Initialize Objects
//Initialize HTML Template @1-8F4531F3
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
$Tpl = new clsTemplate($FileEncoding, $TemplateEncoding);
$Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "CP1252");
$Tpl->block_path = "/$BlockToParse";
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
//End Initialize HTML Template
//Execute Components @1-6E5D448B
$Header->Operations();
$radgroupreply->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-E42A4E82
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
unset($radgroupreply);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-C4E592D9
$Header->Show();
$radgroupreply->Show();
$Footer->Show();
$Tpl->block_path = "";
$Tpl->Parse($BlockToParse, false);
$main_block = $Tpl->GetVar($BlockToParse);
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
if ($CCSEventResult) echo $main_block;
//End Show Page
//Unload Page @1-A6DB8C0B
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
unset($radgroupreply);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
//End Unload Page
?>
|