Viewing file: e_mail_adr_maint.php (20.9 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php //Include Common Files @1-5FB4B541 define("RelativePath", "."); define("PathToCurrentPage", "/"); define("FileName", "e_mail_adr_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 @11-3DD2EFDC include_once(RelativePath . "/Header.php"); //End Include Page implementation
class clsRecorde_mail_adrese_korisnika { //e_mail_adrese_korisnika Class @2-E85A46FB
//Variables @2-9E315808
// Public variables public $ComponentType = "Record"; public $ComponentName; public $Parent; public $HTMLFormAction; public $PressedButton; public $Errors; public $ErrorBlock; public $FormSubmitted; public $FormEnctype; public $Visible; public $IsEmpty;
public $CCSEvents = ""; public $CCSEventResult;
public $RelativePath = "";
public $InsertAllowed = false; public $UpdateAllowed = false; public $DeleteAllowed = false; public $ReadAllowed = false; public $EditMode = false; public $ds; public $DataSource; public $ValidatingControls; public $Controls; public $Attributes;
// Class variables //End Variables
//Class_Initialize Event @2-8EDF9740 function clsRecorde_mail_adrese_korisnika($RelativePath, & $Parent) {
global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->Visible = true; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Record e_mail_adrese_korisnika/Error"; $this->DataSource = new clse_mail_adrese_korisnikaDataSource($this); $this->ds = & $this->DataSource; $this->InsertAllowed = true; $this->UpdateAllowed = true; $this->DeleteAllowed = true; $this->ReadAllowed = true; if($this->Visible) { $this->ComponentName = "e_mail_adrese_korisnika"; $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->id_korisnika = new clsControl(ccsTextBox, "id_korisnika", "Id Korisnika", ccsInteger, "", CCGetRequestParam("id_korisnika", $Method, NULL), $this); $this->id_korisnika->Required = true; $this->e_mail_korisnika = new clsControl(ccsTextBox, "e_mail_korisnika", "E Mail Korisnika", ccsText, "", CCGetRequestParam("e_mail_korisnika", $Method, NULL), $this); $this->e_mail_korisnika->Required = true; $this->id_izdanja = new clsControl(ccsTextBox, "id_izdanja", "Id Izdanja", ccsInteger, "", CCGetRequestParam("id_izdanja", $Method, NULL), $this); $this->id_izdanja->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-68286CD0 function Initialize() {
if(!$this->Visible) return;
$this->DataSource->Parameters["urlid_email_adr"] = CCGetFromGet("id_email_adr", NULL); } //End Initialize Method
//Validate Method @2-89068EF9 function Validate() { global $CCSLocales; $Validation = true; $Where = ""; $Validation = ($this->id_korisnika->Validate() && $Validation); $Validation = ($this->e_mail_korisnika->Validate() && $Validation); $Validation = ($this->id_izdanja->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this); $Validation = $Validation && ($this->id_korisnika->Errors->Count() == 0); $Validation = $Validation && ($this->e_mail_korisnika->Errors->Count() == 0); $Validation = $Validation && ($this->id_izdanja->Errors->Count() == 0); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method
//CheckErrors Method @2-355BB036 function CheckErrors() { $errors = false; $errors = ($errors || $this->id_korisnika->Errors->Count()); $errors = ($errors || $this->e_mail_korisnika->Errors->Count()); $errors = ($errors || $this->id_izdanja->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->DataSource->Errors->Count()); return $errors; } //End CheckErrors Method
//Operation Method @2-1206B7DF 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 = "e_mail_adr_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-E78CA1ED function InsertRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this); if(!$this->InsertAllowed) return false; $this->DataSource->id_korisnika->SetValue($this->id_korisnika->GetValue(true)); $this->DataSource->e_mail_korisnika->SetValue($this->e_mail_korisnika->GetValue(true)); $this->DataSource->id_izdanja->SetValue($this->id_izdanja->GetValue(true)); $this->DataSource->Insert(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this); return (!$this->CheckErrors()); } //End InsertRow Method
//UpdateRow Method @2-6F676037 function UpdateRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this); if(!$this->UpdateAllowed) return false; $this->DataSource->id_korisnika->SetValue($this->id_korisnika->GetValue(true)); $this->DataSource->e_mail_korisnika->SetValue($this->e_mail_korisnika->GetValue(true)); $this->DataSource->id_izdanja->SetValue($this->id_izdanja->GetValue(true)); $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-9FB188B1 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->id_korisnika->SetValue($this->DataSource->id_korisnika->GetValue()); $this->e_mail_korisnika->SetValue($this->DataSource->e_mail_korisnika->GetValue()); $this->id_izdanja->SetValue($this->DataSource->id_izdanja->GetValue()); } } else { $this->EditMode = false; } }
if($this->FormSubmitted || $this->CheckErrors()) { $Error = ""; $Error = ComposeStrings($Error, $this->id_korisnika->Errors->ToString()); $Error = ComposeStrings($Error, $this->e_mail_korisnika->Errors->ToString()); $Error = ComposeStrings($Error, $this->id_izdanja->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); $this->Attributes->Show(); if(!$this->Visible) { $Tpl->block_path = $ParentPath; return; }
$this->id_korisnika->Show(); $this->e_mail_korisnika->Show(); $this->id_izdanja->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 e_mail_adrese_korisnika Class @2-FCB6E20C
class clse_mail_adrese_korisnikaDataSource extends clsDBConnection1 { //e_mail_adrese_korisnikaDataSource Class @2-5E68E873
//DataSource Variables @2-8BDC69D7 public $Parent = ""; public $CCSEvents = ""; public $CCSEventResult; public $ErrorBlock; public $CmdExecution;
public $InsertParameters; public $UpdateParameters; public $DeleteParameters; public $wp; public $AllParametersSet;
public $InsertFields = array(); public $UpdateFields = array();
// Datasource fields public $id_korisnika; public $e_mail_korisnika; public $id_izdanja; //End DataSource Variables
//DataSourceClass_Initialize Event @2-91DE182B function clse_mail_adrese_korisnikaDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Record e_mail_adrese_korisnika/Error"; $this->Initialize(); $this->id_korisnika = new clsField("id_korisnika", ccsInteger, ""); $this->e_mail_korisnika = new clsField("e_mail_korisnika", ccsText, ""); $this->id_izdanja = new clsField("id_izdanja", ccsInteger, "");
$this->InsertFields["id_korisnika"] = array("Name" => "id_korisnika", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["e_mail_korisnika"] = array("Name" => "e_mail_korisnika", "Value" => "", "DataType" => ccsText); $this->InsertFields["id_izdanja"] = array("Name" => "id_izdanja", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["id_korisnika"] = array("Name" => "id_korisnika", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["e_mail_korisnika"] = array("Name" => "e_mail_korisnika", "Value" => "", "DataType" => ccsText); $this->UpdateFields["id_izdanja"] = array("Name" => "id_izdanja", "Value" => "", "DataType" => ccsInteger); } //End DataSourceClass_Initialize Event
//Prepare Method @2-83007B11 function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlid_email_adr", ccsInteger, "", "", $this->Parameters["urlid_email_adr"], "", false); $this->AllParametersSet = $this->wp->AllParamsSet(); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "id_email_adr", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @2-422E02E5 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->SQL = "SELECT * \n\n" . "FROM e_mail_adrese_korisnika {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-CDCB02F8 function SetValues() { $this->id_korisnika->SetDBValue(trim($this->f("id_korisnika"))); $this->e_mail_korisnika->SetDBValue($this->f("e_mail_korisnika")); $this->id_izdanja->SetDBValue(trim($this->f("id_izdanja"))); } //End SetValues Method
//Insert Method @2-0667B24E function Insert() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent); $this->InsertFields["id_korisnika"]["Value"] = $this->id_korisnika->GetDBValue(true); $this->InsertFields["e_mail_korisnika"]["Value"] = $this->e_mail_korisnika->GetDBValue(true); $this->InsertFields["id_izdanja"]["Value"] = $this->id_izdanja->GetDBValue(true); $this->SQL = CCBuildInsert("e_mail_adrese_korisnika", $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 @2-A4F4C6FB function Update() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent); $this->UpdateFields["id_korisnika"]["Value"] = $this->id_korisnika->GetDBValue(true); $this->UpdateFields["e_mail_korisnika"]["Value"] = $this->e_mail_korisnika->GetDBValue(true); $this->UpdateFields["id_izdanja"]["Value"] = $this->id_izdanja->GetDBValue(true); $this->SQL = CCBuildUpdate("e_mail_adrese_korisnika", $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 @2-C8CE64C7 function Delete() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent); $this->SQL = "DELETE FROM e_mail_adrese_korisnika"; $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 e_mail_adrese_korisnikaDataSource Class @2-FCB6E20C
//Include Page implementation @12-58DBA1E3 include_once(RelativePath . "/Footer.php"); //End Include Page implementation
//Initialize Page @1-C640F7BB // Variables $FileName = ""; $Redirect = ""; $Tpl = ""; $TemplateFileName = ""; $BlockToParse = ""; $ComponentName = ""; $Attributes = "";
// Events; $CCSEvents = ""; $CCSEventResult = "";
$FileName = FileName; $Redirect = ""; $TemplateFileName = "e_mail_adr_maint.html"; $BlockToParse = "main"; $TemplateEncoding = "CP1252"; $PathToRoot = "./"; //End Initialize Page
//Authenticate User @1-DC94A87D CCSecurityRedirect("1", ""); //End Authenticate User
//Before Initialize @1-E870CEBC $CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage); //End Before Initialize
//Initialize Objects @1-BBB889FE $DBConnection1 = new clsDBConnection1(); $MainPage->Connections["Connection1"] = & $DBConnection1; $Attributes = new clsAttributes("page:"); $MainPage->Attributes = & $Attributes;
// Controls $Header = new clsHeader("", "Header", $MainPage); $Header->Initialize(); $e_mail_adrese_korisnika = new clsRecorde_mail_adrese_korisnika("", $MainPage); $Footer = new clsFooter("", "Footer", $MainPage); $Footer->Initialize(); $MainPage->Header = & $Header; $MainPage->e_mail_adrese_korisnika = & $e_mail_adrese_korisnika; $MainPage->Footer = & $Footer; $e_mail_adrese_korisnika->Initialize();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
if ($Charset) header("Content-Type: text/html; charset=" . $Charset); //End Initialize Objects
//Initialize HTML Template @1-593C2978 $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); $Attributes->Show(); //End Initialize HTML Template
//Execute Components @1-5ACC608F $Header->Operations(); $e_mail_adrese_korisnika->Operation(); $Footer->Operations(); //End Execute Components
//Go to destination page @1-96622627 if($Redirect) { $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage); $DBConnection1->close(); header("Location: " . $Redirect); $Header->Class_Terminate(); unset($Header); unset($e_mail_adrese_korisnika); $Footer->Class_Terminate(); unset($Footer); unset($Tpl); exit; } //End Go to destination page
//Show Page @1-68883E57 $Header->Show(); $e_mail_adrese_korisnika->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-FE4771AE $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage); $DBConnection1->close(); $Header->Class_Terminate(); unset($Header); unset($e_mail_adrese_korisnika); $Footer->Class_Terminate(); unset($Footer); unset($Tpl); //End Unload Page
?>
|