Viewing file: phpSP_user_maint.php (223.09 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php //Include Common Files @1-32FE04D5 define("RelativePath", "."); define("PathToCurrentPage", "/"); define("FileName", "phpSP_user_maint.php"); include(RelativePath . "/Common.php"); include(RelativePath . "/Template.php"); include(RelativePath . "/Sorter.php"); include(RelativePath . "/Navigator.php"); //End Include Common Files
class clsRecorde_mail_adrese_korisnika1 { //e_mail_adrese_korisnika1 Class @101-35C49164
//Variables @101-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 @101-5B346F29 function clsRecorde_mail_adrese_korisnika1($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_korisnika1/Error"; $this->DataSource = new clse_mail_adrese_korisnika1DataSource($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_korisnika1"; $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->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_korisnika = new clsControl(ccsHidden, "id_korisnika", "Id Korisnika", ccsInteger, "", CCGetRequestParam("id_korisnika", $Method, NULL), $this); $this->id_korisnika->Required = true; $this->id_izdanja = new clsControl(ccsListBox, "id_izdanja", "Id Izdanja", ccsInteger, "", CCGetRequestParam("id_izdanja", $Method, NULL), $this); $this->id_izdanja->DSType = dsTable; list($this->id_izdanja->BoundColumn, $this->id_izdanja->TextColumn, $this->id_izdanja->DBFormat) = array("id_email_izdanja", "naziv_email_izdanja", ""); $this->id_izdanja->DataSource = new clsDBConnection1(); $this->id_izdanja->ds = & $this->id_izdanja->DataSource; $this->id_izdanja->DataSource->SQL = "SELECT * \n" . "FROM e_mail_izdanja {SQL_Where} {SQL_OrderBy}"; $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 @101-68286CD0 function Initialize() {
if(!$this->Visible) return;
$this->DataSource->Parameters["urlid_email_adr"] = CCGetFromGet("id_email_adr", NULL); } //End Initialize Method
//Validate Method @101-9B45FAF2 function Validate() { global $CCSLocales; $Validation = true; $Where = ""; $Validation = ($this->e_mail_korisnika->Validate() && $Validation); $Validation = ($this->id_korisnika->Validate() && $Validation); $Validation = ($this->id_izdanja->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this); $Validation = $Validation && ($this->e_mail_korisnika->Errors->Count() == 0); $Validation = $Validation && ($this->id_korisnika->Errors->Count() == 0); $Validation = $Validation && ($this->id_izdanja->Errors->Count() == 0); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method
//CheckErrors Method @101-7CEF6BCA function CheckErrors() { $errors = false; $errors = ($errors || $this->e_mail_korisnika->Errors->Count()); $errors = ($errors || $this->id_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 @101-B908BA44 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 = $FileName . "?" . 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 @101-87831A87 function InsertRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this); if(!$this->InsertAllowed) return false; $this->DataSource->e_mail_korisnika->SetValue($this->e_mail_korisnika->GetValue(true)); $this->DataSource->id_korisnika->SetValue($this->id_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 @101-0F68DB5D function UpdateRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this); if(!$this->UpdateAllowed) return false; $this->DataSource->e_mail_korisnika->SetValue($this->e_mail_korisnika->GetValue(true)); $this->DataSource->id_korisnika->SetValue($this->id_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 @101-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 @101-4DB015FF function Show() { global $Tpl; global $FileName; global $CCSLocales; $Error = "";
if(!$this->Visible) return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->id_izdanja->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->e_mail_korisnika->SetValue($this->DataSource->e_mail_korisnika->GetValue()); $this->id_korisnika->SetValue($this->DataSource->id_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->e_mail_korisnika->Errors->ToString()); $Error = ComposeStrings($Error, $this->id_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->e_mail_korisnika->Show(); $this->id_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_korisnika1 Class @101-FCB6E20C
class clse_mail_adrese_korisnika1DataSource extends clsDBConnection1 { //e_mail_adrese_korisnika1DataSource Class @101-341031B9
//DataSource Variables @101-9B2480A5 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 $e_mail_korisnika; public $id_korisnika; public $id_izdanja; //End DataSource Variables
//DataSourceClass_Initialize Event @101-63EEC018 function clse_mail_adrese_korisnika1DataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Record e_mail_adrese_korisnika1/Error"; $this->Initialize(); $this->e_mail_korisnika = new clsField("e_mail_korisnika", ccsText, ""); $this->id_korisnika = new clsField("id_korisnika", ccsInteger, ""); $this->id_izdanja = new clsField("id_izdanja", ccsInteger, "");
$this->InsertFields["e_mail_korisnika"] = array("Name" => "e_mail_korisnika", "Value" => "", "DataType" => ccsText); $this->InsertFields["id_korisnika"] = array("Name" => "id_korisnika", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["id_izdanja"] = array("Name" => "id_izdanja", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["e_mail_korisnika"] = array("Name" => "e_mail_korisnika", "Value" => "", "DataType" => ccsText); $this->UpdateFields["id_korisnika"] = array("Name" => "id_korisnika", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["id_izdanja"] = array("Name" => "id_izdanja", "Value" => "", "DataType" => ccsInteger); } //End DataSourceClass_Initialize Event
//Prepare Method @101-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 @101-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 @101-8CE25B51 function SetValues() { $this->e_mail_korisnika->SetDBValue($this->f("e_mail_korisnika")); $this->id_korisnika->SetDBValue(trim($this->f("id_korisnika"))); $this->id_izdanja->SetDBValue(trim($this->f("id_izdanja"))); } //End SetValues Method
//Insert Method @101-641829B3 function Insert() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent); $this->InsertFields["e_mail_korisnika"]["Value"] = $this->e_mail_korisnika->GetDBValue(true); $this->InsertFields["id_korisnika"]["Value"] = $this->id_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 @101-193F6F1E function Update() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent); $this->UpdateFields["e_mail_korisnika"]["Value"] = $this->e_mail_korisnika->GetDBValue(true); $this->UpdateFields["id_korisnika"]["Value"] = $this->id_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 @101-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_korisnika1DataSource Class @101-FCB6E20C
//Include Page implementation @37-3DD2EFDC include_once(RelativePath . "/Header.php"); //End Include Page implementation
class clsRecordphpSP_users { //phpSP_users Class @2-5535CA2D
//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-1A1678DA function clsRecordphpSP_users($RelativePath, & $Parent) {
global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->Visible = true; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Record phpSP_users/Error"; $this->DataSource = new clsphpSP_usersDataSource($this); $this->ds = & $this->DataSource; $this->InsertAllowed = true; $this->UpdateAllowed = true; $this->DeleteAllowed = true; $this->ReadAllowed = true; if($this->Visible) { $this->ComponentName = "phpSP_users"; $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->Web = new clsControl(ccsTextBox, "Web", "Web", ccsMemo, "", CCGetRequestParam("Web", $Method, NULL), $this); $this->MinaGen_site_do = new clsControl(ccsTextBox, "MinaGen_site_do", "Mina Gen Site Do", ccsDate, $DefaultDateFormat, CCGetRequestParam("MinaGen_site_do", $Method, NULL), $this); $this->DatePicker_MinaGen_site_do = new clsDatePicker("DatePicker_MinaGen_site_do", "phpSP_users", "MinaGen_site_do", $this); $this->MinaBiz_site_do = new clsControl(ccsTextBox, "MinaBiz_site_do", "Mina Biz Site Do", ccsDate, $DefaultDateFormat, CCGetRequestParam("MinaBiz_site_do", $Method, NULL), $this); $this->DatePicker_MinaBiz_site_do = new clsDatePicker("DatePicker_MinaBiz_site_do", "phpSP_users", "MinaBiz_site_do", $this); $this->Daily_site_do = new clsControl(ccsTextBox, "Daily_site_do", "Daily Site Do", ccsDate, $DefaultDateFormat, CCGetRequestParam("Daily_site_do", $Method, NULL), $this); $this->DatePicker_Daily_site_do = new clsDatePicker("DatePicker_Daily_site_do", "phpSP_users", "Daily_site_do", $this); $this->kontakt = new clsControl(ccsTextBox, "kontakt", "Kontakt", ccsText, "", CCGetRequestParam("kontakt", $Method, NULL), $this); $this->Pocetak_saradnje = new clsControl(ccsTextBox, "Pocetak_saradnje", "Pocetak Saradnje", ccsDate, $DefaultDateFormat, CCGetRequestParam("Pocetak_saradnje", $Method, NULL), $this); $this->DatePicker_Pocetak_saradnje1 = new clsDatePicker("DatePicker_Pocetak_saradnje1", "phpSP_users", "Pocetak_saradnje", $this); $this->napomena = new clsControl(ccsTextArea, "napomena", "Napomena", ccsMemo, "", CCGetRequestParam("napomena", $Method, NULL), $this); $this->Organizacija = new clsControl(ccsTextBox, "Organizacija", "Organizacija", ccsMemo, "", CCGetRequestParam("Organizacija", $Method, NULL), $this); $this->Adresa = new clsControl(ccsTextArea, "Adresa", "Adresa", ccsMemo, "", CCGetRequestParam("Adresa", $Method, NULL), $this); $this->E_mail = new clsControl(ccsTextBox, "E_mail", "E Mail", ccsMemo, "", CCGetRequestParam("E_mail", $Method, NULL), $this); $this->Telefon = new clsControl(ccsTextBox, "Telefon", "Telefon", ccsText, "", CCGetRequestParam("Telefon", $Method, NULL), $this); $this->Fax = new clsControl(ccsTextBox, "Fax", "Fax", ccsText, "", CCGetRequestParam("Fax", $Method, NULL), $this); $this->Mobilni = new clsControl(ccsTextBox, "Mobilni", "Mobilni", ccsText, "", CCGetRequestParam("Mobilni", $Method, NULL), $this); $this->MinaCijeli_site_do = new clsControl(ccsTextBox, "MinaCijeli_site_do", "Mina Cijeli Site Do", ccsDate, $DefaultDateFormat, CCGetRequestParam("MinaCijeli_site_do", $Method, NULL), $this); $this->DatePicker_MinaCijeli_site_do1 = new clsDatePicker("DatePicker_MinaCijeli_site_do1", "phpSP_users", "MinaCijeli_site_do", $this); $this->Insert = new clsButton("Insert", $Method, $this); $this->Update = new clsButton("Update", $Method, $this); $this->Delete = new clsButton("Delete", $Method, $this); } } //End Class_Initialize Event
//Initialize Method @2-7FEE70F6 function Initialize() {
if(!$this->Visible) return;
$this->DataSource->Parameters["urlklijent"] = CCGetFromGet("klijent", NULL); } //End Initialize Method
//Validate Method @2-A152A967 function Validate() { global $CCSLocales; $Validation = true; $Where = ""; $Validation = ($this->Web->Validate() && $Validation); $Validation = ($this->MinaGen_site_do->Validate() && $Validation); $Validation = ($this->MinaBiz_site_do->Validate() && $Validation); $Validation = ($this->Daily_site_do->Validate() && $Validation); $Validation = ($this->kontakt->Validate() && $Validation); $Validation = ($this->Pocetak_saradnje->Validate() && $Validation); $Validation = ($this->napomena->Validate() && $Validation); $Validation = ($this->Organizacija->Validate() && $Validation); $Validation = ($this->Adresa->Validate() && $Validation); $Validation = ($this->E_mail->Validate() && $Validation); $Validation = ($this->Telefon->Validate() && $Validation); $Validation = ($this->Fax->Validate() && $Validation); $Validation = ($this->Mobilni->Validate() && $Validation); $Validation = ($this->MinaCijeli_site_do->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this); $Validation = $Validation && ($this->Web->Errors->Count() == 0); $Validation = $Validation && ($this->MinaGen_site_do->Errors->Count() == 0); $Validation = $Validation && ($this->MinaBiz_site_do->Errors->Count() == 0); $Validation = $Validation && ($this->Daily_site_do->Errors->Count() == 0); $Validation = $Validation && ($this->kontakt->Errors->Count() == 0); $Validation = $Validation && ($this->Pocetak_saradnje->Errors->Count() == 0); $Validation = $Validation && ($this->napomena->Errors->Count() == 0); $Validation = $Validation && ($this->Organizacija->Errors->Count() == 0); $Validation = $Validation && ($this->Adresa->Errors->Count() == 0); $Validation = $Validation && ($this->E_mail->Errors->Count() == 0); $Validation = $Validation && ($this->Telefon->Errors->Count() == 0); $Validation = $Validation && ($this->Fax->Errors->Count() == 0); $Validation = $Validation && ($this->Mobilni->Errors->Count() == 0); $Validation = $Validation && ($this->MinaCijeli_site_do->Errors->Count() == 0); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method
//CheckErrors Method @2-71014943 function CheckErrors() { $errors = false; $errors = ($errors || $this->Web->Errors->Count()); $errors = ($errors || $this->MinaGen_site_do->Errors->Count()); $errors = ($errors || $this->DatePicker_MinaGen_site_do->Errors->Count()); $errors = ($errors || $this->MinaBiz_site_do->Errors->Count()); $errors = ($errors || $this->DatePicker_MinaBiz_site_do->Errors->Count()); $errors = ($errors || $this->Daily_site_do->Errors->Count()); $errors = ($errors || $this->DatePicker_Daily_site_do->Errors->Count()); $errors = ($errors || $this->kontakt->Errors->Count()); $errors = ($errors || $this->Pocetak_saradnje->Errors->Count()); $errors = ($errors || $this->DatePicker_Pocetak_saradnje1->Errors->Count()); $errors = ($errors || $this->napomena->Errors->Count()); $errors = ($errors || $this->Organizacija->Errors->Count()); $errors = ($errors || $this->Adresa->Errors->Count()); $errors = ($errors || $this->E_mail->Errors->Count()); $errors = ($errors || $this->Telefon->Errors->Count()); $errors = ($errors || $this->Fax->Errors->Count()); $errors = ($errors || $this->Mobilni->Errors->Count()); $errors = ($errors || $this->MinaCijeli_site_do->Errors->Count()); $errors = ($errors || $this->DatePicker_MinaCijeli_site_do1->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->DataSource->Errors->Count()); return $errors; } //End CheckErrors Method
//Operation Method @2-86F0CD9E 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 ? "Update" : "Insert"; if($this->Insert->Pressed) { $this->PressedButton = "Insert"; } else if($this->Update->Pressed) { $this->PressedButton = "Update"; } else if($this->Delete->Pressed) { $this->PressedButton = "Delete"; } } $Redirect = "phpSP_user_maint.php" . "?" . CCGetQueryString("QueryString", array("ccsForm")); if($this->PressedButton == "Delete") { if(!CCGetEvent($this->Delete->CCSEvents, "OnClick", $this->Delete) || !$this->DeleteRow()) { $Redirect = ""; } } else if($this->Validate()) { if($this->PressedButton == "Insert") { if(!CCGetEvent($this->Insert->CCSEvents, "OnClick", $this->Insert) || !$this->InsertRow()) { $Redirect = ""; } } else if($this->PressedButton == "Update") { if(!CCGetEvent($this->Update->CCSEvents, "OnClick", $this->Update) || !$this->UpdateRow()) { $Redirect = ""; } } } else { $Redirect = ""; } if ($Redirect) $this->DataSource->close(); } //End Operation Method
//InsertRow Method @2-AC161D6F function InsertRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this); if(!$this->InsertAllowed) return false; $this->DataSource->Web->SetValue($this->Web->GetValue(true)); $this->DataSource->MinaGen_site_do->SetValue($this->MinaGen_site_do->GetValue(true)); $this->DataSource->MinaBiz_site_do->SetValue($this->MinaBiz_site_do->GetValue(true)); $this->DataSource->Daily_site_do->SetValue($this->Daily_site_do->GetValue(true)); $this->DataSource->kontakt->SetValue($this->kontakt->GetValue(true)); $this->DataSource->Pocetak_saradnje->SetValue($this->Pocetak_saradnje->GetValue(true)); $this->DataSource->napomena->SetValue($this->napomena->GetValue(true)); $this->DataSource->Organizacija->SetValue($this->Organizacija->GetValue(true)); $this->DataSource->Adresa->SetValue($this->Adresa->GetValue(true)); $this->DataSource->E_mail->SetValue($this->E_mail->GetValue(true)); $this->DataSource->Telefon->SetValue($this->Telefon->GetValue(true)); $this->DataSource->Fax->SetValue($this->Fax->GetValue(true)); $this->DataSource->Mobilni->SetValue($this->Mobilni->GetValue(true)); $this->DataSource->MinaCijeli_site_do->SetValue($this->MinaCijeli_site_do->GetValue(true)); $this->DataSource->Insert(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this); return (!$this->CheckErrors()); } //End InsertRow Method
//UpdateRow Method @2-F97A8E9B function UpdateRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this); if(!$this->UpdateAllowed) return false; $this->DataSource->Web->SetValue($this->Web->GetValue(true)); $this->DataSource->MinaGen_site_do->SetValue($this->MinaGen_site_do->GetValue(true)); $this->DataSource->MinaBiz_site_do->SetValue($this->MinaBiz_site_do->GetValue(true)); $this->DataSource->Daily_site_do->SetValue($this->Daily_site_do->GetValue(true)); $this->DataSource->kontakt->SetValue($this->kontakt->GetValue(true)); $this->DataSource->Pocetak_saradnje->SetValue($this->Pocetak_saradnje->GetValue(true)); $this->DataSource->napomena->SetValue($this->napomena->GetValue(true)); $this->DataSource->Organizacija->SetValue($this->Organizacija->GetValue(true)); $this->DataSource->Adresa->SetValue($this->Adresa->GetValue(true)); $this->DataSource->E_mail->SetValue($this->E_mail->GetValue(true)); $this->DataSource->Telefon->SetValue($this->Telefon->GetValue(true)); $this->DataSource->Fax->SetValue($this->Fax->GetValue(true)); $this->DataSource->Mobilni->SetValue($this->Mobilni->GetValue(true)); $this->DataSource->MinaCijeli_site_do->SetValue($this->MinaCijeli_site_do->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-784A20AB 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->Web->SetValue($this->DataSource->Web->GetValue()); $this->MinaGen_site_do->SetValue($this->DataSource->MinaGen_site_do->GetValue()); $this->MinaBiz_site_do->SetValue($this->DataSource->MinaBiz_site_do->GetValue()); $this->Daily_site_do->SetValue($this->DataSource->Daily_site_do->GetValue()); $this->kontakt->SetValue($this->DataSource->kontakt->GetValue()); $this->Pocetak_saradnje->SetValue($this->DataSource->Pocetak_saradnje->GetValue()); $this->napomena->SetValue($this->DataSource->napomena->GetValue()); $this->Organizacija->SetValue($this->DataSource->Organizacija->GetValue()); $this->Adresa->SetValue($this->DataSource->Adresa->GetValue()); $this->E_mail->SetValue($this->DataSource->E_mail->GetValue()); $this->Telefon->SetValue($this->DataSource->Telefon->GetValue()); $this->Fax->SetValue($this->DataSource->Fax->GetValue()); $this->Mobilni->SetValue($this->DataSource->Mobilni->GetValue()); $this->MinaCijeli_site_do->SetValue($this->DataSource->MinaCijeli_site_do->GetValue()); } } else { $this->EditMode = false; } }
if($this->FormSubmitted || $this->CheckErrors()) { $Error = ""; $Error = ComposeStrings($Error, $this->Web->Errors->ToString()); $Error = ComposeStrings($Error, $this->MinaGen_site_do->Errors->ToString()); $Error = ComposeStrings($Error, $this->DatePicker_MinaGen_site_do->Errors->ToString()); $Error = ComposeStrings($Error, $this->MinaBiz_site_do->Errors->ToString()); $Error = ComposeStrings($Error, $this->DatePicker_MinaBiz_site_do->Errors->ToString()); $Error = ComposeStrings($Error, $this->Daily_site_do->Errors->ToString()); $Error = ComposeStrings($Error, $this->DatePicker_Daily_site_do->Errors->ToString()); $Error = ComposeStrings($Error, $this->kontakt->Errors->ToString()); $Error = ComposeStrings($Error, $this->Pocetak_saradnje->Errors->ToString()); $Error = ComposeStrings($Error, $this->DatePicker_Pocetak_saradnje1->Errors->ToString()); $Error = ComposeStrings($Error, $this->napomena->Errors->ToString()); $Error = ComposeStrings($Error, $this->Organizacija->Errors->ToString()); $Error = ComposeStrings($Error, $this->Adresa->Errors->ToString()); $Error = ComposeStrings($Error, $this->E_mail->Errors->ToString()); $Error = ComposeStrings($Error, $this->Telefon->Errors->ToString()); $Error = ComposeStrings($Error, $this->Fax->Errors->ToString()); $Error = ComposeStrings($Error, $this->Mobilni->Errors->ToString()); $Error = ComposeStrings($Error, $this->MinaCijeli_site_do->Errors->ToString()); $Error = ComposeStrings($Error, $this->DatePicker_MinaCijeli_site_do1->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->Insert->Visible = !$this->EditMode && $this->InsertAllowed; $this->Update->Visible = $this->EditMode && $this->UpdateAllowed; $this->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->Web->Show(); $this->MinaGen_site_do->Show(); $this->DatePicker_MinaGen_site_do->Show(); $this->MinaBiz_site_do->Show(); $this->DatePicker_MinaBiz_site_do->Show(); $this->Daily_site_do->Show(); $this->DatePicker_Daily_site_do->Show(); $this->kontakt->Show(); $this->Pocetak_saradnje->Show(); $this->DatePicker_Pocetak_saradnje1->Show(); $this->napomena->Show(); $this->Organizacija->Show(); $this->Adresa->Show(); $this->E_mail->Show(); $this->Telefon->Show(); $this->Fax->Show(); $this->Mobilni->Show(); $this->MinaCijeli_site_do->Show(); $this->DatePicker_MinaCijeli_site_do1->Show(); $this->Insert->Show(); $this->Update->Show(); $this->Delete->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->DataSource->close(); } //End Show Method
} //End phpSP_users Class @2-FCB6E20C
class clsphpSP_usersDataSource extends clsDBConnection1 { //phpSP_usersDataSource Class @2-D7B82E7A
//DataSource Variables @2-6AC52531 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 $Web; public $MinaGen_site_do; public $MinaBiz_site_do; public $Daily_site_do; public $kontakt; public $Pocetak_saradnje; public $napomena; public $Organizacija; public $Adresa; public $E_mail; public $Telefon; public $Fax; public $Mobilni; public $MinaCijeli_site_do; //End DataSource Variables
//DataSourceClass_Initialize Event @2-AE20B5B8 function clsphpSP_usersDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Record phpSP_users/Error"; $this->Initialize(); $this->Web = new clsField("Web", ccsMemo, ""); $this->MinaGen_site_do = new clsField("MinaGen_site_do", ccsDate, array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss")); $this->MinaBiz_site_do = new clsField("MinaBiz_site_do", ccsDate, array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss")); $this->Daily_site_do = new clsField("Daily_site_do", ccsDate, array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss")); $this->kontakt = new clsField("kontakt", ccsText, ""); $this->Pocetak_saradnje = new clsField("Pocetak_saradnje", ccsDate, array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss")); $this->napomena = new clsField("napomena", ccsMemo, ""); $this->Organizacija = new clsField("Organizacija", ccsMemo, ""); $this->Adresa = new clsField("Adresa", ccsMemo, ""); $this->E_mail = new clsField("E_mail", ccsMemo, ""); $this->Telefon = new clsField("Telefon", ccsText, ""); $this->Fax = new clsField("Fax", ccsText, ""); $this->Mobilni = new clsField("Mobilni", ccsText, ""); $this->MinaCijeli_site_do = new clsField("MinaCijeli_site_do", ccsDate, array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"));
$this->InsertFields["Web"] = array("Name" => "Web", "Value" => "", "DataType" => ccsMemo); $this->InsertFields["MinaGen_site_do"] = array("Name" => "MinaGen_site_do", "Value" => "", "DataType" => ccsDate); $this->InsertFields["MinaBiz_site_do"] = array("Name" => "MinaBiz_site_do", "Value" => "", "DataType" => ccsDate); $this->InsertFields["Daily_site_do"] = array("Name" => "Daily_site_do", "Value" => "", "DataType" => ccsDate); $this->InsertFields["kontakt"] = array("Name" => "kontakt", "Value" => "", "DataType" => ccsText); $this->InsertFields["Pocetak_saradnje"] = array("Name" => "Pocetak_saradnje", "Value" => "", "DataType" => ccsDate); $this->InsertFields["napomena"] = array("Name" => "napomena", "Value" => "", "DataType" => ccsMemo); $this->InsertFields["Organizacija"] = array("Name" => "Organizacija", "Value" => "", "DataType" => ccsMemo); $this->InsertFields["Adresa"] = array("Name" => "Adresa", "Value" => "", "DataType" => ccsMemo); $this->InsertFields["E_mail"] = array("Name" => "E_mail", "Value" => "", "DataType" => ccsMemo); $this->InsertFields["Telefon"] = array("Name" => "Telefon", "Value" => "", "DataType" => ccsText); $this->InsertFields["Fax"] = array("Name" => "Fax", "Value" => "", "DataType" => ccsText); $this->InsertFields["Mobilni"] = array("Name" => "Mobilni", "Value" => "", "DataType" => ccsText); $this->InsertFields["MinaCijeli_site_do"] = array("Name" => "MinaCijeli_site_do", "Value" => "", "DataType" => ccsDate); $this->UpdateFields["Web"] = array("Name" => "Web", "Value" => "", "DataType" => ccsMemo); $this->UpdateFields["MinaGen_site_do"] = array("Name" => "MinaGen_site_do", "Value" => "", "DataType" => ccsDate); $this->UpdateFields["MinaBiz_site_do"] = array("Name" => "MinaBiz_site_do", "Value" => "", "DataType" => ccsDate); $this->UpdateFields["Daily_site_do"] = array("Name" => "Daily_site_do", "Value" => "", "DataType" => ccsDate); $this->UpdateFields["kontakt"] = array("Name" => "kontakt", "Value" => "", "DataType" => ccsText); $this->UpdateFields["Pocetak_saradnje"] = array("Name" => "Pocetak_saradnje", "Value" => "", "DataType" => ccsDate); $this->UpdateFields["napomena"] = array("Name" => "napomena", "Value" => "", "DataType" => ccsMemo); $this->UpdateFields["Organizacija"] = array("Name" => "Organizacija", "Value" => "", "DataType" => ccsMemo); $this->UpdateFields["Adresa"] = array("Name" => "Adresa", "Value" => "", "DataType" => ccsMemo); $this->UpdateFields["E_mail"] = array("Name" => "E_mail", "Value" => "", "DataType" => ccsMemo); $this->UpdateFields["Telefon"] = array("Name" => "Telefon", "Value" => "", "DataType" => ccsText); $this->UpdateFields["Fax"] = array("Name" => "Fax", "Value" => "", "DataType" => ccsText); $this->UpdateFields["Mobilni"] = array("Name" => "Mobilni", "Value" => "", "DataType" => ccsText); $this->UpdateFields["MinaCijeli_site_do"] = array("Name" => "MinaCijeli_site_do", "Value" => "", "DataType" => ccsDate); } //End DataSourceClass_Initialize Event
//Prepare Method @2-A480AD3F function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlklijent", ccsInteger, "", "", $this->Parameters["urlklijent"], "", false); $this->AllParametersSet = $this->wp->AllParamsSet(); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "primary_key", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @2-048887B4 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->SQL = "SELECT * \n\n" . "FROM klijenti {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-02E82770 function SetValues() { $this->Web->SetDBValue($this->f("Web")); $this->MinaGen_site_do->SetDBValue(trim($this->f("MinaGen_site_do"))); $this->MinaBiz_site_do->SetDBValue(trim($this->f("MinaBiz_site_do"))); $this->Daily_site_do->SetDBValue(trim($this->f("Daily_site_do"))); $this->kontakt->SetDBValue($this->f("kontakt")); $this->Pocetak_saradnje->SetDBValue(trim($this->f("Pocetak_saradnje"))); $this->napomena->SetDBValue($this->f("napomena")); $this->Organizacija->SetDBValue($this->f("Organizacija")); $this->Adresa->SetDBValue($this->f("Adresa")); $this->E_mail->SetDBValue($this->f("E_mail")); $this->Telefon->SetDBValue($this->f("Telefon")); $this->Fax->SetDBValue($this->f("Fax")); $this->Mobilni->SetDBValue($this->f("Mobilni")); $this->MinaCijeli_site_do->SetDBValue(trim($this->f("MinaCijeli_site_do"))); } //End SetValues Method
//Insert Method @2-3A034E84 function Insert() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent); $this->InsertFields["Web"]["Value"] = $this->Web->GetDBValue(true); $this->InsertFields["MinaGen_site_do"]["Value"] = $this->MinaGen_site_do->GetDBValue(true); $this->InsertFields["MinaBiz_site_do"]["Value"] = $this->MinaBiz_site_do->GetDBValue(true); $this->InsertFields["Daily_site_do"]["Value"] = $this->Daily_site_do->GetDBValue(true); $this->InsertFields["kontakt"]["Value"] = $this->kontakt->GetDBValue(true); $this->InsertFields["Pocetak_saradnje"]["Value"] = $this->Pocetak_saradnje->GetDBValue(true); $this->InsertFields["napomena"]["Value"] = $this->napomena->GetDBValue(true); $this->InsertFields["Organizacija"]["Value"] = $this->Organizacija->GetDBValue(true); $this->InsertFields["Adresa"]["Value"] = $this->Adresa->GetDBValue(true); $this->InsertFields["E_mail"]["Value"] = $this->E_mail->GetDBValue(true); $this->InsertFields["Telefon"]["Value"] = $this->Telefon->GetDBValue(true); $this->InsertFields["Fax"]["Value"] = $this->Fax->GetDBValue(true); $this->InsertFields["Mobilni"]["Value"] = $this->Mobilni->GetDBValue(true); $this->InsertFields["MinaCijeli_site_do"]["Value"] = $this->MinaCijeli_site_do->GetDBValue(true); $this->SQL = CCBuildInsert("klijenti", $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-5B400209 function Update() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent); $this->UpdateFields["Web"]["Value"] = $this->Web->GetDBValue(true); $this->UpdateFields["MinaGen_site_do"]["Value"] = $this->MinaGen_site_do->GetDBValue(true); $this->UpdateFields["MinaBiz_site_do"]["Value"] = $this->MinaBiz_site_do->GetDBValue(true); $this->UpdateFields["Daily_site_do"]["Value"] = $this->Daily_site_do->GetDBValue(true); $this->UpdateFields["kontakt"]["Value"] = $this->kontakt->GetDBValue(true); $this->UpdateFields["Pocetak_saradnje"]["Value"] = $this->Pocetak_saradnje->GetDBValue(true); $this->UpdateFields["napomena"]["Value"] = $this->napomena->GetDBValue(true); $this->UpdateFields["Organizacija"]["Value"] = $this->Organizacija->GetDBValue(true); $this->UpdateFields["Adresa"]["Value"] = $this->Adresa->GetDBValue(true); $this->UpdateFields["E_mail"]["Value"] = $this->E_mail->GetDBValue(true); $this->UpdateFields["Telefon"]["Value"] = $this->Telefon->GetDBValue(true); $this->UpdateFields["Fax"]["Value"] = $this->Fax->GetDBValue(true); $this->UpdateFields["Mobilni"]["Value"] = $this->Mobilni->GetDBValue(true); $this->UpdateFields["MinaCijeli_site_do"]["Value"] = $this->MinaCijeli_site_do->GetDBValue(true); $this->SQL = CCBuildUpdate("klijenti", $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-F9933BEE function Delete() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent); $this->SQL = "DELETE FROM klijenti"; $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 phpSP_usersDataSource Class @2-FCB6E20C
class clsGridtransakcije { //transakcije class @208-930EB02F
//Variables @208-48464A63
// Public variables public $ComponentType = "Grid"; public $ComponentName; public $Visible; public $Errors; public $ErrorBlock; public $ds; public $DataSource; public $PageSize; public $IsEmpty; public $ForceIteration = false; public $HasRecord = false; public $SorterName = ""; public $SorterDirection = ""; public $PageNumber; public $RowNumber; public $ControlsVisible = array();
public $CCSEvents = ""; public $CCSEventResult;
public $RelativePath = ""; public $Attributes;
// Grid Controls public $StaticControls; public $RowControls; public $Sorter_id_transakcije; public $Sorter_id_klijenta; public $Sorter_datum_transakcije; public $Sorter_tip_transakcije; public $Sorter_iznos_transakcije; //End Variables
//Class_Initialize Event @208-E3E1C219 function clsGridtransakcije($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "transakcije"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid transakcije"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clstransakcijeDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = CCGetParam($this->ComponentName . "PageSize", ""); if(!is_numeric($this->PageSize) || !strlen($this->PageSize)) $this->PageSize = 15; 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->SorterName = CCGetParam("transakcijeOrder", ""); $this->SorterDirection = CCGetParam("transakcijeDir", "");
$this->datum_transakcije = new clsControl(ccsLink, "datum_transakcije", "datum_transakcije", ccsDate, array("dd", "/", "mm", "/", "yyyy"), CCGetRequestParam("datum_transakcije", ccsGet, NULL), $this); $this->datum_transakcije->Page = "phpSP_user_maint.php"; $this->tip_transakcije = new clsControl(ccsLabel, "tip_transakcije", "tip_transakcije", ccsText, "", CCGetRequestParam("tip_transakcije", ccsGet, NULL), $this); $this->iznos_transakcije = new clsControl(ccsLabel, "iznos_transakcije", "iznos_transakcije", ccsFloat, array(False, 2, Null, "", False, "", "", 1, True, ""), CCGetRequestParam("iznos_transakcije", ccsGet, NULL), $this); $this->Sorter_id_transakcije = new clsSorter($this->ComponentName, "Sorter_id_transakcije", $FileName, $this); $this->Sorter_id_klijenta = new clsSorter($this->ComponentName, "Sorter_id_klijenta", $FileName, $this); $this->id_transakcije = new clsControl(ccsLabel, "id_transakcije", "id_transakcije", ccsInteger, "", CCGetRequestParam("id_transakcije", ccsGet, NULL), $this); $this->id_klijenta = new clsControl(ccsLabel, "id_klijenta", "id_klijenta", ccsInteger, "", CCGetRequestParam("id_klijenta", ccsGet, NULL), $this); $this->Sorter_datum_transakcije = new clsSorter($this->ComponentName, "Sorter_datum_transakcije", $FileName, $this); $this->Sorter_tip_transakcije = new clsSorter($this->ComponentName, "Sorter_tip_transakcije", $FileName, $this); $this->Sorter_iznos_transakcije = new clsSorter($this->ComponentName, "Sorter_iznos_transakcije", $FileName, $this); $this->transakcije_Insert = new clsControl(ccsLink, "transakcije_Insert", "transakcije_Insert", ccsText, "", CCGetRequestParam("transakcije_Insert", ccsGet, NULL), $this); $this->transakcije_Insert->Parameters = CCGetQueryString("QueryString", array("id_transakcije", "ccsForm")); $this->transakcije_Insert->Page = "phpSP_user_maint.php"; $this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple, $this); } //End Class_Initialize Event
//Initialize Method @208-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 @208-357ADEBC function Show() { global $Tpl; global $CCSLocales; if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["urlklijent"] = CCGetFromGet("klijent", NULL);
$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["datum_transakcije"] = $this->datum_transakcije->Visible; $this->ControlsVisible["tip_transakcije"] = $this->tip_transakcije->Visible; $this->ControlsVisible["iznos_transakcije"] = $this->iznos_transakcije->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->datum_transakcije->SetValue($this->DataSource->datum_transakcije->GetValue()); $this->datum_transakcije->Parameters = CCGetQueryString("QueryString", array("ccsForm")); $this->datum_transakcije->Parameters = CCAddParam($this->datum_transakcije->Parameters, "id_transakcije", $this->DataSource->f("id_transakcije")); $this->tip_transakcije->SetValue($this->DataSource->tip_transakcije->GetValue()); $this->iznos_transakcije->SetValue($this->DataSource->iznos_transakcije->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->datum_transakcije->Show(); $this->tip_transakcije->Show(); $this->iznos_transakcije->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->id_transakcije->SetValue($this->DataSource->id_transakcije->GetValue()); $this->id_klijenta->SetValue($this->DataSource->id_klijenta->GetValue()); $this->Navigator->PageNumber = $this->DataSource->AbsolutePage; 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(); $this->Sorter_id_transakcije->Show(); $this->Sorter_id_klijenta->Show(); $this->id_transakcije->Show(); $this->id_klijenta->Show(); $this->Sorter_datum_transakcije->Show(); $this->Sorter_tip_transakcije->Show(); $this->Sorter_iznos_transakcije->Show(); $this->transakcije_Insert->Show(); $this->Navigator->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->DataSource->close(); } //End Show Method
//GetErrors Method @208-EE6190D9 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->datum_transakcije->Errors->ToString()); $errors = ComposeStrings($errors, $this->tip_transakcije->Errors->ToString()); $errors = ComposeStrings($errors, $this->iznos_transakcije->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method
} //End transakcije Class @208-FCB6E20C
class clstransakcijeDataSource extends clsDBConnection1 { //transakcijeDataSource Class @208-40DC2550
//DataSource Variables @208-6024237C public $Parent = ""; public $CCSEvents = ""; public $CCSEventResult; public $ErrorBlock; public $CmdExecution;
public $CountSQL; public $wp;
// Datasource fields public $id_transakcije; public $id_klijenta; public $datum_transakcije; public $tip_transakcije; public $iznos_transakcije; //End DataSource Variables
//DataSourceClass_Initialize Event @208-12753724 function clstransakcijeDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid transakcije"; $this->Initialize(); $this->id_transakcije = new clsField("id_transakcije", ccsInteger, ""); $this->id_klijenta = new clsField("id_klijenta", ccsInteger, ""); $this->datum_transakcije = new clsField("datum_transakcije", ccsDate, array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss")); $this->tip_transakcije = new clsField("tip_transakcije", ccsText, ""); $this->iznos_transakcije = new clsField("iznos_transakcije", ccsFloat, "");
} //End DataSourceClass_Initialize Event
//SetOrder Method @208-5EBA3C47 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, array("Sorter_id_transakcije" => array("id_transakcije", ""), "Sorter_id_klijenta" => array("id_klijenta", ""), "Sorter_datum_transakcije" => array("datum_transakcije", ""), "Sorter_tip_transakcije" => array("tip_transakcije", ""), "Sorter_iznos_transakcije" => array("iznos_transakcije", ""))); } //End SetOrder Method
//Prepare Method @208-E74B2AB2 function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlklijent", ccsInteger, "", "", $this->Parameters["urlklijent"], "", false); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "transakcije.id_klijenta", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @208-3240EC41 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*)\n\n" . "FROM transakcije INNER JOIN opis_transakcije ON\n\n" . "transakcije.tip_transakcije = opis_transakcije.id_trans"; $this->SQL = "SELECT id_transakcije, datum_transakcije, tip_transakcije, iznos_transakcije, id_klijenta, opis_transakcije.* \n\n" . "FROM transakcije INNER JOIN opis_transakcije ON\n\n" . "transakcije.tip_transakcije = opis_transakcije.id_trans {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 @208-95A9CAB5 function SetValues() { $this->id_transakcije->SetDBValue(trim($this->f("id_transakcije"))); $this->id_klijenta->SetDBValue(trim($this->f("id_klijenta"))); $this->datum_transakcije->SetDBValue(trim($this->f("datum_transakcije"))); $this->tip_transakcije->SetDBValue($this->f("tip")); $this->iznos_transakcije->SetDBValue(trim($this->f("iznos_transakcije"))); } //End SetValues Method
} //End transakcijeDataSource Class @208-FCB6E20C
class clsRecordtransakcije1 { //transakcije1 Class @227-D9D0A313
//Variables @227-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 @227-7EA2A6EA function clsRecordtransakcije1($RelativePath, & $Parent) {
global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->Visible = true; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Record transakcije1/Error"; $this->DataSource = new clstransakcije1DataSource($this); $this->ds = & $this->DataSource; $this->InsertAllowed = true; $this->UpdateAllowed = true; $this->DeleteAllowed = true; $this->ReadAllowed = true; if($this->Visible) { $this->ComponentName = "transakcije1"; $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->tip_transakcije = new clsControl(ccsListBox, "tip_transakcije", "Tip Transakcije", ccsInteger, "", CCGetRequestParam("tip_transakcije", $Method, NULL), $this); $this->tip_transakcije->DSType = dsTable; list($this->tip_transakcije->BoundColumn, $this->tip_transakcije->TextColumn, $this->tip_transakcije->DBFormat) = array("id_trans", "tip", ""); $this->tip_transakcije->DataSource = new clsDBConnection1(); $this->tip_transakcije->ds = & $this->tip_transakcije->DataSource; $this->tip_transakcije->DataSource->SQL = "SELECT * \n" . "FROM opis_transakcije {SQL_Where} {SQL_OrderBy}"; $this->tip_transakcije->Required = true; $this->iznos_transakcije = new clsControl(ccsTextBox, "iznos_transakcije", "Iznos Transakcije", ccsFloat, "", CCGetRequestParam("iznos_transakcije", $Method, NULL), $this); $this->iznos_transakcije->Required = true; $this->id_klijenta = new clsControl(ccsHidden, "id_klijenta", "Id Klijenta", ccsInteger, "", CCGetRequestParam("id_klijenta", $Method, NULL), $this); $this->id_klijenta->Required = true; $this->datum_transakcije = new clsControl(ccsTextBox, "datum_transakcije", "Datum Transakcije", ccsDate, array("dd", "/", "mm", "/", "yyyy"), CCGetRequestParam("datum_transakcije", $Method, NULL), $this); $this->datum_transakcije->Required = true; $this->DatePicker_datum_transakcije = new clsDatePicker("DatePicker_datum_transakcije", "transakcije1", "datum_transakcije", $this); $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 @227-DC671670 function Initialize() {
if(!$this->Visible) return;
$this->DataSource->Parameters["urlid_transakcije"] = CCGetFromGet("id_transakcije", NULL); } //End Initialize Method
//Validate Method @227-3D009967 function Validate() { global $CCSLocales; $Validation = true; $Where = ""; $Validation = ($this->tip_transakcije->Validate() && $Validation); $Validation = ($this->iznos_transakcije->Validate() && $Validation); $Validation = ($this->id_klijenta->Validate() && $Validation); $Validation = ($this->datum_transakcije->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this); $Validation = $Validation && ($this->tip_transakcije->Errors->Count() == 0); $Validation = $Validation && ($this->iznos_transakcije->Errors->Count() == 0); $Validation = $Validation && ($this->id_klijenta->Errors->Count() == 0); $Validation = $Validation && ($this->datum_transakcije->Errors->Count() == 0); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method
//CheckErrors Method @227-45C31A44 function CheckErrors() { $errors = false; $errors = ($errors || $this->tip_transakcije->Errors->Count()); $errors = ($errors || $this->iznos_transakcije->Errors->Count()); $errors = ($errors || $this->id_klijenta->Errors->Count()); $errors = ($errors || $this->datum_transakcije->Errors->Count()); $errors = ($errors || $this->DatePicker_datum_transakcije->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->DataSource->Errors->Count()); return $errors; } //End CheckErrors Method
//Operation Method @227-B908BA44 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 = $FileName . "?" . 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 @227-2F109FD7 function InsertRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this); if(!$this->InsertAllowed) return false; $this->DataSource->tip_transakcije->SetValue($this->tip_transakcije->GetValue(true)); $this->DataSource->iznos_transakcije->SetValue($this->iznos_transakcije->GetValue(true)); $this->DataSource->id_klijenta->SetValue($this->id_klijenta->GetValue(true)); $this->DataSource->datum_transakcije->SetValue($this->datum_transakcije->GetValue(true)); $this->DataSource->Insert(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this); return (!$this->CheckErrors()); } //End InsertRow Method
//UpdateRow Method @227-BE8F0B98 function UpdateRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this); if(!$this->UpdateAllowed) return false; $this->DataSource->tip_transakcije->SetValue($this->tip_transakcije->GetValue(true)); $this->DataSource->iznos_transakcije->SetValue($this->iznos_transakcije->GetValue(true)); $this->DataSource->id_klijenta->SetValue($this->id_klijenta->GetValue(true)); $this->DataSource->datum_transakcije->SetValue($this->datum_transakcije->GetValue(true)); $this->DataSource->Update(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this); return (!$this->CheckErrors()); } //End UpdateRow Method
//DeleteRow Method @227-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 @227-5E74E9B7 function Show() { global $Tpl; global $FileName; global $CCSLocales; $Error = "";
if(!$this->Visible) return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->tip_transakcije->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->tip_transakcije->SetValue($this->DataSource->tip_transakcije->GetValue()); $this->iznos_transakcije->SetValue($this->DataSource->iznos_transakcije->GetValue()); $this->id_klijenta->SetValue($this->DataSource->id_klijenta->GetValue()); $this->datum_transakcije->SetValue($this->DataSource->datum_transakcije->GetValue()); } } else { $this->EditMode = false; } } if ($this->iznos_transakcije->GetValue() < 0 ) $this->iznos_transakcije->Text = CCFormatNumber($this->iznos_transakcije->GetValue(), array(True, 1, Null, "", True, array("(", "0"), array("#", ")"), 1, True, "")); else $this->iznos_transakcije->Text = CCFormatNumber($this->iznos_transakcije->GetValue(), array(True, 1, Null, "", False, array("0"), array("#"), 1, True, ""));
if($this->FormSubmitted || $this->CheckErrors()) { $Error = ""; $Error = ComposeStrings($Error, $this->tip_transakcije->Errors->ToString()); $Error = ComposeStrings($Error, $this->iznos_transakcije->Errors->ToString()); $Error = ComposeStrings($Error, $this->id_klijenta->Errors->ToString()); $Error = ComposeStrings($Error, $this->datum_transakcije->Errors->ToString()); $Error = ComposeStrings($Error, $this->DatePicker_datum_transakcije->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->tip_transakcije->Show(); $this->iznos_transakcije->Show(); $this->id_klijenta->Show(); $this->datum_transakcije->Show(); $this->DatePicker_datum_transakcije->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 transakcije1 Class @227-FCB6E20C
class clstransakcije1DataSource extends clsDBConnection1 { //transakcije1DataSource Class @227-9669F406
//DataSource Variables @227-5D8B1FF3 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 $tip_transakcije; public $iznos_transakcije; public $id_klijenta; public $datum_transakcije; //End DataSource Variables
//DataSourceClass_Initialize Event @227-C05BC5B2 function clstransakcije1DataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Record transakcije1/Error"; $this->Initialize(); $this->tip_transakcije = new clsField("tip_transakcije", ccsInteger, ""); $this->iznos_transakcije = new clsField("iznos_transakcije", ccsFloat, ""); $this->id_klijenta = new clsField("id_klijenta", ccsInteger, ""); $this->datum_transakcije = new clsField("datum_transakcije", ccsDate, array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"));
$this->InsertFields["tip_transakcije"] = array("Name" => "tip_transakcije", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["iznos_transakcije"] = array("Name" => "iznos_transakcije", "Value" => "", "DataType" => ccsFloat); $this->InsertFields["id_klijenta"] = array("Name" => "id_klijenta", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["datum_transakcije"] = array("Name" => "datum_transakcije", "Value" => "", "DataType" => ccsDate); $this->UpdateFields["tip_transakcije"] = array("Name" => "tip_transakcije", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["iznos_transakcije"] = array("Name" => "iznos_transakcije", "Value" => "", "DataType" => ccsFloat); $this->UpdateFields["id_klijenta"] = array("Name" => "id_klijenta", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["datum_transakcije"] = array("Name" => "datum_transakcije", "Value" => "", "DataType" => ccsDate); } //End DataSourceClass_Initialize Event
//Prepare Method @227-99A1D553 function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlid_transakcije", ccsInteger, "", "", $this->Parameters["urlid_transakcije"], "", false); $this->AllParametersSet = $this->wp->AllParamsSet(); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "id_transakcije", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @227-62056C7D function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->SQL = "SELECT * \n\n" . "FROM transakcije {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 @227-7EFB26DE function SetValues() { $this->tip_transakcije->SetDBValue(trim($this->f("tip_transakcije"))); $this->iznos_transakcije->SetDBValue(trim($this->f("iznos_transakcije"))); $this->id_klijenta->SetDBValue(trim($this->f("id_klijenta"))); $this->datum_transakcije->SetDBValue(trim($this->f("datum_transakcije"))); } //End SetValues Method
//Insert Method @227-E1D4429A function Insert() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent); $this->InsertFields["tip_transakcije"]["Value"] = $this->tip_transakcije->GetDBValue(true); $this->InsertFields["iznos_transakcije"]["Value"] = $this->iznos_transakcije->GetDBValue(true); $this->InsertFields["id_klijenta"]["Value"] = $this->id_klijenta->GetDBValue(true); $this->InsertFields["datum_transakcije"]["Value"] = $this->datum_transakcije->GetDBValue(true); $this->SQL = CCBuildInsert("transakcije", $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 @227-6B91948B function Update() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent); $this->UpdateFields["tip_transakcije"]["Value"] = $this->tip_transakcije->GetDBValue(true); $this->UpdateFields["iznos_transakcije"]["Value"] = $this->iznos_transakcije->GetDBValue(true); $this->UpdateFields["id_klijenta"]["Value"] = $this->id_klijenta->GetDBValue(true); $this->UpdateFields["datum_transakcije"]["Value"] = $this->datum_transakcije->GetDBValue(true); $this->SQL = CCBuildUpdate("transakcije", $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 @227-18B14E98 function Delete() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent); $this->SQL = "DELETE FROM transakcije"; $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 transakcije1DataSource Class @227-FCB6E20C
class clsGriddokumenti { //dokumenti class @242-41F6DD22
//Variables @242-01D28694
// Public variables public $ComponentType = "Grid"; public $ComponentName; public $Visible; public $Errors; public $ErrorBlock; public $ds; public $DataSource; public $PageSize; public $IsEmpty; public $ForceIteration = false; public $HasRecord = false; public $SorterName = ""; public $SorterDirection = ""; public $PageNumber; public $RowNumber; public $ControlsVisible = array();
public $CCSEvents = ""; public $CCSEventResult;
public $RelativePath = ""; public $Attributes;
// Grid Controls public $StaticControls; public $RowControls; public $Sorter_id_dok; public $Sorter_datum_dok; public $Sorter_tip_dok; public $Sorter_fajl_dok; //End Variables
//Class_Initialize Event @242-50243E3B function clsGriddokumenti($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "dokumenti"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid dokumenti"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsdokumentiDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = CCGetParam($this->ComponentName . "PageSize", ""); if(!is_numeric($this->PageSize) || !strlen($this->PageSize)) $this->PageSize = 10; 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->SorterName = CCGetParam("dokumentiOrder", ""); $this->SorterDirection = CCGetParam("dokumentiDir", "");
$this->datum_dok = new clsControl(ccsLink, "datum_dok", "datum_dok", ccsDate, $DefaultDateFormat, CCGetRequestParam("datum_dok", ccsGet, NULL), $this); $this->datum_dok->Page = "phpSP_user_maint.php"; $this->tip_dok = new clsControl(ccsLabel, "tip_dok", "tip_dok", ccsInteger, "", CCGetRequestParam("tip_dok", ccsGet, NULL), $this); $this->Opis_dok = new clsControl(ccsLabel, "Opis_dok", "Opis_dok", ccsMemo, "", CCGetRequestParam("Opis_dok", ccsGet, NULL), $this); $this->fajl_dok = new clsControl(ccsLabel, "fajl_dok", "fajl_dok", ccsText, "", CCGetRequestParam("fajl_dok", ccsGet, NULL), $this); $this->Sorter_id_dok = new clsSorter($this->ComponentName, "Sorter_id_dok", $FileName, $this); $this->id_dok = new clsControl(ccsLabel, "id_dok", "id_dok", ccsInteger, "", CCGetRequestParam("id_dok", ccsGet, NULL), $this); $this->Sorter_datum_dok = new clsSorter($this->ComponentName, "Sorter_datum_dok", $FileName, $this); $this->Sorter_tip_dok = new clsSorter($this->ComponentName, "Sorter_tip_dok", $FileName, $this); $this->Sorter_fajl_dok = new clsSorter($this->ComponentName, "Sorter_fajl_dok", $FileName, $this); $this->dokumenti_Insert = new clsControl(ccsLink, "dokumenti_Insert", "dokumenti_Insert", ccsText, "", CCGetRequestParam("dokumenti_Insert", ccsGet, NULL), $this); $this->dokumenti_Insert->Parameters = CCGetQueryString("QueryString", array("id_dok", "ccsForm")); $this->dokumenti_Insert->Page = "phpSP_user_maint.php"; $this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple, $this); } //End Class_Initialize Event
//Initialize Method @242-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 @242-F4878CF2 function Show() { global $Tpl; global $CCSLocales; if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["urlklijent"] = CCGetFromGet("klijent", NULL);
$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["datum_dok"] = $this->datum_dok->Visible; $this->ControlsVisible["tip_dok"] = $this->tip_dok->Visible; $this->ControlsVisible["Opis_dok"] = $this->Opis_dok->Visible; $this->ControlsVisible["fajl_dok"] = $this->fajl_dok->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->datum_dok->SetValue($this->DataSource->datum_dok->GetValue()); $this->datum_dok->Parameters = CCGetQueryString("QueryString", array("ccsForm")); $this->datum_dok->Parameters = CCAddParam($this->datum_dok->Parameters, "id_dok", $this->DataSource->f("id_dok")); $this->tip_dok->SetValue($this->DataSource->tip_dok->GetValue()); $this->Opis_dok->SetValue($this->DataSource->Opis_dok->GetValue()); $this->fajl_dok->SetValue($this->DataSource->fajl_dok->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->datum_dok->Show(); $this->tip_dok->Show(); $this->Opis_dok->Show(); $this->fajl_dok->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->id_dok->SetValue($this->DataSource->id_dok->GetValue()); $this->Navigator->PageNumber = $this->DataSource->AbsolutePage; 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(); $this->Sorter_id_dok->Show(); $this->id_dok->Show(); $this->Sorter_datum_dok->Show(); $this->Sorter_tip_dok->Show(); $this->Sorter_fajl_dok->Show(); $this->dokumenti_Insert->Show(); $this->Navigator->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->DataSource->close(); } //End Show Method
//GetErrors Method @242-A7585855 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->datum_dok->Errors->ToString()); $errors = ComposeStrings($errors, $this->tip_dok->Errors->ToString()); $errors = ComposeStrings($errors, $this->Opis_dok->Errors->ToString()); $errors = ComposeStrings($errors, $this->fajl_dok->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method
} //End dokumenti Class @242-FCB6E20C
class clsdokumentiDataSource extends clsDBConnection1 { //dokumentiDataSource Class @242-8106AA55
//DataSource Variables @242-067B17BF public $Parent = ""; public $CCSEvents = ""; public $CCSEventResult; public $ErrorBlock; public $CmdExecution;
public $CountSQL; public $wp;
// Datasource fields public $id_dok; public $datum_dok; public $tip_dok; public $Opis_dok; public $fajl_dok; //End DataSource Variables
//DataSourceClass_Initialize Event @242-9923DB82 function clsdokumentiDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid dokumenti"; $this->Initialize(); $this->id_dok = new clsField("id_dok", ccsInteger, ""); $this->datum_dok = new clsField("datum_dok", ccsDate, array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss")); $this->tip_dok = new clsField("tip_dok", ccsInteger, ""); $this->Opis_dok = new clsField("Opis_dok", ccsMemo, ""); $this->fajl_dok = new clsField("fajl_dok", ccsText, "");
} //End DataSourceClass_Initialize Event
//SetOrder Method @242-9B795EAE function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, array("Sorter_id_dok" => array("id_dok", ""), "Sorter_datum_dok" => array("datum_dok", ""), "Sorter_tip_dok" => array("tip_dok", ""), "Sorter_fajl_dok" => array("fajl_dok", ""))); } //End SetOrder Method
//Prepare Method @242-01647CDD function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlklijent", ccsInteger, "", "", $this->Parameters["urlklijent"], "", false); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "korisnik_dokument", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @242-2F5B5449 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*)\n\n" . "FROM dokumenti"; $this->SQL = "SELECT id_dok, datum_dok, tip_dok, Opis_dok, fajl_dok \n\n" . "FROM dokumenti {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 @242-CB9D28CA function SetValues() { $this->id_dok->SetDBValue(trim($this->f("id_dok"))); $this->datum_dok->SetDBValue(trim($this->f("datum_dok"))); $this->tip_dok->SetDBValue(trim($this->f("tip_dok"))); $this->Opis_dok->SetDBValue($this->f("Opis_dok")); $this->fajl_dok->SetDBValue($this->f("fajl_dok")); } //End SetValues Method
} //End dokumentiDataSource Class @242-FCB6E20C
class clsRecorddokumenti1 { //dokumenti1 Class @260-E8DE7A44
//Variables @260-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 @260-B97EC64C function clsRecorddokumenti1($RelativePath, & $Parent) {
global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->Visible = true; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Record dokumenti1/Error"; $this->DataSource = new clsdokumenti1DataSource($this); $this->ds = & $this->DataSource; $this->InsertAllowed = true; $this->UpdateAllowed = true; $this->DeleteAllowed = true; $this->ReadAllowed = true; if($this->Visible) { $this->ComponentName = "dokumenti1"; $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 = "multipart/form-data"; $this->FormSubmitted = ($FormName == $this->ComponentName); $Method = $this->FormSubmitted ? ccsPost : ccsGet; $this->Hidden1 = new clsControl(ccsHidden, "Hidden1", "Hidden1", ccsInteger, "", CCGetRequestParam("Hidden1", $Method, NULL), $this); $this->tip_dok = new clsControl(ccsListBox, "tip_dok", "Tip Dok", ccsInteger, "", CCGetRequestParam("tip_dok", $Method, NULL), $this); $this->tip_dok->DSType = dsTable; list($this->tip_dok->BoundColumn, $this->tip_dok->TextColumn, $this->tip_dok->DBFormat) = array("id_tip_dok", "tip_dok", ""); $this->tip_dok->DataSource = new clsDBConnection1(); $this->tip_dok->ds = & $this->tip_dok->DataSource; $this->tip_dok->DataSource->SQL = "SELECT * \n" . "FROM tipovi_dokumenata {SQL_Where} {SQL_OrderBy}"; $this->tip_dok->Required = true; $this->Hidden2 = new clsControl(ccsHidden, "Hidden2", "Hidden2", ccsInteger, "", CCGetRequestParam("Hidden2", $Method, NULL), $this); $this->Opis_dok = new clsControl(ccsTextArea, "Opis_dok", "Opis Dok", ccsMemo, "", CCGetRequestParam("Opis_dok", $Method, NULL), $this); $this->Opis_dok->Required = true; $this->FileUpload1 = new clsFileUpload("FileUpload1", "FileUpload1", "/home/mnnews/public_html/mina/manage/temp/", "/home/mnnews/public_html/mina/manage/dokumenti/", "*", "", 5000000, $this); $this->FileUpload1->Required = true; $this->datum_dok = new clsControl(ccsTextBox, "datum_dok", "Datum Dok", ccsDate, array("dd", "/", "mm", "/", "yyyy"), CCGetRequestParam("datum_dok", $Method, NULL), $this); $this->datum_dok->Required = true; $this->DatePicker_datum_dok = new clsDatePicker("DatePicker_datum_dok", "dokumenti1", "datum_dok", $this); $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 @260-7B2A9C64 function Initialize() {
if(!$this->Visible) return;
$this->DataSource->Parameters["urlid_dok"] = CCGetFromGet("id_dok", NULL); } //End Initialize Method
//Validate Method @260-A73E7DE3 function Validate() { global $CCSLocales; $Validation = true; $Where = ""; $Validation = ($this->Hidden1->Validate() && $Validation); $Validation = ($this->tip_dok->Validate() && $Validation); $Validation = ($this->Hidden2->Validate() && $Validation); $Validation = ($this->Opis_dok->Validate() && $Validation); $Validation = ($this->FileUpload1->Validate() && $Validation); $Validation = ($this->datum_dok->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this); $Validation = $Validation && ($this->Hidden1->Errors->Count() == 0); $Validation = $Validation && ($this->tip_dok->Errors->Count() == 0); $Validation = $Validation && ($this->Hidden2->Errors->Count() == 0); $Validation = $Validation && ($this->Opis_dok->Errors->Count() == 0); $Validation = $Validation && ($this->FileUpload1->Errors->Count() == 0); $Validation = $Validation && ($this->datum_dok->Errors->Count() == 0); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method
//CheckErrors Method @260-1C32F178 function CheckErrors() { $errors = false; $errors = ($errors || $this->Hidden1->Errors->Count()); $errors = ($errors || $this->tip_dok->Errors->Count()); $errors = ($errors || $this->Hidden2->Errors->Count()); $errors = ($errors || $this->Opis_dok->Errors->Count()); $errors = ($errors || $this->FileUpload1->Errors->Count()); $errors = ($errors || $this->datum_dok->Errors->Count()); $errors = ($errors || $this->DatePicker_datum_dok->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->DataSource->Errors->Count()); return $errors; } //End CheckErrors Method
//Operation Method @260-2D78CF33 function Operation() { if(!$this->Visible) return;
global $Redirect; global $FileName;
$this->DataSource->Prepare(); if(!$this->FormSubmitted) { $this->EditMode = $this->DataSource->AllParametersSet; return; }
$this->FileUpload1->Upload();
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 = $FileName . "?" . 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 @260-5909E2AB function InsertRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this); if(!$this->InsertAllowed) return false; $this->DataSource->Hidden1->SetValue($this->Hidden1->GetValue(true)); $this->DataSource->tip_dok->SetValue($this->tip_dok->GetValue(true)); $this->DataSource->Hidden2->SetValue($this->Hidden2->GetValue(true)); $this->DataSource->Opis_dok->SetValue($this->Opis_dok->GetValue(true)); $this->DataSource->FileUpload1->SetValue($this->FileUpload1->GetValue(true)); $this->DataSource->datum_dok->SetValue($this->datum_dok->GetValue(true)); $this->DataSource->Insert(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this); if($this->DataSource->Errors->Count() == 0) { $this->FileUpload1->Move(); } return (!$this->CheckErrors()); } //End InsertRow Method
//UpdateRow Method @260-59BC2D65 function UpdateRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this); if(!$this->UpdateAllowed) return false; $this->DataSource->Hidden1->SetValue($this->Hidden1->GetValue(true)); $this->DataSource->tip_dok->SetValue($this->tip_dok->GetValue(true)); $this->DataSource->Hidden2->SetValue($this->Hidden2->GetValue(true)); $this->DataSource->Opis_dok->SetValue($this->Opis_dok->GetValue(true)); $this->DataSource->FileUpload1->SetValue($this->FileUpload1->GetValue(true)); $this->DataSource->datum_dok->SetValue($this->datum_dok->GetValue(true)); $this->DataSource->Update(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this); if($this->DataSource->Errors->Count() == 0) { $this->FileUpload1->Move(); } return (!$this->CheckErrors()); } //End UpdateRow Method
//DeleteRow Method @260-2B077D44 function DeleteRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeDelete", $this); if(!$this->DeleteAllowed) return false; $this->DataSource->Delete(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterDelete", $this); if($this->DataSource->Errors->Count() == 0) { $this->FileUpload1->Delete(); } return (!$this->CheckErrors()); } //End DeleteRow Method
//Show Method @260-188EBD2C function Show() { global $Tpl; global $FileName; global $CCSLocales; $Error = "";
if(!$this->Visible) return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->tip_dok->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->Hidden1->SetValue($this->DataSource->Hidden1->GetValue()); $this->tip_dok->SetValue($this->DataSource->tip_dok->GetValue()); $this->Hidden2->SetValue($this->DataSource->Hidden2->GetValue()); $this->Opis_dok->SetValue($this->DataSource->Opis_dok->GetValue()); $this->FileUpload1->SetValue($this->DataSource->FileUpload1->GetValue()); $this->datum_dok->SetValue($this->DataSource->datum_dok->GetValue()); } } else { $this->EditMode = false; } }
if($this->FormSubmitted || $this->CheckErrors()) { $Error = ""; $Error = ComposeStrings($Error, $this->Hidden1->Errors->ToString()); $Error = ComposeStrings($Error, $this->tip_dok->Errors->ToString()); $Error = ComposeStrings($Error, $this->Hidden2->Errors->ToString()); $Error = ComposeStrings($Error, $this->Opis_dok->Errors->ToString()); $Error = ComposeStrings($Error, $this->FileUpload1->Errors->ToString()); $Error = ComposeStrings($Error, $this->datum_dok->Errors->ToString()); $Error = ComposeStrings($Error, $this->DatePicker_datum_dok->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->Hidden1->Show(); $this->tip_dok->Show(); $this->Hidden2->Show(); $this->Opis_dok->Show(); $this->FileUpload1->Show(); $this->datum_dok->Show(); $this->DatePicker_datum_dok->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 dokumenti1 Class @260-FCB6E20C
class clsdokumenti1DataSource extends clsDBConnection1 { //dokumenti1DataSource Class @260-E6C2DA06
//DataSource Variables @260-E9EFD974 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 $Hidden1; public $tip_dok; public $Hidden2; public $Opis_dok; public $FileUpload1; public $datum_dok; //End DataSource Variables
//DataSourceClass_Initialize Event @260-82EAD842 function clsdokumenti1DataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Record dokumenti1/Error"; $this->Initialize(); $this->Hidden1 = new clsField("Hidden1", ccsInteger, ""); $this->tip_dok = new clsField("tip_dok", ccsInteger, ""); $this->Hidden2 = new clsField("Hidden2", ccsInteger, ""); $this->Opis_dok = new clsField("Opis_dok", ccsMemo, ""); $this->FileUpload1 = new clsField("FileUpload1", ccsText, ""); $this->datum_dok = new clsField("datum_dok", ccsDate, array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"));
$this->InsertFields["korisnik_dokument"] = array("Name" => "korisnik_dokument", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["tip_dok"] = array("Name" => "tip_dok", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["korisnik_dokument"] = array("Name" => "korisnik_dokument", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["Opis_dok"] = array("Name" => "Opis_dok", "Value" => "", "DataType" => ccsMemo); $this->InsertFields["fajl_dok"] = array("Name" => "fajl_dok", "Value" => "", "DataType" => ccsText); $this->InsertFields["datum_dok"] = array("Name" => "datum_dok", "Value" => "", "DataType" => ccsDate); $this->UpdateFields["korisnik_dokument"] = array("Name" => "korisnik_dokument", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["tip_dok"] = array("Name" => "tip_dok", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["korisnik_dokument"] = array("Name" => "korisnik_dokument", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["Opis_dok"] = array("Name" => "Opis_dok", "Value" => "", "DataType" => ccsMemo); $this->UpdateFields["fajl_dok"] = array("Name" => "fajl_dok", "Value" => "", "DataType" => ccsText); $this->UpdateFields["datum_dok"] = array("Name" => "datum_dok", "Value" => "", "DataType" => ccsDate); } //End DataSourceClass_Initialize Event
//Prepare Method @260-10B5C6E5 function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlid_dok", ccsInteger, "", "", $this->Parameters["urlid_dok"], "", false); $this->AllParametersSet = $this->wp->AllParamsSet(); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "id_dok", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @260-880D6A38 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->SQL = "SELECT * \n\n" . "FROM dokumenti {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 @260-D65436AE function SetValues() { $this->Hidden1->SetDBValue(trim($this->f("korisnik_dokument"))); $this->tip_dok->SetDBValue(trim($this->f("tip_dok"))); $this->Hidden2->SetDBValue(trim($this->f("korisnik_dokument"))); $this->Opis_dok->SetDBValue($this->f("Opis_dok")); $this->FileUpload1->SetDBValue($this->f("fajl_dok")); $this->datum_dok->SetDBValue(trim($this->f("datum_dok"))); } //End SetValues Method
//Insert Method @260-FB5CD297 function Insert() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent); $this->InsertFields["korisnik_dokument"]["Value"] = $this->Hidden1->GetDBValue(true); $this->InsertFields["tip_dok"]["Value"] = $this->tip_dok->GetDBValue(true); $this->InsertFields["korisnik_dokument"]["Value"] = $this->Hidden2->GetDBValue(true); $this->InsertFields["Opis_dok"]["Value"] = $this->Opis_dok->GetDBValue(true); $this->InsertFields["fajl_dok"]["Value"] = $this->FileUpload1->GetDBValue(true); $this->InsertFields["datum_dok"]["Value"] = $this->datum_dok->GetDBValue(true); $this->SQL = CCBuildInsert("dokumenti", $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 @260-7C4C1424 function Update() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent); $this->UpdateFields["korisnik_dokument"]["Value"] = $this->Hidden1->GetDBValue(true); $this->UpdateFields["tip_dok"]["Value"] = $this->tip_dok->GetDBValue(true); $this->UpdateFields["korisnik_dokument"]["Value"] = $this->Hidden2->GetDBValue(true); $this->UpdateFields["Opis_dok"]["Value"] = $this->Opis_dok->GetDBValue(true); $this->UpdateFields["fajl_dok"]["Value"] = $this->FileUpload1->GetDBValue(true); $this->UpdateFields["datum_dok"]["Value"] = $this->datum_dok->GetDBValue(true); $this->SQL = CCBuildUpdate("dokumenti", $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 @260-82431B5A function Delete() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent); $this->SQL = "DELETE FROM dokumenti"; $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 dokumenti1DataSource Class @260-FCB6E20C
class clsGride_mail_adrese_korisnika { //e_mail_adrese_korisnika class @179-8AD3A85B
//Variables @179-36835807
// Public variables public $ComponentType = "Grid"; public $ComponentName; public $Visible; public $Errors; public $ErrorBlock; public $ds; public $DataSource; public $PageSize; public $IsEmpty; public $ForceIteration = false; public $HasRecord = false; public $SorterName = ""; public $SorterDirection = ""; public $PageNumber; public $RowNumber; public $ControlsVisible = array();
public $CCSEvents = ""; public $CCSEventResult;
public $RelativePath = ""; public $Attributes;
// Grid Controls public $StaticControls; public $RowControls; public $Sorter_id_korisnika; public $Sorter_id_email_adr; public $Sorter_e_mail_korisnika; public $Sorter_id_izdanja; //End Variables
//Class_Initialize Event @179-2773B094 function clsGride_mail_adrese_korisnika($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "e_mail_adrese_korisnika"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid e_mail_adrese_korisnika"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clse_mail_adrese_korisnikaDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = CCGetParam($this->ComponentName . "PageSize", ""); if(!is_numeric($this->PageSize) || !strlen($this->PageSize)) $this->PageSize = 10; 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->SorterName = CCGetParam("e_mail_adrese_korisnikaOrder", ""); $this->SorterDirection = CCGetParam("e_mail_adrese_korisnikaDir", "");
$this->e_mail_korisnika = new clsControl(ccsLink, "e_mail_korisnika", "e_mail_korisnika", ccsText, "", CCGetRequestParam("e_mail_korisnika", ccsGet, NULL), $this); $this->e_mail_korisnika->Page = "phpSP_user_maint.php"; $this->id_izdanja = new clsControl(ccsLabel, "id_izdanja", "id_izdanja", ccsText, "", CCGetRequestParam("id_izdanja", ccsGet, NULL), $this); $this->Label1 = new clsControl(ccsLabel, "Label1", "Label1", ccsText, "", CCGetRequestParam("Label1", ccsGet, NULL), $this); $this->Sorter_id_korisnika = new clsSorter($this->ComponentName, "Sorter_id_korisnika", $FileName, $this); $this->Sorter_id_email_adr = new clsSorter($this->ComponentName, "Sorter_id_email_adr", $FileName, $this); $this->id_korisnika = new clsControl(ccsLabel, "id_korisnika", "id_korisnika", ccsInteger, "", CCGetRequestParam("id_korisnika", ccsGet, NULL), $this); $this->id_email_adr = new clsControl(ccsLabel, "id_email_adr", "id_email_adr", ccsInteger, "", CCGetRequestParam("id_email_adr", ccsGet, NULL), $this); $this->Sorter_e_mail_korisnika = new clsSorter($this->ComponentName, "Sorter_e_mail_korisnika", $FileName, $this); $this->Sorter_id_izdanja = new clsSorter($this->ComponentName, "Sorter_id_izdanja", $FileName, $this); $this->e_mail_adrese_korisnika_Insert = new clsControl(ccsLink, "e_mail_adrese_korisnika_Insert", "e_mail_adrese_korisnika_Insert", ccsText, "", CCGetRequestParam("e_mail_adrese_korisnika_Insert", ccsGet, NULL), $this); $this->e_mail_adrese_korisnika_Insert->Parameters = CCGetQueryString("QueryString", array("id_email_adr", "ccsForm")); $this->e_mail_adrese_korisnika_Insert->Page = "phpSP_user_maint.php"; $this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple, $this); } //End Class_Initialize Event
//Initialize Method @179-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 @179-09F2AD79 function Show() { global $Tpl; global $CCSLocales; if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["urlklijent"] = CCGetFromGet("klijent", NULL);
$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["e_mail_korisnika"] = $this->e_mail_korisnika->Visible; $this->ControlsVisible["id_izdanja"] = $this->id_izdanja->Visible; $this->ControlsVisible["Label1"] = $this->Label1->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->e_mail_korisnika->SetValue($this->DataSource->e_mail_korisnika->GetValue()); $this->e_mail_korisnika->Parameters = CCGetQueryString("QueryString", array("ccsForm")); $this->e_mail_korisnika->Parameters = CCAddParam($this->e_mail_korisnika->Parameters, "id_email_adr", $this->DataSource->f("id_email_adr")); $this->id_izdanja->SetValue($this->DataSource->id_izdanja->GetValue()); $this->Label1->SetValue($this->DataSource->Label1->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->e_mail_korisnika->Show(); $this->id_izdanja->Show(); $this->Label1->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->id_korisnika->SetValue($this->DataSource->id_korisnika->GetValue()); $this->id_email_adr->SetValue($this->DataSource->id_email_adr->GetValue()); $this->Navigator->PageNumber = $this->DataSource->AbsolutePage; 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(); $this->Sorter_id_korisnika->Show(); $this->Sorter_id_email_adr->Show(); $this->id_korisnika->Show(); $this->id_email_adr->Show(); $this->Sorter_e_mail_korisnika->Show(); $this->Sorter_id_izdanja->Show(); $this->e_mail_adrese_korisnika_Insert->Show(); $this->Navigator->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->DataSource->close(); } //End Show Method
//GetErrors Method @179-A238C362 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->e_mail_korisnika->Errors->ToString()); $errors = ComposeStrings($errors, $this->id_izdanja->Errors->ToString()); $errors = ComposeStrings($errors, $this->Label1->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method
} //End e_mail_adrese_korisnika Class @179-FCB6E20C
class clse_mail_adrese_korisnikaDataSource extends clsDBConnection1 { //e_mail_adrese_korisnikaDataSource Class @179-5E68E873
//DataSource Variables @179-31E91426 public $Parent = ""; public $CCSEvents = ""; public $CCSEventResult; public $ErrorBlock; public $CmdExecution;
public $CountSQL; public $wp;
// Datasource fields public $id_korisnika; public $id_email_adr; public $e_mail_korisnika; public $id_izdanja; public $Label1; //End DataSource Variables
//DataSourceClass_Initialize Event @179-D7537F2F function clse_mail_adrese_korisnikaDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid e_mail_adrese_korisnika"; $this->Initialize(); $this->id_korisnika = new clsField("id_korisnika", ccsInteger, ""); $this->id_email_adr = new clsField("id_email_adr", ccsInteger, ""); $this->e_mail_korisnika = new clsField("e_mail_korisnika", ccsText, ""); $this->id_izdanja = new clsField("id_izdanja", ccsText, ""); $this->Label1 = new clsField("Label1", ccsText, "");
} //End DataSourceClass_Initialize Event
//SetOrder Method @179-72B4C134 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, array("Sorter_id_korisnika" => array("id_korisnika", ""), "Sorter_id_email_adr" => array("id_email_adr", ""), "Sorter_e_mail_korisnika" => array("e_mail_korisnika", ""), "Sorter_id_izdanja" => array("id_izdanja", ""))); } //End SetOrder Method
//Prepare Method @179-87E6718D function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlklijent", ccsInteger, "", "", $this->Parameters["urlklijent"], "", false); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "e_mail_adrese_korisnika.id_korisnika", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @179-AB7AF8DE function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*)\n\n" . "FROM (e_mail_adrese_korisnika LEFT JOIN e_mail_izdanja ON\n\n" . "e_mail_adrese_korisnika.id_izdanja = e_mail_izdanja.id_email_izdanja) LEFT JOIN status_korisnika ON\n\n" . "e_mail_adrese_korisnika.stanje_kor = status_korisnika.id_stat"; $this->SQL = "SELECT id_email_adr, e_mail_korisnika, id_korisnika, id_izdanja, e_mail_izdanja.*, status_korisnika.* \n\n" . "FROM (e_mail_adrese_korisnika LEFT JOIN e_mail_izdanja ON\n\n" . "e_mail_adrese_korisnika.id_izdanja = e_mail_izdanja.id_email_izdanja) LEFT JOIN status_korisnika ON\n\n" . "e_mail_adrese_korisnika.stanje_kor = status_korisnika.id_stat {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 @179-F16550EA function SetValues() { $this->id_korisnika->SetDBValue(trim($this->f("id_korisnika"))); $this->id_email_adr->SetDBValue(trim($this->f("id_email_adr"))); $this->e_mail_korisnika->SetDBValue($this->f("e_mail_korisnika")); $this->id_izdanja->SetDBValue($this->f("naziv_email_izdanja")); $this->Label1->SetDBValue($this->f("stanje")); } //End SetValues Method
} //End e_mail_adrese_korisnikaDataSource Class @179-FCB6E20C
class clsRecorde_mail_adrese_korisnika2 { //e_mail_adrese_korisnika2 Class @195-1EE9C2A7
//Variables @195-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 @195-8F64E71D function clsRecorde_mail_adrese_korisnika2($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_korisnika2/Error"; $this->DataSource = new clse_mail_adrese_korisnika2DataSource($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_korisnika2"; $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->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(ccsListBox, "id_izdanja", "Id Izdanja", ccsInteger, "", CCGetRequestParam("id_izdanja", $Method, NULL), $this); $this->id_izdanja->DSType = dsTable; list($this->id_izdanja->BoundColumn, $this->id_izdanja->TextColumn, $this->id_izdanja->DBFormat) = array("id_email_izdanja", "naziv_email_izdanja", ""); $this->id_izdanja->DataSource = new clsDBConnection1(); $this->id_izdanja->ds = & $this->id_izdanja->DataSource; $this->id_izdanja->DataSource->SQL = "SELECT * \n" . "FROM e_mail_izdanja {SQL_Where} {SQL_OrderBy}"; $this->id_izdanja->Required = true; $this->id_korisnika = new clsControl(ccsHidden, "id_korisnika", "Id Korisnika", ccsInteger, "", CCGetRequestParam("id_korisnika", $Method, NULL), $this); $this->id_korisnika->Required = true; $this->ListBox1 = new clsControl(ccsListBox, "ListBox1", "ListBox1", ccsText, "", CCGetRequestParam("ListBox1", $Method, NULL), $this); $this->ListBox1->DSType = dsTable; list($this->ListBox1->BoundColumn, $this->ListBox1->TextColumn, $this->ListBox1->DBFormat) = array("id_stat", "stanje", ""); $this->ListBox1->DataSource = new clsDBConnection1(); $this->ListBox1->ds = & $this->ListBox1->DataSource; $this->ListBox1->DataSource->SQL = "SELECT * \n" . "FROM status_korisnika {SQL_Where} {SQL_OrderBy}"; $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 @195-68286CD0 function Initialize() {
if(!$this->Visible) return;
$this->DataSource->Parameters["urlid_email_adr"] = CCGetFromGet("id_email_adr", NULL); } //End Initialize Method
//Validate Method @195-2756BD4B function Validate() { global $CCSLocales; $Validation = true; $Where = ""; $Validation = ($this->e_mail_korisnika->Validate() && $Validation); $Validation = ($this->id_izdanja->Validate() && $Validation); $Validation = ($this->id_korisnika->Validate() && $Validation); $Validation = ($this->ListBox1->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this); $Validation = $Validation && ($this->e_mail_korisnika->Errors->Count() == 0); $Validation = $Validation && ($this->id_izdanja->Errors->Count() == 0); $Validation = $Validation && ($this->id_korisnika->Errors->Count() == 0); $Validation = $Validation && ($this->ListBox1->Errors->Count() == 0); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method
//CheckErrors Method @195-94A8AD38 function CheckErrors() { $errors = false; $errors = ($errors || $this->e_mail_korisnika->Errors->Count()); $errors = ($errors || $this->id_izdanja->Errors->Count()); $errors = ($errors || $this->id_korisnika->Errors->Count()); $errors = ($errors || $this->ListBox1->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->DataSource->Errors->Count()); return $errors; } //End CheckErrors Method
//Operation Method @195-B908BA44 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 = $FileName . "?" . 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 @195-ED762637 function InsertRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this); if(!$this->InsertAllowed) return false; $this->DataSource->e_mail_korisnika->SetValue($this->e_mail_korisnika->GetValue(true)); $this->DataSource->id_izdanja->SetValue($this->id_izdanja->GetValue(true)); $this->DataSource->id_korisnika->SetValue($this->id_korisnika->GetValue(true)); $this->DataSource->ListBox1->SetValue($this->ListBox1->GetValue(true)); $this->DataSource->Insert(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this); return (!$this->CheckErrors()); } //End InsertRow Method
//UpdateRow Method @195-A5C761CF function UpdateRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this); if(!$this->UpdateAllowed) return false; $this->DataSource->e_mail_korisnika->SetValue($this->e_mail_korisnika->GetValue(true)); $this->DataSource->id_izdanja->SetValue($this->id_izdanja->GetValue(true)); $this->DataSource->id_korisnika->SetValue($this->id_korisnika->GetValue(true)); $this->DataSource->ListBox1->SetValue($this->ListBox1->GetValue(true)); $this->DataSource->Update(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this); return (!$this->CheckErrors()); } //End UpdateRow Method
//DeleteRow Method @195-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 @195-19BC08F6 function Show() { global $Tpl; global $FileName; global $CCSLocales; $Error = "";
if(!$this->Visible) return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->id_izdanja->Prepare(); $this->ListBox1->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->e_mail_korisnika->SetValue($this->DataSource->e_mail_korisnika->GetValue()); $this->id_izdanja->SetValue($this->DataSource->id_izdanja->GetValue()); $this->id_korisnika->SetValue($this->DataSource->id_korisnika->GetValue()); $this->ListBox1->SetValue($this->DataSource->ListBox1->GetValue()); } } else { $this->EditMode = false; } }
if($this->FormSubmitted || $this->CheckErrors()) { $Error = ""; $Error = ComposeStrings($Error, $this->e_mail_korisnika->Errors->ToString()); $Error = ComposeStrings($Error, $this->id_izdanja->Errors->ToString()); $Error = ComposeStrings($Error, $this->id_korisnika->Errors->ToString()); $Error = ComposeStrings($Error, $this->ListBox1->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->e_mail_korisnika->Show(); $this->id_izdanja->Show(); $this->id_korisnika->Show(); $this->ListBox1->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_korisnika2 Class @195-FCB6E20C
class clse_mail_adrese_korisnika2DataSource extends clsDBConnection1 { //e_mail_adrese_korisnika2DataSource Class @195-BFC30FA0
//DataSource Variables @195-06CBCCDE 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 $e_mail_korisnika; public $id_izdanja; public $id_korisnika; public $ListBox1; //End DataSource Variables
//DataSourceClass_Initialize Event @195-1D75D978 function clse_mail_adrese_korisnika2DataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Record e_mail_adrese_korisnika2/Error"; $this->Initialize(); $this->e_mail_korisnika = new clsField("e_mail_korisnika", ccsText, ""); $this->id_izdanja = new clsField("id_izdanja", ccsInteger, ""); $this->id_korisnika = new clsField("id_korisnika", ccsInteger, ""); $this->ListBox1 = new clsField("ListBox1", ccsText, "");
$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->InsertFields["id_korisnika"] = array("Name" => "id_korisnika", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["stanje_kor"] = array("Name" => "stanje_kor", "Value" => "", "DataType" => ccsText); $this->UpdateFields["e_mail_korisnika"] = array("Name" => "e_mail_korisnika", "Value" => "", "DataType" => ccsText); $this->UpdateFields["id_izdanja"] = array("Name" => "id_izdanja", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["id_korisnika"] = array("Name" => "id_korisnika", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["stanje_kor"] = array("Name" => "stanje_kor", "Value" => "", "DataType" => ccsText); } //End DataSourceClass_Initialize Event
//Prepare Method @195-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 @195-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 @195-747F7D60 function SetValues() { $this->e_mail_korisnika->SetDBValue($this->f("e_mail_korisnika")); $this->id_izdanja->SetDBValue(trim($this->f("id_izdanja"))); $this->id_korisnika->SetDBValue(trim($this->f("id_korisnika"))); $this->ListBox1->SetDBValue($this->f("stanje_kor")); } //End SetValues Method
//Insert Method @195-E17DEDB5 function Insert() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent); $this->InsertFields["e_mail_korisnika"]["Value"] = $this->e_mail_korisnika->GetDBValue(true); $this->InsertFields["id_izdanja"]["Value"] = $this->id_izdanja->GetDBValue(true); $this->InsertFields["id_korisnika"]["Value"] = $this->id_korisnika->GetDBValue(true); $this->InsertFields["stanje_kor"]["Value"] = $this->ListBox1->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 @195-EC1AC8F8 function Update() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent); $this->UpdateFields["e_mail_korisnika"]["Value"] = $this->e_mail_korisnika->GetDBValue(true); $this->UpdateFields["id_izdanja"]["Value"] = $this->id_izdanja->GetDBValue(true); $this->UpdateFields["id_korisnika"]["Value"] = $this->id_korisnika->GetDBValue(true); $this->UpdateFields["stanje_kor"]["Value"] = $this->ListBox1->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 @195-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_korisnika2DataSource Class @195-FCB6E20C
class clsGridadrese_autom_distribuc { //adrese_autom_distribuc class @115-089594E0
//Variables @115-7B4E6522
// Public variables public $ComponentType = "Grid"; public $ComponentName; public $Visible; public $Errors; public $ErrorBlock; public $ds; public $DataSource; public $PageSize; public $IsEmpty; public $ForceIteration = false; public $HasRecord = false; public $SorterName = ""; public $SorterDirection = ""; public $PageNumber; public $RowNumber; public $ControlsVisible = array();
public $CCSEvents = ""; public $CCSEventResult;
public $RelativePath = ""; public $Attributes;
// Grid Controls public $StaticControls; public $RowControls; public $Sorter_id_korisnika_aut; public $Sorter_id_email; public $Sorter_e_mailkorisnika_aut; public $Sorter_tiponlineservisa_aut; //End Variables
//Class_Initialize Event @115-9A531E44 function clsGridadrese_autom_distribuc($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "adrese_autom_distribuc"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid adrese_autom_distribuc"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsadrese_autom_distribucDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = CCGetParam($this->ComponentName . "PageSize", ""); if(!is_numeric($this->PageSize) || !strlen($this->PageSize)) $this->PageSize = 10; 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->SorterName = CCGetParam("adrese_autom_distribucOrder", ""); $this->SorterDirection = CCGetParam("adrese_autom_distribucDir", "");
$this->e_mailkorisnika_aut = new clsControl(ccsLink, "e_mailkorisnika_aut", "e_mailkorisnika_aut", ccsText, "", CCGetRequestParam("e_mailkorisnika_aut", ccsGet, NULL), $this); $this->e_mailkorisnika_aut->Page = "phpSP_user_maint.php"; $this->id_korisnika_aut = new clsControl(ccsHidden, "id_korisnika_aut", "id_korisnika_aut", ccsInteger, "", CCGetRequestParam("id_korisnika_aut", ccsGet, NULL), $this); $this->id_email = new clsControl(ccsHidden, "id_email", "id_email", ccsInteger, "", CCGetRequestParam("id_email", ccsGet, NULL), $this); $this->tiponlineservisa_aut = new clsControl(ccsLabel, "tiponlineservisa_aut", "tiponlineservisa_aut", ccsText, "", CCGetRequestParam("tiponlineservisa_aut", ccsGet, NULL), $this); $this->Label1 = new clsControl(ccsLabel, "Label1", "Label1", ccsText, "", CCGetRequestParam("Label1", ccsGet, NULL), $this); $this->Sorter_id_korisnika_aut = new clsSorter($this->ComponentName, "Sorter_id_korisnika_aut", $FileName, $this); $this->Sorter_id_email = new clsSorter($this->ComponentName, "Sorter_id_email", $FileName, $this); $this->Sorter_e_mailkorisnika_aut = new clsSorter($this->ComponentName, "Sorter_e_mailkorisnika_aut", $FileName, $this); $this->Sorter_tiponlineservisa_aut = new clsSorter($this->ComponentName, "Sorter_tiponlineservisa_aut", $FileName, $this); $this->adrese_autom_distribuc_Insert = new clsControl(ccsLink, "adrese_autom_distribuc_Insert", "adrese_autom_distribuc_Insert", ccsText, "", CCGetRequestParam("adrese_autom_distribuc_Insert", ccsGet, NULL), $this); $this->adrese_autom_distribuc_Insert->Parameters = CCGetQueryString("QueryString", array("id_email", "ccsForm")); $this->adrese_autom_distribuc_Insert->Page = "phpSP_user_maint.php"; $this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple, $this); } //End Class_Initialize Event
//Initialize Method @115-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 @115-4D091CB6 function Show() { global $Tpl; global $CCSLocales; if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["urlklijent"] = CCGetFromGet("klijent", NULL);
$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["e_mailkorisnika_aut"] = $this->e_mailkorisnika_aut->Visible; $this->ControlsVisible["id_korisnika_aut"] = $this->id_korisnika_aut->Visible; $this->ControlsVisible["id_email"] = $this->id_email->Visible; $this->ControlsVisible["tiponlineservisa_aut"] = $this->tiponlineservisa_aut->Visible; $this->ControlsVisible["Label1"] = $this->Label1->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->e_mailkorisnika_aut->SetValue($this->DataSource->e_mailkorisnika_aut->GetValue()); $this->e_mailkorisnika_aut->Parameters = CCGetQueryString("QueryString", array("ccsForm")); $this->e_mailkorisnika_aut->Parameters = CCAddParam($this->e_mailkorisnika_aut->Parameters, "id_email", $this->DataSource->f("id_email")); $this->id_korisnika_aut->SetValue($this->DataSource->id_korisnika_aut->GetValue()); $this->id_email->SetValue($this->DataSource->id_email->GetValue()); $this->tiponlineservisa_aut->SetValue($this->DataSource->tiponlineservisa_aut->GetValue()); $this->Label1->SetValue($this->DataSource->Label1->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->e_mailkorisnika_aut->Show(); $this->id_korisnika_aut->Show(); $this->id_email->Show(); $this->tiponlineservisa_aut->Show(); $this->Label1->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; 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(); $this->Sorter_id_korisnika_aut->Show(); $this->Sorter_id_email->Show(); $this->Sorter_e_mailkorisnika_aut->Show(); $this->Sorter_tiponlineservisa_aut->Show(); $this->adrese_autom_distribuc_Insert->Show(); $this->Navigator->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->DataSource->close(); } //End Show Method
//GetErrors Method @115-D09DC835 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->e_mailkorisnika_aut->Errors->ToString()); $errors = ComposeStrings($errors, $this->id_korisnika_aut->Errors->ToString()); $errors = ComposeStrings($errors, $this->id_email->Errors->ToString()); $errors = ComposeStrings($errors, $this->tiponlineservisa_aut->Errors->ToString()); $errors = ComposeStrings($errors, $this->Label1->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method
} //End adrese_autom_distribuc Class @115-FCB6E20C
class clsadrese_autom_distribucDataSource extends clsDBConnection1 { //adrese_autom_distribucDataSource Class @115-8CDEA43D
//DataSource Variables @115-8F2DE7DD public $Parent = ""; public $CCSEvents = ""; public $CCSEventResult; public $ErrorBlock; public $CmdExecution;
public $CountSQL; public $wp;
// Datasource fields public $e_mailkorisnika_aut; public $id_korisnika_aut; public $id_email; public $tiponlineservisa_aut; public $Label1; //End DataSource Variables
//DataSourceClass_Initialize Event @115-13310451 function clsadrese_autom_distribucDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid adrese_autom_distribuc"; $this->Initialize(); $this->e_mailkorisnika_aut = new clsField("e_mailkorisnika_aut", ccsText, ""); $this->id_korisnika_aut = new clsField("id_korisnika_aut", ccsInteger, ""); $this->id_email = new clsField("id_email", ccsInteger, ""); $this->tiponlineservisa_aut = new clsField("tiponlineservisa_aut", ccsText, ""); $this->Label1 = new clsField("Label1", ccsText, "");
} //End DataSourceClass_Initialize Event
//SetOrder Method @115-419B1C70 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, array("Sorter_id_korisnika_aut" => array("id_korisnika_aut", ""), "Sorter_id_email" => array("id_email", ""), "Sorter_e_mailkorisnika_aut" => array("e_mailkorisnika_aut", ""), "Sorter_tiponlineservisa_aut" => array("tiponlineservisa_aut", ""))); } //End SetOrder Method
//Prepare Method @115-68BE1D41 function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlklijent", ccsInteger, "", "", $this->Parameters["urlklijent"], "", false); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "adrese_autom_distribuc.id_korisnika_aut", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @115-0F72D30B function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*)\n\n" . "FROM (adrese_autom_distribuc INNER JOIN e_mail_izdanja ON\n\n" . "adrese_autom_distribuc.tiponlineservisa_aut = e_mail_izdanja.id_email_izdanja) LEFT JOIN status_korisnika ON\n\n" . "adrese_autom_distribuc.stanje_aut = status_korisnika.id_stat"; $this->SQL = "SELECT id_email, e_mailkorisnika_aut, id_korisnika_aut, tiponlineservisa_aut, e_mail_izdanja.*, status_korisnika.* \n\n" . "FROM (adrese_autom_distribuc INNER JOIN e_mail_izdanja ON\n\n" . "adrese_autom_distribuc.tiponlineservisa_aut = e_mail_izdanja.id_email_izdanja) LEFT JOIN status_korisnika ON\n\n" . "adrese_autom_distribuc.stanje_aut = status_korisnika.id_stat {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 @115-7B4A99DE function SetValues() { $this->e_mailkorisnika_aut->SetDBValue($this->f("e_mailkorisnika_aut")); $this->id_korisnika_aut->SetDBValue(trim($this->f("id_korisnika_aut"))); $this->id_email->SetDBValue(trim($this->f("id_email"))); $this->tiponlineservisa_aut->SetDBValue($this->f("naziv_email_izdanja")); $this->Label1->SetDBValue($this->f("stanje")); } //End SetValues Method
} //End adrese_autom_distribucDataSource Class @115-FCB6E20C
class clsRecordadrese_autom_distribuc1 { //adrese_autom_distribuc1 Class @131-DDC879FA
//Variables @131-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 @131-C3D74145 function clsRecordadrese_autom_distribuc1($RelativePath, & $Parent) {
global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->Visible = true; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Record adrese_autom_distribuc1/Error"; $this->DataSource = new clsadrese_autom_distribuc1DataSource($this); $this->ds = & $this->DataSource; $this->InsertAllowed = true; $this->UpdateAllowed = true; $this->DeleteAllowed = true; $this->ReadAllowed = true; if($this->Visible) { $this->ComponentName = "adrese_autom_distribuc1"; $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->e_mailkorisnika_aut = new clsControl(ccsTextBox, "e_mailkorisnika_aut", "E Mailkorisnika Aut", ccsText, "", CCGetRequestParam("e_mailkorisnika_aut", $Method, NULL), $this); $this->e_mailkorisnika_aut->Required = true; $this->ListBox2 = new clsControl(ccsListBox, "ListBox2", "ListBox2", ccsText, "", CCGetRequestParam("ListBox2", $Method, NULL), $this); $this->ListBox2->DSType = dsTable; list($this->ListBox2->BoundColumn, $this->ListBox2->TextColumn, $this->ListBox2->DBFormat) = array("id_email_izdanja", "naziv_email_izdanja", ""); $this->ListBox2->DataSource = new clsDBConnection1(); $this->ListBox2->ds = & $this->ListBox2->DataSource; $this->ListBox2->DataSource->SQL = "SELECT * \n" . "FROM e_mail_izdanja {SQL_Where} {SQL_OrderBy}"; $this->id_korisnika_aut = new clsControl(ccsHidden, "id_korisnika_aut", "Id Korisnika Aut", ccsInteger, "", CCGetRequestParam("id_korisnika_aut", $Method, NULL), $this); $this->id_korisnika_aut->Required = true; $this->ListBox1 = new clsControl(ccsListBox, "ListBox1", "ListBox1", ccsText, "", CCGetRequestParam("ListBox1", $Method, NULL), $this); $this->ListBox1->DSType = dsTable; list($this->ListBox1->BoundColumn, $this->ListBox1->TextColumn, $this->ListBox1->DBFormat) = array("id_stat", "stanje", ""); $this->ListBox1->DataSource = new clsDBConnection1(); $this->ListBox1->ds = & $this->ListBox1->DataSource; $this->ListBox1->DataSource->SQL = "SELECT * \n" . "FROM status_korisnika {SQL_Where} {SQL_OrderBy}"; $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 @131-DF105166 function Initialize() {
if(!$this->Visible) return;
$this->DataSource->Parameters["urlid_email"] = CCGetFromGet("id_email", NULL); } //End Initialize Method
//Validate Method @131-F323E81C function Validate() { global $CCSLocales; $Validation = true; $Where = ""; $Validation = ($this->e_mailkorisnika_aut->Validate() && $Validation); $Validation = ($this->ListBox2->Validate() && $Validation); $Validation = ($this->id_korisnika_aut->Validate() && $Validation); $Validation = ($this->ListBox1->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this); $Validation = $Validation && ($this->e_mailkorisnika_aut->Errors->Count() == 0); $Validation = $Validation && ($this->ListBox2->Errors->Count() == 0); $Validation = $Validation && ($this->id_korisnika_aut->Errors->Count() == 0); $Validation = $Validation && ($this->ListBox1->Errors->Count() == 0); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method
//CheckErrors Method @131-861C456B function CheckErrors() { $errors = false; $errors = ($errors || $this->e_mailkorisnika_aut->Errors->Count()); $errors = ($errors || $this->ListBox2->Errors->Count()); $errors = ($errors || $this->id_korisnika_aut->Errors->Count()); $errors = ($errors || $this->ListBox1->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->DataSource->Errors->Count()); return $errors; } //End CheckErrors Method
//Operation Method @131-B908BA44 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 = $FileName . "?" . 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 @131-8E1E3790 function InsertRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this); if(!$this->InsertAllowed) return false; $this->DataSource->e_mailkorisnika_aut->SetValue($this->e_mailkorisnika_aut->GetValue(true)); $this->DataSource->ListBox2->SetValue($this->ListBox2->GetValue(true)); $this->DataSource->id_korisnika_aut->SetValue($this->id_korisnika_aut->GetValue(true)); $this->DataSource->ListBox1->SetValue($this->ListBox1->GetValue(true)); $this->DataSource->Insert(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this); return (!$this->CheckErrors()); } //End InsertRow Method
//UpdateRow Method @131-A400213D function UpdateRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this); if(!$this->UpdateAllowed) return false; $this->DataSource->e_mailkorisnika_aut->SetValue($this->e_mailkorisnika_aut->GetValue(true)); $this->DataSource->ListBox2->SetValue($this->ListBox2->GetValue(true)); $this->DataSource->id_korisnika_aut->SetValue($this->id_korisnika_aut->GetValue(true)); $this->DataSource->ListBox1->SetValue($this->ListBox1->GetValue(true)); $this->DataSource->Update(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this); return (!$this->CheckErrors()); } //End UpdateRow Method
//DeleteRow Method @131-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 @131-DBBDA068 function Show() { global $Tpl; global $FileName; global $CCSLocales; $Error = "";
if(!$this->Visible) return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->ListBox2->Prepare(); $this->ListBox1->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->e_mailkorisnika_aut->SetValue($this->DataSource->e_mailkorisnika_aut->GetValue()); $this->ListBox2->SetValue($this->DataSource->ListBox2->GetValue()); $this->id_korisnika_aut->SetValue($this->DataSource->id_korisnika_aut->GetValue()); $this->ListBox1->SetValue($this->DataSource->ListBox1->GetValue()); } } else { $this->EditMode = false; } }
if($this->FormSubmitted || $this->CheckErrors()) { $Error = ""; $Error = ComposeStrings($Error, $this->e_mailkorisnika_aut->Errors->ToString()); $Error = ComposeStrings($Error, $this->ListBox2->Errors->ToString()); $Error = ComposeStrings($Error, $this->id_korisnika_aut->Errors->ToString()); $Error = ComposeStrings($Error, $this->ListBox1->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->e_mailkorisnika_aut->Show(); $this->ListBox2->Show(); $this->id_korisnika_aut->Show(); $this->ListBox1->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 adrese_autom_distribuc1 Class @131-FCB6E20C
class clsadrese_autom_distribuc1DataSource extends clsDBConnection1 { //adrese_autom_distribuc1DataSource Class @131-A5A6EB62
//DataSource Variables @131-F275F634 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 $e_mailkorisnika_aut; public $ListBox2; public $id_korisnika_aut; public $ListBox1; //End DataSource Variables
//DataSourceClass_Initialize Event @131-408F2D80 function clsadrese_autom_distribuc1DataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Record adrese_autom_distribuc1/Error"; $this->Initialize(); $this->e_mailkorisnika_aut = new clsField("e_mailkorisnika_aut", ccsText, ""); $this->ListBox2 = new clsField("ListBox2", ccsText, ""); $this->id_korisnika_aut = new clsField("id_korisnika_aut", ccsInteger, ""); $this->ListBox1 = new clsField("ListBox1", ccsText, "");
$this->InsertFields["e_mailkorisnika_aut"] = array("Name" => "e_mailkorisnika_aut", "Value" => "", "DataType" => ccsText); $this->InsertFields["tiponlineservisa_aut"] = array("Name" => "tiponlineservisa_aut", "Value" => "", "DataType" => ccsText); $this->InsertFields["id_korisnika_aut"] = array("Name" => "id_korisnika_aut", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["stanje_aut"] = array("Name" => "stanje_aut", "Value" => "", "DataType" => ccsText); $this->UpdateFields["e_mailkorisnika_aut"] = array("Name" => "e_mailkorisnika_aut", "Value" => "", "DataType" => ccsText); $this->UpdateFields["tiponlineservisa_aut"] = array("Name" => "tiponlineservisa_aut", "Value" => "", "DataType" => ccsText); $this->UpdateFields["id_korisnika_aut"] = array("Name" => "id_korisnika_aut", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["stanje_aut"] = array("Name" => "stanje_aut", "Value" => "", "DataType" => ccsText); } //End DataSourceClass_Initialize Event
//Prepare Method @131-27551C15 function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlid_email", ccsInteger, "", "", $this->Parameters["urlid_email"], "", false); $this->AllParametersSet = $this->wp->AllParamsSet(); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "id_email", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @131-8F200EC2 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->SQL = "SELECT * \n\n" . "FROM adrese_autom_distribuc {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 @131-2E452C0E function SetValues() { $this->e_mailkorisnika_aut->SetDBValue($this->f("e_mailkorisnika_aut")); $this->ListBox2->SetDBValue($this->f("tiponlineservisa_aut")); $this->id_korisnika_aut->SetDBValue(trim($this->f("id_korisnika_aut"))); $this->ListBox1->SetDBValue($this->f("stanje_aut")); } //End SetValues Method
//Insert Method @131-C0AA85C7 function Insert() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent); $this->InsertFields["e_mailkorisnika_aut"]["Value"] = $this->e_mailkorisnika_aut->GetDBValue(true); $this->InsertFields["tiponlineservisa_aut"]["Value"] = $this->ListBox2->GetDBValue(true); $this->InsertFields["id_korisnika_aut"]["Value"] = $this->id_korisnika_aut->GetDBValue(true); $this->InsertFields["stanje_aut"]["Value"] = $this->ListBox1->GetDBValue(true); $this->SQL = CCBuildInsert("adrese_autom_distribuc", $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 @131-0C0142F9 function Update() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent); $this->UpdateFields["e_mailkorisnika_aut"]["Value"] = $this->e_mailkorisnika_aut->GetDBValue(true); $this->UpdateFields["tiponlineservisa_aut"]["Value"] = $this->ListBox2->GetDBValue(true); $this->UpdateFields["id_korisnika_aut"]["Value"] = $this->id_korisnika_aut->GetDBValue(true); $this->UpdateFields["stanje_aut"]["Value"] = $this->ListBox1->GetDBValue(true); $this->SQL = CCBuildUpdate("adrese_autom_distribuc", $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 @131-FD4F2C46 function Delete() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent); $this->SQL = "DELETE FROM adrese_autom_distribuc"; $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 adrese_autom_distribuc1DataSource Class @131-FCB6E20C
class clsGridphpSP_users1 { //phpSP_users1 class @145-3718F945
//Variables @145-A136D3AA
// Public variables public $ComponentType = "Grid"; public $ComponentName; public $Visible; public $Errors; public $ErrorBlock; public $ds; public $DataSource; public $PageSize; public $IsEmpty; public $ForceIteration = false; public $HasRecord = false; public $SorterName = ""; public $SorterDirection = ""; public $PageNumber; public $RowNumber; public $ControlsVisible = array();
public $CCSEvents = ""; public $CCSEventResult;
public $RelativePath = ""; public $Attributes;
// Grid Controls public $StaticControls; public $RowControls; public $Sorter_klijent_id; public $Sorter_password; public $Sorter_primary_key; public $Sorter_user; public $Sorter_userlevel; //End Variables
//Class_Initialize Event @145-8E8D53CD function clsGridphpSP_users1($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "phpSP_users1"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid phpSP_users1"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsphpSP_users1DataSource($this); $this->ds = & $this->DataSource; $this->PageSize = CCGetParam($this->ComponentName . "PageSize", ""); if(!is_numeric($this->PageSize) || !strlen($this->PageSize)) $this->PageSize = 10; 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->SorterName = CCGetParam("phpSP_users1Order", ""); $this->SorterDirection = CCGetParam("phpSP_users1Dir", "");
$this->user = new clsControl(ccsLink, "user", "user", ccsText, "", CCGetRequestParam("user", ccsGet, NULL), $this); $this->user->Page = "phpSP_user_maint.php"; $this->userlevel = new clsControl(ccsLabel, "userlevel", "userlevel", ccsText, "", CCGetRequestParam("userlevel", ccsGet, NULL), $this); $this->Label1 = new clsControl(ccsLabel, "Label1", "Label1", ccsText, "", CCGetRequestParam("Label1", ccsGet, NULL), $this); $this->Sorter_klijent_id = new clsSorter($this->ComponentName, "Sorter_klijent_id", $FileName, $this); $this->Sorter_password = new clsSorter($this->ComponentName, "Sorter_password", $FileName, $this); $this->klijent_id = new clsControl(ccsLink, "klijent_id", "klijent_id", ccsText, "", CCGetRequestParam("klijent_id", ccsGet, NULL), $this); $this->klijent_id->Page = "phpSP_user_maint.php"; $this->Sorter_primary_key = new clsSorter($this->ComponentName, "Sorter_primary_key", $FileName, $this); $this->password = new clsControl(ccsLabel, "password", "password", ccsText, "", CCGetRequestParam("password", ccsGet, NULL), $this); $this->primary_key = new clsControl(ccsLabel, "primary_key", "primary_key", ccsInteger, "", CCGetRequestParam("primary_key", ccsGet, NULL), $this); $this->Sorter_user = new clsSorter($this->ComponentName, "Sorter_user", $FileName, $this); $this->Sorter_userlevel = new clsSorter($this->ComponentName, "Sorter_userlevel", $FileName, $this); $this->phpSP_users1_Insert = new clsControl(ccsLink, "phpSP_users1_Insert", "phpSP_users1_Insert", ccsText, "", CCGetRequestParam("phpSP_users1_Insert", ccsGet, NULL), $this); $this->phpSP_users1_Insert->Parameters = CCGetQueryString("QueryString", array("primary_key", "ccsForm")); $this->phpSP_users1_Insert->Page = "phpSP_user_maint.php"; $this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple, $this); } //End Class_Initialize Event
//Initialize Method @145-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 @145-A27732E1 function Show() { global $Tpl; global $CCSLocales; if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["urlklijent"] = CCGetFromGet("klijent", NULL);
$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["user"] = $this->user->Visible; $this->ControlsVisible["userlevel"] = $this->userlevel->Visible; $this->ControlsVisible["Label1"] = $this->Label1->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->user->SetValue($this->DataSource->user->GetValue()); $this->user->Parameters = CCGetQueryString("QueryString", array("ccsForm")); $this->user->Parameters = CCAddParam($this->user->Parameters, "primary_key", $this->DataSource->f("primary_key")); $this->userlevel->SetValue($this->DataSource->userlevel->GetValue()); $this->Label1->SetValue($this->DataSource->Label1->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->user->Show(); $this->userlevel->Show(); $this->Label1->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->klijent_id->SetValue($this->DataSource->klijent_id->GetValue()); $this->klijent_id->Parameters = CCGetQueryString("QueryString", array("ccsForm")); $this->klijent_id->Parameters = CCAddParam($this->klijent_id->Parameters, "primary_key", $this->DataSource->f("primary_key")); $this->password->SetValue($this->DataSource->password->GetValue()); $this->primary_key->SetValue($this->DataSource->primary_key->GetValue()); $this->Navigator->PageNumber = $this->DataSource->AbsolutePage; 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(); $this->Sorter_klijent_id->Show(); $this->Sorter_password->Show(); $this->klijent_id->Show(); $this->Sorter_primary_key->Show(); $this->password->Show(); $this->primary_key->Show(); $this->Sorter_user->Show(); $this->Sorter_userlevel->Show(); $this->phpSP_users1_Insert->Show(); $this->Navigator->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->DataSource->close(); } //End Show Method
//GetErrors Method @145-70AF00DA function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->user->Errors->ToString()); $errors = ComposeStrings($errors, $this->userlevel->Errors->ToString()); $errors = ComposeStrings($errors, $this->Label1->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method
} //End phpSP_users1 Class @145-FCB6E20C
class clsphpSP_users1DataSource extends clsDBConnection1 { //phpSP_users1DataSource Class @145-4D4559DB
//DataSource Variables @145-9B74B4B7 public $Parent = ""; public $CCSEvents = ""; public $CCSEventResult; public $ErrorBlock; public $CmdExecution;
public $CountSQL; public $wp;
// Datasource fields public $klijent_id; public $password; public $primary_key; public $user; public $userlevel; public $Label1; //End DataSource Variables
//DataSourceClass_Initialize Event @145-03FD7534 function clsphpSP_users1DataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid phpSP_users1"; $this->Initialize(); $this->klijent_id = new clsField("klijent_id", ccsText, ""); $this->password = new clsField("password", ccsText, ""); $this->primary_key = new clsField("primary_key", ccsInteger, ""); $this->user = new clsField("user", ccsText, ""); $this->userlevel = new clsField("userlevel", ccsText, ""); $this->Label1 = new clsField("Label1", ccsText, "");
} //End DataSourceClass_Initialize Event
//SetOrder Method @145-02FFF430 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, array("Sorter_klijent_id" => array("klijent_id", ""), "Sorter_password" => array("password", ""), "Sorter_primary_key" => array("primary_key", ""), "Sorter_user" => array("user", ""), "Sorter_userlevel" => array("userlevel", ""))); } //End SetOrder Method
//Prepare Method @145-D876544B function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlklijent", ccsText, "", "", $this->Parameters["urlklijent"], "", false); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "phpSP_users.klijent_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @145-5138983C function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*)\n\n" . "FROM (phpSP_users INNER JOIN servisi ON\n\n" . "phpSP_users.userlevel = servisi.id) LEFT JOIN status_korisnika ON\n\n" . "phpSP_users.stanje_onl = status_korisnika.id_stat"; $this->SQL = "SELECT primary_key, klijent_id, user, password, userlevel, servisi.*, status_korisnika.* \n\n" . "FROM (phpSP_users INNER JOIN servisi ON\n\n" . "phpSP_users.userlevel = servisi.id) LEFT JOIN status_korisnika ON\n\n" . "phpSP_users.stanje_onl = status_korisnika.id_stat {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 @145-2CEBC38E function SetValues() { $this->klijent_id->SetDBValue($this->f("klijent_id")); $this->password->SetDBValue($this->f("password")); $this->primary_key->SetDBValue(trim($this->f("primary_key"))); $this->user->SetDBValue($this->f("user")); $this->userlevel->SetDBValue($this->f("imeservisa")); $this->Label1->SetDBValue($this->f("stanje")); } //End SetValues Method
} //End phpSP_users1DataSource Class @145-FCB6E20C
class clsRecordphpSP_users2 { //phpSP_users2 Class @164-71E4DACA
//Variables @164-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 @164-308D77C2 function clsRecordphpSP_users2($RelativePath, & $Parent) {
global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->Visible = true; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Record phpSP_users2/Error"; $this->DataSource = new clsphpSP_users2DataSource($this); $this->ds = & $this->DataSource; $this->InsertAllowed = true; $this->UpdateAllowed = true; $this->DeleteAllowed = true; $this->ReadAllowed = true; if($this->Visible) { $this->ComponentName = "phpSP_users2"; $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->user = new clsControl(ccsTextBox, "user", "User", ccsText, "", CCGetRequestParam("user", $Method, NULL), $this); $this->password = new clsControl(ccsTextBox, "password", "Password", ccsText, "", CCGetRequestParam("password", $Method, NULL), $this); $this->userlevel = new clsControl(ccsListBox, "userlevel", "Userlevel", ccsInteger, "", CCGetRequestParam("userlevel", $Method, NULL), $this); $this->userlevel->DSType = dsTable; list($this->userlevel->BoundColumn, $this->userlevel->TextColumn, $this->userlevel->DBFormat) = array("id", "imeservisa", ""); $this->userlevel->DataSource = new clsDBConnection1(); $this->userlevel->ds = & $this->userlevel->DataSource; $this->userlevel->DataSource->SQL = "SELECT * \n" . "FROM servisi {SQL_Where} {SQL_OrderBy}"; $this->klijent_id = new clsControl(ccsHidden, "klijent_id", "Klijent Id", ccsInteger, "", CCGetRequestParam("klijent_id", $Method, NULL), $this); $this->ListBox1 = new clsControl(ccsListBox, "ListBox1", "ListBox1", ccsText, "", CCGetRequestParam("ListBox1", $Method, NULL), $this); $this->ListBox1->DSType = dsTable; list($this->ListBox1->BoundColumn, $this->ListBox1->TextColumn, $this->ListBox1->DBFormat) = array("id_stat", "stanje", ""); $this->ListBox1->DataSource = new clsDBConnection1(); $this->ListBox1->ds = & $this->ListBox1->DataSource; $this->ListBox1->DataSource->SQL = "SELECT * \n" . "FROM status_korisnika {SQL_Where} {SQL_OrderBy}"; $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 @164-8BE06C01 function Initialize() {
if(!$this->Visible) return;
$this->DataSource->Parameters["urlprimary_key"] = CCGetFromGet("primary_key", NULL); } //End Initialize Method
//Validate Method @164-1D57545D function Validate() { global $CCSLocales; $Validation = true; $Where = ""; $Validation = ($this->user->Validate() && $Validation); $Validation = ($this->password->Validate() && $Validation); $Validation = ($this->userlevel->Validate() && $Validation); $Validation = ($this->klijent_id->Validate() && $Validation); $Validation = ($this->ListBox1->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this); $Validation = $Validation && ($this->user->Errors->Count() == 0); $Validation = $Validation && ($this->password->Errors->Count() == 0); $Validation = $Validation && ($this->userlevel->Errors->Count() == 0); $Validation = $Validation && ($this->klijent_id->Errors->Count() == 0); $Validation = $Validation && ($this->ListBox1->Errors->Count() == 0); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method
//CheckErrors Method @164-10BE82D7 function CheckErrors() { $errors = false; $errors = ($errors || $this->user->Errors->Count()); $errors = ($errors || $this->password->Errors->Count()); $errors = ($errors || $this->userlevel->Errors->Count()); $errors = ($errors || $this->klijent_id->Errors->Count()); $errors = ($errors || $this->ListBox1->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->DataSource->Errors->Count()); return $errors; } //End CheckErrors Method
//Operation Method @164-B908BA44 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 = $FileName . "?" . 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 @164-7A69E44C function InsertRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this); if(!$this->InsertAllowed) return false; $this->DataSource->user->SetValue($this->user->GetValue(true)); $this->DataSource->password->SetValue($this->password->GetValue(true)); $this->DataSource->userlevel->SetValue($this->userlevel->GetValue(true)); $this->DataSource->klijent_id->SetValue($this->klijent_id->GetValue(true)); $this->DataSource->ListBox1->SetValue($this->ListBox1->GetValue(true)); $this->DataSource->Insert(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this); return (!$this->CheckErrors()); } //End InsertRow Method
//UpdateRow Method @164-EE68A0AB function UpdateRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this); if(!$this->UpdateAllowed) return false; $this->DataSource->user->SetValue($this->user->GetValue(true)); $this->DataSource->password->SetValue($this->password->GetValue(true)); $this->DataSource->userlevel->SetValue($this->userlevel->GetValue(true)); $this->DataSource->klijent_id->SetValue($this->klijent_id->GetValue(true)); $this->DataSource->ListBox1->SetValue($this->ListBox1->GetValue(true)); $this->DataSource->Update(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this); return (!$this->CheckErrors()); } //End UpdateRow Method
//DeleteRow Method @164-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 @164-F7C8EE54 function Show() { global $Tpl; global $FileName; global $CCSLocales; $Error = "";
if(!$this->Visible) return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->userlevel->Prepare(); $this->ListBox1->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->user->SetValue($this->DataSource->user->GetValue()); $this->password->SetValue($this->DataSource->password->GetValue()); $this->userlevel->SetValue($this->DataSource->userlevel->GetValue()); $this->klijent_id->SetValue($this->DataSource->klijent_id->GetValue()); $this->ListBox1->SetValue($this->DataSource->ListBox1->GetValue()); } } else { $this->EditMode = false; } }
if($this->FormSubmitted || $this->CheckErrors()) { $Error = ""; $Error = ComposeStrings($Error, $this->user->Errors->ToString()); $Error = ComposeStrings($Error, $this->password->Errors->ToString()); $Error = ComposeStrings($Error, $this->userlevel->Errors->ToString()); $Error = ComposeStrings($Error, $this->klijent_id->Errors->ToString()); $Error = ComposeStrings($Error, $this->ListBox1->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->user->Show(); $this->password->Show(); $this->userlevel->Show(); $this->klijent_id->Show(); $this->ListBox1->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 phpSP_users2 Class @164-FCB6E20C
class clsphpSP_users2DataSource extends clsDBConnection1 { //phpSP_users2DataSource Class @164-C69667C2
//DataSource Variables @164-C9A9AF4B 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 $user; public $password; public $userlevel; public $klijent_id; public $ListBox1; //End DataSource Variables
//DataSourceClass_Initialize Event @164-3C5C27DE function clsphpSP_users2DataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Record phpSP_users2/Error"; $this->Initialize(); $this->user = new clsField("user", ccsText, ""); $this->password = new clsField("password", ccsText, ""); $this->userlevel = new clsField("userlevel", ccsInteger, ""); $this->klijent_id = new clsField("klijent_id", ccsInteger, ""); $this->ListBox1 = new clsField("ListBox1", ccsText, "");
$this->InsertFields["user"] = array("Name" => "user", "Value" => "", "DataType" => ccsText); $this->InsertFields["password"] = array("Name" => "password", "Value" => "", "DataType" => ccsText); $this->InsertFields["userlevel"] = array("Name" => "userlevel", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["klijent_id"] = array("Name" => "klijent_id", "Value" => "", "DataType" => ccsInteger); $this->InsertFields["stanje_onl"] = array("Name" => "stanje_onl", "Value" => "", "DataType" => ccsText); $this->UpdateFields["user"] = array("Name" => "user", "Value" => "", "DataType" => ccsText); $this->UpdateFields["password"] = array("Name" => "password", "Value" => "", "DataType" => ccsText); $this->UpdateFields["userlevel"] = array("Name" => "userlevel", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["klijent_id"] = array("Name" => "klijent_id", "Value" => "", "DataType" => ccsInteger); $this->UpdateFields["stanje_onl"] = array("Name" => "stanje_onl", "Value" => "", "DataType" => ccsText); } //End DataSourceClass_Initialize Event
//Prepare Method @164-B64D4A97 function Prepare() { global $CCSLocales; global $DefaultDateFormat; $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlprimary_key", ccsInteger, "", "", $this->Parameters["urlprimary_key"], "", false); $this->AllParametersSet = $this->wp->AllParamsSet(); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "primary_key", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method
//Open Method @164-C99CF494 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->SQL = "SELECT * \n\n" . "FROM phpSP_users {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 @164-49BC55B2 function SetValues() { $this->user->SetDBValue($this->f("user")); $this->password->SetDBValue($this->f("password")); $this->userlevel->SetDBValue(trim($this->f("userlevel"))); $this->klijent_id->SetDBValue(trim($this->f("klijent_id"))); $this->ListBox1->SetDBValue($this->f("stanje_onl")); } //End SetValues Method
//Insert Method @164-B8C159FD function Insert() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent); $this->InsertFields["user"]["Value"] = $this->user->GetDBValue(true); $this->InsertFields["password"]["Value"] = $this->password->GetDBValue(true); $this->InsertFields["userlevel"]["Value"] = $this->userlevel->GetDBValue(true); $this->InsertFields["klijent_id"]["Value"] = $this->klijent_id->GetDBValue(true); $this->InsertFields["stanje_onl"]["Value"] = $this->ListBox1->GetDBValue(true); $this->SQL = CCBuildInsert("phpSP_users", $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 @164-5A43B36D function Update() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent); $this->UpdateFields["user"]["Value"] = $this->user->GetDBValue(true); $this->UpdateFields["password"]["Value"] = $this->password->GetDBValue(true); $this->UpdateFields["userlevel"]["Value"] = $this->userlevel->GetDBValue(true); $this->UpdateFields["klijent_id"]["Value"] = $this->klijent_id->GetDBValue(true); $this->UpdateFields["stanje_onl"]["Value"] = $this->ListBox1->GetDBValue(true); $this->SQL = CCBuildUpdate("phpSP_users", $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 @164-9E87D574 function Delete() { global $CCSLocales; global $DefaultDateFormat; $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent); $this->SQL = "DELETE FROM phpSP_users"; $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 phpSP_users2DataSource Class @164-FCB6E20C
//Include Page implementation @38-58DBA1E3 include_once(RelativePath . "/Footer.php"); //End Include Page implementation
//Initialize Page @1-4322E6D1 // Variables $FileName = ""; $Redirect = ""; $Tpl = ""; $TemplateFileName = ""; $BlockToParse = ""; $ComponentName = ""; $Attributes = "";
// Events; $CCSEvents = ""; $CCSEventResult = "";
$FileName = FileName; $Redirect = ""; $TemplateFileName = "phpSP_user_maint.html"; $BlockToParse = "main"; $TemplateEncoding = "CP1250"; $PathToRoot = "./"; //End Initialize Page
//Authenticate User @1-DC94A87D CCSecurityRedirect("1", ""); //End Authenticate User
//Include events file @1-30FD3292 include("./phpSP_user_maint_events.php"); //End Include events file
//Before Initialize @1-E870CEBC $CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage); //End Before Initialize
//Initialize Objects @1-D6CB54CD $DBConnection1 = new clsDBConnection1(); $MainPage->Connections["Connection1"] = & $DBConnection1; $Attributes = new clsAttributes("page:"); $MainPage->Attributes = & $Attributes;
// Controls $e_mail_adrese_korisnika1 = new clsRecorde_mail_adrese_korisnika1("", $MainPage); $Header = new clsHeader("", "Header", $MainPage); $Header->Initialize(); $phpSP_users = new clsRecordphpSP_users("", $MainPage); $transakcije = new clsGridtransakcije("", $MainPage); $transakcije1 = new clsRecordtransakcije1("", $MainPage); $dokumenti = new clsGriddokumenti("", $MainPage); $dokumenti1 = new clsRecorddokumenti1("", $MainPage); $e_mail_adrese_korisnika = new clsGride_mail_adrese_korisnika("", $MainPage); $e_mail_adrese_korisnika2 = new clsRecorde_mail_adrese_korisnika2("", $MainPage); $adrese_autom_distribuc = new clsGridadrese_autom_distribuc("", $MainPage); $adrese_autom_distribuc1 = new clsRecordadrese_autom_distribuc1("", $MainPage); $phpSP_users1 = new clsGridphpSP_users1("", $MainPage); $phpSP_users2 = new clsRecordphpSP_users2("", $MainPage); $Footer = new clsFooter("", "Footer", $MainPage); $Footer->Initialize(); $MainPage->e_mail_adrese_korisnika1 = & $e_mail_adrese_korisnika1; $MainPage->Header = & $Header; $MainPage->phpSP_users = & $phpSP_users; $MainPage->transakcije = & $transakcije; $MainPage->transakcije1 = & $transakcije1; $MainPage->dokumenti = & $dokumenti; $MainPage->dokumenti1 = & $dokumenti1; $MainPage->e_mail_adrese_korisnika = & $e_mail_adrese_korisnika; $MainPage->e_mail_adrese_korisnika2 = & $e_mail_adrese_korisnika2; $MainPage->adrese_autom_distribuc = & $adrese_autom_distribuc; $MainPage->adrese_autom_distribuc1 = & $adrese_autom_distribuc1; $MainPage->phpSP_users1 = & $phpSP_users1; $MainPage->phpSP_users2 = & $phpSP_users2; $MainPage->Footer = & $Footer; $e_mail_adrese_korisnika1->Initialize(); $phpSP_users->Initialize(); $transakcije->Initialize(); $transakcije1->Initialize(); $dokumenti->Initialize(); $dokumenti1->Initialize(); $e_mail_adrese_korisnika->Initialize(); $e_mail_adrese_korisnika2->Initialize(); $adrese_autom_distribuc->Initialize(); $adrese_autom_distribuc1->Initialize(); $phpSP_users1->Initialize(); $phpSP_users2->Initialize();
BindEvents();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
$Charset = $Charset ? $Charset : "windows-1250"; if ($Charset) header("Content-Type: text/html; charset=" . $Charset); //End Initialize Objects
//Initialize HTML Template @1-A050F2BB $CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage); $Tpl = new clsTemplate($FileEncoding, $TemplateEncoding); $Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "CP1250"); $Tpl->block_path = "/$BlockToParse"; $CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage); $Attributes->Show(); //End Initialize HTML Template
//Execute Components @1-96A9ADDE $e_mail_adrese_korisnika1->Operation(); $Header->Operations(); $phpSP_users->Operation(); $transakcije1->Operation(); $dokumenti1->Operation(); $e_mail_adrese_korisnika2->Operation(); $adrese_autom_distribuc1->Operation(); $phpSP_users2->Operation(); $Footer->Operations(); //End Execute Components
//Go to destination page @1-837F9BBF if($Redirect) { $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage); $DBConnection1->close(); header("Location: " . $Redirect); unset($e_mail_adrese_korisnika1); $Header->Class_Terminate(); unset($Header); unset($phpSP_users); unset($transakcije); unset($transakcije1); unset($dokumenti); unset($dokumenti1); unset($e_mail_adrese_korisnika); unset($e_mail_adrese_korisnika2); unset($adrese_autom_distribuc); unset($adrese_autom_distribuc1); unset($phpSP_users1); unset($phpSP_users2); $Footer->Class_Terminate(); unset($Footer); unset($Tpl); exit; } //End Go to destination page
//Show Page @1-273A6878 $e_mail_adrese_korisnika1->Show(); $Header->Show(); $phpSP_users->Show(); $transakcije->Show(); $transakcije1->Show(); $dokumenti->Show(); $dokumenti1->Show(); $e_mail_adrese_korisnika->Show(); $e_mail_adrese_korisnika2->Show(); $adrese_autom_distribuc->Show(); $adrese_autom_distribuc1->Show(); $phpSP_users1->Show(); $phpSP_users2->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-FAAD2609 $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage); $DBConnection1->close(); unset($e_mail_adrese_korisnika1); $Header->Class_Terminate(); unset($Header); unset($phpSP_users); unset($transakcije); unset($transakcije1); unset($dokumenti); unset($dokumenti1); unset($e_mail_adrese_korisnika); unset($e_mail_adrese_korisnika2); unset($adrese_autom_distribuc); unset($adrese_autom_distribuc1); unset($phpSP_users1); unset($phpSP_users2); $Footer->Class_Terminate(); unset($Footer); unset($Tpl); //End Unload Page
?>
|