Viewing file: java_maint.php (21.82 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//Include Common Files @1-5471E0F2
define("RelativePath", ".");
include(RelativePath . "/Common.php");
include(RelativePath . "/Template.php");
include(RelativePath . "/Sorter.php");
include(RelativePath . "/Navigator.php");
//End Include Common Files
//Include Page implementation @11-3DD2EFDC
include_once(RelativePath . "/Header.php");
//End Include Page implementation
//Include Page implementation @20-9090FF7A
include_once(RelativePath . "/Header1.php");
//End Include Page implementation
class clsRecordmmsmelodije { //mmsmelodije Class @2-DB415A20
//Variables @2-B2F7A83E
// Public variables
var $ComponentName;
var $HTMLFormAction;
var $PressedButton;
var $Errors;
var $ErrorBlock;
var $FormSubmitted;
var $FormEnctype;
var $Visible;
var $Recordset;
var $CCSEvents = "";
var $CCSEventResult;
var $InsertAllowed = false;
var $UpdateAllowed = false;
var $DeleteAllowed = false;
var $ReadAllowed = false;
var $EditMode = false;
var $ds;
var $ValidatingControls;
var $Controls;
// Class variables
//End Variables
//Class_Initialize Event @2-6D68AA08
function clsRecordmmsmelodije()
{
global $FileName;
$this->Visible = true;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record mmsmelodije/Error";
$this->ds = new clsmmsmelodijeDataSource();
$this->InsertAllowed = true;
$this->UpdateAllowed = true;
$this->DeleteAllowed = true;
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "mmsmelodije";
$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->nazivmelodije = new clsControl(ccsTextBox, "nazivmelodije", "Nazivmelodije", ccsMemo, "", CCGetRequestParam("nazivmelodije", $Method));
$this->nazivmelodije->Required = true;
$this->FileUpload1 = new clsFileUpload("FileUpload1", "FileUpload1", "/home/monetweb/public_html/temp/", "/home/monetweb/public_html/web/java/", "*", "", 1000000);
$this->FileUpload2 = new clsFileUpload("FileUpload2", "FileUpload2", "/home/monetweb/public_html/temp/", "/home/monetweb/public_html/web/java/", "*", "", 1000000);
$this->Label1 = new clsControl(ccsLabel, "Label1", "Label1", ccsText, "", CCGetRequestParam("Label1", $Method));
$this->CheckBoxList1 = new clsControl(ccsListBox, "CheckBoxList1", "CheckBoxList1", ccsText, "", CCGetRequestParam("CheckBoxList1", $Method));
$this->CheckBoxList1->DSType = dsTable;
list($this->CheckBoxList1->BoundColumn, $this->CheckBoxList1->TextColumn, $this->CheckBoxList1->DBFormat) = array("idtelefona", "naziv_telefona", "");
$this->CheckBoxList1->ds = new clsDBConnection1();
$this->CheckBoxList1->ds->SQL = "SELECT * " .
"FROM telefoni";
$this->CheckBoxList1->HTML = true;
$this->kodmelodije = new clsControl(ccsTextBox, "kodmelodije", "Kodmelodije", ccsMemo, "", CCGetRequestParam("kodmelodije", $Method));
$this->Button_Insert = new clsButton("Button_Insert");
$this->Button_Update = new clsButton("Button_Update");
$this->Button_Delete = new clsButton("Button_Delete");
}
}
//End Class_Initialize Event
//Initialize Method @2-81F8725E
function Initialize()
{
if(!$this->Visible)
return;
$this->ds->Parameters["urlidmmsslike"] = CCGetFromGet("idmmsslike", "");
}
//End Initialize Method
//Validate Method @2-BB39FC84
function Validate()
{
$Validation = true;
$Where = "";
$Validation = ($this->nazivmelodije->Validate() && $Validation);
$Validation = ($this->FileUpload1->Validate() && $Validation);
$Validation = ($this->FileUpload2->Validate() && $Validation);
$Validation = ($this->CheckBoxList1->Validate() && $Validation);
$Validation = ($this->kodmelodije->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
$Validation = $Validation && ($this->nazivmelodije->Errors->Count() == 0);
$Validation = $Validation && ($this->FileUpload1->Errors->Count() == 0);
$Validation = $Validation && ($this->FileUpload2->Errors->Count() == 0);
$Validation = $Validation && ($this->CheckBoxList1->Errors->Count() == 0);
$Validation = $Validation && ($this->kodmelodije->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-CCD270A3
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->nazivmelodije->Errors->Count());
$errors = ($errors || $this->FileUpload1->Errors->Count());
$errors = ($errors || $this->FileUpload2->Errors->Count());
$errors = ($errors || $this->Label1->Errors->Count());
$errors = ($errors || $this->CheckBoxList1->Errors->Count());
$errors = ($errors || $this->kodmelodije->Errors->Count());
$errors = ($errors || $this->Errors->Count());
$errors = ($errors || $this->ds->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-CF6A5789
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
$this->ds->Prepare();
if(!$this->FormSubmitted) {
$this->EditMode = $this->ds->AllParametersSet;
return;
}
$this->FileUpload1->Upload();
$this->FileUpload2->Upload();
if($this->FormSubmitted) {
$this->PressedButton = $this->EditMode ? "Button_Update" : "Button_Insert";
if(strlen(CCGetParam("Button_Insert", ""))) {
$this->PressedButton = "Button_Insert";
} else if(strlen(CCGetParam("Button_Update", ""))) {
$this->PressedButton = "Button_Update";
} else if(strlen(CCGetParam("Button_Delete", ""))) {
$this->PressedButton = "Button_Delete";
}
}
$Redirect = "java_list.php" . "?" . CCGetQueryString("QueryString", Array("ccsForm"));
if($this->PressedButton == "Button_Delete") {
if(!CCGetEvent($this->Button_Delete->CCSEvents, "OnClick") || !$this->DeleteRow()) {
$Redirect = "";
}
} else if($this->Validate()) {
if($this->PressedButton == "Button_Insert") {
if(!CCGetEvent($this->Button_Insert->CCSEvents, "OnClick") || !$this->InsertRow()) {
$Redirect = "";
}
} else if($this->PressedButton == "Button_Update") {
if(!CCGetEvent($this->Button_Update->CCSEvents, "OnClick") || !$this->UpdateRow()) {
$Redirect = "";
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//InsertRow Method @2-A0579687
function InsertRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert");
if(!$this->InsertAllowed) return false;
$this->ds->nazivmelodije->SetValue($this->nazivmelodije->GetValue());
$this->ds->FileUpload1->SetValue($this->FileUpload1->GetValue());
$this->ds->FileUpload2->SetValue($this->FileUpload2->GetValue());
$this->ds->Label1->SetValue($this->Label1->GetValue());
$this->ds->CheckBoxList1->SetValue($this->CheckBoxList1->GetValue());
$this->ds->kodmelodije->SetValue($this->kodmelodije->GetValue());
$this->ds->Insert();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert");
if($this->ds->Errors->Count() == 0) {
$this->FileUpload1->Move();
$this->FileUpload2->Move();
}
return (!$this->CheckErrors());
}
//End InsertRow Method
//UpdateRow Method @2-58403A42
function UpdateRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate");
if(!$this->UpdateAllowed) return false;
$this->ds->nazivmelodije->SetValue($this->nazivmelodije->GetValue());
$this->ds->FileUpload1->SetValue($this->FileUpload1->GetValue());
$this->ds->FileUpload2->SetValue($this->FileUpload2->GetValue());
$this->ds->Label1->SetValue($this->Label1->GetValue());
$this->ds->CheckBoxList1->SetValue($this->CheckBoxList1->GetValue());
$this->ds->kodmelodije->SetValue($this->kodmelodije->GetValue());
$this->ds->Update();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate");
if($this->ds->Errors->Count() == 0) {
$this->FileUpload1->Move();
$this->FileUpload2->Move();
}
return (!$this->CheckErrors());
}
//End UpdateRow Method
//DeleteRow Method @2-7D64D2A1
function DeleteRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeDelete");
if(!$this->DeleteAllowed) return false;
$this->ds->Delete();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterDelete");
if($this->ds->Errors->Count() == 0) {
$this->FileUpload1->Delete();
$this->FileUpload2->Delete();
}
return (!$this->CheckErrors());
}
//End DeleteRow Method
//Show Method @2-6A48B942
function Show()
{
global $Tpl;
global $FileName;
$Error = "";
if(!$this->Visible)
return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect");
$this->CheckBoxList1->Prepare();
$RecordBlock = "Record " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $RecordBlock;
$this->EditMode = $this->EditMode && $this->ReadAllowed;
if($this->EditMode)
{
$this->ds->open();
if($this->Errors->Count() == 0)
{
if($this->ds->Errors->Count() > 0)
{
echo "Error in Record mmsmelodije";
}
else if($this->ds->next_record())
{
$this->ds->SetValues();
$this->Label1->SetValue($this->ds->Label1->GetValue());
if(!$this->FormSubmitted)
{
$this->nazivmelodije->SetValue($this->ds->nazivmelodije->GetValue());
$this->FileUpload1->SetValue($this->ds->FileUpload1->GetValue());
$this->FileUpload2->SetValue($this->ds->FileUpload2->GetValue());
$this->CheckBoxList1->SetValue($this->ds->CheckBoxList1->GetValue());
$this->kodmelodije->SetValue($this->ds->kodmelodije->GetValue());
}
}
else
{
$this->EditMode = false;
}
}
}
if(!$this->FormSubmitted)
{
}
if($this->FormSubmitted || $this->CheckErrors()) {
$Error .= $this->nazivmelodije->Errors->ToString();
$Error .= $this->FileUpload1->Errors->ToString();
$Error .= $this->FileUpload2->Errors->ToString();
$Error .= $this->Label1->Errors->ToString();
$Error .= $this->CheckBoxList1->Errors->ToString();
$Error .= $this->kodmelodije->Errors->ToString();
$Error .= $this->Errors->ToString();
$Error .= $this->ds->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");
if(!$this->Visible) {
$Tpl->block_path = $ParentPath;
return;
}
$this->nazivmelodije->Show();
$this->FileUpload1->Show();
$this->FileUpload2->Show();
$this->Label1->Show();
$this->CheckBoxList1->Show();
$this->kodmelodije->Show();
$this->Button_Insert->Show();
$this->Button_Update->Show();
$this->Button_Delete->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
} //End mmsmelodije Class @2-FCB6E20C
class clsmmsmelodijeDataSource extends clsDBConnection1 { //mmsmelodijeDataSource Class @2-FC35D769
//DataSource Variables @2-8865EA43
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $InsertParameters;
var $UpdateParameters;
var $DeleteParameters;
var $wp;
var $AllParametersSet;
// Datasource fields
var $nazivmelodije;
var $FileUpload1;
var $FileUpload2;
var $Label1;
var $CheckBoxList1;
var $kodmelodije;
//End DataSource Variables
//DataSourceClass_Initialize Event @2-3B27914D
function clsmmsmelodijeDataSource()
{
$this->ErrorBlock = "Record mmsmelodije/Error";
$this->Initialize();
$this->nazivmelodije = new clsField("nazivmelodije", ccsMemo, "");
$this->FileUpload1 = new clsField("FileUpload1", ccsText, "");
$this->FileUpload2 = new clsField("FileUpload2", ccsText, "");
$this->Label1 = new clsField("Label1", ccsText, "");
$this->CheckBoxList1 = new clsField("CheckBoxList1", ccsText, "");
$this->kodmelodije = new clsField("kodmelodije", ccsMemo, "");
}
//End DataSourceClass_Initialize Event
//Prepare Method @2-34BDED25
function Prepare()
{
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urlidmmsslike", ccsInteger, "", "", $this->Parameters["urlidmmsslike"], "", false);
$this->AllParametersSet = $this->wp->AllParamsSet();
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "idmmsslike", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @2-2AC02089
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->SQL = "SELECT * " .
"FROM java";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect");
$this->PageSize = 1;
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect");
}
//End Open Method
//SetValues Method @2-BFA42958
function SetValues()
{
$this->nazivmelodije->SetDBValue($this->f("nazivslike"));
$this->FileUpload1->SetDBValue($this->f("imefajla"));
$this->FileUpload2->SetDBValue($this->f("jar"));
$this->Label1->SetDBValue($this->f("jar"));
$this->CheckBoxList1->SetDBValue($this->f("idtelefona"));
$this->kodmelodije->SetDBValue($this->f("kodslike"));
}
//End SetValues Method
//Insert Method @2-E649E7B6
function Insert()
{
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert");
$this->SQL = "INSERT INTO java ("
. "nazivslike, "
. "imefajla, "
. "jar, "
. "idtelefona, "
. "kodslike"
. ") VALUES ("
. $this->ToSQL($this->nazivmelodije->GetDBValue(), $this->nazivmelodije->DataType) . ", "
. $this->ToSQL($this->FileUpload1->GetDBValue(), $this->FileUpload1->DataType) . ", "
. $this->ToSQL($this->FileUpload2->GetDBValue(), $this->FileUpload2->DataType) . ", "
. $this->ToSQL($this->CheckBoxList1->GetDBValue(), $this->CheckBoxList1->DataType) . ", "
. $this->ToSQL($this->kodmelodije->GetDBValue(), $this->kodmelodije->DataType)
. ")";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteInsert");
if($this->Errors->Count() == 0 && $this->CmdExecution) {
$this->query($this->SQL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteInsert");
}
$this->close();
}
//End Insert Method
//Update Method @2-BF8876B5
function Update()
{
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate");
$this->SQL = "UPDATE java SET "
. "nazivslike=" . $this->ToSQL($this->nazivmelodije->GetDBValue(), $this->nazivmelodije->DataType) . ", "
. "imefajla=" . $this->ToSQL($this->FileUpload1->GetDBValue(), $this->FileUpload1->DataType) . ", "
. "jar=" . $this->ToSQL($this->FileUpload2->GetDBValue(), $this->FileUpload2->DataType) . ", "
. "idtelefona=" . $this->ToSQL($this->CheckBoxList1->GetDBValue(), $this->CheckBoxList1->DataType) . ", "
. "kodslike=" . $this->ToSQL($this->kodmelodije->GetDBValue(), $this->kodmelodije->DataType);
$this->SQL = CCBuildSQL($this->SQL, $this->Where, "");
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate");
if($this->Errors->Count() == 0 && $this->CmdExecution) {
$this->query($this->SQL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteUpdate");
}
$this->close();
}
//End Update Method
//Delete Method @2-CF42E2A5
function Delete()
{
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete");
$this->SQL = "DELETE FROM java";
$this->SQL = CCBuildSQL($this->SQL, $this->Where, "");
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteDelete");
if($this->Errors->Count() == 0 && $this->CmdExecution) {
$this->query($this->SQL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteDelete");
}
$this->close();
}
//End Delete Method
} //End mmsmelodijeDataSource Class @2-FCB6E20C
//Include Page implementation @12-58DBA1E3
include_once(RelativePath . "/Footer.php");
//End Include Page implementation
//Initialize Page @1-E6DAA84F
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "java_maint.php";
$Redirect = "";
$TemplateFileName = "java_maint.html";
$BlockToParse = "main";
$TemplateEncoding = "";
$FileEncoding = "";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-DC94A87D
CCSecurityRedirect("1", "");
//End Authenticate User
//Initialize Objects @1-9635A874
$DBConnection1 = new clsDBConnection1();
// Controls
$Header = new clsHeader("");
$Header->BindEvents();
$Header->Initialize();
$Header1 = new clsHeader1("");
$Header1->BindEvents();
$Header1->Initialize();
$mmsmelodije = new clsRecordmmsmelodije();
$Footer = new clsFooter("");
$Footer->BindEvents();
$Footer->Initialize();
$mmsmelodije->Initialize();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize");
if ($Charset)
header("Content-Type: text/html; charset=" . $Charset);
//End Initialize Objects
//Initialize HTML Template @1-51DB8464
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView");
$Tpl = new clsTemplate();
$Tpl->LoadTemplate(TemplatePath . $TemplateFileName, "main", $TemplateEncoding);
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow");
//End Initialize HTML Template
//Execute Components @1-DF2CA01E
$Header->Operations();
$Header1->Operations();
$mmsmelodije->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-CBA57590
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
$Header1->Class_Terminate();
unset($Header1);
unset($mmsmelodije);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-89A91988
$Header->Show("Header");
$Header1->Show("Header1");
$mmsmelodije->Show();
$Footer->Show("Footer");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-B735A71E
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
$Header1->Class_Terminate();
unset($Header1);
unset($mmsmelodije);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
//End Unload Page
?>
|