//Include Common Files @1-8AC8646C 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 @57-A35332B7 include_once(RelativePath . "/compraventa/editar/../../includes/cabecera.php"); //End Include Page implementation //Include Page implementation @81-8D440B2F include_once(RelativePath . "/compraventa/editar/../../includes/menuBarra.php"); //End Include Page implementation //Include Page implementation @92-CA859097 include_once(RelativePath . "/compraventa/editar/../../includes/navegador.php"); //End Include Page implementation //Include Page implementation @85-35BB6C18 include_once(RelativePath . "/compraventa/editar/../../includes/menuTematica.php"); //End Include Page implementation //Include Page implementation @93-C627AB4E include_once(RelativePath . "/compraventa/editar/../../includes/login.php"); //End Include Page implementation class clsRecordcompraventaSearch { //compraventaSearch Class @96-22F4A0CB //Variables @96-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 @96-CBABA27E function clsRecordcompraventaSearch() { global $FileName; $this->Visible = true; $this->Errors = new clsErrors(); $this->ErrorBlock = "Record compraventaSearch/Error"; $this->ReadAllowed = true; if($this->Visible) { $this->ComponentName = "compraventaSearch"; $CCSForm = split(":", CCGetFromGet("ccsForm", ""), 2); if(sizeof($CCSForm) == 1) $CCSForm[1] = ""; list($FormName, $FormMethod) = $CCSForm; $this->FormEnctype = "application/x-www-form-urlencoded"; $this->FormSubmitted = ($FormName == $this->ComponentName); $Method = $this->FormSubmitted ? ccsPost : ccsGet; $this->s_compra_venta = new clsControl(ccsListBox, "s_compra_venta", "s_compra_venta", ccsInteger, "", CCGetRequestParam("s_compra_venta", $Method)); $this->s_compra_venta->DSType = dsListOfValues; $this->s_compra_venta->Values = array(array("0", "Compras"), array("1", "Ventas"), array("", "Ver Todo"), array("2", "Otros")); $this->s_categoria = new clsControl(ccsListBox, "s_categoria", "s_categoria", ccsInteger, "", CCGetRequestParam("s_categoria", $Method)); $this->s_categoria->DSType = dsTable; list($this->s_categoria->BoundColumn, $this->s_categoria->TextColumn, $this->s_categoria->DBFormat) = array("id", "nombre", ""); $this->s_categoria->ds = new clsDBespadelada(); $this->s_categoria->ds->SQL = "SELECT nombre_c AS nombre " . "FROM compraventa_cat"; $this->s_categoria->ds->Order = "nombre_c"; $this->s_query = new clsControl(ccsTextBox, "s_query", "s_query", ccsText, "", CCGetRequestParam("s_query", $Method)); $this->Button_DoSearch = new clsButton("Button_DoSearch"); } } //End Class_Initialize Event //Validate Method @96-7708112B function Validate() { $Validation = true; $Where = ""; $Validation = ($this->s_compra_venta->Validate() && $Validation); $Validation = ($this->s_categoria->Validate() && $Validation); $Validation = ($this->s_query->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate"); $Validation = $Validation && ($this->s_compra_venta->Errors->Count() == 0); $Validation = $Validation && ($this->s_categoria->Errors->Count() == 0); $Validation = $Validation && ($this->s_query->Errors->Count() == 0); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method //CheckErrors Method @96-A878DE0B function CheckErrors() { $errors = false; $errors = ($errors || $this->s_compra_venta->Errors->Count()); $errors = ($errors || $this->s_categoria->Errors->Count()); $errors = ($errors || $this->s_query->Errors->Count()); $errors = ($errors || $this->Errors->Count()); return $errors; } //End CheckErrors Method //Operation Method @96-651A1B79 function Operation() { if(!$this->Visible) return; global $Redirect; global $FileName; if(!$this->FormSubmitted) { return; } if($this->FormSubmitted) { $this->PressedButton = "Button_DoSearch"; if(strlen(CCGetParam("Button_DoSearch", ""))) { $this->PressedButton = "Button_DoSearch"; } } $Redirect = "index.php"; if($this->Validate()) { if($this->PressedButton == "Button_DoSearch") { if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick")) { $Redirect = ""; } else { $Redirect = "index.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", Array("Button_DoSearch"))); } } } else { $Redirect = ""; } } //End Operation Method //Show Method @96-729D7FA1 function Show() { global $Tpl; global $FileName; $Error = ""; if(!$this->Visible) return; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect"); $this->s_compra_venta->Prepare(); $this->s_categoria->Prepare(); $RecordBlock = "Record " . $this->ComponentName; $ParentPath = $Tpl->block_path; $Tpl->block_path = $ParentPath . "/" . $RecordBlock; $this->EditMode = $this->EditMode && $this->ReadAllowed; if(!$this->FormSubmitted) { } if($this->FormSubmitted || $this->CheckErrors()) { $Error .= $this->s_compra_venta->Errors->ToString(); $Error .= $this->s_categoria->Errors->ToString(); $Error .= $this->s_query->Errors->ToString(); $Error .= $this->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->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if(!$this->Visible) { $Tpl->block_path = $ParentPath; return; } $this->s_compra_venta->Show(); $this->s_categoria->Show(); $this->s_query->Show(); $this->Button_DoSearch->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; } //End Show Method } //End compraventaSearch Class @96-FCB6E20C class clsEditableGridcompraventa { //compraventa Class @148-B301BC89 //Variables @148-5DA2F7CB // 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_titulo; var $Sorter_fecha_baja; var $Sorter_precio; var $Sorter_cantidad; var $Navigator; //End Variables //Class_Initialize Event @148-D8B426BF function clsEditableGridcompraventa() { global $FileName; $this->Visible = true; $this->Errors = new clsErrors(); $this->ErrorBlock = "EditableGrid compraventa/Error"; $this->ComponentName = "compraventa"; $this->CachedColumns["id"][0] = "id"; $this->ds = new clscompraventaDataSource(); $this->PageSize = 20; if($this->PageSize == 0) $this->Errors->addError("

Form: EditableGrid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.

"); $this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1)); $this->EmptyRows = 1; $this->DeleteAllowed = true; $this->ReadAllowed = true; if(!$this->Visible) return; $CCSForm = CCGetFromGet("ccsForm", ""); $this->FormEnctype = "application/x-www-form-urlencoded"; $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("compraventaOrder", ""); $this->SorterDirection = CCGetParam("compraventaDir", ""); $this->Sorter_titulo = new clsSorter($this->ComponentName, "Sorter_titulo", $FileName); $this->i_fechabaja = new clsControl(ccsLabel, "i_fechabaja", "i_fechabaja", ccsText, ""); $this->Sorter_fecha_baja = new clsSorter($this->ComponentName, "Sorter_fecha_baja", $FileName); $this->Sorter_precio = new clsSorter($this->ComponentName, "Sorter_precio", $FileName); $this->i_cantidad = new clsControl(ccsLabel, "i_cantidad", "i_cantidad", ccsText, ""); $this->Sorter_cantidad = new clsSorter($this->ComponentName, "Sorter_cantidad", $FileName); $this->titulo = new clsControl(ccsLabel, "titulo", "titulo", ccsText, ""); $this->fecha_baja = new clsControl(ccsLabel, "fecha_baja", "fecha_baja", ccsText, ""); $this->precio = new clsControl(ccsLabel, "precio", "precio", ccsText, ""); $this->cantidad = new clsControl(ccsLabel, "cantidad", "cantidad", ccsText, ""); $this->editar = new clsControl(ccsLink, "editar", "editar", ccsText, ""); $this->CheckBox_Delete = new clsControl(ccsCheckBox, "CheckBox_Delete", "CheckBox_Delete", ccsBoolean, Array(1, 0, "")); $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, tpMoving); $this->Button_Submit = new clsButton("Button_Submit"); } //End Class_Initialize Event //Initialize Method @148-5A8CDD11 function Initialize() { if(!$this->Visible) return; $this->ds->PageSize = $this->PageSize; $this->ds->AbsolutePage = $this->PageNumber; $this->ds->SetOrder($this->SorterName, $this->SorterDirection); $this->ds->Parameters["sesUserID"] = CCGetSession("UserID"); $this->ds->Parameters["urls_compra_venta"] = CCGetFromGet("s_compra_venta", ""); $this->ds->Parameters["urls_categoria"] = CCGetFromGet("s_categoria", ""); $this->ds->Parameters["urls_query"] = CCGetFromGet("s_query", ""); } //End Initialize Method //GetFormParameters Method @148-1F2665C5 function GetFormParameters() { for($RowNumber = 1; $RowNumber <= $this->TotalRows; $RowNumber++) { $this->FormParameters["CheckBox_Delete"][$RowNumber] = CCGetFromPost("CheckBox_Delete_" . $RowNumber); } } //End GetFormParameters Method //Validate Method @148-3E62EBB9 function Validate() { $Validation = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate"); for($RowNumber = 1; $RowNumber <= $this->TotalRows; $RowNumber++) { $this->ds->CachedColumns["id"] = $this->CachedColumns["id"][$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 @148-7A1F5D1F function ValidateRow($RowNumber) { $this->CheckBox_Delete->Validate(); $this->RowErrors = new clsErrors(); $errors = $this->CheckBox_Delete->Errors->ToString(); $this->CheckBox_Delete->Errors->Clear(); $errors .=$this->RowErrors->ToString(); $this->RowsErrors[$RowNumber] = $errors; return $errors ? 0 : 1; } //End ValidateRow Method //CheckInsert Method @148-A92F1C6B function CheckInsert($RowNumber) { $filed = false; return $filed; } //End CheckInsert Method //CheckErrors Method @148-242E5992 function CheckErrors() { $errors = false; $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->ds->Errors->Count()); return $errors; } //End CheckErrors Method //Operation Method @148-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 @148-3B985484 function UpdateGrid() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSubmit"); if(!$this->Validate()) return; $Validation = true; for($RowNumber = 1; $RowNumber <= $this->TotalRows; $RowNumber++) { $this->ds->CachedColumns["id"] = $this->CachedColumns["id"][$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 //DeleteRow Method @148-E90CB5E3 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(); } return (($this->Errors->Count() == 0) && !strlen($errors)); } //End DeleteRow Method //FormScript Method @148-D78573C2 function FormScript($TotalRows) { $script = ""; $script .= "\n"; return $script; } //End FormScript Method //SetFormState Method @148-0EEA5586 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["id"][$RowNumber] = $piece; $RowNumber++; } if(!$RowNumber) { $RowNumber = 1; } for($i = 1; $i <= $this->EmptyRows; $i++) { $this->CachedColumns["id"][$RowNumber] = ""; $RowNumber++; } } } //End SetFormState Method //GetFormState Method @148-692238C5 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["id"][$i])); } } } return $this->FormState; } //End GetFormState Method //Show Method @148-94DD68C9 function Show() { global $Tpl; global $FileName; $Error = ""; if(!$this->Visible) { return; } $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect"); $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(); $this->titulo->SetValue($this->ds->titulo->GetValue()); $this->fecha_baja->SetValue($this->ds->fecha_baja->GetValue()); $this->precio->SetValue($this->ds->precio->GetValue()); $this->cantidad->SetValue($this->ds->cantidad->GetValue()); } else { $this->titulo->SetText(""); $this->fecha_baja->SetText(""); $this->precio->SetText(""); $this->cantidad->SetText(""); } $this->editar->Parameters = CCGetQueryString("QueryString", Array("ccsForm")); $this->editar->Parameters = CCAddParam($this->editar->Parameters, "id", $this->ds->f("id")); $this->editar->Page = "editar.php"; if(!$is_next_record || !$this->DeleteAllowed) $this->CheckBox_Delete->Visible = false; if(!$this->FormSubmitted && $is_next_record) { $this->CachedColumns["id"][$RowNumber] = $this->ds->CachedColumns["id"]; $this->ValidateRow($RowNumber); } else if (!$this->FormSubmitted){ $this->CachedColumns["id"][$RowNumber] = ""; $this->CheckBox_Delete->SetText(""); } else { $this->CheckBox_Delete->SetText($this->FormParameters["CheckBox_Delete"][$RowNumber], $RowNumber); } $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->titulo->Show($RowNumber); $this->fecha_baja->Show($RowNumber); $this->precio->Show($RowNumber); $this->cantidad->Show($RowNumber); $this->editar->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_titulo->Show(); $this->i_fechabaja->Show(); $this->Sorter_fecha_baja->Show(); $this->Sorter_precio->Show(); $this->i_cantidad->Show(); $this->Sorter_cantidad->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 compraventa Class @148-FCB6E20C class clscompraventaDataSource extends clsDBespadelada { //compraventaDataSource Class @148-BEDA9A9D //DataSource Variables @148-78EE4D2A var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CmdExecution; var $DeleteParameters; var $CountSQL; var $wp; var $AllParametersSet; var $CachedColumns; // Datasource fields var $titulo; var $fecha_baja; var $precio; var $cantidad; var $editar; var $CheckBox_Delete; //End DataSource Variables //DataSourceClass_Initialize Event @148-09A244C5 function clscompraventaDataSource() { $this->ErrorBlock = "EditableGrid compraventa/Error"; $this->Initialize(); $this->titulo = new clsField("titulo", ccsText, ""); $this->fecha_baja = new clsField("fecha_baja", ccsText, ""); $this->precio = new clsField("precio", ccsText, ""); $this->cantidad = new clsField("cantidad", ccsText, ""); $this->editar = new clsField("editar", ccsText, ""); $this->CheckBox_Delete = new clsField("CheckBox_Delete", ccsBoolean, Array(1, 0, "")); } //End DataSourceClass_Initialize Event //SetOrder Method @148-0148DE7B function SetOrder($SorterName, $SorterDirection) { $this->Order = "fecha_baja"; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, array("Sorter_titulo" => array("titulo", ""), "Sorter_fecha_baja" => array("fecha_baja", ""), "Sorter_precio" => array("precio", ""), "Sorter_cantidad" => array("cantidad", ""))); } //End SetOrder Method //Prepare Method @148-8B5B58E4 function Prepare() { $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", true); $this->wp->AddParameter("2", "urls_compra_venta", ccsInteger, "", "", $this->Parameters["urls_compra_venta"], "", false); $this->wp->AddParameter("3", "urls_categoria", ccsInteger, "", "", $this->Parameters["urls_categoria"], "", false); $this->wp->AddParameter("4", "urls_query", ccsText, "", "", $this->Parameters["urls_query"], "", false); $this->wp->AddParameter("5", "urls_query", ccsMemo, "", "", $this->Parameters["urls_query"], "", false); $this->AllParametersSet = $this->wp->AllParamsSet(); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "uid", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),true); $this->wp->Criterion[2] = $this->wp->Operation(opEqual, "compra_venta", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsInteger),false); $this->wp->Criterion[3] = $this->wp->Operation(opEqual, "categoria", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsInteger),false); $this->wp->Criterion[4] = $this->wp->Operation(opContains, "titulo", $this->wp->GetDBValue("4"), $this->ToSQL($this->wp->GetDBValue("4"), ccsText),false); $this->wp->Criterion[5] = $this->wp->Operation(opContains, "descripcion", $this->wp->GetDBValue("5"), $this->ToSQL($this->wp->GetDBValue("5"), ccsMemo),false); $this->Where = $this->wp->opOR( false, $this->wp->opAND( false, $this->wp->opAND( false, $this->wp->opAND( false, $this->wp->Criterion[1], $this->wp->Criterion[2]), $this->wp->Criterion[3]), $this->wp->Criterion[4]), $this->wp->Criterion[5]); } //End Prepare Method //Open Method @148-AE1FFA97 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect"); $this->CountSQL = "SELECT COUNT(*) " . "FROM compraventa"; $this->SQL = "SELECT id, titulo, fecha_baja, precio, cantidad " . "FROM compraventa"; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect"); $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this); $this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order)); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect"); $this->MoveToPage($this->AbsolutePage); } //End Open Method //SetValues Method @148-8ADC527A function SetValues() { $this->CachedColumns["id"] = $this->f("id"); $this->titulo->SetDBValue($this->f("titulo")); $this->fecha_baja->SetDBValue($this->f("fecha_baja")); $this->precio->SetDBValue($this->f("precio")); $this->cantidad->SetDBValue($this->f("cantidad")); } //End SetValues Method //Delete Method @148-B008DAF1 function Delete() { $this->CmdExecution = true; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete"); $this->Where = "id=" . $this->ToSQL($this->CachedColumns["id"], ccsInteger); $this->SQL = "DELETE FROM compraventa"; $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 compraventaDataSource Class @148-FCB6E20C //Include Page implementation @56-B2342D53 include_once(RelativePath . "/compraventa/editar/../../includes/pie.php"); //End Include Page implementation //Initialize Page @1-AF7D84DD // Variables $FileName = ""; $Redirect = ""; $Tpl = ""; $TemplateFileName = ""; $BlockToParse = ""; $ComponentName = ""; // Events; $CCSEvents = ""; $CCSEventResult = ""; $FileName = "index.php"; $Redirect = ""; $TemplateFileName = "index.html"; $BlockToParse = "main"; $TemplateEncoding = ""; $FileEncoding = ""; $PathToRoot = "../../"; //End Initialize Page //Authenticate User @1-5420BF0F CCSecurityRedirect("1", "../../login.php"); //End Authenticate User //Initialize Objects @1-2836C1A6 $DBespadelada = new clsDBespadelada(); // Controls $cabecera = new clscabecera("../../includes/"); $cabecera->BindEvents(); $cabecera->Initialize(); $menuBarra = new clsmenuBarra("../../includes/"); $menuBarra->BindEvents(); $menuBarra->Initialize(); $navegador = new clsnavegador("../../includes/"); $navegador->BindEvents(); $navegador->Initialize(); $menuTematica = new clsmenuTematica("../../includes/"); $menuTematica->BindEvents(); $menuTematica->Initialize(); $login = new clslogin("../../includes/"); $login->BindEvents(); $login->Initialize(); $usuario = new clsControl(ccsLabel, "usuario", "usuario", ccsText, "", CCGetRequestParam("usuario", ccsGet)); $compraventaSearch = new clsRecordcompraventaSearch(); $compraventa = new clsEditableGridcompraventa(); $pie = new clspie("../../includes/"); $pie->BindEvents(); $pie->Initialize(); $compraventa->Initialize(); // Events include("./index_events.php"); BindEvents(); $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-7DD1FAC6 $cabecera->Operations(); $menuBarra->Operations(); $navegador->Operations(); $menuTematica->Operations(); $login->Operations(); $compraventaSearch->Operation(); $compraventa->Operation(); $pie->Operations(); //End Execute Components //Go to destination page @1-2BFFC09C if($Redirect) { $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload"); $DBespadelada->close(); header("Location: " . $Redirect); $cabecera->Class_Terminate(); unset($cabecera); $menuBarra->Class_Terminate(); unset($menuBarra); $navegador->Class_Terminate(); unset($navegador); $menuTematica->Class_Terminate(); unset($menuTematica); $login->Class_Terminate(); unset($login); unset($compraventaSearch); unset($compraventa); $pie->Class_Terminate(); unset($pie); unset($Tpl); exit; } //End Go to destination page //Show Page @1-49015363 $cabecera->Show("cabecera"); $menuBarra->Show("menuBarra"); $navegador->Show("navegador"); $menuTematica->Show("menuTematica"); $login->Show("login"); $compraventaSearch->Show(); $compraventa->Show(); $pie->Show("pie"); $usuario->Show(); $Tpl->PParse("main", false); //End Show Page //Unload Page @1-DC0174D2 $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload"); $DBespadelada->close(); $cabecera->Class_Terminate(); unset($cabecera); $menuBarra->Class_Terminate(); unset($menuBarra); $navegador->Class_Terminate(); unset($navegador); $menuTematica->Class_Terminate(); unset($menuTematica); $login->Class_Terminate(); unset($login); unset($compraventaSearch); unset($compraventa); $pie->Class_Terminate(); unset($pie); unset($Tpl); //End Unload Page ?>