Viewing file: informacij_list.php (67.96 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 @33-3DD2EFDC
include_once(RelativePath . "/Header.php");
//End Include Page implementation
//Include Page implementation @77-9090FF7A
include_once(RelativePath . "/Header1.php");
//End Include Page implementation
class clsEditableGridmmsmelodije { //mmsmelodije Class @78-87A792FD
//Variables @78-89501313
// Public variables
var $ComponentName;
var $HTMLFormAction;
var $PressedButton;
var $Errors;
var $ErrorBlock;
var $FormSubmitted;
var $FormParameters;
var $FormState;
var $FormEnctype;
var $CachedColumns;
var $TotalRows;
var $UpdatedRows;
var $EmptyRows;
var $Visible;
var $EditableGridset;
var $RowsErrors;
var $ds;
var $PageSize;
var $SorterName = "";
var $SorterDirection = "";
var $PageNumber;
var $CCSEvents = "";
var $CCSEventResult;
var $InsertAllowed = false;
var $UpdateAllowed = false;
var $DeleteAllowed = false;
var $ReadAllowed = false;
var $EditMode;
var $ValidatingControls;
var $Controls;
var $ControlsErrors;
// Class variables
var $Sorter_demo;
var $Sorter_idtelefona;
var $Sorter_kategorija;
var $Navigator;
//End Variables
//Class_Initialize Event @78-74F45C98
function clsEditableGridmmsmelodije()
{
global $FileName;
$this->Visible = true;
$this->Errors = new clsErrors();
$this->ErrorBlock = "EditableGrid mmsmelodije/Error";
$this->ComponentName = "mmsmelodije";
$this->CachedColumns["idmelodije"][0] = "idmelodije";
$this->ds = new clsmmsmelodijeDataSource();
$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: EditableGrid " . $this->ComponentName . "<br>Error: (CCS06) Invalid page size.</p>");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
$this->EmptyRows = 3;
$this->InsertAllowed = true;
$this->UpdateAllowed = true;
$this->DeleteAllowed = true;
$this->ReadAllowed = true;
if(!$this->Visible) return;
$CCSForm = CCGetFromGet("ccsForm", "");
$this->FormEnctype = "multipart/form-data";
$this->FormSubmitted = ($CCSForm == $this->ComponentName);
if($this->FormSubmitted) {
$this->FormState = CCGetFromPost("FormState", "");
$this->SetFormState($this->FormState);
} else {
$this->FormState = "";
}
$Method = $this->FormSubmitted ? ccsPost : ccsGet;
$this->SorterName = CCGetParam("mmsmelodijeOrder", "");
$this->SorterDirection = CCGetParam("mmsmelodijeDir", "");
$this->Sorter_demo = new clsSorter($this->ComponentName, "Sorter_demo", $FileName);
$this->Sorter_idtelefona = new clsSorter($this->ComponentName, "Sorter_idtelefona", $FileName);
$this->Sorter_kategorija = new clsSorter($this->ComponentName, "Sorter_kategorija", $FileName);
$this->nazivmelodije = new clsControl(ccsTextBox, "nazivmelodije", "Nazivmelodije", ccsMemo, "");
$this->nazivmelodije->Required = true;
$this->FileUpload1 = new clsFileUpload("FileUpload1", "FileUpload1", "/home/mnnews/public_html/mms/temp/", "/home/mnnews/public_html/mms/mmsmelodije/", "*", "", 100000);
$this->FileUpload3 = new clsFileUpload("FileUpload3", "FileUpload3", "/home/mnnews/public_html/mms/temp/", "/home/mnnews/public_html/mms/mmsmelodije/", "*", "", 100000);
$this->FileUpload4 = new clsFileUpload("FileUpload4", "FileUpload4", "/home/mnnews/public_html/mms/temp/", "/home/mnnews/public_html/mms/mmsmelodije/", "*", "", 100000);
$this->FileUpload2 = new clsFileUpload("FileUpload2", "FileUpload2", "/home/mnnews/public_html/mms/temp/", "/home/mnnews/public_html/mms/mmsmelodije/", "*", "", 1000000);
$this->idtelefona = new clsControl(ccsListBox, "idtelefona", "Idtelefona", ccsInteger, "");
$this->idtelefona->DSType = dsTable;
list($this->idtelefona->BoundColumn, $this->idtelefona->TextColumn, $this->idtelefona->DBFormat) = array("idtelefona", "naziv_telefona", "");
$this->idtelefona->ds = new clsDBConnection1();
$this->idtelefona->ds->SQL = "SELECT * " .
"FROM telefoni";
$this->idtelefona->Required = true;
$this->kategorija = new clsControl(ccsListBox, "kategorija", "Kategorija", ccsInteger, "");
$this->kategorija->DSType = dsTable;
list($this->kategorija->BoundColumn, $this->kategorija->TextColumn, $this->kategorija->DBFormat) = array("idsekcije", "nazivsekcije", "");
$this->kategorija->ds = new clsDBConnection1();
$this->kategorija->ds->SQL = "SELECT * " .
"FROM sekcija";
$this->kategorija->Required = true;
$this->CheckBox_Delete = new clsControl(ccsCheckBox, "CheckBox_Delete", "CheckBox_Delete", ccsBoolean, Array("True", "False", ""));
$this->CheckBox_Delete->CheckedValue = $this->CheckBox_Delete->GetParsedValue(true);
$this->CheckBox_Delete->UncheckedValue = $this->CheckBox_Delete->GetParsedValue(false);
$this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple);
$this->Button_Submit = new clsButton("Button_Submit");
}
//End Class_Initialize Event
//Initialize Method @78-03626367
function Initialize()
{
if(!$this->Visible) return;
$this->ds->PageSize = $this->PageSize;
$this->ds->AbsolutePage = $this->PageNumber;
$this->ds->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//GetFormParameters Method @78-B2805BFE
function GetFormParameters()
{
for($RowNumber = 1; $RowNumber <= $this->TotalRows; $RowNumber++)
{
$this->FormParameters["nazivmelodije"][$RowNumber] = CCGetFromPost("nazivmelodije_" . $RowNumber);
$this->FormParameters["idtelefona"][$RowNumber] = CCGetFromPost("idtelefona_" . $RowNumber);
$this->FormParameters["kategorija"][$RowNumber] = CCGetFromPost("kategorija_" . $RowNumber);
$this->FormParameters["CheckBox_Delete"][$RowNumber] = CCGetFromPost("CheckBox_Delete_" . $RowNumber);
$this->FileUpload1->Upload($RowNumber);
$this->FormParameters["FileUpload1"][$RowNumber] = $this->FileUpload1->GetValue();
$this->ControlsErrors["FileUpload1"][$RowNumber] = $this->FileUpload1->Errors;
$this->FileUpload1->Errors->Clear();
$this->FileUpload3->Upload($RowNumber);
$this->FormParameters["FileUpload3"][$RowNumber] = $this->FileUpload3->GetValue();
$this->ControlsErrors["FileUpload3"][$RowNumber] = $this->FileUpload3->Errors;
$this->FileUpload3->Errors->Clear();
$this->FileUpload4->Upload($RowNumber);
$this->FormParameters["FileUpload4"][$RowNumber] = $this->FileUpload4->GetValue();
$this->ControlsErrors["FileUpload4"][$RowNumber] = $this->FileUpload4->Errors;
$this->FileUpload4->Errors->Clear();
$this->FileUpload2->Upload($RowNumber);
$this->FormParameters["FileUpload2"][$RowNumber] = $this->FileUpload2->GetValue();
$this->ControlsErrors["FileUpload2"][$RowNumber] = $this->FileUpload2->Errors;
$this->FileUpload2->Errors->Clear();
}
}
//End GetFormParameters Method
//Validate Method @78-9E3D1F2B
function Validate()
{
$Validation = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
for($RowNumber = 1; $RowNumber <= $this->TotalRows; $RowNumber++)
{
$this->ds->CachedColumns["idmelodije"] = $this->CachedColumns["idmelodije"][$RowNumber];
$this->nazivmelodije->SetText($this->FormParameters["nazivmelodije"][$RowNumber], $RowNumber);
$this->FileUpload1->SetText($this->FormParameters["FileUpload1"][$RowNumber], $RowNumber);
$this->FileUpload1->Errors = $this->ControlsErrors["FileUpload1"][$RowNumber];
$this->FileUpload3->SetText($this->FormParameters["FileUpload3"][$RowNumber], $RowNumber);
$this->FileUpload3->Errors = $this->ControlsErrors["FileUpload3"][$RowNumber];
$this->FileUpload4->SetText($this->FormParameters["FileUpload4"][$RowNumber], $RowNumber);
$this->FileUpload4->Errors = $this->ControlsErrors["FileUpload4"][$RowNumber];
$this->FileUpload2->SetText($this->FormParameters["FileUpload2"][$RowNumber], $RowNumber);
$this->FileUpload2->Errors = $this->ControlsErrors["FileUpload2"][$RowNumber];
$this->idtelefona->SetText($this->FormParameters["idtelefona"][$RowNumber], $RowNumber);
$this->kategorija->SetText($this->FormParameters["kategorija"][$RowNumber], $RowNumber);
$this->CheckBox_Delete->SetText($this->FormParameters["CheckBox_Delete"][$RowNumber], $RowNumber);
if ($this->UpdatedRows >= $RowNumber) {
if(!$this->CheckBox_Delete->Value)
$Validation = ($this->ValidateRow($RowNumber) && $Validation);
}
else if($this->CheckInsert($RowNumber))
{
$Validation = ($this->ValidateRow($RowNumber) && $Validation);
}
}
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//ValidateRow Method @78-3A1CF4F2
function ValidateRow($RowNumber)
{
$this->nazivmelodije->Validate();
$this->FileUpload1->Validate();
$this->FileUpload3->Validate();
$this->FileUpload4->Validate();
$this->FileUpload2->Validate();
$this->idtelefona->Validate();
$this->kategorija->Validate();
$this->CheckBox_Delete->Validate();
$this->RowErrors = new clsErrors();
$errors = $this->nazivmelodije->Errors->ToString();
$errors .= $this->FileUpload1->Errors->ToString();
$errors .= $this->FileUpload3->Errors->ToString();
$errors .= $this->FileUpload4->Errors->ToString();
$errors .= $this->FileUpload2->Errors->ToString();
$errors .= $this->idtelefona->Errors->ToString();
$errors .= $this->kategorija->Errors->ToString();
$errors .= $this->CheckBox_Delete->Errors->ToString();
$this->nazivmelodije->Errors->Clear();
$this->FileUpload1->Errors->Clear();
$this->FileUpload3->Errors->Clear();
$this->FileUpload4->Errors->Clear();
$this->FileUpload2->Errors->Clear();
$this->idtelefona->Errors->Clear();
$this->kategorija->Errors->Clear();
$this->CheckBox_Delete->Errors->Clear();
$errors .=$this->RowErrors->ToString();
$this->RowsErrors[$RowNumber] = $errors;
return $errors ? 0 : 1;
}
//End ValidateRow Method
//CheckInsert Method @78-807424F6
function CheckInsert($RowNumber)
{
$filed = false;
$filed = ($filed || strlen($this->FormParameters["nazivmelodije"][$RowNumber]));
$filed = ($filed || strlen($this->FormParameters["FileUpload1"][$RowNumber]));
$filed = ($filed || strlen($this->FormParameters["FileUpload3"][$RowNumber]));
$filed = ($filed || strlen($this->FormParameters["FileUpload4"][$RowNumber]));
$filed = ($filed || strlen($this->FormParameters["FileUpload2"][$RowNumber]));
$filed = ($filed || strlen($this->FormParameters["idtelefona"][$RowNumber]));
$filed = ($filed || strlen($this->FormParameters["kategorija"][$RowNumber]));
$filed = ($filed || $this->FileUpload1->Errors->Count());
$filed = ($filed || $this->FileUpload3->Errors->Count());
$filed = ($filed || $this->FileUpload4->Errors->Count());
$filed = ($filed || $this->FileUpload2->Errors->Count());
return $filed;
}
//End CheckInsert Method
//CheckErrors Method @78-242E5992
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->Errors->Count());
$errors = ($errors || $this->ds->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @78-6A172129
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
$this->ds->Prepare();
if(!$this->FormSubmitted)
return;
$this->GetFormParameters();
$this->PressedButton = "Button_Submit";
if(strlen(CCGetParam("Button_Submit", ""))) {
$this->PressedButton = "Button_Submit";
}
$Redirect = $FileName . "?" . CCGetQueryString("QueryString", Array("ccsForm"));
if($this->PressedButton == "Button_Submit") {
if(!CCGetEvent($this->Button_Submit->CCSEvents, "OnClick") || !$this->UpdateGrid()) {
$Redirect = "";
}
} else {
$Redirect = "";
}
}
//End Operation Method
//UpdateGrid Method @78-149F734F
function UpdateGrid()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSubmit");
if(!$this->Validate()) return;
$Validation = true;
for($RowNumber = 1; $RowNumber <= $this->TotalRows; $RowNumber++)
{
$this->ds->CachedColumns["idmelodije"] = $this->CachedColumns["idmelodije"][$RowNumber];
$this->nazivmelodije->SetText($this->FormParameters["nazivmelodije"][$RowNumber], $RowNumber);
$this->FileUpload1->SetText($this->FormParameters["FileUpload1"][$RowNumber], $RowNumber);
$this->FileUpload3->SetText($this->FormParameters["FileUpload3"][$RowNumber], $RowNumber);
$this->FileUpload4->SetText($this->FormParameters["FileUpload4"][$RowNumber], $RowNumber);
$this->FileUpload2->SetText($this->FormParameters["FileUpload2"][$RowNumber], $RowNumber);
$this->idtelefona->SetText($this->FormParameters["idtelefona"][$RowNumber], $RowNumber);
$this->kategorija->SetText($this->FormParameters["kategorija"][$RowNumber], $RowNumber);
$this->CheckBox_Delete->SetText($this->FormParameters["CheckBox_Delete"][$RowNumber], $RowNumber);
if ($this->UpdatedRows >= $RowNumber) {
if($this->CheckBox_Delete->Value) {
if($this->DeleteAllowed) { $Validation = ($this->DeleteRow($RowNumber) && $Validation); }
} else if($this->UpdateAllowed) {
$Validation = ($this->UpdateRow($RowNumber) && $Validation);
}
}
else if($this->CheckInsert($RowNumber) && $this->InsertAllowed)
{
$Validation = ($this->InsertRow($RowNumber) && $Validation);
}
}
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterSubmit");
return ($this->Errors->Count() == 0 && $Validation);
}
//End UpdateGrid Method
//InsertRow Method @78-B10B0D23
function InsertRow($RowNumber)
{
if(!$this->InsertAllowed) return false;
$this->ds->nazivmelodije->SetValue($this->nazivmelodije->GetValue());
$this->ds->FileUpload1->SetValue($this->FileUpload1->GetValue());
$this->ds->FileUpload3->SetValue($this->FileUpload3->GetValue());
$this->ds->FileUpload4->SetValue($this->FileUpload4->GetValue());
$this->ds->FileUpload2->SetValue($this->FileUpload2->GetValue());
$this->ds->idtelefona->SetValue($this->idtelefona->GetValue());
$this->ds->kategorija->SetValue($this->kategorija->GetValue());
$this->ds->Insert();
$errors = "";
if($this->ds->Errors->Count() > 0) {
$errors = $this->ds->Errors->ToString();
$this->RowsErrors[$RowNumber] = $errors;
$this->ds->Errors->Clear();
} else {
$this->FileUpload1->Move();
$errors .= $this->FileUpload1->Errors->ToString();
$this->FileUpload1->Errors->Clear();
$this->FileUpload3->Move();
$errors .= $this->FileUpload3->Errors->ToString();
$this->FileUpload3->Errors->Clear();
$this->FileUpload4->Move();
$errors .= $this->FileUpload4->Errors->ToString();
$this->FileUpload4->Errors->Clear();
$this->FileUpload2->Move();
$errors .= $this->FileUpload2->Errors->ToString();
$this->FileUpload2->Errors->Clear();
$this->RowsErrors[$RowNumber] = $errors;
}
return (($this->Errors->Count() == 0) && !strlen($errors));
}
//End InsertRow Method
//UpdateRow Method @78-F65176D3
function UpdateRow($RowNumber)
{
if(!$this->UpdateAllowed) return false;
$this->ds->nazivmelodije->SetValue($this->nazivmelodije->GetValue());
$this->ds->FileUpload1->SetValue($this->FileUpload1->GetValue());
$this->ds->FileUpload3->SetValue($this->FileUpload3->GetValue());
$this->ds->FileUpload4->SetValue($this->FileUpload4->GetValue());
$this->ds->FileUpload2->SetValue($this->FileUpload2->GetValue());
$this->ds->idtelefona->SetValue($this->idtelefona->GetValue());
$this->ds->kategorija->SetValue($this->kategorija->GetValue());
$this->ds->Update();
$errors = "";
if($this->ds->Errors->Count() > 0) {
$errors = $this->ds->Errors->ToString();
$this->RowsErrors[$RowNumber] = $errors;
$this->ds->Errors->Clear();
} else {
$this->FileUpload1->Move();
$errors .= $this->FileUpload1->Errors->ToString();
$this->FileUpload1->Errors->Clear();
$this->FileUpload3->Move();
$errors .= $this->FileUpload3->Errors->ToString();
$this->FileUpload3->Errors->Clear();
$this->FileUpload4->Move();
$errors .= $this->FileUpload4->Errors->ToString();
$this->FileUpload4->Errors->Clear();
$this->FileUpload2->Move();
$errors .= $this->FileUpload2->Errors->ToString();
$this->FileUpload2->Errors->Clear();
$this->RowsErrors[$RowNumber] = $errors;
}
return (($this->Errors->Count() == 0) && !strlen($errors));
}
//End UpdateRow Method
//DeleteRow Method @78-CFD1B458
function DeleteRow($RowNumber)
{
if(!$this->DeleteAllowed) return false;
$this->ds->Delete();
$errors = "";
if($this->ds->Errors->Count() > 0) {
$errors = $this->ds->Errors->ToString();
$this->RowsErrors[$RowNumber] = $errors;
$this->ds->Errors->Clear();
} else {
$this->FileUpload1->Delete();
$errors .= $this->FileUpload1->Errors->ToString();
$this->FileUpload1->Errors->Clear();
$this->FileUpload3->Delete();
$errors .= $this->FileUpload3->Errors->ToString();
$this->FileUpload3->Errors->Clear();
$this->FileUpload4->Delete();
$errors .= $this->FileUpload4->Errors->ToString();
$this->FileUpload4->Errors->Clear();
$this->FileUpload2->Delete();
$errors .= $this->FileUpload2->Errors->ToString();
$this->FileUpload2->Errors->Clear();
$this->RowsErrors[$RowNumber] = $errors;
}
return (($this->Errors->Count() == 0) && !strlen($errors));
}
//End DeleteRow Method
//FormScript Method @78-59800DB5
function FormScript($TotalRows)
{
$script = "";
return $script;
}
//End FormScript Method
//SetFormState Method @78-15C3DDD3
function SetFormState($FormState)
{
if(strlen($FormState)) {
$FormState = str_replace("\\\\", "\\" . ord("\\"), $FormState);
$FormState = str_replace("\\;", "\\" . ord(";"), $FormState);
$pieces = explode(";", $FormState);
$this->UpdatedRows = $pieces[0];
$this->EmptyRows = $pieces[1];
$this->TotalRows = $this->UpdatedRows + $this->EmptyRows;
$RowNumber = 0;
for($i = 2; $i < sizeof($pieces); $i = $i + 1) {
$piece = $pieces[$i + 0];
$piece = str_replace("\\" . ord("\\"), "\\", $piece);
$piece = str_replace("\\" . ord(";"), ";", $piece);
$this->CachedColumns["idmelodije"][$RowNumber] = $piece;
$RowNumber++;
}
if(!$RowNumber) { $RowNumber = 1; }
for($i = 1; $i <= $this->EmptyRows; $i++) {
$this->CachedColumns["idmelodije"][$RowNumber] = "";
$RowNumber++;
}
}
}
//End SetFormState Method
//GetFormState Method @78-7A9F9F5B
function GetFormState($NonEmptyRows)
{
if(!$this->FormSubmitted) {
$this->FormState = $NonEmptyRows . ";";
$this->FormState .= $this->InsertAllowed ? $this->EmptyRows : "0";
if($NonEmptyRows) {
for($i = 0; $i <= $NonEmptyRows; $i++) {
$this->FormState .= ";" . str_replace(";", "\\;", str_replace("\\", "\\\\", $this->CachedColumns["idmelodije"][$i]));
}
}
}
return $this->FormState;
}
//End GetFormState Method
//Show Method @78-1908139B
function Show()
{
global $Tpl;
global $FileName;
$Error = "";
if(!$this->Visible) { return; }
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect");
$this->idtelefona->Prepare();
$this->kategorija->Prepare();
$this->ds->open();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
if(!$this->Visible) { return; }
$this->Button_Submit->Visible = $this->Button_Submit->Visible && ($this->InsertAllowed || $this->UpdateAllowed || $this->DeleteAllowed);
$ParentPath = $Tpl->block_path;
$EditableGridPath = $ParentPath . "/EditableGrid " . $this->ComponentName;
$EditableGridRowPath = $ParentPath . "/EditableGrid " . $this->ComponentName . "/Row";
$Tpl->block_path = $EditableGridRowPath;
$RowNumber = 0;
$NonEmptyRows = 0;
$EmptyRowsLeft = $this->EmptyRows;
$is_next_record = $this->ds->next_record() && $this->ReadAllowed && $RowNumber < $this->PageSize;
if($is_next_record || ($EmptyRowsLeft && $this->InsertAllowed))
{
do
{
$RowNumber++;
if($is_next_record) {
$NonEmptyRows++;
$this->ds->SetValues();
} else {
}
if(!$is_next_record || !$this->DeleteAllowed)
$this->CheckBox_Delete->Visible = false;
if(!$this->FormSubmitted && $is_next_record) {
$this->CachedColumns["idmelodije"][$RowNumber] = $this->ds->CachedColumns["idmelodije"];
$this->nazivmelodije->SetValue($this->ds->nazivmelodije->GetValue());
$this->FileUpload1->SetValue($this->ds->FileUpload1->GetValue());
$this->FileUpload3->SetValue($this->ds->FileUpload3->GetValue());
$this->FileUpload4->SetValue($this->ds->FileUpload4->GetValue());
$this->FileUpload2->SetValue($this->ds->FileUpload2->GetValue());
$this->idtelefona->SetValue($this->ds->idtelefona->GetValue());
$this->kategorija->SetValue($this->ds->kategorija->GetValue());
$this->ValidateRow($RowNumber);
} else if (!$this->FormSubmitted){
$this->CachedColumns["idmelodije"][$RowNumber] = "";
$this->nazivmelodije->SetText("");
$this->FileUpload1->SetText("");
$this->FileUpload3->SetText("");
$this->FileUpload4->SetText("");
$this->FileUpload2->SetText("");
$this->idtelefona->SetText(0);
$this->kategorija->SetText(0);
$this->CheckBox_Delete->SetText("");
} else {
$this->nazivmelodije->SetText($this->FormParameters["nazivmelodije"][$RowNumber], $RowNumber);
$this->FileUpload1->SetText($this->FormParameters["FileUpload1"][$RowNumber], $RowNumber);
$this->FileUpload3->SetText($this->FormParameters["FileUpload3"][$RowNumber], $RowNumber);
$this->FileUpload4->SetText($this->FormParameters["FileUpload4"][$RowNumber], $RowNumber);
$this->FileUpload2->SetText($this->FormParameters["FileUpload2"][$RowNumber], $RowNumber);
$this->idtelefona->SetText($this->FormParameters["idtelefona"][$RowNumber], $RowNumber);
$this->kategorija->SetText($this->FormParameters["kategorija"][$RowNumber], $RowNumber);
$this->CheckBox_Delete->SetText($this->FormParameters["CheckBox_Delete"][$RowNumber], $RowNumber);
}
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->nazivmelodije->Show($RowNumber);
$this->FileUpload1->Show($RowNumber);
$this->FileUpload3->Show($RowNumber);
$this->FileUpload4->Show($RowNumber);
$this->FileUpload2->Show($RowNumber);
$this->idtelefona->Show($RowNumber);
$this->kategorija->Show($RowNumber);
$this->CheckBox_Delete->Show($RowNumber);
if(isset($this->RowsErrors[$RowNumber]) && $this->RowsErrors[$RowNumber] !== "") {
$Tpl->setvar("Error", $this->RowsErrors[$RowNumber]);
$Tpl->parse("RowError", false);
} else {
$Tpl->setblockvar("RowError", "");
}
$Tpl->setvar("FormScript", $this->FormScript($RowNumber));
$Tpl->parse();
if($is_next_record) $is_next_record = $this->ds->next_record() && $this->ReadAllowed && $RowNumber < $this->PageSize;
else $EmptyRowsLeft--;
} while($is_next_record || ($EmptyRowsLeft && $this->InsertAllowed));
} else {
$Tpl->block_path = $EditableGridPath;
$Tpl->parse("NoRecords", false);
}
$Tpl->block_path = $EditableGridPath;
$this->Navigator->PageNumber = $this->ds->AbsolutePage;
$this->Navigator->TotalPages = $this->ds->PageCount();
$this->Sorter_demo->Show();
$this->Sorter_idtelefona->Show();
$this->Sorter_kategorija->Show();
$this->Navigator->Show();
$this->Button_Submit->Show();
if($this->CheckErrors()) {
$Error .= $this->Errors->ToString();
$Error .= $this->ds->Errors->ToString();
$Tpl->SetVar("Error", $Error);
$Tpl->Parse("Error", false);
}
$CCSForm = $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);
$Tpl->SetVar("HTMLFormProperties", "method=\"POST\" action=\"" . $this->HTMLFormAction . "\" name=\"" . $this->ComponentName . "\"");
$Tpl->SetVar("FormState", htmlspecialchars($this->GetFormState($NonEmptyRows)));
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
} //End mmsmelodije Class @78-FCB6E20C
class clsmmsmelodijeDataSource extends clsDBConnection1 { //mmsmelodijeDataSource Class @78-FC35D769
//DataSource Variables @78-A805CA18
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $InsertParameters;
var $UpdateParameters;
var $DeleteParameters;
var $CountSQL;
var $wp;
var $AllParametersSet;
var $CachedColumns;
// Datasource fields
var $nazivmelodije;
var $FileUpload1;
var $FileUpload3;
var $FileUpload4;
var $FileUpload2;
var $idtelefona;
var $kategorija;
var $CheckBox_Delete;
//End DataSource Variables
//DataSourceClass_Initialize Event @78-31099D9A
function clsmmsmelodijeDataSource()
{
$this->ErrorBlock = "EditableGrid mmsmelodije/Error";
$this->Initialize();
$this->nazivmelodije = new clsField("nazivmelodije", ccsMemo, "");
$this->FileUpload1 = new clsField("FileUpload1", ccsText, "");
$this->FileUpload3 = new clsField("FileUpload3", ccsText, "");
$this->FileUpload4 = new clsField("FileUpload4", ccsText, "");
$this->FileUpload2 = new clsField("FileUpload2", ccsText, "");
$this->idtelefona = new clsField("idtelefona", ccsInteger, "");
$this->kategorija = new clsField("kategorija", ccsInteger, "");
$this->CheckBox_Delete = new clsField("CheckBox_Delete", ccsBoolean, Array("true", "false", ""));
}
//End DataSourceClass_Initialize Event
//SetOrder Method @78-79FBA244
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_demo" => array("demo", ""),
"Sorter_idtelefona" => array("idtelefona", ""),
"Sorter_kategorija" => array("kategorija", "")));
}
//End SetOrder Method
//Prepare Method @78-DFF3DD87
function Prepare()
{
}
//End Prepare Method
//Open Method @78-FF442BE4
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM mmsmelodije";
$this->SQL = "SELECT * " .
"FROM mmsmelodije";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect");
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect");
}
//End Open Method
//SetValues Method @78-B276248B
function SetValues()
{
$this->CachedColumns["idmelodije"] = $this->f("idmelodije");
$this->nazivmelodije->SetDBValue($this->f("nazivmelodije"));
$this->FileUpload1->SetDBValue($this->f("imefajla"));
$this->FileUpload3->SetDBValue($this->f("4kan"));
$this->FileUpload4->SetDBValue($this->f("mmf"));
$this->FileUpload2->SetDBValue($this->f("demo"));
$this->idtelefona->SetDBValue(trim($this->f("idtelefona")));
$this->kategorija->SetDBValue(trim($this->f("kategorija")));
}
//End SetValues Method
//Insert Method @78-9E3D9622
function Insert()
{
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert");
$this->SQL = "INSERT INTO mmsmelodije ("
. "nazivmelodije, "
. "imefajla, "
. "`4kan`, "
. "mmf, "
. "demo, "
. "idtelefona, "
. "kategorija"
. ") VALUES ("
. $this->ToSQL($this->nazivmelodije->GetDBValue(), $this->nazivmelodije->DataType) . ", "
. $this->ToSQL($this->FileUpload1->GetDBValue(), $this->FileUpload1->DataType) . ", "
. $this->ToSQL($this->FileUpload3->GetDBValue(), $this->FileUpload3->DataType) . ", "
. $this->ToSQL($this->FileUpload4->GetDBValue(), $this->FileUpload4->DataType) . ", "
. $this->ToSQL($this->FileUpload2->GetDBValue(), $this->FileUpload2->DataType) . ", "
. $this->ToSQL($this->idtelefona->GetDBValue(), $this->idtelefona->DataType) . ", "
. $this->ToSQL($this->kategorija->GetDBValue(), $this->kategorija->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 @78-65E772CD
function Update()
{
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate");
$this->Where = "idmelodije=" . $this->ToSQL($this->CachedColumns["idmelodije"], ccsInteger);
$this->SQL = "UPDATE mmsmelodije SET "
. "nazivmelodije=" . $this->ToSQL($this->nazivmelodije->GetDBValue(), $this->nazivmelodije->DataType) . ", "
. "imefajla=" . $this->ToSQL($this->FileUpload1->GetDBValue(), $this->FileUpload1->DataType) . ", "
. "`4kan`=" . $this->ToSQL($this->FileUpload3->GetDBValue(), $this->FileUpload3->DataType) . ", "
. "mmf=" . $this->ToSQL($this->FileUpload4->GetDBValue(), $this->FileUpload4->DataType) . ", "
. "demo=" . $this->ToSQL($this->FileUpload2->GetDBValue(), $this->FileUpload2->DataType) . ", "
. "idtelefona=" . $this->ToSQL($this->idtelefona->GetDBValue(), $this->idtelefona->DataType) . ", "
. "kategorija=" . $this->ToSQL($this->kategorija->GetDBValue(), $this->kategorija->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 @78-44DD0F94
function Delete()
{
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete");
$this->Where = "idmelodije=" . $this->ToSQL($this->CachedColumns["idmelodije"], ccsInteger);
$this->SQL = "DELETE FROM mmsmelodije";
$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 @78-FCB6E20C
class clsEditableGridmmsslike { //mmsslike Class @93-E8EEC449
//Variables @93-89501313
// Public variables
var $ComponentName;
var $HTMLFormAction;
var $PressedButton;
var $Errors;
var $ErrorBlock;
var $FormSubmitted;
var $FormParameters;
var $FormState;
var $FormEnctype;
var $CachedColumns;
var $TotalRows;
var $UpdatedRows;
var $EmptyRows;
var $Visible;
var $EditableGridset;
var $RowsErrors;
var $ds;
var $PageSize;
var $SorterName = "";
var $SorterDirection = "";
var $PageNumber;
var $CCSEvents = "";
var $CCSEventResult;
var $InsertAllowed = false;
var $UpdateAllowed = false;
var $DeleteAllowed = false;
var $ReadAllowed = false;
var $EditMode;
var $ValidatingControls;
var $Controls;
var $ControlsErrors;
// Class variables
var $Sorter_demo;
var $Sorter_idtelefona;
var $Sorter_kategorija;
var $Navigator;
//End Variables
//Class_Initialize Event @93-AFB2B5EC
function clsEditableGridmmsslike()
{
global $FileName;
$this->Visible = true;
$this->Errors = new clsErrors();
$this->ErrorBlock = "EditableGrid mmsslike/Error";
$this->ComponentName = "mmsslike";
$this->CachedColumns["idmmsslike"][0] = "idmmsslike";
$this->ds = new clsmmsslikeDataSource();
$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: EditableGrid " . $this->ComponentName . "<br>Error: (CCS06) Invalid page size.</p>");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
$this->EmptyRows = 3;
$this->InsertAllowed = true;
$this->UpdateAllowed = true;
$this->DeleteAllowed = true;
$this->ReadAllowed = true;
if(!$this->Visible) return;
$CCSForm = CCGetFromGet("ccsForm", "");
$this->FormEnctype = "multipart/form-data";
$this->FormSubmitted = ($CCSForm == $this->ComponentName);
if($this->FormSubmitted) {
$this->FormState = CCGetFromPost("FormState", "");
$this->SetFormState($this->FormState);
} else {
$this->FormState = "";
}
$Method = $this->FormSubmitted ? ccsPost : ccsGet;
$this->SorterName = CCGetParam("mmsslikeOrder", "");
$this->SorterDirection = CCGetParam("mmsslikeDir", "");
$this->Sorter_demo = new clsSorter($this->ComponentName, "Sorter_demo", $FileName);
$this->Sorter_idtelefona = new clsSorter($this->ComponentName, "Sorter_idtelefona", $FileName);
$this->Sorter_kategorija = new clsSorter($this->ComponentName, "Sorter_kategorija", $FileName);
$this->nazivslike = new clsControl(ccsTextBox, "nazivslike", "Nazivslike", ccsMemo, "");
$this->nazivslike->Required = true;
$this->FileUpload1 = new clsFileUpload("FileUpload1", "FileUpload1", "/home/mnnews/public_html/mms/temp/", "/home/mnnews/public_html/mms/mmsslike/", "*", "", 100000);
$this->FileUpload2 = new clsFileUpload("FileUpload2", "FileUpload2", "/home/mnnews/public_html/mms/temp/", "/home/mnnews/public_html/mms/mmsslike/", "*", "", 100000);
$this->idtelefona = new clsControl(ccsListBox, "idtelefona", "Idtelefona", ccsInteger, "");
$this->idtelefona->DSType = dsTable;
list($this->idtelefona->BoundColumn, $this->idtelefona->TextColumn, $this->idtelefona->DBFormat) = array("idtelefona", "naziv_telefona", "");
$this->idtelefona->ds = new clsDBConnection1();
$this->idtelefona->ds->SQL = "SELECT * " .
"FROM telefoni";
$this->idtelefona->Required = true;
$this->kategorija = new clsControl(ccsListBox, "kategorija", "Kategorija", ccsInteger, "");
$this->kategorija->DSType = dsTable;
list($this->kategorija->BoundColumn, $this->kategorija->TextColumn, $this->kategorija->DBFormat) = array("idsekcije", "nazivsekcije", "");
$this->kategorija->ds = new clsDBConnection1();
$this->kategorija->ds->SQL = "SELECT * " .
"FROM sekcija";
$this->kategorija->Required = true;
$this->CheckBox_Delete = new clsControl(ccsCheckBox, "CheckBox_Delete", "CheckBox_Delete", ccsBoolean, Array("True", "False", ""));
$this->CheckBox_Delete->CheckedValue = $this->CheckBox_Delete->GetParsedValue(true);
$this->CheckBox_Delete->UncheckedValue = $this->CheckBox_Delete->GetParsedValue(false);
$this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple);
$this->Button_Submit = new clsButton("Button_Submit");
}
//End Class_Initialize Event
//Initialize Method @93-03626367
function Initialize()
{
if(!$this->Visible) return;
$this->ds->PageSize = $this->PageSize;
$this->ds->AbsolutePage = $this->PageNumber;
$this->ds->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//GetFormParameters Method @93-90808420
function GetFormParameters()
{
for($RowNumber = 1; $RowNumber <= $this->TotalRows; $RowNumber++)
{
$this->FormParameters["nazivslike"][$RowNumber] = CCGetFromPost("nazivslike_" . $RowNumber);
$this->FormParameters["idtelefona"][$RowNumber] = CCGetFromPost("idtelefona_" . $RowNumber);
$this->FormParameters["kategorija"][$RowNumber] = CCGetFromPost("kategorija_" . $RowNumber);
$this->FormParameters["CheckBox_Delete"][$RowNumber] = CCGetFromPost("CheckBox_Delete_" . $RowNumber);
$this->FileUpload1->Upload($RowNumber);
$this->FormParameters["FileUpload1"][$RowNumber] = $this->FileUpload1->GetValue();
$this->ControlsErrors["FileUpload1"][$RowNumber] = $this->FileUpload1->Errors;
$this->FileUpload1->Errors->Clear();
$this->FileUpload2->Upload($RowNumber);
$this->FormParameters["FileUpload2"][$RowNumber] = $this->FileUpload2->GetValue();
$this->ControlsErrors["FileUpload2"][$RowNumber] = $this->FileUpload2->Errors;
$this->FileUpload2->Errors->Clear();
}
}
//End GetFormParameters Method
//Validate Method @93-A099409D
function Validate()
{
$Validation = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
for($RowNumber = 1; $RowNumber <= $this->TotalRows; $RowNumber++)
{
$this->ds->CachedColumns["idmmsslike"] = $this->CachedColumns["idmmsslike"][$RowNumber];
$this->nazivslike->SetText($this->FormParameters["nazivslike"][$RowNumber], $RowNumber);
$this->FileUpload1->SetText($this->FormParameters["FileUpload1"][$RowNumber], $RowNumber);
$this->FileUpload1->Errors = $this->ControlsErrors["FileUpload1"][$RowNumber];
$this->FileUpload2->SetText($this->FormParameters["FileUpload2"][$RowNumber], $RowNumber);
$this->FileUpload2->Errors = $this->ControlsErrors["FileUpload2"][$RowNumber];
$this->idtelefona->SetText($this->FormParameters["idtelefona"][$RowNumber], $RowNumber);
$this->kategorija->SetText($this->FormParameters["kategorija"][$RowNumber], $RowNumber);
$this->CheckBox_Delete->SetText($this->FormParameters["CheckBox_Delete"][$RowNumber], $RowNumber);
if ($this->UpdatedRows >= $RowNumber) {
if(!$this->CheckBox_Delete->Value)
$Validation = ($this->ValidateRow($RowNumber) && $Validation);
}
else if($this->CheckInsert($RowNumber))
{
$Validation = ($this->ValidateRow($RowNumber) && $Validation);
}
}
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//ValidateRow Method @93-C617E514
function ValidateRow($RowNumber)
{
$this->nazivslike->Validate();
$this->FileUpload1->Validate();
$this->FileUpload2->Validate();
$this->idtelefona->Validate();
$this->kategorija->Validate();
$this->CheckBox_Delete->Validate();
$this->RowErrors = new clsErrors();
$errors = $this->nazivslike->Errors->ToString();
$errors .= $this->FileUpload1->Errors->ToString();
$errors .= $this->FileUpload2->Errors->ToString();
$errors .= $this->idtelefona->Errors->ToString();
$errors .= $this->kategorija->Errors->ToString();
$errors .= $this->CheckBox_Delete->Errors->ToString();
$this->nazivslike->Errors->Clear();
$this->FileUpload1->Errors->Clear();
$this->FileUpload2->Errors->Clear();
$this->idtelefona->Errors->Clear();
$this->kategorija->Errors->Clear();
$this->CheckBox_Delete->Errors->Clear();
$errors .=$this->RowErrors->ToString();
$this->RowsErrors[$RowNumber] = $errors;
return $errors ? 0 : 1;
}
//End ValidateRow Method
//CheckInsert Method @93-E4FE2FA5
function CheckInsert($RowNumber)
{
$filed = false;
$filed = ($filed || strlen($this->FormParameters["nazivslike"][$RowNumber]));
$filed = ($filed || strlen($this->FormParameters["FileUpload1"][$RowNumber]));
$filed = ($filed || strlen($this->FormParameters["FileUpload2"][$RowNumber]));
$filed = ($filed || strlen($this->FormParameters["idtelefona"][$RowNumber]));
$filed = ($filed || strlen($this->FormParameters["kategorija"][$RowNumber]));
$filed = ($filed || $this->FileUpload1->Errors->Count());
$filed = ($filed || $this->FileUpload2->Errors->Count());
return $filed;
}
//End CheckInsert Method
//CheckErrors Method @93-242E5992
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->Errors->Count());
$errors = ($errors || $this->ds->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @93-6A172129
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
$this->ds->Prepare();
if(!$this->FormSubmitted)
return;
$this->GetFormParameters();
$this->PressedButton = "Button_Submit";
if(strlen(CCGetParam("Button_Submit", ""))) {
$this->PressedButton = "Button_Submit";
}
$Redirect = $FileName . "?" . CCGetQueryString("QueryString", Array("ccsForm"));
if($this->PressedButton == "Button_Submit") {
if(!CCGetEvent($this->Button_Submit->CCSEvents, "OnClick") || !$this->UpdateGrid()) {
$Redirect = "";
}
} else {
$Redirect = "";
}
}
//End Operation Method
//UpdateGrid Method @93-037C690E
function UpdateGrid()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSubmit");
if(!$this->Validate()) return;
$Validation = true;
for($RowNumber = 1; $RowNumber <= $this->TotalRows; $RowNumber++)
{
$this->ds->CachedColumns["idmmsslike"] = $this->CachedColumns["idmmsslike"][$RowNumber];
$this->nazivslike->SetText($this->FormParameters["nazivslike"][$RowNumber], $RowNumber);
$this->FileUpload1->SetText($this->FormParameters["FileUpload1"][$RowNumber], $RowNumber);
$this->FileUpload2->SetText($this->FormParameters["FileUpload2"][$RowNumber], $RowNumber);
$this->idtelefona->SetText($this->FormParameters["idtelefona"][$RowNumber], $RowNumber);
$this->kategorija->SetText($this->FormParameters["kategorija"][$RowNumber], $RowNumber);
$this->CheckBox_Delete->SetText($this->FormParameters["CheckBox_Delete"][$RowNumber], $RowNumber);
if ($this->UpdatedRows >= $RowNumber) {
if($this->CheckBox_Delete->Value) {
if($this->DeleteAllowed) { $Validation = ($this->DeleteRow($RowNumber) && $Validation); }
} else if($this->UpdateAllowed) {
$Validation = ($this->UpdateRow($RowNumber) && $Validation);
}
}
else if($this->CheckInsert($RowNumber) && $this->InsertAllowed)
{
$Validation = ($this->InsertRow($RowNumber) && $Validation);
}
}
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterSubmit");
return ($this->Errors->Count() == 0 && $Validation);
}
//End UpdateGrid Method
//InsertRow Method @93-1DFB4E54
function InsertRow($RowNumber)
{
if(!$this->InsertAllowed) return false;
$this->ds->nazivslike->SetValue($this->nazivslike->GetValue());
$this->ds->FileUpload1->SetValue($this->FileUpload1->GetValue());
$this->ds->FileUpload2->SetValue($this->FileUpload2->GetValue());
$this->ds->idtelefona->SetValue($this->idtelefona->GetValue());
$this->ds->kategorija->SetValue($this->kategorija->GetValue());
$this->ds->Insert();
$errors = "";
if($this->ds->Errors->Count() > 0) {
$errors = $this->ds->Errors->ToString();
$this->RowsErrors[$RowNumber] = $errors;
$this->ds->Errors->Clear();
} else {
$this->FileUpload1->Move();
$errors .= $this->FileUpload1->Errors->ToString();
$this->FileUpload1->Errors->Clear();
$this->FileUpload2->Move();
$errors .= $this->FileUpload2->Errors->ToString();
$this->FileUpload2->Errors->Clear();
$this->RowsErrors[$RowNumber] = $errors;
}
return (($this->Errors->Count() == 0) && !strlen($errors));
}
//End InsertRow Method
//UpdateRow Method @93-E71D57C0
function UpdateRow($RowNumber)
{
if(!$this->UpdateAllowed) return false;
$this->ds->nazivslike->SetValue($this->nazivslike->GetValue());
$this->ds->FileUpload1->SetValue($this->FileUpload1->GetValue());
$this->ds->FileUpload2->SetValue($this->FileUpload2->GetValue());
$this->ds->idtelefona->SetValue($this->idtelefona->GetValue());
$this->ds->kategorija->SetValue($this->kategorija->GetValue());
$this->ds->Update();
$errors = "";
if($this->ds->Errors->Count() > 0) {
$errors = $this->ds->Errors->ToString();
$this->RowsErrors[$RowNumber] = $errors;
$this->ds->Errors->Clear();
} else {
$this->FileUpload1->Move();
$errors .= $this->FileUpload1->Errors->ToString();
$this->FileUpload1->Errors->Clear();
$this->FileUpload2->Move();
$errors .= $this->FileUpload2->Errors->ToString();
$this->FileUpload2->Errors->Clear();
$this->RowsErrors[$RowNumber] = $errors;
}
return (($this->Errors->Count() == 0) && !strlen($errors));
}
//End UpdateRow Method
//DeleteRow Method @93-5EA547BA
function DeleteRow($RowNumber)
{
if(!$this->DeleteAllowed) return false;
$this->ds->Delete();
$errors = "";
if($this->ds->Errors->Count() > 0) {
$errors = $this->ds->Errors->ToString();
$this->RowsErrors[$RowNumber] = $errors;
$this->ds->Errors->Clear();
} else {
$this->FileUpload1->Delete();
$errors .= $this->FileUpload1->Errors->ToString();
$this->FileUpload1->Errors->Clear();
$this->FileUpload2->Delete();
$errors .= $this->FileUpload2->Errors->ToString();
$this->FileUpload2->Errors->Clear();
$this->RowsErrors[$RowNumber] = $errors;
}
return (($this->Errors->Count() == 0) && !strlen($errors));
}
//End DeleteRow Method
//FormScript Method @93-59800DB5
function FormScript($TotalRows)
{
$script = "";
return $script;
}
//End FormScript Method
//SetFormState Method @93-9DC970BF
function SetFormState($FormState)
{
if(strlen($FormState)) {
$FormState = str_replace("\\\\", "\\" . ord("\\"), $FormState);
$FormState = str_replace("\\;", "\\" . ord(";"), $FormState);
$pieces = explode(";", $FormState);
$this->UpdatedRows = $pieces[0];
$this->EmptyRows = $pieces[1];
$this->TotalRows = $this->UpdatedRows + $this->EmptyRows;
$RowNumber = 0;
for($i = 2; $i < sizeof($pieces); $i = $i + 1) {
$piece = $pieces[$i + 0];
$piece = str_replace("\\" . ord("\\"), "\\", $piece);
$piece = str_replace("\\" . ord(";"), ";", $piece);
$this->CachedColumns["idmmsslike"][$RowNumber] = $piece;
$RowNumber++;
}
if(!$RowNumber) { $RowNumber = 1; }
for($i = 1; $i <= $this->EmptyRows; $i++) {
$this->CachedColumns["idmmsslike"][$RowNumber] = "";
$RowNumber++;
}
}
}
//End SetFormState Method
//GetFormState Method @93-72BE7B9E
function GetFormState($NonEmptyRows)
{
if(!$this->FormSubmitted) {
$this->FormState = $NonEmptyRows . ";";
$this->FormState .= $this->InsertAllowed ? $this->EmptyRows : "0";
if($NonEmptyRows) {
for($i = 0; $i <= $NonEmptyRows; $i++) {
$this->FormState .= ";" . str_replace(";", "\\;", str_replace("\\", "\\\\", $this->CachedColumns["idmmsslike"][$i]));
}
}
}
return $this->FormState;
}
//End GetFormState Method
//Show Method @93-73166D4E
function Show()
{
global $Tpl;
global $FileName;
$Error = "";
if(!$this->Visible) { return; }
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect");
$this->idtelefona->Prepare();
$this->kategorija->Prepare();
$this->ds->open();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
if(!$this->Visible) { return; }
$this->Button_Submit->Visible = $this->Button_Submit->Visible && ($this->InsertAllowed || $this->UpdateAllowed || $this->DeleteAllowed);
$ParentPath = $Tpl->block_path;
$EditableGridPath = $ParentPath . "/EditableGrid " . $this->ComponentName;
$EditableGridRowPath = $ParentPath . "/EditableGrid " . $this->ComponentName . "/Row";
$Tpl->block_path = $EditableGridRowPath;
$RowNumber = 0;
$NonEmptyRows = 0;
$EmptyRowsLeft = $this->EmptyRows;
$is_next_record = $this->ds->next_record() && $this->ReadAllowed && $RowNumber < $this->PageSize;
if($is_next_record || ($EmptyRowsLeft && $this->InsertAllowed))
{
do
{
$RowNumber++;
if($is_next_record) {
$NonEmptyRows++;
$this->ds->SetValues();
} else {
}
if(!$is_next_record || !$this->DeleteAllowed)
$this->CheckBox_Delete->Visible = false;
if(!$this->FormSubmitted && $is_next_record) {
$this->CachedColumns["idmmsslike"][$RowNumber] = $this->ds->CachedColumns["idmmsslike"];
$this->nazivslike->SetValue($this->ds->nazivslike->GetValue());
$this->FileUpload1->SetValue($this->ds->FileUpload1->GetValue());
$this->FileUpload2->SetValue($this->ds->FileUpload2->GetValue());
$this->idtelefona->SetValue($this->ds->idtelefona->GetValue());
$this->kategorija->SetValue($this->ds->kategorija->GetValue());
$this->ValidateRow($RowNumber);
} else if (!$this->FormSubmitted){
$this->CachedColumns["idmmsslike"][$RowNumber] = "";
$this->nazivslike->SetText("");
$this->FileUpload1->SetText("");
$this->FileUpload2->SetText("");
$this->idtelefona->SetText("");
$this->kategorija->SetText("");
$this->CheckBox_Delete->SetText("");
} else {
$this->nazivslike->SetText($this->FormParameters["nazivslike"][$RowNumber], $RowNumber);
$this->FileUpload1->SetText($this->FormParameters["FileUpload1"][$RowNumber], $RowNumber);
$this->FileUpload2->SetText($this->FormParameters["FileUpload2"][$RowNumber], $RowNumber);
$this->idtelefona->SetText($this->FormParameters["idtelefona"][$RowNumber], $RowNumber);
$this->kategorija->SetText($this->FormParameters["kategorija"][$RowNumber], $RowNumber);
$this->CheckBox_Delete->SetText($this->FormParameters["CheckBox_Delete"][$RowNumber], $RowNumber);
}
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->nazivslike->Show($RowNumber);
$this->FileUpload1->Show($RowNumber);
$this->FileUpload2->Show($RowNumber);
$this->idtelefona->Show($RowNumber);
$this->kategorija->Show($RowNumber);
$this->CheckBox_Delete->Show($RowNumber);
if(isset($this->RowsErrors[$RowNumber]) && $this->RowsErrors[$RowNumber] !== "") {
$Tpl->setvar("Error", $this->RowsErrors[$RowNumber]);
$Tpl->parse("RowError", false);
} else {
$Tpl->setblockvar("RowError", "");
}
$Tpl->setvar("FormScript", $this->FormScript($RowNumber));
$Tpl->parse();
if($is_next_record) $is_next_record = $this->ds->next_record() && $this->ReadAllowed && $RowNumber < $this->PageSize;
else $EmptyRowsLeft--;
} while($is_next_record || ($EmptyRowsLeft && $this->InsertAllowed));
} else {
$Tpl->block_path = $EditableGridPath;
$Tpl->parse("NoRecords", false);
}
$Tpl->block_path = $EditableGridPath;
$this->Navigator->PageNumber = $this->ds->AbsolutePage;
$this->Navigator->TotalPages = $this->ds->PageCount();
$this->Sorter_demo->Show();
$this->Sorter_idtelefona->Show();
$this->Sorter_kategorija->Show();
$this->Navigator->Show();
$this->Button_Submit->Show();
if($this->CheckErrors()) {
$Error .= $this->Errors->ToString();
$Error .= $this->ds->Errors->ToString();
$Tpl->SetVar("Error", $Error);
$Tpl->Parse("Error", false);
}
$CCSForm = $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);
$Tpl->SetVar("HTMLFormProperties", "method=\"POST\" action=\"" . $this->HTMLFormAction . "\" name=\"" . $this->ComponentName . "\"");
$Tpl->SetVar("FormState", htmlspecialchars($this->GetFormState($NonEmptyRows)));
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
} //End mmsslike Class @93-FCB6E20C
class clsmmsslikeDataSource extends clsDBConnection1 { //mmsslikeDataSource Class @93-9727365E
//DataSource Variables @93-8BE9F758
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $InsertParameters;
var $UpdateParameters;
var $DeleteParameters;
var $CountSQL;
var $wp;
var $AllParametersSet;
var $CachedColumns;
// Datasource fields
var $nazivslike;
var $FileUpload1;
var $FileUpload2;
var $idtelefona;
var $kategorija;
var $CheckBox_Delete;
//End DataSource Variables
//DataSourceClass_Initialize Event @93-EDD0E80D
function clsmmsslikeDataSource()
{
$this->ErrorBlock = "EditableGrid mmsslike/Error";
$this->Initialize();
$this->nazivslike = new clsField("nazivslike", ccsMemo, "");
$this->FileUpload1 = new clsField("FileUpload1", ccsText, "");
$this->FileUpload2 = new clsField("FileUpload2", ccsText, "");
$this->idtelefona = new clsField("idtelefona", ccsInteger, "");
$this->kategorija = new clsField("kategorija", ccsInteger, "");
$this->CheckBox_Delete = new clsField("CheckBox_Delete", ccsBoolean, Array("true", "false", ""));
}
//End DataSourceClass_Initialize Event
//SetOrder Method @93-79FBA244
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_demo" => array("demo", ""),
"Sorter_idtelefona" => array("idtelefona", ""),
"Sorter_kategorija" => array("kategorija", "")));
}
//End SetOrder Method
//Prepare Method @93-DFF3DD87
function Prepare()
{
}
//End Prepare Method
//Open Method @93-8084F940
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM mmsslike";
$this->SQL = "SELECT * " .
"FROM mmsslike";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect");
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect");
}
//End Open Method
//SetValues Method @93-5AF9364D
function SetValues()
{
$this->CachedColumns["idmmsslike"] = $this->f("idmmsslike");
$this->nazivslike->SetDBValue($this->f("nazivslike"));
$this->FileUpload1->SetDBValue($this->f("imefajla"));
$this->FileUpload2->SetDBValue($this->f("demo"));
$this->idtelefona->SetDBValue(trim($this->f("idtelefona")));
$this->kategorija->SetDBValue(trim($this->f("kategorija")));
}
//End SetValues Method
//Insert Method @93-5BFB1F50
function Insert()
{
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert");
$this->SQL = "INSERT INTO mmsslike ("
. "nazivslike, "
. "imefajla, "
. "demo, "
. "idtelefona, "
. "kategorija"
. ") VALUES ("
. $this->ToSQL($this->nazivslike->GetDBValue(), $this->nazivslike->DataType) . ", "
. $this->ToSQL($this->FileUpload1->GetDBValue(), $this->FileUpload1->DataType) . ", "
. $this->ToSQL($this->FileUpload2->GetDBValue(), $this->FileUpload2->DataType) . ", "
. $this->ToSQL($this->idtelefona->GetDBValue(), $this->idtelefona->DataType) . ", "
. $this->ToSQL($this->kategorija->GetDBValue(), $this->kategorija->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 @93-05C4673E
function Update()
{
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate");
$this->Where = "idmmsslike=" . $this->ToSQL($this->CachedColumns["idmmsslike"], ccsInteger);
$this->SQL = "UPDATE mmsslike SET "
. "nazivslike=" . $this->ToSQL($this->nazivslike->GetDBValue(), $this->nazivslike->DataType) . ", "
. "imefajla=" . $this->ToSQL($this->FileUpload1->GetDBValue(), $this->FileUpload1->DataType) . ", "
. "demo=" . $this->ToSQL($this->FileUpload2->GetDBValue(), $this->FileUpload2->DataType) . ", "
. "idtelefona=" . $this->ToSQL($this->idtelefona->GetDBValue(), $this->idtelefona->DataType) . ", "
. "kategorija=" . $this->ToSQL($this->kategorija->GetDBValue(), $this->kategorija->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 @93-CEB3438F
function Delete()
{
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete");
$this->Where = "idmmsslike=" . $this->ToSQL($this->CachedColumns["idmmsslike"], ccsInteger);
$this->SQL = "DELETE FROM mmsslike";
$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 mmsslikeDataSource Class @93-FCB6E20C
//Include Page implementation @34-58DBA1E3
include_once(RelativePath . "/Footer.php");
//End Include Page implementation
//Initialize Page @1-904A233D
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "informacij_list.php";
$Redirect = "";
$TemplateFileName = "informacij_list.html";
$BlockToParse = "main";
$TemplateEncoding = "";
$FileEncoding = "";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-DC94A87D
CCSecurityRedirect("1", "");
//End Authenticate User
//Initialize Objects @1-20461123
$DBConnection1 = new clsDBConnection1();
// Controls
$Header = new clsHeader("");
$Header->BindEvents();
$Header->Initialize();
$Header1 = new clsHeader1("");
$Header1->BindEvents();
$Header1->Initialize();
$mmsmelodije = new clsEditableGridmmsmelodije();
$mmsslike = new clsEditableGridmmsslike();
$Footer = new clsFooter("");
$Footer->BindEvents();
$Footer->Initialize();
$mmsmelodije->Initialize();
$mmsslike->Initialize();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize");
$Charset = $Charset ? $Charset : $TemplateEncoding;
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-57269C08
$Header->Operations();
$Header1->Operations();
$mmsmelodije->Operation();
$mmsslike->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-BFCE597C
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
$Header1->Class_Terminate();
unset($Header1);
unset($mmsmelodije);
unset($mmsslike);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-B75A76CF
$Header->Show("Header");
$Header1->Show("Header1");
$mmsmelodije->Show();
$mmsslike->Show();
$Footer->Show("Footer");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-94C42353
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
$Header1->Class_Terminate();
unset($Header1);
unset($mmsmelodije);
unset($mmsslike);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
//End Unload Page
?>
|