/admin/edit_tickets.php
PHP | 882 lines | 730 code | 78 blank | 74 comment | 173 complexity | ed36d36dfb795c9ea530e0be1efda02b MD5 | raw file
Possible License(s): GPL-3.0
- <?php
- /*
- ##############################################################################
- # PHP Scratch And Win Version 4.04 #
- # Copyright 2012 www.YourPHPPro.com #
- # #
- # For questions concerning licensing, please read license.txt #
- ##############################################################################
- */
- //Include Common Files @1-23DF6421
- define("RelativePath", "..");
- define("PathToCurrentPage", "/admin/");
- define("FileName", "edit_tickets.php");
- include_once(RelativePath . "/Common.php");
- include_once(RelativePath . "/Template.php");
- include_once(RelativePath . "/Sorter.php");
- include_once(RelativePath . "/Navigator.php");
- //End Include Common Files
-
- //Include Page implementation @28-47CFCC1A
- include_once(RelativePath . "/admin/header.php");
- //End Include Page implementation
-
- class clsRecordEditTickets { //EditTickets Class @2-20E58353
-
- //Variables @2-9E315808
-
- // Public variables
- public $ComponentType = "Record";
- public $ComponentName;
- public $Parent;
- public $HTMLFormAction;
- public $PressedButton;
- public $Errors;
- public $ErrorBlock;
- public $FormSubmitted;
- public $FormEnctype;
- public $Visible;
- public $IsEmpty;
-
- public $CCSEvents = "";
- public $CCSEventResult;
-
- public $RelativePath = "";
-
- public $InsertAllowed = false;
- public $UpdateAllowed = false;
- public $DeleteAllowed = false;
- public $ReadAllowed = false;
- public $EditMode = false;
- public $ds;
- public $DataSource;
- public $ValidatingControls;
- public $Controls;
- public $Attributes;
-
- // Class variables
- //End Variables
-
- //Class_Initialize Event @2-01C1789F
- function clsRecordEditTickets($RelativePath, & $Parent)
- {
-
- global $FileName;
- global $CCSLocales;
- global $DefaultDateFormat;
- $this->Visible = true;
- $this->Parent = & $Parent;
- $this->RelativePath = $RelativePath;
- $this->Errors = new clsErrors();
- $this->ErrorBlock = "Record EditTickets/Error";
- $this->DataSource = new clsEditTicketsDataSource($this);
- $this->ds = & $this->DataSource;
- $this->InsertAllowed = true;
- $this->UpdateAllowed = true;
- $this->DeleteAllowed = true;
- $this->ReadAllowed = true;
- if($this->Visible)
- {
- $this->ComponentName = "EditTickets";
- $this->Attributes = new clsAttributes($this->ComponentName . ":");
- $CCSForm = explode(":", 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->Ticket_Email_Address = new clsControl(ccsTextBox, "Ticket_Email_Address", "Email Address", ccsText, "", CCGetRequestParam("Ticket_Email_Address", $Method, NULL), $this);
- $this->Ticket_Email_Address->Required = true;
- $this->Ticket_DrawDate = new clsControl(ccsTextBox, "Ticket_DrawDate", "Draw Date", ccsDate, array("GeneralDate"), CCGetRequestParam("Ticket_DrawDate", $Method, NULL), $this);
- $this->Ticket_DrawDate->Required = true;
- $this->DatePicker_Ticket_DrawDate = new clsDatePicker("DatePicker_Ticket_DrawDate", "EditTickets", "Ticket_DrawDate", $this);
- $this->Ticket_Number_1 = new clsControl(ccsTextBox, "Ticket_Number_1", "Number 1", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("Ticket_Number_1", $Method, NULL), $this);
- $this->Ticket_Number_1->Required = true;
- $this->Ticket_Number_2 = new clsControl(ccsTextBox, "Ticket_Number_2", "Number 2", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("Ticket_Number_2", $Method, NULL), $this);
- $this->Ticket_Number_2->Required = true;
- $this->Ticket_Pick_1 = new clsControl(ccsTextBox, "Ticket_Pick_1", "Pick 1", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("Ticket_Pick_1", $Method, NULL), $this);
- $this->Ticket_Pick_1->Required = true;
- $this->Ticket_Pick_2 = new clsControl(ccsTextBox, "Ticket_Pick_2", "Pick 2", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("Ticket_Pick_2", $Method, NULL), $this);
- $this->Ticket_Pick_2->Required = true;
- $this->Ticket_Pick_3 = new clsControl(ccsTextBox, "Ticket_Pick_3", "Pick 3", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("Ticket_Pick_3", $Method, NULL), $this);
- $this->Ticket_Pick_3->Required = true;
- $this->Ticket_Pick_4 = new clsControl(ccsTextBox, "Ticket_Pick_4", "Pick 4", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("Ticket_Pick_4", $Method, NULL), $this);
- $this->Ticket_Pick_4->Required = true;
- $this->Ticket_Show_1 = new clsControl(ccsRadioButton, "Ticket_Show_1", "Show 1", ccsText, "", CCGetRequestParam("Ticket_Show_1", $Method, NULL), $this);
- $this->Ticket_Show_1->DSType = dsListOfValues;
- $this->Ticket_Show_1->Values = array(array("Yes", "Yes"), array("No", "No"));
- $this->Ticket_Show_1->HTML = true;
- $this->Ticket_Show_1->Required = true;
- $this->Ticket_Show_2 = new clsControl(ccsRadioButton, "Ticket_Show_2", "Show 2", ccsText, "", CCGetRequestParam("Ticket_Show_2", $Method, NULL), $this);
- $this->Ticket_Show_2->DSType = dsListOfValues;
- $this->Ticket_Show_2->Values = array(array("Yes", "Yes"), array("No", "No"));
- $this->Ticket_Show_2->HTML = true;
- $this->Ticket_Show_2->Required = true;
- $this->Ticket_Show_3 = new clsControl(ccsRadioButton, "Ticket_Show_3", "Show 3", ccsText, "", CCGetRequestParam("Ticket_Show_3", $Method, NULL), $this);
- $this->Ticket_Show_3->DSType = dsListOfValues;
- $this->Ticket_Show_3->Values = array(array("Yes", "Yes"), array("No", "No"));
- $this->Ticket_Show_3->HTML = true;
- $this->Ticket_Show_3->Required = true;
- $this->Ticket_Show_4 = new clsControl(ccsRadioButton, "Ticket_Show_4", "Show 4", ccsText, "", CCGetRequestParam("Ticket_Show_4", $Method, NULL), $this);
- $this->Ticket_Show_4->DSType = dsListOfValues;
- $this->Ticket_Show_4->Values = array(array("Yes", "Yes"), array("No", "No"));
- $this->Ticket_Show_4->HTML = true;
- $this->Ticket_Show_4->Required = true;
- $this->Button_Insert = new clsButton("Button_Insert", $Method, $this);
- $this->Button_Update = new clsButton("Button_Update", $Method, $this);
- $this->Button_Delete = new clsButton("Button_Delete", $Method, $this);
- $this->Ticket_SerialNumber = new clsControl(ccsTextBox, "Ticket_SerialNumber", "Ticket Serial Number", ccsText, "", CCGetRequestParam("Ticket_SerialNumber", $Method, NULL), $this);
- $this->Ticket_Played = new clsControl(ccsRadioButton, "Ticket_Played", "Played", ccsText, "", CCGetRequestParam("Ticket_Played", $Method, NULL), $this);
- $this->Ticket_Played->DSType = dsListOfValues;
- $this->Ticket_Played->Values = array(array("Yes", "Yes"), array("No", "No"));
- $this->Ticket_Played->HTML = true;
- $this->Ticket_Played->Required = true;
- $this->Ticket_Winner = new clsControl(ccsRadioButton, "Ticket_Winner", "Winner", ccsText, "", CCGetRequestParam("Ticket_Winner", $Method, NULL), $this);
- $this->Ticket_Winner->DSType = dsListOfValues;
- $this->Ticket_Winner->Values = array(array("Yes", "Yes"), array("No", "No"));
- $this->Ticket_Winner->HTML = true;
- $this->Ticket_Winner->Required = true;
- $this->Ticket_IPAddress = new clsControl(ccsTextBox, "Ticket_IPAddress", "IP Address", ccsText, "", CCGetRequestParam("Ticket_IPAddress", $Method, NULL), $this);
- $this->Ticket_IPAddress->Required = true;
- if(!$this->FormSubmitted) {
- if(!is_array($this->Ticket_DrawDate->Value) && !strlen($this->Ticket_DrawDate->Value) && $this->Ticket_DrawDate->Value !== false)
- $this->Ticket_DrawDate->SetValue(time());
- }
- }
- }
- //End Class_Initialize Event
-
- //Initialize Method @2-E39BA32D
- function Initialize()
- {
-
- if(!$this->Visible)
- return;
-
- $this->DataSource->Parameters["urlTicket_ID"] = CCGetFromGet("Ticket_ID", NULL);
- }
- //End Initialize Method
-
- //Validate Method @2-D20DC42B
- function Validate()
- {
- global $CCSLocales;
- $Validation = true;
- $Where = "";
- $Validation = ($this->Ticket_Email_Address->Validate() && $Validation);
- $Validation = ($this->Ticket_DrawDate->Validate() && $Validation);
- $Validation = ($this->Ticket_Number_1->Validate() && $Validation);
- $Validation = ($this->Ticket_Number_2->Validate() && $Validation);
- $Validation = ($this->Ticket_Pick_1->Validate() && $Validation);
- $Validation = ($this->Ticket_Pick_2->Validate() && $Validation);
- $Validation = ($this->Ticket_Pick_3->Validate() && $Validation);
- $Validation = ($this->Ticket_Pick_4->Validate() && $Validation);
- $Validation = ($this->Ticket_Show_1->Validate() && $Validation);
- $Validation = ($this->Ticket_Show_2->Validate() && $Validation);
- $Validation = ($this->Ticket_Show_3->Validate() && $Validation);
- $Validation = ($this->Ticket_Show_4->Validate() && $Validation);
- $Validation = ($this->Ticket_SerialNumber->Validate() && $Validation);
- $Validation = ($this->Ticket_Played->Validate() && $Validation);
- $Validation = ($this->Ticket_Winner->Validate() && $Validation);
- $Validation = ($this->Ticket_IPAddress->Validate() && $Validation);
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this);
- $Validation = $Validation && ($this->Ticket_Email_Address->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_DrawDate->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Number_1->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Number_2->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Pick_1->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Pick_2->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Pick_3->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Pick_4->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Show_1->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Show_2->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Show_3->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Show_4->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_SerialNumber->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Played->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_Winner->Errors->Count() == 0);
- $Validation = $Validation && ($this->Ticket_IPAddress->Errors->Count() == 0);
- return (($this->Errors->Count() == 0) && $Validation);
- }
- //End Validate Method
-
- //CheckErrors Method @2-0CE4A6F3
- function CheckErrors()
- {
- $errors = false;
- $errors = ($errors || $this->Ticket_Email_Address->Errors->Count());
- $errors = ($errors || $this->Ticket_DrawDate->Errors->Count());
- $errors = ($errors || $this->DatePicker_Ticket_DrawDate->Errors->Count());
- $errors = ($errors || $this->Ticket_Number_1->Errors->Count());
- $errors = ($errors || $this->Ticket_Number_2->Errors->Count());
- $errors = ($errors || $this->Ticket_Pick_1->Errors->Count());
- $errors = ($errors || $this->Ticket_Pick_2->Errors->Count());
- $errors = ($errors || $this->Ticket_Pick_3->Errors->Count());
- $errors = ($errors || $this->Ticket_Pick_4->Errors->Count());
- $errors = ($errors || $this->Ticket_Show_1->Errors->Count());
- $errors = ($errors || $this->Ticket_Show_2->Errors->Count());
- $errors = ($errors || $this->Ticket_Show_3->Errors->Count());
- $errors = ($errors || $this->Ticket_Show_4->Errors->Count());
- $errors = ($errors || $this->Ticket_SerialNumber->Errors->Count());
- $errors = ($errors || $this->Ticket_Played->Errors->Count());
- $errors = ($errors || $this->Ticket_Winner->Errors->Count());
- $errors = ($errors || $this->Ticket_IPAddress->Errors->Count());
- $errors = ($errors || $this->Errors->Count());
- $errors = ($errors || $this->DataSource->Errors->Count());
- return $errors;
- }
- //End CheckErrors Method
-
- //Operation Method @2-475C577F
- function Operation()
- {
- if(!$this->Visible)
- return;
-
- global $Redirect;
- global $FileName;
-
- $this->DataSource->Prepare();
- if(!$this->FormSubmitted) {
- $this->EditMode = $this->DataSource->AllParametersSet;
- return;
- }
-
- if($this->FormSubmitted) {
- $this->PressedButton = $this->EditMode ? "Button_Update" : "Button_Insert";
- if($this->Button_Insert->Pressed) {
- $this->PressedButton = "Button_Insert";
- } else if($this->Button_Update->Pressed) {
- $this->PressedButton = "Button_Update";
- } else if($this->Button_Delete->Pressed) {
- $this->PressedButton = "Button_Delete";
- }
- }
- $Redirect = "list_tickets.php" . "?" . CCGetQueryString("QueryString", array("ccsForm"));
- if($this->PressedButton == "Button_Delete") {
- if(!CCGetEvent($this->Button_Delete->CCSEvents, "OnClick", $this->Button_Delete) || !$this->DeleteRow()) {
- $Redirect = "";
- }
- } else if($this->Validate()) {
- if($this->PressedButton == "Button_Insert") {
- if(!CCGetEvent($this->Button_Insert->CCSEvents, "OnClick", $this->Button_Insert) || !$this->InsertRow()) {
- $Redirect = "";
- }
- } else if($this->PressedButton == "Button_Update") {
- if(!CCGetEvent($this->Button_Update->CCSEvents, "OnClick", $this->Button_Update) || !$this->UpdateRow()) {
- $Redirect = "";
- }
- }
- } else {
- $Redirect = "";
- }
- if ($Redirect)
- $this->DataSource->close();
- }
- //End Operation Method
-
- //InsertRow Method @2-256545D2
- function InsertRow()
- {
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this);
- if(!$this->InsertAllowed) return false;
- $this->DataSource->Ticket_Email_Address->SetValue($this->Ticket_Email_Address->GetValue(true));
- $this->DataSource->Ticket_DrawDate->SetValue($this->Ticket_DrawDate->GetValue(true));
- $this->DataSource->Ticket_Number_1->SetValue($this->Ticket_Number_1->GetValue(true));
- $this->DataSource->Ticket_Number_2->SetValue($this->Ticket_Number_2->GetValue(true));
- $this->DataSource->Ticket_Pick_1->SetValue($this->Ticket_Pick_1->GetValue(true));
- $this->DataSource->Ticket_Pick_2->SetValue($this->Ticket_Pick_2->GetValue(true));
- $this->DataSource->Ticket_Pick_3->SetValue($this->Ticket_Pick_3->GetValue(true));
- $this->DataSource->Ticket_Pick_4->SetValue($this->Ticket_Pick_4->GetValue(true));
- $this->DataSource->Ticket_Show_1->SetValue($this->Ticket_Show_1->GetValue(true));
- $this->DataSource->Ticket_Show_2->SetValue($this->Ticket_Show_2->GetValue(true));
- $this->DataSource->Ticket_Show_3->SetValue($this->Ticket_Show_3->GetValue(true));
- $this->DataSource->Ticket_Show_4->SetValue($this->Ticket_Show_4->GetValue(true));
- $this->DataSource->Ticket_SerialNumber->SetValue($this->Ticket_SerialNumber->GetValue(true));
- $this->DataSource->Ticket_Played->SetValue($this->Ticket_Played->GetValue(true));
- $this->DataSource->Ticket_Winner->SetValue($this->Ticket_Winner->GetValue(true));
- $this->DataSource->Ticket_IPAddress->SetValue($this->Ticket_IPAddress->GetValue(true));
- $this->DataSource->Insert();
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this);
- return (!$this->CheckErrors());
- }
- //End InsertRow Method
-
- //UpdateRow Method @2-C1AB2A1C
- function UpdateRow()
- {
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this);
- if(!$this->UpdateAllowed) return false;
- $this->DataSource->Ticket_Email_Address->SetValue($this->Ticket_Email_Address->GetValue(true));
- $this->DataSource->Ticket_DrawDate->SetValue($this->Ticket_DrawDate->GetValue(true));
- $this->DataSource->Ticket_Number_1->SetValue($this->Ticket_Number_1->GetValue(true));
- $this->DataSource->Ticket_Number_2->SetValue($this->Ticket_Number_2->GetValue(true));
- $this->DataSource->Ticket_Pick_1->SetValue($this->Ticket_Pick_1->GetValue(true));
- $this->DataSource->Ticket_Pick_2->SetValue($this->Ticket_Pick_2->GetValue(true));
- $this->DataSource->Ticket_Pick_3->SetValue($this->Ticket_Pick_3->GetValue(true));
- $this->DataSource->Ticket_Pick_4->SetValue($this->Ticket_Pick_4->GetValue(true));
- $this->DataSource->Ticket_Show_1->SetValue($this->Ticket_Show_1->GetValue(true));
- $this->DataSource->Ticket_Show_2->SetValue($this->Ticket_Show_2->GetValue(true));
- $this->DataSource->Ticket_Show_3->SetValue($this->Ticket_Show_3->GetValue(true));
- $this->DataSource->Ticket_Show_4->SetValue($this->Ticket_Show_4->GetValue(true));
- $this->DataSource->Ticket_SerialNumber->SetValue($this->Ticket_SerialNumber->GetValue(true));
- $this->DataSource->Ticket_Played->SetValue($this->Ticket_Played->GetValue(true));
- $this->DataSource->Ticket_Winner->SetValue($this->Ticket_Winner->GetValue(true));
- $this->DataSource->Ticket_IPAddress->SetValue($this->Ticket_IPAddress->GetValue(true));
- $this->DataSource->Update();
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this);
- return (!$this->CheckErrors());
- }
- //End UpdateRow Method
-
- //DeleteRow Method @2-299D98C3
- function DeleteRow()
- {
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeDelete", $this);
- if(!$this->DeleteAllowed) return false;
- $this->DataSource->Delete();
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterDelete", $this);
- return (!$this->CheckErrors());
- }
- //End DeleteRow Method
-
- //Show Method @2-BC12677D
- function Show()
- {
- global $CCSUseAmp;
- $Tpl = & CCGetTemplate($this);
- global $FileName;
- global $CCSLocales;
- $Error = "";
-
- if(!$this->Visible)
- return;
-
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
-
- $this->Ticket_Show_1->Prepare();
- $this->Ticket_Show_2->Prepare();
- $this->Ticket_Show_3->Prepare();
- $this->Ticket_Show_4->Prepare();
- $this->Ticket_Played->Prepare();
- $this->Ticket_Winner->Prepare();
-
- $RecordBlock = "Record " . $this->ComponentName;
- $ParentPath = $Tpl->block_path;
- $Tpl->block_path = $ParentPath . "/" . $RecordBlock;
- $this->EditMode = $this->EditMode && $this->ReadAllowed;
- if($this->EditMode) {
- if($this->DataSource->Errors->Count()){
- $this->Errors->AddErrors($this->DataSource->Errors);
- $this->DataSource->Errors->clear();
- }
- $this->DataSource->Open();
- if($this->DataSource->Errors->Count() == 0 && $this->DataSource->next_record()) {
- $this->DataSource->SetValues();
- if(!$this->FormSubmitted){
- $this->Ticket_Email_Address->SetValue($this->DataSource->Ticket_Email_Address->GetValue());
- $this->Ticket_DrawDate->SetValue($this->DataSource->Ticket_DrawDate->GetValue());
- $this->Ticket_Number_1->SetValue($this->DataSource->Ticket_Number_1->GetValue());
- $this->Ticket_Number_2->SetValue($this->DataSource->Ticket_Number_2->GetValue());
- $this->Ticket_Pick_1->SetValue($this->DataSource->Ticket_Pick_1->GetValue());
- $this->Ticket_Pick_2->SetValue($this->DataSource->Ticket_Pick_2->GetValue());
- $this->Ticket_Pick_3->SetValue($this->DataSource->Ticket_Pick_3->GetValue());
- $this->Ticket_Pick_4->SetValue($this->DataSource->Ticket_Pick_4->GetValue());
- $this->Ticket_Show_1->SetValue($this->DataSource->Ticket_Show_1->GetValue());
- $this->Ticket_Show_2->SetValue($this->DataSource->Ticket_Show_2->GetValue());
- $this->Ticket_Show_3->SetValue($this->DataSource->Ticket_Show_3->GetValue());
- $this->Ticket_Show_4->SetValue($this->DataSource->Ticket_Show_4->GetValue());
- $this->Ticket_SerialNumber->SetValue($this->DataSource->Ticket_SerialNumber->GetValue());
- $this->Ticket_Played->SetValue($this->DataSource->Ticket_Played->GetValue());
- $this->Ticket_Winner->SetValue($this->DataSource->Ticket_Winner->GetValue());
- $this->Ticket_IPAddress->SetValue($this->DataSource->Ticket_IPAddress->GetValue());
- }
- } else {
- $this->EditMode = false;
- }
- }
-
- if($this->FormSubmitted || $this->CheckErrors()) {
- $Error = "";
- $Error = ComposeStrings($Error, $this->Ticket_Email_Address->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_DrawDate->Errors->ToString());
- $Error = ComposeStrings($Error, $this->DatePicker_Ticket_DrawDate->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Number_1->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Number_2->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Pick_1->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Pick_2->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Pick_3->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Pick_4->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Show_1->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Show_2->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Show_3->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Show_4->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_SerialNumber->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Played->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_Winner->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Ticket_IPAddress->Errors->ToString());
- $Error = ComposeStrings($Error, $this->Errors->ToString());
- $Error = ComposeStrings($Error, $this->DataSource->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", !$CCSUseAmp ? $this->HTMLFormAction : str_replace("&", "&", $this->HTMLFormAction));
- $Tpl->SetVar("HTMLFormName", $this->ComponentName);
- $Tpl->SetVar("HTMLFormEnctype", $this->FormEnctype);
- $this->Button_Insert->Visible = !$this->EditMode && $this->InsertAllowed;
- $this->Button_Update->Visible = $this->EditMode && $this->UpdateAllowed;
- $this->Button_Delete->Visible = $this->EditMode && $this->DeleteAllowed;
-
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
- $this->Attributes->Show();
- if(!$this->Visible) {
- $Tpl->block_path = $ParentPath;
- return;
- }
-
- $this->Ticket_Email_Address->Show();
- $this->Ticket_DrawDate->Show();
- $this->DatePicker_Ticket_DrawDate->Show();
- $this->Ticket_Number_1->Show();
- $this->Ticket_Number_2->Show();
- $this->Ticket_Pick_1->Show();
- $this->Ticket_Pick_2->Show();
- $this->Ticket_Pick_3->Show();
- $this->Ticket_Pick_4->Show();
- $this->Ticket_Show_1->Show();
- $this->Ticket_Show_2->Show();
- $this->Ticket_Show_3->Show();
- $this->Ticket_Show_4->Show();
- $this->Button_Insert->Show();
- $this->Button_Update->Show();
- $this->Button_Delete->Show();
- $this->Ticket_SerialNumber->Show();
- $this->Ticket_Played->Show();
- $this->Ticket_Winner->Show();
- $this->Ticket_IPAddress->Show();
- $Tpl->parse();
- $Tpl->block_path = $ParentPath;
- $this->DataSource->close();
- }
- //End Show Method
-
- } //End EditTickets Class @2-FCB6E20C
-
- class clsEditTicketsDataSource extends clsDBConnection { //EditTicketsDataSource Class @2-E9D4C3E8
-
- //DataSource Variables @2-42E038EB
- public $Parent = "";
- public $CCSEvents = "";
- public $CCSEventResult;
- public $ErrorBlock;
- public $CmdExecution;
-
- public $InsertParameters;
- public $UpdateParameters;
- public $DeleteParameters;
- public $wp;
- public $AllParametersSet;
-
-
- // Datasource fields
- public $Ticket_Email_Address;
- public $Ticket_DrawDate;
- public $Ticket_Number_1;
- public $Ticket_Number_2;
- public $Ticket_Pick_1;
- public $Ticket_Pick_2;
- public $Ticket_Pick_3;
- public $Ticket_Pick_4;
- public $Ticket_Show_1;
- public $Ticket_Show_2;
- public $Ticket_Show_3;
- public $Ticket_Show_4;
- public $Ticket_SerialNumber;
- public $Ticket_Played;
- public $Ticket_Winner;
- public $Ticket_IPAddress;
- //End DataSource Variables
-
- //DataSourceClass_Initialize Event @2-D798E3AA
- function clsEditTicketsDataSource(& $Parent)
- {
- $this->Parent = & $Parent;
- $this->ErrorBlock = "Record EditTickets/Error";
- $this->Initialize();
- $this->Ticket_Email_Address = new clsField("Ticket_Email_Address", ccsText, "");
-
- $this->Ticket_DrawDate = new clsField("Ticket_DrawDate", ccsDate, array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"));
-
- $this->Ticket_Number_1 = new clsField("Ticket_Number_1", ccsInteger, "");
-
- $this->Ticket_Number_2 = new clsField("Ticket_Number_2", ccsInteger, "");
-
- $this->Ticket_Pick_1 = new clsField("Ticket_Pick_1", ccsInteger, "");
-
- $this->Ticket_Pick_2 = new clsField("Ticket_Pick_2", ccsInteger, "");
-
- $this->Ticket_Pick_3 = new clsField("Ticket_Pick_3", ccsInteger, "");
-
- $this->Ticket_Pick_4 = new clsField("Ticket_Pick_4", ccsInteger, "");
-
- $this->Ticket_Show_1 = new clsField("Ticket_Show_1", ccsText, "");
-
- $this->Ticket_Show_2 = new clsField("Ticket_Show_2", ccsText, "");
-
- $this->Ticket_Show_3 = new clsField("Ticket_Show_3", ccsText, "");
-
- $this->Ticket_Show_4 = new clsField("Ticket_Show_4", ccsText, "");
-
- $this->Ticket_SerialNumber = new clsField("Ticket_SerialNumber", ccsText, "");
-
- $this->Ticket_Played = new clsField("Ticket_Played", ccsText, "");
-
- $this->Ticket_Winner = new clsField("Ticket_Winner", ccsText, "");
-
- $this->Ticket_IPAddress = new clsField("Ticket_IPAddress", ccsText, "");
-
-
- }
- //End DataSourceClass_Initialize Event
-
- //Prepare Method @2-32E90A35
- function Prepare()
- {
- global $CCSLocales;
- global $DefaultDateFormat;
- $this->wp = new clsSQLParameters($this->ErrorBlock);
- $this->wp->AddParameter("1", "urlTicket_ID", ccsInteger, "", "", $this->Parameters["urlTicket_ID"], "", false);
- $this->AllParametersSet = $this->wp->AllParamsSet();
- $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "Ticket_ID", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
- $this->Where =
- $this->wp->Criterion[1];
- }
- //End Prepare Method
-
- //Open Method @2-04C42337
- function Open()
- {
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
- $this->SQL = "SELECT INET_NTOA(Ticket_IPAddress) AS Display_Ticket_IPAddress, Ticket_ID, Ticket_SerialNumber, Ticket_Email_Address, Ticket_IPAddress,\n\n" .
- "Ticket_DrawDate, Ticket_Number_1, Ticket_Number_2, Ticket_Pick_1, Ticket_Pick_2, Ticket_Pick_3, Ticket_Pick_4, Ticket_Show_1,\n\n" .
- "Ticket_Show_2, Ticket_Show_3, Ticket_Show_4, Ticket_Played, Ticket_Winner, Ticket_Archived \n\n" .
- "FROM Tickets {SQL_Where} {SQL_OrderBy}";
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
- $this->PageSize = 1;
- $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
- }
- //End Open Method
-
- //SetValues Method @2-B1817024
- function SetValues()
- {
- $this->Ticket_Email_Address->SetDBValue($this->f("Ticket_Email_Address"));
- $this->Ticket_DrawDate->SetDBValue(trim($this->f("Ticket_DrawDate")));
- $this->Ticket_Number_1->SetDBValue(trim($this->f("Ticket_Number_1")));
- $this->Ticket_Number_2->SetDBValue(trim($this->f("Ticket_Number_2")));
- $this->Ticket_Pick_1->SetDBValue(trim($this->f("Ticket_Pick_1")));
- $this->Ticket_Pick_2->SetDBValue(trim($this->f("Ticket_Pick_2")));
- $this->Ticket_Pick_3->SetDBValue(trim($this->f("Ticket_Pick_3")));
- $this->Ticket_Pick_4->SetDBValue(trim($this->f("Ticket_Pick_4")));
- $this->Ticket_Show_1->SetDBValue($this->f("Ticket_Show_1"));
- $this->Ticket_Show_2->SetDBValue($this->f("Ticket_Show_2"));
- $this->Ticket_Show_3->SetDBValue($this->f("Ticket_Show_3"));
- $this->Ticket_Show_4->SetDBValue($this->f("Ticket_Show_4"));
- $this->Ticket_SerialNumber->SetDBValue($this->f("Ticket_SerialNumber"));
- $this->Ticket_Played->SetDBValue($this->f("Ticket_Played"));
- $this->Ticket_Winner->SetDBValue($this->f("Ticket_Winner"));
- $this->Ticket_IPAddress->SetDBValue($this->f("Display_Ticket_IPAddress"));
- }
- //End SetValues Method
-
- //Insert Method @2-0DB85A9D
- function Insert()
- {
- global $CCSLocales;
- global $DefaultDateFormat;
- $this->CmdExecution = true;
- $this->cp["Ticket_Email_Address"] = new clsSQLParameter("ctrlTicket_Email_Address", ccsText, "", "", $this->Ticket_Email_Address->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_DrawDate"] = new clsSQLParameter("ctrlTicket_DrawDate", ccsDate, array("GeneralDate"), array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"), $this->Ticket_DrawDate->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Number_1"] = new clsSQLParameter("ctrlTicket_Number_1", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Number_1->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Number_2"] = new clsSQLParameter("ctrlTicket_Number_2", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Number_2->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Pick_1"] = new clsSQLParameter("ctrlTicket_Pick_1", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Pick_1->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Pick_2"] = new clsSQLParameter("ctrlTicket_Pick_2", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Pick_2->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Pick_3"] = new clsSQLParameter("ctrlTicket_Pick_3", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Pick_3->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Pick_4"] = new clsSQLParameter("ctrlTicket_Pick_4", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Pick_4->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Show_1"] = new clsSQLParameter("ctrlTicket_Show_1", ccsText, "", "", $this->Ticket_Show_1->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Show_2"] = new clsSQLParameter("ctrlTicket_Show_2", ccsText, "", "", $this->Ticket_Show_2->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Show_3"] = new clsSQLParameter("ctrlTicket_Show_3", ccsText, "", "", $this->Ticket_Show_3->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Show_4"] = new clsSQLParameter("ctrlTicket_Show_4", ccsText, "", "", $this->Ticket_Show_4->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_SerialNumber"] = new clsSQLParameter("ctrlTicket_SerialNumber", ccsText, "", "", $this->Ticket_SerialNumber->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Played"] = new clsSQLParameter("ctrlTicket_Played", ccsText, "", "", $this->Ticket_Played->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Winner"] = new clsSQLParameter("ctrlTicket_Winner", ccsText, "", "", $this->Ticket_Winner->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_IPAddress"] = new clsSQLParameter("ctrlTicket_IPAddress", ccsText, "", "", $this->Ticket_IPAddress->GetValue(true), "", false, $this->ErrorBlock);
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent);
- if (!is_null($this->cp["Ticket_Email_Address"]->GetValue()) and !strlen($this->cp["Ticket_Email_Address"]->GetText()) and !is_bool($this->cp["Ticket_Email_Address"]->GetValue()))
- $this->cp["Ticket_Email_Address"]->SetValue($this->Ticket_Email_Address->GetValue(true));
- if (!is_null($this->cp["Ticket_DrawDate"]->GetValue()) and !strlen($this->cp["Ticket_DrawDate"]->GetText()) and !is_bool($this->cp["Ticket_DrawDate"]->GetValue()))
- $this->cp["Ticket_DrawDate"]->SetValue($this->Ticket_DrawDate->GetValue(true));
- if (!is_null($this->cp["Ticket_Number_1"]->GetValue()) and !strlen($this->cp["Ticket_Number_1"]->GetText()) and !is_bool($this->cp["Ticket_Number_1"]->GetValue()))
- $this->cp["Ticket_Number_1"]->SetValue($this->Ticket_Number_1->GetValue(true));
- if (!is_null($this->cp["Ticket_Number_2"]->GetValue()) and !strlen($this->cp["Ticket_Number_2"]->GetText()) and !is_bool($this->cp["Ticket_Number_2"]->GetValue()))
- $this->cp["Ticket_Number_2"]->SetValue($this->Ticket_Number_2->GetValue(true));
- if (!is_null($this->cp["Ticket_Pick_1"]->GetValue()) and !strlen($this->cp["Ticket_Pick_1"]->GetText()) and !is_bool($this->cp["Ticket_Pick_1"]->GetValue()))
- $this->cp["Ticket_Pick_1"]->SetValue($this->Ticket_Pick_1->GetValue(true));
- if (!is_null($this->cp["Ticket_Pick_2"]->GetValue()) and !strlen($this->cp["Ticket_Pick_2"]->GetText()) and !is_bool($this->cp["Ticket_Pick_2"]->GetValue()))
- $this->cp["Ticket_Pick_2"]->SetValue($this->Ticket_Pick_2->GetValue(true));
- if (!is_null($this->cp["Ticket_Pick_3"]->GetValue()) and !strlen($this->cp["Ticket_Pick_3"]->GetText()) and !is_bool($this->cp["Ticket_Pick_3"]->GetValue()))
- $this->cp["Ticket_Pick_3"]->SetValue($this->Ticket_Pick_3->GetValue(true));
- if (!is_null($this->cp["Ticket_Pick_4"]->GetValue()) and !strlen($this->cp["Ticket_Pick_4"]->GetText()) and !is_bool($this->cp["Ticket_Pick_4"]->GetValue()))
- $this->cp["Ticket_Pick_4"]->SetValue($this->Ticket_Pick_4->GetValue(true));
- if (!is_null($this->cp["Ticket_Show_1"]->GetValue()) and !strlen($this->cp["Ticket_Show_1"]->GetText()) and !is_bool($this->cp["Ticket_Show_1"]->GetValue()))
- $this->cp["Ticket_Show_1"]->SetValue($this->Ticket_Show_1->GetValue(true));
- if (!is_null($this->cp["Ticket_Show_2"]->GetValue()) and !strlen($this->cp["Ticket_Show_2"]->GetText()) and !is_bool($this->cp["Ticket_Show_2"]->GetValue()))
- $this->cp["Ticket_Show_2"]->SetValue($this->Ticket_Show_2->GetValue(true));
- if (!is_null($this->cp["Ticket_Show_3"]->GetValue()) and !strlen($this->cp["Ticket_Show_3"]->GetText()) and !is_bool($this->cp["Ticket_Show_3"]->GetValue()))
- $this->cp["Ticket_Show_3"]->SetValue($this->Ticket_Show_3->GetValue(true));
- if (!is_null($this->cp["Ticket_Show_4"]->GetValue()) and !strlen($this->cp["Ticket_Show_4"]->GetText()) and !is_bool($this->cp["Ticket_Show_4"]->GetValue()))
- $this->cp["Ticket_Show_4"]->SetValue($this->Ticket_Show_4->GetValue(true));
- if (!is_null($this->cp["Ticket_SerialNumber"]->GetValue()) and !strlen($this->cp["Ticket_SerialNumber"]->GetText()) and !is_bool($this->cp["Ticket_SerialNumber"]->GetValue()))
- $this->cp["Ticket_SerialNumber"]->SetValue($this->Ticket_SerialNumber->GetValue(true));
- if (!is_null($this->cp["Ticket_Played"]->GetValue()) and !strlen($this->cp["Ticket_Played"]->GetText()) and !is_bool($this->cp["Ticket_Played"]->GetValue()))
- $this->cp["Ticket_Played"]->SetValue($this->Ticket_Played->GetValue(true));
- if (!is_null($this->cp["Ticket_Winner"]->GetValue()) and !strlen($this->cp["Ticket_Winner"]->GetText()) and !is_bool($this->cp["Ticket_Winner"]->GetValue()))
- $this->cp["Ticket_Winner"]->SetValue($this->Ticket_Winner->GetValue(true));
- if (!is_null($this->cp["Ticket_IPAddress"]->GetValue()) and !strlen($this->cp["Ticket_IPAddress"]->GetText()) and !is_bool($this->cp["Ticket_IPAddress"]->GetValue()))
- $this->cp["Ticket_IPAddress"]->SetValue($this->Ticket_IPAddress->GetValue(true));
- $this->SQL = "INSERT INTO Tickets(Ticket_Email_Address, Ticket_DrawDate, Ticket_Number_1, Ticket_Number_2, Ticket_Pick_1, Ticket_Pick_2, Ticket_Pick_3, Ticket_Pick_4, Ticket_Show_1, Ticket_Show_2, Ticket_Show_3, Ticket_Show_4, Ticket_SerialNumber, Ticket_Played, Ticket_Winner, Ticket_IPAddress) VALUES('" . $this->SQLValue($this->cp["Ticket_Email_Address"]->GetDBValue(), ccsText) . "', '" . $this->SQLValue($this->cp["Ticket_DrawDate"]->GetDBValue(), ccsDate) . "', " . $this->SQLValue($this->cp["Ticket_Number_1"]->GetDBValue(), ccsInteger) . ", " . $this->SQLValue($this->cp["Ticket_Number_2"]->GetDBValue(), ccsInteger) . ", " . $this->SQLValue($this->cp["Ticket_Pick_1"]->GetDBValue(), ccsInteger) . ", " . $this->SQLValue($this->cp["Ticket_Pick_2"]->GetDBValue(), ccsInteger) . ", " . $this->SQLValue($this->cp["Ticket_Pick_3"]->GetDBValue(), ccsInteger) . ", " . $this->SQLValue($this->cp["Ticket_Pick_4"]->GetDBValue(), ccsInteger) . ", '" . $this->SQLValue($this->cp["Ticket_Show_1"]->GetDBValue(), ccsText) . "', '" . $this->SQLValue($this->cp["Ticket_Show_2"]->GetDBValue(), ccsText) . "', '" . $this->SQLValue($this->cp["Ticket_Show_3"]->GetDBValue(), ccsText) . "', '" . $this->SQLValue($this->cp["Ticket_Show_4"]->GetDBValue(), ccsText) . "', '" . $this->SQLValue($this->cp["Ticket_SerialNumber"]->GetDBValue(), ccsText) . "', '" . $this->SQLValue($this->cp["Ticket_Played"]->GetDBValue(), ccsText) . "', '" . $this->SQLValue($this->cp["Ticket_Winner"]->GetDBValue(), ccsText) . "', INET_ATON(" . $this->SQLValue($this->cp["Ticket_IPAddress"]->GetDBValue(), ccsText) . "))";
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteInsert", $this->Parent);
- if($this->Errors->Count() == 0 && $this->CmdExecution) {
- $this->query($this->SQL);
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteInsert", $this->Parent);
- }
- }
- //End Insert Method
-
- //Update Method @2-D0213EDC
- function Update()
- {
- global $CCSLocales;
- global $DefaultDateFormat;
- $this->CmdExecution = true;
- $Where = "";
- $this->cp["Ticket_Email_Address"] = new clsSQLParameter("ctrlTicket_Email_Address", ccsText, "", "", $this->Ticket_Email_Address->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_DrawDate"] = new clsSQLParameter("ctrlTicket_DrawDate", ccsDate, array("GeneralDate"), array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"), $this->Ticket_DrawDate->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Number_1"] = new clsSQLParameter("ctrlTicket_Number_1", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Number_1->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Number_2"] = new clsSQLParameter("ctrlTicket_Number_2", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Number_2->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Pick_1"] = new clsSQLParameter("ctrlTicket_Pick_1", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Pick_1->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Pick_2"] = new clsSQLParameter("ctrlTicket_Pick_2", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Pick_2->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Pick_3"] = new clsSQLParameter("ctrlTicket_Pick_3", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Pick_3->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Pick_4"] = new clsSQLParameter("ctrlTicket_Pick_4", ccsInteger, array(False, 0, Null, Null, False, "", "", 1, True, ""), "", $this->Ticket_Pick_4->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Show_1"] = new clsSQLParameter("ctrlTicket_Show_1", ccsText, "", "", $this->Ticket_Show_1->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Show_2"] = new clsSQLParameter("ctrlTicket_Show_2", ccsText, "", "", $this->Ticket_Show_2->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Show_3"] = new clsSQLParameter("ctrlTicket_Show_3", ccsText, "", "", $this->Ticket_Show_3->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Show_4"] = new clsSQLParameter("ctrlTicket_Show_4", ccsText, "", "", $this->Ticket_Show_4->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_SerialNumber"] = new clsSQLParameter("ctrlTicket_SerialNumber", ccsText, "", "", $this->Ticket_SerialNumber->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Played"] = new clsSQLParameter("ctrlTicket_Played", ccsText, "", "", $this->Ticket_Played->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_Winner"] = new clsSQLParameter("ctrlTicket_Winner", ccsText, "", "", $this->Ticket_Winner->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_IPAddress"] = new clsSQLParameter("ctrlTicket_IPAddress", ccsText, "", "", $this->Ticket_IPAddress->GetValue(true), "", false, $this->ErrorBlock);
- $this->cp["Ticket_ID"] = new clsSQLParameter("urlTicket_ID", ccsInteger, "", "", CCGetFromGet("Ticket_ID", NULL), 0, false, $this->ErrorBlock);
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent);
- if (!is_null($this->cp["Ticket_Email_Address"]->GetValue()) and !strlen($this->cp["Ticket_Email_Address"]->GetText()) and !is_bool($this->cp["Ticket_Email_Address"]->GetValue()))
- $this->cp["Ticket_Email_Address"]->SetValue($this->Ticket_Email_Address->GetValue(true));
- if (!is_null($this->cp["Ticket_DrawDate"]->GetValue()) and !strlen($this->cp["Ticket_DrawDate"]->GetText()) and !is_bool($this->cp["Ticket_DrawDate"]->GetValue()))
- $this->cp["Ticket_DrawDate"]->SetValue($this->Ticket_DrawDate->GetValue(true));
- if (!is_null($this->cp["Ticket_Number_1"]->GetValue()) and !strlen($this->cp["Ticket_Number_1"]->GetText()) and !is_bool($this->cp["Ticket_Number_1"]->GetValue()))
- $this->cp["Ticket_Number_1"]->SetValue($this->Ticket_Number_1->GetValue(true));
- if (!is_null($this->cp["Ticket_Number_2"]->GetValue()) and !strlen($this->cp["Ticket_Number_2"]->GetText()) and !is_bool($this->cp["Ticket_Number_2"]->GetValue()))
- $this->cp["Ticket_Number_2"]->SetValue($this->Ticket_Number_2->GetValue(true));
- if (!is_null($this->cp["Ticket_Pick_1"]->GetValue()) and !strlen($this->cp["Ticket_Pick_1"]->GetText()) and !is_bool($this->cp["Ticket_Pick_1"]->GetValue()))
- $this->cp["Ticket_Pick_1"]->SetValue($this->Ticket_Pick_1->GetValue(true));
- if (!is_null($this->cp["Ticket_Pick_2"]->GetValue()) and !strlen($this->cp["Ticket_Pick_2"]->GetText()) and !is_bool($this->cp["Ticket_Pick_2"]->GetValue()))
- $this->cp["Ticket_Pick_2"]->SetValue($this->Ticket_Pick_2->GetValue(true));
- if (!is_null($this->cp["Ticket_Pick_3"]->GetValue()) and !strlen($this->cp["Ticket_Pick_3"]->GetText()) and !is_bool($this->cp["Ticket_Pick_3"]->GetValue()))
- $this->cp["Ticket_Pick_3"]->SetValue($this->Ticket_Pick_3->GetValue(true));
- if (!is_null($this->cp["Ticket_Pick_4"]->GetValue()) and !strlen($this->cp["Ticket_Pick_4"]->GetText()) and !is_bool($this->cp["Ticket_Pick_4"]->GetValue()))
- $this->cp["Ticket_Pick_4"]->SetValue($this->Ticket_Pick_4->GetValue(true));
- if (!is_null($this->cp["Ticket_Show_1"]->GetValue()) and !strlen($this->cp["Ticket_Show_1"]->GetText()) and !is_bool($this->cp["Ticket_Show_1"]->GetValue()))
- $this->cp["Ticket_Show_1"]->SetValue($this->Ticket_Show_1->GetValue(true));
- if (!is_null($this->cp["Ticket_Show_2"]->GetValue()) and !strlen($this->cp["Ticket_Show_2"]->GetText()) and !is_bool($this->cp["Ticket_Show_2"]->GetValue()))
- $this->cp["Ticket_Show_2"]->SetValue($this->Ticket_Show_2->GetValue(true));
- if (!is_null($this->cp["Ticket_Show_3"]->GetValue()) and !strlen($this->cp["Ticket_Show_3"]->GetText()) and !is_bool($this->cp["Ticket_Show_3"]->GetValue()))
- $this->cp["Ticket_Show_3"]->SetValue($this->Ticket_Show_3->GetValue(true));
- if (!is_null($this->cp["Ticket_Show_4"]->GetValue()) and !strlen($this->cp["Ticket_Show_4"]->GetText()) and !is_bool($this->cp["Ticket_Show_4"]->GetValue()))
- $this->cp["Ticket_Show_4"]->SetValue($this->Ticket_Show_4->GetValue(true));
- if (!is_null($this->cp["Ticket_SerialNumber"]->GetValue()) and !strlen($this->cp["Ticket_SerialNumber"]->GetText()) and !is_bool($this->cp["Ticket_SerialNumber"]->GetValue()))
- $this->cp["Ticket_SerialNumber"]->SetValue($this->Ticket_SerialNumber->GetValue(true));
- if (!is_null($this->cp["Ticket_Played"]->GetValue()) and !strlen($this->cp["Ticket_Played"]->GetText()) and !is_bool($this->cp["Ticket_Played"]->GetValue()))
- $this->cp["Ticket_Played"]->SetValue($this->Ticket_Played->GetValue(true));
- if (!is_null($this->cp["Ticket_Winner"]->GetValue()) and !strlen($this->cp["Ticket_Winner"]->GetText()) and !is_bool($this->cp["Ticket_Winner"]->GetValue()))
- $this->cp["Ticket_Winner"]->SetValue($this->Ticket_Winner->GetValue(true));
- if (!is_null($this->cp["Ticket_IPAddress"]->GetValue()) and !strlen($this->cp["Ticket_IPAddress"]->GetText()) and !is_bool($this->cp["Ticket_IPAddress"]->GetValue()))
- $this->cp["Ticket_IPAddress"]->SetValue($this->Ticket_IPAddress->GetValue(true));
- if (!is_null($this->cp["Ticket_ID"]->GetValue()) and !strlen($this->cp["Ticket_ID"]->GetText()) and !is_bool($this->cp["Ticket_ID"]->GetValue()))
- $this->cp["Ticket_ID"]->SetText(CCGetFromGet("Ticket_ID", NULL));
- if (!strlen($this->cp["Ticket_ID"]->GetText()) and !is_bool($this->cp["Ticket_ID"]->GetValue(true)))
- $this->cp["Ticket_ID"]->SetText(0);
- $this->SQL = "UPDATE Tickets SET Ticket_Email_Address='" . $this->SQLValue($this->cp["Ticket_Email_Address"]->GetDBValue(), ccsText) . "', Ticket_DrawDate='" . $this->SQLValue($this->cp["Ticket_DrawDate"]->GetDBValue(), ccsDate) . "', Ticket_Number_1=" . $this->SQLValue($this->cp["Ticket_Number_1"]->GetDBValue(), ccsInteger) . ", Ticket_Number_2=" . $this->SQLValue($this->cp["Ticket_Number_2"]->GetDBValue(), ccsInteger) . ", Ticket_Pick_1=" . $this->SQLValue($this->cp["Ticket_Pick_1"]->GetDBValue(), ccsInteger) . ", Ticket_Pick_2=" . $this->SQLValue($this->cp["Ticket_Pick_2"]->GetDBValue(), ccsInteger) . ", Ticket_Pick_3=" . $this->SQLValue($this->cp["Ticket_Pick_3"]->GetDBValue(), ccsInteger) . ", Ticket_Pick_4=" . $this->SQLValue($this->cp["Ticket_Pick_4"]->GetDBValue(), ccsInteger) . ", Ticket_Show_1='" . $this->SQLValue($this->cp["Ticket_Show_1"]->GetDBValue(), ccsText) . "', Ticket_Show_2='" . $this->SQLValue($this->cp["Ticket_Show_2"]->GetDBValue(), ccsText) . "', Ticket_Show_3='" . $this->SQLValue($this->cp["Ticket_Show_3"]->GetDBValue(), ccsText) . "', Ticket_Show_4='" . $this->SQLValue($this->cp["Ticket_Show_4"]->GetDBValue(), ccsText) . "', Ticket_SerialNumber='" . $this->SQLValue($this->cp["Ticket_SerialNumber"]->GetDBValue(), ccsText) . "', Ticket_Played='" . $this->SQLValue($this->cp["Ticket_Played"]->GetDBValue(), ccsText) . "', Ticket_Winner='" . $this->SQLValue($this->cp["Ticket_Winner"]->GetDBValue(), ccsText) . "', Ticket_IPAddress=INET_ATON('" . $this->SQLValue($this->cp["Ticket_IPAddress"]->GetDBValue(), ccsText) . "') WHERE Ticket_ID = " . $this->SQLValue($this->cp["Ticket_ID"]->GetDBValue(), ccsInteger) . "";
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate", $this->Parent);
- if($this->Errors->Count() == 0 && $this->CmdExecution) {
- $this->query($this->SQL);
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteUpdate", $this->Parent);
- }
- }
- //End Update Method
-
- //Delete Method @2-17C78D36
- function Delete()
- {
- global $CCSLocales;
- global $DefaultDateFormat;
- $this->CmdExecution = true;
- $Where = "";
- $wp = new clsSQLParameters($this->ErrorBlock);
- $wp->AddParameter("1", "urlTicket_ID", ccsInteger, "", "", CCGetFromGet("Ticket_ID", NULL), "", false);
- if(!$wp->AllParamsSet()) {
- $this->Errors->addError($CCSLocales->GetText("CCS_CustomOperationError_MissingParameters"));
- }
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent);
- $wp->Criterion[1] = $wp->Operation(opEqual, "Ticket_ID", $wp->GetDBValue("1"), $this->ToSQL($wp->GetDBValue("1"), ccsInteger),false);
- $Where =
- $wp->Criterion[1];
- $this->SQL = "DELETE FROM Tickets";
- $this->SQL = CCBuildSQL($this->SQL, $Where, "");
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteDelete", $this->Parent);
- if($this->Errors->Count() == 0 && $this->CmdExecution) {
- $this->query($this->SQL);
- $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteDelete", $this->Parent);
- }
- }
- //End Delete Method
-
- } //End EditTicketsDataSource Class @2-FCB6E20C
-
- //Include Page implementation @27-22C68225
- include_once(RelativePath . "/admin/footer.php");
- //End Include Page implementation
-
- //Initialize Page @1-5076FEA5
- // Variables
- $FileName = "";
- $Redirect = "";
- $Tpl = "";
- $TemplateFileName = "";
- $BlockToParse = "";
- $ComponentName = "";
- $Attributes = "";
-
- // Events;
- $CCSEvents = "";
- $CCSEventResult = "";
- $TemplateSource = "";
-
- $FileName = FileName;
- $Redirect = "";
- $TemplateFileName = "edit_tickets.html";
- $BlockToParse = "main";
- $TemplateEncoding = "CP1252";
- $ContentType = "text/html";
- $PathToRoot = "../";
- //End Initialize Page
-
- //Authenticate User @1-9740DC77
- CCSecurityRedirect("Administrator", "login.php");
- //End Authenticate User
-
- //Before Initialize @1-E870CEBC
- $CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage);
- //End Before Initialize
-
- //Initialize Objects @1-183E4000
- $DBConnection = new clsDBConnection();
- $MainPage->Connections["Connection"] = & $DBConnection;
- $Attributes = new clsAttributes("page:");
- $Attributes->SetValue("pathToRoot", $PathToRoot);
- $MainPage->Attributes = & $Attributes;
-
- // Controls
- $header = new clsheader("", "header", $MainPage);
- $header->Initialize();
- $EditTickets = new clsRecordEditTickets("", $MainPage);
- $footer = new clsfooter("", "footer", $MainPage);
- $footer->Initialize();
- $MainPage->header = & $header;
- $MainPage->EditTickets = & $EditTickets;
- $MainPage->footer = & $footer;
- $EditTickets->Initialize();
-
- $CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
-
- if ($Charset) {
- header("Content-Type: " . $ContentType . "; charset=" . $Charset);
- } else {
- header("Content-Type: " . $ContentType);
- }
- //End Initialize Objects
-
- //Initialize HTML Template @1-C455ECEF
- $CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
- $Tpl = new clsTemplate();
- if (strlen($TemplateSource)) {
- $Tpl->LoadTemplateFromStr($TemplateSource, $BlockToParse, "CP1252");
- } else {
- $Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "CP1252");
- }
- $Tpl->SetVar("CCS_PathToRoot", $PathToRoot);
- $Tpl->block_path = "/$BlockToParse";
- $CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
- $Attributes->SetValue("pathToRoot", "../");
- $Attributes->Show();
- //End Initialize HTML Template
-
- //Execute Components @1-964A7E71
- $footer->Operations();
- $EditTickets->Operation();
- $header->Operations();
- //End Execute Components
-
- //Go to destination page @1-494BF165
- if($Redirect)
- {
- $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
- $DBConnection->close();
- header("Location: " . $Redirect);
- $header->Class_Terminate();
- unset($header);
- unset($EditTickets);
- $footer->Class_Terminate();
- unset($footer);
- unset($Tpl);
- exit;
- }
- //End Go to destination page
-
- //Show Page @1-940FE9EC
- $header->Show();
- $EditTickets->Show();
- $footer->Show();
- $Tpl->block_path = "";
- $Tpl->Parse($BlockToParse, false);
- if (!isset($main_block)) $main_block = $Tpl->GetVar($BlockToParse);
- $CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
- if ($CCSEventResult) echo $main_block;
- //End Show Page
-
- //Unload Page @1-7AC3C49E
- $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
- $DBConnection->close();
- $header->Class_Terminate();
- unset($header);
- unset($EditTickets);
- $footer->Class_Terminate();
- unset($footer);
- unset($Tpl);
- //End Unload Page
-
-
- ?>