Visible = true; $this->Errors = new clsErrors(); $this->ErrorBlock = "Record users/Error"; $this->ds = new clsusersDataSource(); $this->InsertAllowed = true; if($this->Visible) { $this->ComponentName = "users"; $CCSForm = split(":", CCGetFromGet("ccsForm", ""), 2); if(sizeof($CCSForm) == 1) $CCSForm[1] = ""; list($FormName, $FormMethod) = $CCSForm; $this->EditMode = ($FormMethod == "Edit"); $this->FormEnctype = "application/x-www-form-urlencoded"; $this->FormSubmitted = ($FormName == $this->ComponentName); $Method = $this->FormSubmitted ? ccsPost : ccsGet; $this->user_login = new clsControl(ccsTextBox, "user_login", "Login", ccsText, "", CCGetRequestParam("user_login", $Method)); $this->user_login->Required = true; $this->user_password = new clsControl(ccsTextBox, "user_password", "Password", ccsText, "", CCGetRequestParam("user_password", $Method)); $this->nombre = new clsControl(ccsTextBox, "nombre", "Nombre", ccsText, "", CCGetRequestParam("nombre", $Method)); $this->nombre->Required = true; $this->last_name = new clsControl(ccsTextBox, "last_name", "Last Name", ccsText, "", CCGetRequestParam("last_name", $Method)); $this->email = new clsControl(ccsTextBox, "email", "Email", ccsText, "", CCGetRequestParam("email", $Method)); $this->email->Required = true; $this->emalPublico = new clsControl(ccsTextBox, "emalPublico", "Email Publico", ccsText, "", CCGetRequestParam("emalPublico", $Method)); $this->phone_work = new clsControl(ccsTextBox, "phone_work", "Work Phone", ccsText, "", CCGetRequestParam("phone_work", $Method)); $this->Patrocinador = new clsControl(ccsTextBox, "Patrocinador", "Patrocinador", ccsText, "", CCGetRequestParam("Patrocinador", $Method)); $this->address1 = new clsControl(ccsTextBox, "address1", "Address Line 1", ccsText, "", CCGetRequestParam("address1", $Method)); $this->address2 = new clsControl(ccsTextBox, "address2", "Address Line 2", ccsText, "", CCGetRequestParam("address2", $Method)); $this->address3 = new clsControl(ccsTextBox, "address3", "Address3", ccsText, "", CCGetRequestParam("address3", $Method)); $this->city = new clsControl(ccsTextBox, "city", "City", ccsText, "", CCGetRequestParam("city", $Method)); $this->state_id = new clsControl(ccsListBox, "state_id", "Provincia", ccsInteger, "", CCGetRequestParam("state_id", $Method)); $this->state_id->DSType = dsTable; list($this->state_id->BoundColumn, $this->state_id->TextColumn, $this->state_id->DBFormat) = array("state_id", "state_name", ""); $this->state_id->ds = new clsDBinternet(); $this->state_id->ds->SQL = "SELECT * " . "FROM states"; $this->state_id->ds->Order = "state_name"; $this->state_id->Required = true; $this->country_id = new clsControl(ccsListBox, "country_id", "Country", ccsInteger, "", CCGetRequestParam("country_id", $Method)); $this->country_id->DSType = dsTable; list($this->country_id->BoundColumn, $this->country_id->TextColumn, $this->country_id->DBFormat) = array("country_id", "country_name", ""); $this->country_id->ds = new clsDBinternet(); $this->country_id->ds->SQL = "SELECT * " . "FROM countries"; $this->country_id->ds->Order = "country_name"; $this->phone_home = new clsControl(ccsTextBox, "phone_home", "Home Phone", ccsText, "", CCGetRequestParam("phone_home", $Method)); $this->age_id = new clsControl(ccsListBox, "age_id", "Age", ccsInteger, "", CCGetRequestParam("age_id", $Method)); $this->age_id->DSType = dsTable; list($this->age_id->BoundColumn, $this->age_id->TextColumn, $this->age_id->DBFormat) = array("age_id", "age_name", ""); $this->age_id->ds = new clsDBinternet(); $this->age_id->ds->SQL = "SELECT * " . "FROM ages"; $this->age_id->ds->Order = "age_name"; $this->gender_id = new clsControl(ccsListBox, "gender_id", "Gender", ccsInteger, "", CCGetRequestParam("gender_id", $Method)); $this->gender_id->DSType = dsTable; list($this->gender_id->BoundColumn, $this->gender_id->TextColumn, $this->gender_id->DBFormat) = array("gender_id", "gender_name", ""); $this->gender_id->ds = new clsDBinternet(); $this->gender_id->ds->SQL = "SELECT * " . "FROM genders"; $this->gender_id->ds->Order = "gender_name"; $this->note = new clsControl(ccsTextArea, "note", "Describe Yourself", ccsMemo, "", CCGetRequestParam("note", $Method)); $this->group_id = new clsControl(ccsHidden, "group_id", "group_id", ccsText, "", CCGetRequestParam("group_id", $Method)); $this->Insert = new clsButton("Insert"); $this->Cancel = new clsButton("Cancel"); if(!$this->FormSubmitted) { if(!is_array($this->country_id->Value) && !strlen($this->country_id->Value) && $this->country_id->Value !== false) $this->country_id->SetText(195); if(!is_array($this->age_id->Value) && !strlen($this->age_id->Value) && $this->age_id->Value !== false) $this->age_id->SetText(0); if(!is_array($this->gender_id->Value) && !strlen($this->gender_id->Value) && $this->gender_id->Value !== false) $this->gender_id->SetText(1); if(!is_array($this->group_id->Value) && !strlen($this->group_id->Value) && $this->group_id->Value !== false) $this->group_id->SetText(1); } } } //End Class_Initialize Event //Initialize Method @4-C016A25E function Initialize() { if(!$this->Visible) return; $this->ds->Parameters["urluser_id"] = CCGetFromGet("user_id", ""); } //End Initialize Method //Validate Method @4-3B501759 function Validate() { $Validation = true; $Where = ""; $Validation = ($this->user_login->Validate() && $Validation); $Validation = ($this->user_password->Validate() && $Validation); $Validation = ($this->nombre->Validate() && $Validation); $Validation = ($this->last_name->Validate() && $Validation); $Validation = ($this->email->Validate() && $Validation); $Validation = ($this->emalPublico->Validate() && $Validation); $Validation = ($this->phone_work->Validate() && $Validation); $Validation = ($this->Patrocinador->Validate() && $Validation); $Validation = ($this->address1->Validate() && $Validation); $Validation = ($this->address2->Validate() && $Validation); $Validation = ($this->address3->Validate() && $Validation); $Validation = ($this->city->Validate() && $Validation); $Validation = ($this->state_id->Validate() && $Validation); $Validation = ($this->country_id->Validate() && $Validation); $Validation = ($this->phone_home->Validate() && $Validation); $Validation = ($this->age_id->Validate() && $Validation); $Validation = ($this->gender_id->Validate() && $Validation); $Validation = ($this->note->Validate() && $Validation); $Validation = ($this->group_id->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate"); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method //CheckErrors Method @4-503B4620 function CheckErrors() { $errors = false; $errors = ($errors || $this->user_login->Errors->Count()); $errors = ($errors || $this->user_password->Errors->Count()); $errors = ($errors || $this->nombre->Errors->Count()); $errors = ($errors || $this->last_name->Errors->Count()); $errors = ($errors || $this->email->Errors->Count()); $errors = ($errors || $this->emalPublico->Errors->Count()); $errors = ($errors || $this->phone_work->Errors->Count()); $errors = ($errors || $this->Patrocinador->Errors->Count()); $errors = ($errors || $this->address1->Errors->Count()); $errors = ($errors || $this->address2->Errors->Count()); $errors = ($errors || $this->address3->Errors->Count()); $errors = ($errors || $this->city->Errors->Count()); $errors = ($errors || $this->state_id->Errors->Count()); $errors = ($errors || $this->country_id->Errors->Count()); $errors = ($errors || $this->phone_home->Errors->Count()); $errors = ($errors || $this->age_id->Errors->Count()); $errors = ($errors || $this->gender_id->Errors->Count()); $errors = ($errors || $this->note->Errors->Count()); $errors = ($errors || $this->group_id->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->ds->Errors->Count()); return $errors; } //End CheckErrors Method //Operation Method @4-374CA409 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 = "Insert"; if(strlen(CCGetParam("Insert", ""))) { $this->PressedButton = "Insert"; } else if(strlen(CCGetParam("Cancel", ""))) { $this->PressedButton = "Cancel"; } } $Redirect = "index.htm" . "?" . CCGetQueryString("QueryString", Array("ccsForm")); if($this->PressedButton == "Cancel") { if(!CCGetEvent($this->Cancel->CCSEvents, "OnClick")) { $Redirect = ""; } } else if($this->Validate()) { if($this->PressedButton == "Insert") { if(!CCGetEvent($this->Insert->CCSEvents, "OnClick") || !$this->InsertRow()) { $Redirect = ""; } } } else { $Redirect = ""; } } //End Operation Method //InsertRow Method @4-24D7A7E7 function InsertRow() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert"); if(!$this->InsertAllowed) return false; $this->ds->user_login->SetValue($this->user_login->GetValue()); $this->ds->user_password->SetValue($this->user_password->GetValue()); $this->ds->nombre->SetValue($this->nombre->GetValue()); $this->ds->last_name->SetValue($this->last_name->GetValue()); $this->ds->email->SetValue($this->email->GetValue()); $this->ds->emalPublico->SetValue($this->emalPublico->GetValue()); $this->ds->phone_work->SetValue($this->phone_work->GetValue()); $this->ds->Patrocinador->SetValue($this->Patrocinador->GetValue()); $this->ds->address1->SetValue($this->address1->GetValue()); $this->ds->address2->SetValue($this->address2->GetValue()); $this->ds->address3->SetValue($this->address3->GetValue()); $this->ds->city->SetValue($this->city->GetValue()); $this->ds->state_id->SetValue($this->state_id->GetValue()); $this->ds->country_id->SetValue($this->country_id->GetValue()); $this->ds->phone_home->SetValue($this->phone_home->GetValue()); $this->ds->age_id->SetValue($this->age_id->GetValue()); $this->ds->gender_id->SetValue($this->gender_id->GetValue()); $this->ds->note->SetValue($this->note->GetValue()); $this->ds->group_id->SetValue($this->group_id->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 //Show Method @4-01C44075 function Show() { global $Tpl; global $FileName; $Error = ""; if(!$this->Visible) return; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect"); $this->state_id->Prepare(); $this->country_id->Prepare(); $this->age_id->Prepare(); $this->gender_id->Prepare(); $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 users"; } else if($this->ds->next_record()) { $this->ds->SetValues(); if(!$this->FormSubmitted) { $this->user_login->SetValue($this->ds->user_login->GetValue()); $this->user_password->SetValue($this->ds->user_password->GetValue()); $this->nombre->SetValue($this->ds->nombre->GetValue()); $this->last_name->SetValue($this->ds->last_name->GetValue()); $this->email->SetValue($this->ds->email->GetValue()); $this->emalPublico->SetValue($this->ds->emalPublico->GetValue()); $this->phone_work->SetValue($this->ds->phone_work->GetValue()); $this->Patrocinador->SetValue($this->ds->Patrocinador->GetValue()); $this->address1->SetValue($this->ds->address1->GetValue()); $this->address2->SetValue($this->ds->address2->GetValue()); $this->address3->SetValue($this->ds->address3->GetValue()); $this->city->SetValue($this->ds->city->GetValue()); $this->state_id->SetValue($this->ds->state_id->GetValue()); $this->country_id->SetValue($this->ds->country_id->GetValue()); $this->phone_home->SetValue($this->ds->phone_home->GetValue()); $this->age_id->SetValue($this->ds->age_id->GetValue()); $this->gender_id->SetValue($this->ds->gender_id->GetValue()); $this->note->SetValue($this->ds->note->GetValue()); $this->group_id->SetValue($this->ds->group_id->GetValue()); } } else { $this->EditMode = false; } } } if(!$this->FormSubmitted) { } if($this->FormSubmitted || $this->CheckErrors()) { $Error .= $this->user_login->Errors->ToString(); $Error .= $this->user_password->Errors->ToString(); $Error .= $this->nombre->Errors->ToString(); $Error .= $this->last_name->Errors->ToString(); $Error .= $this->email->Errors->ToString(); $Error .= $this->emalPublico->Errors->ToString(); $Error .= $this->phone_work->Errors->ToString(); $Error .= $this->Patrocinador->Errors->ToString(); $Error .= $this->address1->Errors->ToString(); $Error .= $this->address2->Errors->ToString(); $Error .= $this->address3->Errors->ToString(); $Error .= $this->city->Errors->ToString(); $Error .= $this->state_id->Errors->ToString(); $Error .= $this->country_id->Errors->ToString(); $Error .= $this->phone_home->Errors->ToString(); $Error .= $this->age_id->Errors->ToString(); $Error .= $this->gender_id->Errors->ToString(); $Error .= $this->note->Errors->ToString(); $Error .= $this->group_id->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->Insert->Visible = !$this->EditMode && $this->InsertAllowed; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if(!$this->Visible) { $Tpl->block_path = $ParentPath; return; } $this->user_login->Show(); $this->user_password->Show(); $this->nombre->Show(); $this->last_name->Show(); $this->email->Show(); $this->emalPublico->Show(); $this->phone_work->Show(); $this->Patrocinador->Show(); $this->address1->Show(); $this->address2->Show(); $this->address3->Show(); $this->city->Show(); $this->state_id->Show(); $this->country_id->Show(); $this->phone_home->Show(); $this->age_id->Show(); $this->gender_id->Show(); $this->note->Show(); $this->group_id->Show(); $this->Insert->Show(); $this->Cancel->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->ds->close(); } //End Show Method } //End users Class @4-FCB6E20C class clsusersDataSource extends clsDBinternet { //usersDataSource Class @4-98485C1D //DataSource Variables @4-B99C672C var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $InsertParameters; var $wp; var $AllParametersSet; // Datasource fields var $user_login; var $user_password; var $nombre; var $last_name; var $email; var $emalPublico; var $phone_work; var $Patrocinador; var $address1; var $address2; var $address3; var $city; var $state_id; var $country_id; var $phone_home; var $age_id; var $gender_id; var $note; var $group_id; //End DataSource Variables //Class_Initialize Event @4-D04C8605 function clsusersDataSource() { $this->ErrorBlock = "Record users/Error"; $this->Initialize(); $this->user_login = new clsField("user_login", ccsText, ""); $this->user_password = new clsField("user_password", ccsText, ""); $this->nombre = new clsField("nombre", ccsText, ""); $this->last_name = new clsField("last_name", ccsText, ""); $this->email = new clsField("email", ccsText, ""); $this->emalPublico = new clsField("emalPublico", ccsText, ""); $this->phone_work = new clsField("phone_work", ccsText, ""); $this->Patrocinador = new clsField("Patrocinador", ccsText, ""); $this->address1 = new clsField("address1", ccsText, ""); $this->address2 = new clsField("address2", ccsText, ""); $this->address3 = new clsField("address3", ccsText, ""); $this->city = new clsField("city", ccsText, ""); $this->state_id = new clsField("state_id", ccsInteger, ""); $this->country_id = new clsField("country_id", ccsInteger, ""); $this->phone_home = new clsField("phone_home", ccsText, ""); $this->age_id = new clsField("age_id", ccsInteger, ""); $this->gender_id = new clsField("gender_id", ccsInteger, ""); $this->note = new clsField("note", ccsMemo, ""); $this->group_id = new clsField("group_id", ccsText, ""); } //End Class_Initialize Event //Prepare Method @4-BAD07477 function Prepare() { $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urluser_id", ccsInteger, "", "", $this->Parameters["urluser_id"], "", false); $this->AllParametersSet = $this->wp->AllParamsSet(); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "user_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method //Open Method @4-DC1AA46D function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect"); $this->SQL = "SELECT * " . "FROM users"; $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 @4-50D056E2 function SetValues() { $this->user_login->SetDBValue($this->f("user_login")); $this->user_password->SetDBValue($this->f("user_password")); $this->nombre->SetDBValue($this->f("first_name")); $this->last_name->SetDBValue($this->f("last_name")); $this->email->SetDBValue($this->f("email")); $this->emalPublico->SetDBValue($this->f("zip")); $this->phone_work->SetDBValue($this->f("phone_work")); $this->Patrocinador->SetDBValue($this->f("phone_day")); $this->address1->SetDBValue($this->f("address1")); $this->address2->SetDBValue($this->f("address2")); $this->address3->SetDBValue($this->f("address3")); $this->city->SetDBValue($this->f("city")); $this->state_id->SetDBValue(trim($this->f("state_id"))); $this->country_id->SetDBValue(trim($this->f("country_id"))); $this->phone_home->SetDBValue($this->f("phone_home")); $this->age_id->SetDBValue(trim($this->f("age_id"))); $this->gender_id->SetDBValue(trim($this->f("gender_id"))); $this->note->SetDBValue($this->f("notes")); $this->group_id->SetDBValue($this->f("group_id")); } //End SetValues Method //Insert Method @4-9E7C179A function Insert() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert"); $this->SQL = "INSERT INTO users (" . "user_login, " . "user_password, " . "first_name, " . "last_name, " . "email, " . "zip, " . "phone_work, " . "phone_day, " . "address1, " . "address2, " . "address3, " . "city, " . "state_id, " . "country_id, " . "phone_home, " . "age_id, " . "gender_id, " . "notes, " . "group_id" . ") VALUES (" . $this->ToSQL($this->user_login->GetDBValue(), $this->user_login->DataType) . ", " . $this->ToSQL($this->user_password->GetDBValue(), $this->user_password->DataType) . ", " . $this->ToSQL($this->nombre->GetDBValue(), $this->nombre->DataType) . ", " . $this->ToSQL($this->last_name->GetDBValue(), $this->last_name->DataType) . ", " . $this->ToSQL($this->email->GetDBValue(), $this->email->DataType) . ", " . $this->ToSQL($this->emalPublico->GetDBValue(), $this->emalPublico->DataType) . ", " . $this->ToSQL($this->phone_work->GetDBValue(), $this->phone_work->DataType) . ", " . $this->ToSQL($this->Patrocinador->GetDBValue(), $this->Patrocinador->DataType) . ", " . $this->ToSQL($this->address1->GetDBValue(), $this->address1->DataType) . ", " . $this->ToSQL($this->address2->GetDBValue(), $this->address2->DataType) . ", " . $this->ToSQL($this->address3->GetDBValue(), $this->address3->DataType) . ", " . $this->ToSQL($this->city->GetDBValue(), $this->city->DataType) . ", " . $this->ToSQL($this->state_id->GetDBValue(), $this->state_id->DataType) . ", " . $this->ToSQL($this->country_id->GetDBValue(), $this->country_id->DataType) . ", " . $this->ToSQL($this->phone_home->GetDBValue(), $this->phone_home->DataType) . ", " . $this->ToSQL($this->age_id->GetDBValue(), $this->age_id->DataType) . ", " . $this->ToSQL($this->gender_id->GetDBValue(), $this->gender_id->DataType) . ", " . $this->ToSQL($this->note->GetDBValue(), $this->note->DataType) . ", " . $this->ToSQL($this->group_id->GetDBValue(), $this->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 } //End usersDataSource Class @4-FCB6E20C //Include Page implementation @3-B4331262 include_once("./Footer.htm"); //End Include Page implementation //Initialize Page @1-D65D0935 // Variables $FileName = ""; $Redirect = ""; $Tpl = ""; $TemplateFileName = ""; $BlockToParse = ""; $ComponentName = ""; // Events; $CCSEvents = ""; $CCSEventResult = ""; $FileName = "registro.htm"; $Redirect = ""; $TemplateFileName = "registro.html"; $BlockToParse = "main"; $PathToRoot = "./"; //End Initialize Page //Initialize Objects @1-33DB1BD3 $DBinternet = new clsDBinternet(); // Controls $Header = new clsHeader(); $Header->BindEvents(); $Header->TemplatePath = "./"; $Header->Initialize(); $users = new clsRecordusers(); $Footer = new clsFooter(); $Footer->BindEvents(); $Footer->TemplatePath = "./"; $Footer->Initialize(); $users->Initialize(); // Events include("./registro_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-AB1E45CE $Header->Operations(); $users->Operation(); $Footer->Operations(); //End Execute Components //Go to destination page @1-61A4F1DF if($Redirect) { $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload"); $DBinternet->close(); header("Location: " . $Redirect); exit; } //End Go to destination page //Show Page @1-A8206A32 $Header->Show("Header"); $users->Show(); $Footer->Show("Footer"); $Tpl->Parse("main", false); $main_block = $Tpl->GetVar("main"); //$generated_with = "