ComponentName = "departments"; $this->Visible = True; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid departments"; $this->ds = new clsdepartmentsDataSource(); $this->PageSize = CCGetParam($this->ComponentName . "PageSize", ""); if(!is_numeric($this->PageSize) || !strlen($this->PageSize)) $this->PageSize = 10; else if ($this->PageSize > 100) $this->PageSize = 100; else $this->PageSize = intval($this->PageSize); if($this->PageSize == 0) $this->Errors->addError("

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

"); $this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1)); $this->department_name = new clsControl(ccsLink, "department_name", "department_name", ccsText, "", CCGetRequestParam("department_name", ccsGet)); $this->department_name->Parameters = CCGetQueryString("QueryString", Array("ccsForm")); $this->department_name->Parameters = CCAddParam($this->department_name->Parameters, "id", CCGetFromGet("id", "")); $this->department_name->Page = "index.htm"; $this->department_descripcion = new clsControl(ccsLabel, "department_descripcion", "department_descripcion", ccsMemo, "", CCGetRequestParam("department_descripcion", ccsGet)); $this->department_descripcion->HTML = true; $this->activo = new clsControl(ccsLabel, "activo", "activo", ccsText, "", CCGetRequestParam("activo", ccsGet)); } //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 //Show Method @78-643F647B function Show() { global $Tpl; if(!$this->Visible) return; $ShownRecords = 0; $this->ds->Parameters["urlid"] = CCGetFromGet("id", ""); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect"); $this->ds->Prepare(); $this->ds->Open(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if(!$this->Visible) return; $GridBlock = "Grid " . $this->ComponentName; $ParentPath = $Tpl->block_path; $Tpl->block_path = $ParentPath . "/" . $GridBlock; $is_next_record = $this->ds->next_record(); if($is_next_record && $ShownRecords < $this->PageSize) { do { $this->ds->SetValues(); $Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row"; $this->department_name->SetValue($this->ds->department_name->GetValue()); $this->department_descripcion->SetValue($this->ds->department_descripcion->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->department_name->Show(); $this->department_descripcion->Show(); $Tpl->block_path = $ParentPath . "/" . $GridBlock; $Tpl->parse("Row", true); $ShownRecords++; $is_next_record = $this->ds->next_record(); } while ($is_next_record && $ShownRecords < $this->PageSize); } else // Show NoRecords block if no records are found { $Tpl->parse("NoRecords", false); } $errors = $this->GetErrors(); if(strlen($errors)) { $Tpl->replaceblock("", $errors); $Tpl->block_path = $ParentPath; return; } $this->activo->SetValue($this->ds->activo->GetValue()); $this->activo->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->ds->close(); } //End Show Method //GetErrors Method @78-620E630F function GetErrors() { $errors = ""; $errors .= $this->department_name->Errors->ToString(); $errors .= $this->department_descripcion->Errors->ToString(); $errors .= $this->Errors->ToString(); $errors .= $this->ds->Errors->ToString(); return $errors; } //End GetErrors Method } //End departments Class @78-FCB6E20C class clsdepartmentsDataSource extends clsDBIntranet { //departmentsDataSource Class @78-2BF64B92 //DataSource Variables @78-3B0A1F2B var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CountSQL; var $wp; // Datasource fields var $department_name; var $department_descripcion; var $activo; //End DataSource Variables //Class_Initialize Event @78-CE54EF1C function clsdepartmentsDataSource() { $this->ErrorBlock = "Grid departments"; $this->Initialize(); $this->department_name = new clsField("department_name", ccsText, ""); $this->department_descripcion = new clsField("department_descripcion", ccsMemo, ""); $this->activo = new clsField("activo", ccsText, ""); } //End Class_Initialize Event //SetOrder Method @78-9E1383D1 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, ""); } //End SetOrder Method //Prepare Method @78-5380D785 function Prepare() { $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlid", ccsInteger, "", "", $this->Parameters["urlid"], 0, false); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "department_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->wp->Criterion[2] = "department_manager_id = '1'"; $this->Where = $this->wp->opAND(false, $this->wp->Criterion[1], $this->wp->Criterion[2]); } //End Prepare Method //Open Method @78-05059776 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect"); $this->CountSQL = "SELECT COUNT(*) " . "FROM departments"; $this->SQL = "SELECT * " . "FROM departments"; $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 @78-C44F1EDF function SetValues() { $this->department_name->SetDBValue($this->f("department_name")); $this->department_descripcion->SetDBValue($this->f("department_descripcion")); $this->activo->SetDBValue($this->f("department_manager_id")); } //End SetValues Method } //End departmentsDataSource Class @78-FCB6E20C class clsRecordemps { //emps Class @5-570CC05B //Variables @5-4A82E0A3 // 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; var $UpdateAllowed; var $DeleteAllowed; var $ds; var $EditMode; var $ValidatingControls; var $Controls; // Class variables //End Variables //Class_Initialize Event @5-B981FF08 function clsRecordemps() { global $FileName; $this->Visible = true; $this->Errors = new clsErrors(); $this->ErrorBlock = "Record emps/Error"; $this->ds = new clsempsDataSource(); $this->InsertAllowed = true; $this->UpdateAllowed = true; $this->DeleteAllowed = true; if($this->Visible) { $this->ComponentName = "emps"; $CCSForm = split(":", CCGetFromGet("ccsForm", ""), 2); if(sizeof($CCSForm) == 1) $CCSForm[1] = ""; list($FormName, $FormMethod) = $CCSForm; $this->EditMode = ($FormMethod == "Edit"); $this->FormEnctype = "application/x-www-form-urlencoded"; $this->FormSubmitted = ($FormName == $this->ComponentName); $Method = $this->FormSubmitted ? ccsPost : ccsGet; $this->Nombre = new clsControl(ccsTextBox, "Nombre", "Nombre y Apellidos", ccsText, "", CCGetRequestParam("Nombre", $Method)); $this->Nombre->Required = true; $this->phone_home = new clsControl(ccsTextBox, "phone_home", "Frecuencia 1", ccsText, "", CCGetRequestParam("phone_home", $Method)); $this->phone_home->Required = true; $this->work_phone = new clsControl(ccsTextBox, "work_phone", "Work Phone", ccsText, "", CCGetRequestParam("work_phone", $Method)); $this->cell_phone = new clsControl(ccsTextBox, "cell_phone", "Cell Phone", ccsText, "", CCGetRequestParam("cell_phone", $Method)); $this->ciudad = new clsControl(ccsTextBox, "ciudad", "ciudad", ccsText, "", CCGetRequestParam("ciudad", $Method)); $this->title = new clsControl(ccsTextBox, "title", "Title", ccsText, "", CCGetRequestParam("title", $Method)); $this->patrocinador = new clsControl(ccsTextBox, "patrocinador", "patrocinador", ccsText, "", CCGetRequestParam("patrocinador", $Method)); $this->email = new clsControl(ccsTextBox, "email", "E-mail", ccsText, "", CCGetRequestParam("email", $Method)); $this->Transponder = new clsControl(ccsTextBox, "Transponder", "Transponder", ccsText, "", CCGetRequestParam("Transponder", $Method)); $this->Licencia = new clsControl(ccsTextBox, "Licencia", "Licencia", ccsText, "", CCGetRequestParam("Licencia", $Method)); $this->address = new clsControl(ccsTextBox, "address", "Address", ccsText, "", CCGetRequestParam("address", $Method)); $this->notas = new clsControl(ccsTextArea, "notas", "notas", ccsText, "", CCGetRequestParam("notas", $Method)); $this->emps_Insert = new clsButton("emps_Insert"); $this->emps_Cancel = new clsButton("emps_Cancel"); } } //End Class_Initialize Event //Initialize Method @5-42165130 function Initialize() { if(!$this->Visible) return; $this->ds->Parameters["urlemp_id"] = CCGetFromGet("emp_id", ""); } //End Initialize Method //Validate Method @5-FABD68D3 function Validate() { $Validation = true; $Where = ""; $Validation = ($this->Nombre->Validate() && $Validation); $Validation = ($this->phone_home->Validate() && $Validation); $Validation = ($this->work_phone->Validate() && $Validation); $Validation = ($this->cell_phone->Validate() && $Validation); $Validation = ($this->ciudad->Validate() && $Validation); $Validation = ($this->title->Validate() && $Validation); $Validation = ($this->patrocinador->Validate() && $Validation); $Validation = ($this->email->Validate() && $Validation); $Validation = ($this->Transponder->Validate() && $Validation); $Validation = ($this->Licencia->Validate() && $Validation); $Validation = ($this->address->Validate() && $Validation); $Validation = ($this->notas->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate"); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method //CheckErrors Method @5-28CBE164 function CheckErrors() { $errors = false; $errors = ($errors || $this->Nombre->Errors->Count()); $errors = ($errors || $this->phone_home->Errors->Count()); $errors = ($errors || $this->work_phone->Errors->Count()); $errors = ($errors || $this->cell_phone->Errors->Count()); $errors = ($errors || $this->ciudad->Errors->Count()); $errors = ($errors || $this->title->Errors->Count()); $errors = ($errors || $this->patrocinador->Errors->Count()); $errors = ($errors || $this->email->Errors->Count()); $errors = ($errors || $this->Transponder->Errors->Count()); $errors = ($errors || $this->Licencia->Errors->Count()); $errors = ($errors || $this->address->Errors->Count()); $errors = ($errors || $this->notas->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->ds->Errors->Count()); return $errors; } //End CheckErrors Method //Operation Method @5-37C47E0F function Operation() { if(!$this->Visible) return; global $Redirect; global $FileName; $this->ds->Prepare(); $this->EditMode = $this->ds->AllParametersSet; if(!$this->FormSubmitted) return; if($this->FormSubmitted) { $this->PressedButton = $this->EditMode ? "emps_Cancel" : "emps_Insert"; if(strlen(CCGetParam("emps_Insert", ""))) { $this->PressedButton = "emps_Insert"; } else if(strlen(CCGetParam("emps_Cancel", ""))) { $this->PressedButton = "emps_Cancel"; } } $Redirect = "pilotoslista.htm" . "?" . CCGetQueryString("QueryString", Array("ccsForm")); if($this->PressedButton == "emps_Cancel") { if(!CCGetEvent($this->emps_Cancel->CCSEvents, "OnClick")) { $Redirect = ""; } else { $Redirect = "index.htm" . "?" . CCGetQueryString("QueryString", Array("ccsForm")); } } else if($this->Validate()) { if($this->PressedButton == "emps_Insert") { if(!CCGetEvent($this->emps_Insert->CCSEvents, "OnClick") || !$this->InsertRow()) { $Redirect = ""; } else { $Redirect = "index.htm". "?" . CCGetQueryString("QueryString", Array("ccsForm")); } } } else { $Redirect = ""; } } //End Operation Method //InsertRow Method @5-4629E288 function InsertRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert"); if(!$this->InsertAllowed) return false; $this->ds->Nombre->SetValue($this->Nombre->GetValue()); $this->ds->phone_home->SetValue($this->phone_home->GetValue()); $this->ds->work_phone->SetValue($this->work_phone->GetValue()); $this->ds->cell_phone->SetValue($this->cell_phone->GetValue()); $this->ds->ciudad->SetValue($this->ciudad->GetValue()); $this->ds->title->SetValue($this->title->GetValue()); $this->ds->patrocinador->SetValue($this->patrocinador->GetValue()); $this->ds->email->SetValue($this->email->GetValue()); $this->ds->Transponder->SetValue($this->Transponder->GetValue()); $this->ds->Licencia->SetValue($this->Licencia->GetValue()); $this->ds->address->SetValue($this->address->GetValue()); $this->ds->notas->SetValue($this->notas->GetValue()); $this->ds->Insert(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert"); if($this->ds->Errors->Count() > 0) { echo "Error in Record " . $this->ComponentName . " / Insert Operation"; $this->ds->Errors->Clear(); $this->Errors->AddError("Database command error."); } return (!$this->CheckErrors()); } //End InsertRow Method //UpdateRow Method @5-ACD514FC function UpdateRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate"); if(!$this->UpdateAllowed) return false; $this->ds->Nombre->SetValue($this->Nombre->GetValue()); $this->ds->phone_home->SetValue($this->phone_home->GetValue()); $this->ds->work_phone->SetValue($this->work_phone->GetValue()); $this->ds->cell_phone->SetValue($this->cell_phone->GetValue()); $this->ds->ciudad->SetValue($this->ciudad->GetValue()); $this->ds->title->SetValue($this->title->GetValue()); $this->ds->patrocinador->SetValue($this->patrocinador->GetValue()); $this->ds->email->SetValue($this->email->GetValue()); $this->ds->Transponder->SetValue($this->Transponder->GetValue()); $this->ds->Licencia->SetValue($this->Licencia->GetValue()); $this->ds->address->SetValue($this->address->GetValue()); $this->ds->notas->SetValue($this->notas->GetValue()); $this->ds->Update(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate"); if($this->ds->Errors->Count() > 0) { echo "Error in Record " . $this->ComponentName . " / Update Operation"; $this->ds->Errors->Clear(); $this->Errors->AddError("Database command error."); } return (!$this->CheckErrors()); } //End UpdateRow Method //DeleteRow Method @5-EA88835F 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) { echo "Error in Record " . ComponentName . " / Delete Operation"; $this->ds->Errors->Clear(); $this->Errors->AddError("Database command error."); } return (!$this->CheckErrors()); } //End DeleteRow Method //Show Method @5-03806C68 function Show() { global $Tpl; global $FileName; $Error = ""; if(!$this->Visible) return; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect"); $this->ds->open(); $RecordBlock = "Record " . $this->ComponentName; $ParentPath = $Tpl->block_path; $Tpl->block_path = $ParentPath . "/" . $RecordBlock; if($this->EditMode) { if($this->Errors->Count() == 0) { if($this->ds->Errors->Count() > 0) { echo "Error in Record emps"; } else if($this->ds->next_record()) { $this->ds->SetValues(); if(!$this->FormSubmitted) { $this->Nombre->SetValue($this->ds->Nombre->GetValue()); $this->phone_home->SetValue($this->ds->phone_home->GetValue()); $this->work_phone->SetValue($this->ds->work_phone->GetValue()); $this->cell_phone->SetValue($this->ds->cell_phone->GetValue()); $this->ciudad->SetValue($this->ds->ciudad->GetValue()); $this->title->SetValue($this->ds->title->GetValue()); $this->patrocinador->SetValue($this->ds->patrocinador->GetValue()); $this->email->SetValue($this->ds->email->GetValue()); $this->Transponder->SetValue($this->ds->Transponder->GetValue()); $this->Licencia->SetValue($this->ds->Licencia->GetValue()); $this->address->SetValue($this->ds->address->GetValue()); $this->notas->SetValue($this->ds->notas->GetValue()); } } else { $this->EditMode = false; } } } if(!$this->FormSubmitted) { } if($this->FormSubmitted || $this->CheckErrors()) { $Error .= $this->Nombre->Errors->ToString(); $Error .= $this->phone_home->Errors->ToString(); $Error .= $this->work_phone->Errors->ToString(); $Error .= $this->cell_phone->Errors->ToString(); $Error .= $this->ciudad->Errors->ToString(); $Error .= $this->title->Errors->ToString(); $Error .= $this->patrocinador->Errors->ToString(); $Error .= $this->email->Errors->ToString(); $Error .= $this->Transponder->Errors->ToString(); $Error .= $this->Licencia->Errors->ToString(); $Error .= $this->address->Errors->ToString(); $Error .= $this->notas->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->emps_Insert->Visible = !$this->EditMode && $this->InsertAllowed; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if(!$this->Visible) { $Tpl->block_path = $ParentPath; return; } $this->Nombre->Show(); $this->phone_home->Show(); $this->work_phone->Show(); $this->cell_phone->Show(); $this->ciudad->Show(); $this->title->Show(); $this->patrocinador->Show(); $this->email->Show(); $this->Transponder->Show(); $this->Licencia->Show(); $this->address->Show(); $this->notas->Show(); $this->emps_Insert->Show(); $this->emps_Cancel->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->ds->close(); } //End Show Method } //End emps Class @5-FCB6E20C class clsempsDataSource extends clsDBIntranet { //empsDataSource Class @5-623D3E2C //DataSource Variables @5-B26B5ED9 var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $InsertParameters; var $UpdateParameters; var $DeleteParameters; var $wp; var $AllParametersSet; // Datasource fields var $Nombre; var $phone_home; var $work_phone; var $cell_phone; var $ciudad; var $title; var $patrocinador; var $email; var $Transponder; var $Licencia; var $address; var $notas; //End DataSource Variables //Class_Initialize Event @5-A8662733 function clsempsDataSource() { $this->ErrorBlock = "Record emps/Error"; $this->Initialize(); $this->Nombre = new clsField("Nombre", ccsText, ""); $this->phone_home = new clsField("phone_home", ccsText, ""); $this->work_phone = new clsField("work_phone", ccsText, ""); $this->cell_phone = new clsField("cell_phone", ccsText, ""); $this->ciudad = new clsField("ciudad", ccsText, ""); $this->title = new clsField("title", ccsText, ""); $this->patrocinador = new clsField("patrocinador", ccsText, ""); $this->email = new clsField("email", ccsText, ""); $this->Transponder = new clsField("Transponder", ccsText, ""); $this->Licencia = new clsField("Licencia", ccsText, ""); $this->address = new clsField("address", ccsText, ""); $this->notas = new clsField("notas", ccsText, ""); } //End Class_Initialize Event //Prepare Method @5-B9EF2B06 function Prepare() { $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlemp_id", ccsInteger, "", "", $this->Parameters["urlemp_id"], "", false); $this->AllParametersSet = $this->wp->AllParamsSet(); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "emp_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method //Open Method @5-54622AA6 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect"); $this->SQL = "SELECT * " . "FROM employees"; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect"); $this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order)); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect"); $this->MoveToPage($this->AbsolutePage); } //End Open Method //SetValues Method @5-082A948C function SetValues() { $this->Nombre->SetDBValue($this->f("emp_name")); $this->phone_home->SetDBValue($this->f("phone_home")); $this->work_phone->SetDBValue($this->f("phone_work")); $this->cell_phone->SetDBValue($this->f("phone_cell")); $this->ciudad->SetDBValue($this->f("city")); $this->title->SetDBValue($this->f("title")); $this->patrocinador->SetDBValue($this->f("picture")); $this->email->SetDBValue($this->f("email")); $this->Transponder->SetDBValue($this->f("fax")); $this->Licencia->SetDBValue($this->f("zip")); $this->address->SetDBValue($this->f("address")); $this->notas->SetDBValue($this->f("notas")); } //End SetValues Method //Insert Method @5-19F21EA0 function Insert() { $this->cp["emp_name"] = new clsSQLParameter("ctrlNombre", ccsText, "", "", $this->Nombre->GetValue(), "", false, $this->ErrorBlock); $this->cp["phone_home"] = new clsSQLParameter("ctrlphone_home", ccsText, "", "", $this->phone_home->GetValue(), "", false, $this->ErrorBlock); $this->cp["phone_work"] = new clsSQLParameter("ctrlwork_phone", ccsText, "", "", $this->work_phone->GetValue(), "", false, $this->ErrorBlock); $this->cp["phone_cell"] = new clsSQLParameter("ctrlcell_phone", ccsText, "", "", $this->cell_phone->GetValue(), "", false, $this->ErrorBlock); $this->cp["city"] = new clsSQLParameter("ctrlciudad", ccsText, "", "", $this->ciudad->GetValue(), "", false, $this->ErrorBlock); $this->cp["title"] = new clsSQLParameter("ctrltitle", ccsText, "", "", $this->title->GetValue(), "", false, $this->ErrorBlock); $this->cp["picture"] = new clsSQLParameter("ctrlpatrocinador", ccsText, "", "", $this->patrocinador->GetValue(), "", false, $this->ErrorBlock); $this->cp["email"] = new clsSQLParameter("ctrlemail", ccsText, "", "", $this->email->GetValue(), "", false, $this->ErrorBlock); $this->cp["fax"] = new clsSQLParameter("ctrlTransponder", ccsText, "", "", $this->Transponder->GetValue(), "", false, $this->ErrorBlock); $this->cp["zip"] = new clsSQLParameter("ctrlLicencia", ccsText, "", "", $this->Licencia->GetValue(), "", false, $this->ErrorBlock); $this->cp["address"] = new clsSQLParameter("ctrladdress", ccsText, "", "", $this->address->GetValue(), "", false, $this->ErrorBlock); $this->cp["notas"] = new clsSQLParameter("ctrlnotas", ccsText, "", "", $this->notas->GetValue(), "", false, $this->ErrorBlock); $this->cp["department_id"] = new clsSQLParameter("urlid", ccsInteger, "", "", CCGetFromGet("id", ""), 0, false, $this->ErrorBlock); $this->cp["group_id"] = new clsSQLParameter("expr77", ccsInteger, "", "", 1, 1, false, $this->ErrorBlock); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert"); $this->SQL = "INSERT INTO employees (" . "emp_name, " . "phone_home, " . "phone_work, " . "phone_cell, " . "city, " . "title, " . "picture, " . "email, " . "fax, " . "zip, " . "address, " . "notas, " . "department_id, " . "group_id" . ") VALUES (" . $this->ToSQL($this->cp["emp_name"]->GetDBValue(), $this->cp["emp_name"]->DataType) . ", " . $this->ToSQL($this->cp["phone_home"]->GetDBValue(), $this->cp["phone_home"]->DataType) . ", " . $this->ToSQL($this->cp["phone_work"]->GetDBValue(), $this->cp["phone_work"]->DataType) . ", " . $this->ToSQL($this->cp["phone_cell"]->GetDBValue(), $this->cp["phone_cell"]->DataType) . ", " . $this->ToSQL($this->cp["city"]->GetDBValue(), $this->cp["city"]->DataType) . ", " . $this->ToSQL($this->cp["title"]->GetDBValue(), $this->cp["title"]->DataType) . ", " . $this->ToSQL($this->cp["picture"]->GetDBValue(), $this->cp["picture"]->DataType) . ", " . $this->ToSQL($this->cp["email"]->GetDBValue(), $this->cp["email"]->DataType) . ", " . $this->ToSQL($this->cp["fax"]->GetDBValue(), $this->cp["fax"]->DataType) . ", " . $this->ToSQL($this->cp["zip"]->GetDBValue(), $this->cp["zip"]->DataType) . ", " . $this->ToSQL($this->cp["address"]->GetDBValue(), $this->cp["address"]->DataType) . ", " . $this->ToSQL($this->cp["notas"]->GetDBValue(), $this->cp["notas"]->DataType) . ", " . $this->ToSQL($this->cp["department_id"]->GetDBValue(), $this->cp["department_id"]->DataType) . ", " . $this->ToSQL($this->cp["group_id"]->GetDBValue(), $this->cp["group_id"]->DataType) . ")"; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteInsert"); $this->query($this->SQL); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteInsert"); if($this->Errors->Count() > 0) $this->Errors->AddError($this->Errors->ToString()); $this->close(); } //End Insert Method //Update Method @5-C95EBB69 function Update() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate"); $this->SQL = "UPDATE employees SET " . "emp_name=" . $this->ToSQL($this->Nombre->GetDBValue(), $this->Nombre->DataType) . ", " . "phone_home=" . $this->ToSQL($this->phone_home->GetDBValue(), $this->phone_home->DataType) . ", " . "phone_work=" . $this->ToSQL($this->work_phone->GetDBValue(), $this->work_phone->DataType) . ", " . "phone_cell=" . $this->ToSQL($this->cell_phone->GetDBValue(), $this->cell_phone->DataType) . ", " . "city=" . $this->ToSQL($this->ciudad->GetDBValue(), $this->ciudad->DataType) . ", " . "title=" . $this->ToSQL($this->title->GetDBValue(), $this->title->DataType) . ", " . "picture=" . $this->ToSQL($this->patrocinador->GetDBValue(), $this->patrocinador->DataType) . ", " . "email=" . $this->ToSQL($this->email->GetDBValue(), $this->email->DataType) . ", " . "fax=" . $this->ToSQL($this->Transponder->GetDBValue(), $this->Transponder->DataType) . ", " . "zip=" . $this->ToSQL($this->Licencia->GetDBValue(), $this->Licencia->DataType) . ", " . "address=" . $this->ToSQL($this->address->GetDBValue(), $this->address->DataType) . ", " . "notas=" . $this->ToSQL($this->notas->GetDBValue(), $this->notas->DataType); $this->SQL = CCBuildSQL($this->SQL, $this->Where, ""); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate"); $this->query($this->SQL); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteUpdate"); if($this->Errors->Count() > 0) $this->Errors->AddError($this->Errors->ToString()); $this->close(); } //End Update Method //Delete Method @5-B7CB6A30 function Delete() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete"); $this->SQL = "DELETE FROM employees"; $this->SQL = CCBuildSQL($this->SQL, $this->Where, ""); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteDelete"); $this->query($this->SQL); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteDelete"); if($this->Errors->Count() > 0) $this->Errors->AddError($this->Errors->ToString()); $this->close(); } //End Delete Method } //End empsDataSource Class @5-FCB6E20C //Initialize Page @1-C75D463F // Variables $FileName = ""; $Redirect = ""; $Tpl = ""; $TemplateFileName = ""; $BlockToParse = ""; $ComponentName = ""; // Events; $CCSEvents = ""; $CCSEventResult = ""; $FileName = "inscripcion.htm"; $Redirect = ""; $TemplateFileName = "inscripcion.html"; $BlockToParse = "main"; $PathToRoot = "./"; //End Initialize Page //Initialize Objects @1-B2778791 $DBIntranet = new clsDBIntranet(); // Controls $departments = new clsGriddepartments(); $emps = new clsRecordemps(); $back = new clsControl(ccsLink, "back", "back", ccsText, "", CCGetRequestParam("back", ccsGet)); $back->Parameters = CCGetQueryString("QueryString", Array("emp_id", "ccsForm")); $back->Parameters = CCAddParam($back->Parameters, "id", CCGetFromGet("id", "")); $back->Page = "index.htm"; $departments->Initialize(); $emps->Initialize(); // Events include("./inscripcion_events.htm"); BindEvents(); $CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize"); if($Charset) { header("Content-Type: text/html; charset=" . $Charset); } //End Initialize Objects //Initialize HTML Template @1-A0111C9D $CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView"); $Tpl = new clsTemplate(); $Tpl->LoadTemplate(TemplatePath . $TemplateFileName, "main"); $CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow"); //End Initialize HTML Template //Execute Components @1-45935043 $emps->Operation(); //End Execute Components //Go to destination page @1-22C088D1 if($Redirect) { $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload"); $DBIntranet->close(); header("Location: " . $Redirect); exit; } //End Go to destination page //Show Page @1-CC1C05B6 $departments->Show(); $emps->Show(); $back->Show(); $Tpl->Parse("main", false); $main_block = $Tpl->GetVar("main"); $generated_with = "
Copyright www.minizz.com
"; if(preg_match("/<\/body>/i", $main_block)) { $main_block = preg_replace("/<\/body>/i", $generated_with . "", $main_block); } else if(preg_match("/<\/html>/i", $main_block) && !preg_match("/<\/frameset>/i", $main_block)) { $main_block = preg_replace("/<\/html>/i", $generated_with . "", $main_block); } else if(!preg_match("/<\/frameset>/i", $main_block)) { $main_block .= $generated_with; } echo $main_block; //End Show Page //Unload Page @1-0E2619CD $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload"); $DBIntranet->close(); unset($Tpl); //End Unload Page ?>