Commits

Your PHP Pro  committed d8870bf

Add Ticket_IPAddress field - Add in email address checking - Add in ip address checking - Fix various bugs/issues with admin area - Update version number to 4.02

  • Participants
  • Parent commits 794fd70

Comments (0)

Files changed (69)

File Admin_Winning_Email.txt

 
 Ticket Serial#: {Ticket_SerialNumber}
 Email Addr: {Ticket_Email_Address}
+IP Address: {Ticket_IPAddress}
 DrawDate: {Ticket_DrawDate}
 Number_1: {Ticket_Number_1}
 Number_2: {Ticket_Number_2}

File CalendarNavigator.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #
 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File ClientI18N.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #
 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File Navigator.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File Services.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #
 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File Template.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/dailystats.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/dailystats_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/delete_action.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/delete_action_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/delete_played_tickets.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/delete_prizes.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/delete_tickets.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/delete_tickets_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/delete_unplayed_tickets.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/delete_users.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/delete_winning_tickets.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/edit_prize.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #
     // Class variables
 //End Variables
 
-//Class_Initialize Event @2-4330CE47
+//Class_Initialize Event @2-A43EF56A
     function clsRecordEditPrizes($RelativePath, & $Parent)
     {
 
             $Method = $this->FormSubmitted ? ccsPost : ccsGet;
             $this->Prize_Name = new clsControl(ccsTextBox, "Prize_Name", "Name", ccsText, "", CCGetRequestParam("Prize_Name", $Method, NULL), $this);
             $this->Prize_Name->Required = true;
-            $this->Prize_DisplayName = new clsControl(ccsTextBox, "Prize_DisplayName", "Displayname", ccsText, "", CCGetRequestParam("Prize_DisplayName", $Method, NULL), $this);
+            $this->Prize_DisplayName = new clsControl(ccsTextBox, "Prize_DisplayName", "Display Name", ccsText, "", CCGetRequestParam("Prize_DisplayName", $Method, NULL), $this);
             $this->Prize_DisplayName->Required = true;
-            $this->Prize_ClaimURL = new clsControl(ccsTextBox, "Prize_ClaimURL", "Claimurl", ccsText, "", CCGetRequestParam("Prize_ClaimURL", $Method, NULL), $this);
-            $this->Prize_ClaimText = new clsControl(ccsTextArea, "Prize_ClaimText", "Claimtext", ccsMemo, "", CCGetRequestParam("Prize_ClaimText", $Method, NULL), $this);
-            $this->Prize_DisplayURLOrText = new clsControl(ccsRadioButton, "Prize_DisplayURLOrText", "Display Url Or Text", ccsText, "", CCGetRequestParam("Prize_DisplayURLOrText", $Method, NULL), $this);
+            $this->Prize_ClaimURL = new clsControl(ccsTextBox, "Prize_ClaimURL", "Claim URL", ccsText, "", CCGetRequestParam("Prize_ClaimURL", $Method, NULL), $this);
+            $this->Prize_ClaimText = new clsControl(ccsTextArea, "Prize_ClaimText", "Claim Text", ccsMemo, "", CCGetRequestParam("Prize_ClaimText", $Method, NULL), $this);
+            $this->Prize_DisplayURLOrText = new clsControl(ccsRadioButton, "Prize_DisplayURLOrText", "Display URL Or Text", ccsText, "", CCGetRequestParam("Prize_DisplayURLOrText", $Method, NULL), $this);
             $this->Prize_DisplayURLOrText->DSType = dsListOfValues;
             $this->Prize_DisplayURLOrText->Values = array(array("URL", "Display URL"), array("TEXT", "Display Text"));
             $this->Prize_DisplayURLOrText->HTML = true;
     }
 //End Class_Initialize Event
 
-//Initialize Method @2-B2F7DA96
+//Initialize Method @2-F5FEFCD8
     function Initialize()
     {
 
         if(!$this->Visible)
             return;
 
-        $this->DataSource->Parameters["urlprize_id"] = CCGetFromGet("prize_id", NULL);
+        $this->DataSource->Parameters["urlPrize_ID"] = CCGetFromGet("Prize_ID", NULL);
     }
 //End Initialize Method
 
     }
 //End CheckErrors Method
 
-//Operation Method @2-FAA9CE42
+//Operation Method @2-6D5441B0
     function Operation()
     {
         if(!$this->Visible)
                 $this->PressedButton = "Button_Delete";
             }
         }
-        $Redirect = "list_prize.php";
+        $Redirect = "list_prize.php" . "?" . CCGetQueryString("QueryString", array("ccsForm"));
         if($this->PressedButton == "Button_Delete") {
             if(!CCGetEvent($this->Button_Delete->CCSEvents, "OnClick", $this->Button_Delete) || !$this->DeleteRow()) {
                 $Redirect = "";
         $this->ErrorBlock = "Record EditPrizes/Error";
         $this->Initialize();
         $this->Prize_Name = new clsField("Prize_Name", ccsText, "");
-
+        
         $this->Prize_DisplayName = new clsField("Prize_DisplayName", ccsText, "");
-
+        
         $this->Prize_ClaimURL = new clsField("Prize_ClaimURL", ccsText, "");
-
+        
         $this->Prize_ClaimText = new clsField("Prize_ClaimText", ccsMemo, "");
-
+        
         $this->Prize_DisplayURLOrText = new clsField("Prize_DisplayURLOrText", ccsText, "");
-
+        
         $this->Prize_Credits = new clsField("Prize_Credits", ccsInteger, "");
-
+        
         $this->Prize_Active = new clsField("Prize_Active", ccsText, "");
-
+        
 
         $this->InsertFields["Prize_Name"] = array("Name" => "Prize_Name", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
         $this->InsertFields["Prize_DisplayName"] = array("Name" => "Prize_DisplayName", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
     }
 //End DataSourceClass_Initialize Event
 
-//Prepare Method @2-10A54751
+//Prepare Method @2-4C463B7D
     function Prepare()
     {
         global $CCSLocales;
         global $DefaultDateFormat;
         $this->wp = new clsSQLParameters($this->ErrorBlock);
-        $this->wp->AddParameter("1", "urlprize_id", ccsInteger, "", "", $this->Parameters["urlprize_id"], "", false);
+        $this->wp->AddParameter("1", "urlPrize_ID", ccsInteger, "", "", $this->Parameters["urlPrize_ID"], "", false);
         $this->AllParametersSet = $this->wp->AllParamsSet();
-        $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "prize_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
-        $this->Where =
+        $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "Prize_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-83947ADE
+//Open Method @2-904683B3
     function Open()
     {
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
-        $this->SQL = "SELECT * \n\n" .
+        $this->SQL = "SELECT *, Prize_ID \n\n" .
         "FROM Prizes {SQL_Where} {SQL_OrderBy}";
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
         $this->PageSize = 1;
         $this->UpdateFields["Prize_Active"]["Value"] = $this->Prize_Active->GetDBValue(true);
         $this->SQL = CCBuildUpdate("Prizes", $this->UpdateFields, $this);
         $this->SQL .= strlen($this->Where) ? " WHERE " . $this->Where : $this->Where;
-        if (!strlen($this->Where) && $this->Errors->Count() == 0)
+        if (!strlen($this->Where) && $this->Errors->Count() == 0) 
             $this->Errors->addError($CCSLocales->GetText("CCS_CustomOperationError_MissingParameters"));
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate", $this->Parent);
         if($this->Errors->Count() == 0 && $this->CmdExecution) {
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent);
         $this->SQL = "DELETE FROM Prizes";
         $this->SQL = CCBuildSQL($this->SQL, $this->Where, "");
-        if (!strlen($this->Where) && $this->Errors->Count() == 0)
+        if (!strlen($this->Where) && $this->Errors->Count() == 0) 
             $this->Errors->addError($CCSLocales->GetText("CCS_CustomOperationError_MissingParameters"));
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteDelete", $this->Parent);
         if($this->Errors->Count() == 0 && $this->CmdExecution) {

File admin/edit_tickets.html

           <tr class="Controls">
             <th>Serial #&nbsp;</th>
  
-            <td><input name="{Ticket_SerialNumber_Name}" maxlength="13" value="{Ticket_SerialNumber}" size="13">&nbsp;</td>
+            <td><input name="{Ticket_SerialNumber_Name}" maxlength="13" value="{Ticket_SerialNumber}" size="15">&nbsp;</td>
           </tr>
  
           <tr class="Controls">
           </tr>
  
           <tr class="Controls">
+            <th>IP Address&nbsp;</th>
+ 
+            <td><input name="{Ticket_IPAddress_Name}" maxlength="15" value="{Ticket_IPAddress}" size="15">&nbsp;</td>
+          </tr>
+ 
+          <tr class="Controls">
             <th>Draw Date</th>
  
             <td><input name="{Ticket_DrawDate_Name}" maxlength="100" value="{Ticket_DrawDate}" size="21">

File admin/edit_tickets.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #
     // Class variables
 //End Variables
 
-//Class_Initialize Event @2-11200205
+//Class_Initialize Event @2-01C1789F
     function clsRecordEditTickets($RelativePath, & $Parent)
     {
 
             $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_SerialNumber", ccsText, "", CCGetRequestParam("Ticket_SerialNumber", $Method, NULL), $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_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 Initialize Method
 
-//Validate Method @2-3A3CEE3A
+//Validate Method @2-D20DC42B
     function Validate()
     {
         global $CCSLocales;
         $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_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-5FE0DE6B
+//CheckErrors Method @2-0CE4A6F3
     function CheckErrors()
     {
         $errors = false;
         $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-BE5FFDEB
+//Operation Method @2-475C577F
     function Operation()
     {
         if(!$this->Visible)
                 $this->PressedButton = "Button_Delete";
             }
         }
-        $Redirect = "list_tickets.php";
+        $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 = "";
     }
 //End Operation Method
 
-//InsertRow Method @2-F4F4D95F
+//InsertRow Method @2-256545D2
     function InsertRow()
     {
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this);
         $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-6135CAF6
+//UpdateRow Method @2-C1AB2A1C
     function UpdateRow()
     {
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this);
         $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 DeleteRow Method
 
-//Show Method @2-FDCA9944
+//Show Method @2-BC12677D
     function Show()
     {
         global $CCSUseAmp;
                     $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;
             $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);
         $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();
 
 class clsEditTicketsDataSource extends clsDBConnection {  //EditTicketsDataSource Class @2-E9D4C3E8
 
-//DataSource Variables @2-B0DE769F
+//DataSource Variables @2-42E038EB
     public $Parent = "";
     public $CCSEvents = "";
     public $CCSEventResult;
     public $wp;
     public $AllParametersSet;
 
-    public $InsertFields = array();
-    public $UpdateFields = array();
 
     // Datasource fields
     public $Ticket_Email_Address;
     public $Ticket_SerialNumber;
     public $Ticket_Played;
     public $Ticket_Winner;
+    public $Ticket_IPAddress;
 //End DataSource Variables
 
-//DataSourceClass_Initialize Event @2-D7C0E429
+//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, "");
+        
 
-        $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->InsertFields["Ticket_Email_Address"] = array("Name" => "Ticket_Email_Address", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_DrawDate"] = array("Name" => "Ticket_DrawDate", "Value" => "", "DataType" => ccsDate, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Number_1"] = array("Name" => "Ticket_Number_1", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Number_2"] = array("Name" => "Ticket_Number_2", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Pick_1"] = array("Name" => "Ticket_Pick_1", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Pick_2"] = array("Name" => "Ticket_Pick_2", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Pick_3"] = array("Name" => "Ticket_Pick_3", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Pick_4"] = array("Name" => "Ticket_Pick_4", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Show_1"] = array("Name" => "Ticket_Show_1", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Show_2"] = array("Name" => "Ticket_Show_2", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Show_3"] = array("Name" => "Ticket_Show_3", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Show_4"] = array("Name" => "Ticket_Show_4", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_SerialNumber"] = array("Name" => "Ticket_SerialNumber", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Played"] = array("Name" => "Ticket_Played", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->InsertFields["Ticket_Winner"] = array("Name" => "Ticket_Winner", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Email_Address"] = array("Name" => "Ticket_Email_Address", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_DrawDate"] = array("Name" => "Ticket_DrawDate", "Value" => "", "DataType" => ccsDate, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Number_1"] = array("Name" => "Ticket_Number_1", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Number_2"] = array("Name" => "Ticket_Number_2", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Pick_1"] = array("Name" => "Ticket_Pick_1", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Pick_2"] = array("Name" => "Ticket_Pick_2", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Pick_3"] = array("Name" => "Ticket_Pick_3", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Pick_4"] = array("Name" => "Ticket_Pick_4", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Show_1"] = array("Name" => "Ticket_Show_1", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Show_2"] = array("Name" => "Ticket_Show_2", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Show_3"] = array("Name" => "Ticket_Show_3", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Show_4"] = array("Name" => "Ticket_Show_4", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_SerialNumber"] = array("Name" => "Ticket_SerialNumber", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Played"] = array("Name" => "Ticket_Played", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
-        $this->UpdateFields["Ticket_Winner"] = array("Name" => "Ticket_Winner", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
     }
 //End DataSourceClass_Initialize Event
 
         $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->Where = 
              $this->wp->Criterion[1];
     }
 //End Prepare Method
 
-//Open Method @2-D2C71CB8
+//Open Method @2-04C42337
     function Open()
     {
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
-        $this->SQL = "SELECT * \n\n" .
+        $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;
     }
 //End Open Method
 
-//SetValues Method @2-34199BA0
+//SetValues Method @2-B1817024
     function SetValues()
     {
         $this->Ticket_Email_Address->SetDBValue($this->f("Ticket_Email_Address"));
         $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-65ED87C1
+//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);
-        $this->InsertFields["Ticket_Email_Address"]["Value"] = $this->Ticket_Email_Address->GetDBValue(true);
-        $this->InsertFields["Ticket_DrawDate"]["Value"] = $this->Ticket_DrawDate->GetDBValue(true);
-        $this->InsertFields["Ticket_Number_1"]["Value"] = $this->Ticket_Number_1->GetDBValue(true);
-        $this->InsertFields["Ticket_Number_2"]["Value"] = $this->Ticket_Number_2->GetDBValue(true);
-        $this->InsertFields["Ticket_Pick_1"]["Value"] = $this->Ticket_Pick_1->GetDBValue(true);
-        $this->InsertFields["Ticket_Pick_2"]["Value"] = $this->Ticket_Pick_2->GetDBValue(true);
-        $this->InsertFields["Ticket_Pick_3"]["Value"] = $this->Ticket_Pick_3->GetDBValue(true);
-        $this->InsertFields["Ticket_Pick_4"]["Value"] = $this->Ticket_Pick_4->GetDBValue(true);
-        $this->InsertFields["Ticket_Show_1"]["Value"] = $this->Ticket_Show_1->GetDBValue(true);
-        $this->InsertFields["Ticket_Show_2"]["Value"] = $this->Ticket_Show_2->GetDBValue(true);
-        $this->InsertFields["Ticket_Show_3"]["Value"] = $this->Ticket_Show_3->GetDBValue(true);
-        $this->InsertFields["Ticket_Show_4"]["Value"] = $this->Ticket_Show_4->GetDBValue(true);
-        $this->InsertFields["Ticket_SerialNumber"]["Value"] = $this->Ticket_SerialNumber->GetDBValue(true);
-        $this->InsertFields["Ticket_Played"]["Value"] = $this->Ticket_Played->GetDBValue(true);
-        $this->InsertFields["Ticket_Winner"]["Value"] = $this->Ticket_Winner->GetDBValue(true);
-        $this->SQL = CCBuildInsert("Tickets", $this->InsertFields, $this);
+        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);
     }
 //End Insert Method
 
-//Update Method @2-B6C1E4D0
+//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);
-        $this->UpdateFields["Ticket_Email_Address"]["Value"] = $this->Ticket_Email_Address->GetDBValue(true);
-        $this->UpdateFields["Ticket_DrawDate"]["Value"] = $this->Ticket_DrawDate->GetDBValue(true);
-        $this->UpdateFields["Ticket_Number_1"]["Value"] = $this->Ticket_Number_1->GetDBValue(true);
-        $this->UpdateFields["Ticket_Number_2"]["Value"] = $this->Ticket_Number_2->GetDBValue(true);
-        $this->UpdateFields["Ticket_Pick_1"]["Value"] = $this->Ticket_Pick_1->GetDBValue(true);
-        $this->UpdateFields["Ticket_Pick_2"]["Value"] = $this->Ticket_Pick_2->GetDBValue(true);
-        $this->UpdateFields["Ticket_Pick_3"]["Value"] = $this->Ticket_Pick_3->GetDBValue(true);
-        $this->UpdateFields["Ticket_Pick_4"]["Value"] = $this->Ticket_Pick_4->GetDBValue(true);
-        $this->UpdateFields["Ticket_Show_1"]["Value"] = $this->Ticket_Show_1->GetDBValue(true);
-        $this->UpdateFields["Ticket_Show_2"]["Value"] = $this->Ticket_Show_2->GetDBValue(true);
-        $this->UpdateFields["Ticket_Show_3"]["Value"] = $this->Ticket_Show_3->GetDBValue(true);
-        $this->UpdateFields["Ticket_Show_4"]["Value"] = $this->Ticket_Show_4->GetDBValue(true);
-        $this->UpdateFields["Ticket_SerialNumber"]["Value"] = $this->Ticket_SerialNumber->GetDBValue(true);
-        $this->UpdateFields["Ticket_Played"]["Value"] = $this->Ticket_Played->GetDBValue(true);
-        $this->UpdateFields["Ticket_Winner"]["Value"] = $this->Ticket_Winner->GetDBValue(true);
-        $this->SQL = CCBuildUpdate("Tickets", $this->UpdateFields, $this);
-        $this->SQL .= strlen($this->Where) ? " WHERE " . $this->Where : $this->Where;
-        if (!strlen($this->Where) && $this->Errors->Count() == 0)
-            $this->Errors->addError($CCSLocales->GetText("CCS_CustomOperationError_MissingParameters"));
+        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);
     }
 //End Update Method
 
-//Delete Method @2-74E0B5CC
+//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, $this->Where, "");
-        if (!strlen($this->Where) && $this->Errors->Count() == 0)
-            $this->Errors->addError($CCSLocales->GetText("CCS_CustomOperationError_MissingParameters"));
+        $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);

File admin/edit_users.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/edit_users_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/email_counts.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/email_counts_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/export_prizes.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/export_prizes_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/export_tickets.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/export_tickets_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/export_users.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/export_users_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/footer.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/header.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/import_prizes.html

 </head>
 <body>
 <p>{Header}</p>
-<p>{Error_Message}</p>
-<p>{Application_Text}</p>
-<p>&nbsp; {Footer} </p>
+<p align="center">{Error_Message}</p>
+<p align="center">{Application_Text}</p>
+<p>{Footer}</p>
 </body>
 </html>

File admin/import_prizes.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/import_prizes_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #
 // -------------------------
     global $index, $Application_Text, $Error_Message, $_POST, $_GET;
 
-$Error_Message->SetText("<br>Importing can take several minutes... Please be patient...");
+$Error_Message->SetText("Importing can take several minutes... Please be patient...");
 
 set_time_limit(3600);
 $TableName = "Prizes";
 	}
 	// End importing stuff
 } else {
-	$DisplayText .= "<table border=0>";
+	$DisplayText .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">";
 	$DisplayText .= "<form action=\"$FormAction\" method=post enctype=\"multipart/form-data\" name=import_form>";
 	$DisplayText .= "<INPUT type=hidden name=mode value=\"\">";
 	$DisplayText .= "<tr><td colspan=2>Column order:<p>";
 	$DisplayText .= "</td></tr>";
 	$Select="";
 	for ($a=0; $a<=($OptionCount+10); $a++) {
-		$Select .="\n\n<tr><td width=1>" . ($a+1) . ":</td><td width=99%><select name=\"{$a}\">";
+		$Select .="\n\n<tr><td width=20>" . ($a+1) . ":</td><td><select name=\"{$a}\">";
 		for ($b=0; $b<=($OptionCount-1); $b++) {
 			if ($b==$a) {
 				$Select .="\n<option value=\"" . $Option[$b] . "\" selected>" . $OptionValue[$b] . "</option>";

File admin/import_tickets.html

 </head>
 <body>
 <p>{Header}</p>
-<p>{Error_Message}</p>
-<p>{Application_Text}</p>
-<p>&nbsp; {Footer} </p>
+<p align="center">{Error_Message}</p>
+<p align="center">{Application_Text}</p>
+<p>{Footer} </p>
 </body>
 </html>

File admin/import_tickets.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/import_tickets_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #
 // -------------------------
     global $index, $Application_Text, $Error_Message, $_POST, $_GET;
 
-$Error_Message->SetText("<br>Importing can take several minutes... Please be patient...");
+$Error_Message->SetText("Importing can take several minutes... Please be patient...");
 
 set_time_limit(3600);
 $TableName = "Tickets";
 	}
 	// End importing stuff
 } else {
-	$DisplayText .= "<table border=0>";
+	$DisplayText .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">";
 	$DisplayText .= "<form action=\"$FormAction\" method=post enctype=\"multipart/form-data\" name=import_form>";
 	$DisplayText .= "<INPUT type=hidden name=mode value=\"\">";
 	$DisplayText .= "<tr><td colspan=2>Column order:<p>";
 	$DisplayText .= "</td></tr>";
 	$Select="";
 	for ($a=0; $a<=($OptionCount+10); $a++) {
-		$Select .="\n\n<tr><td width=1>" . ($a+1) . ":</td><td width=99%><select name=\"{$a}\">";
+		$Select .="\n\n<tr><td width=20>" . ($a+1) . ":</td><td><select name=\"{$a}\">";
 		for ($b=0; $b<=($OptionCount-1); $b++) {
 			if ($b==$a) {
 				$Select .="\n<option value=\"" . $Option[$b] . "\" selected>" . $OptionValue[$b] . "</option>";

File admin/import_users.html

 </head>
 <body>
 <p>{Header}</p>
-<p>{Error_Message}</p>
-<p>{Application_Text}</p>
-<p>&nbsp; {Footer} </p>
+<p align="center">{Error_Message}</p>
+<p align="center">{Application_Text}</p>
+<p>{Footer} </p>
 </body>
 </html>

File admin/import_users.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/import_users_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #
 // -------------------------
     global $index, $Application_Text, $Error_Message, $_POST, $_GET;
 
-$Error_Message->SetText("<br>Importing can take several minutes... Please be patient...");
+$Error_Message->SetText("Importing can take several minutes... Please be patient...");
 
 set_time_limit(3600);
 $TableName = "Users";
 	}
 	// End importing stuff
 } else {
-	$DisplayText .= "<table border=0>";
+	$DisplayText .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">";
 	$DisplayText .= "<form action=\"$FormAction\" method=post enctype=\"multipart/form-data\" name=import_form>";
 	$DisplayText .= "<INPUT type=hidden name=mode value=\"\">";
 	$DisplayText .= "<tr><td colspan=2>Column order:<p>";
 	$DisplayText .= "</td></tr>";
 	$Select="";
 	for ($a=0; $a<=($OptionCount+10); $a++) {
-		$Select .="\n\n<tr><td width=1>" . ($a+1) . ":</td><td width=99%><select name=\"{$a}\">";
+		$Select .="\n\n<tr><td width=20>" . ($a+1) . ":</td><td><select name=\"{$a}\">";
 		for ($b=0; $b<=($OptionCount-1); $b++) {
 			if ($b==$a) {
 				$Select .="\n<option value=\"" . $Option[$b] . "\" selected>" . $OptionValue[$b] . "</option>";

File admin/index.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/index_events.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #

File admin/list_prize.html

 </head>
 <body>
 <p>{header}</p>
-<!-- BEGIN Record prizesSearch -->
-<form id="prizesSearch" method="post" name="{HTMLFormName}" action="{Action}">
+<!-- BEGIN Record SearchPrize -->
+<form id="SearchPrize" method="post" name="{HTMLFormName}" action="{Action}">
   <table border="0" cellspacing="0" cellpadding="0" align="center">
     <tr>
       <td valign="top">
     </tr>
   </table>
 </form>
-<!-- END Record prizesSearch --><br>
+<!-- END Record SearchPrize --><br>
 <!-- BEGIN Grid ListPrizes -->
 <table border="0" cellspacing="0" cellpadding="0" align="center">
   <tr>

File admin/list_prize.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #
 include_once(RelativePath . "/admin/header.php");
 //End Include Page implementation
 
-class clsRecordprizesSearch { //prizesSearch Class @2-EB57A2C9
+class clsRecordSearchPrize { //SearchPrize Class @2-F832DBB4
 
 //Variables @2-9E315808
 
     // Class variables
 //End Variables
 
-//Class_Initialize Event @2-003B8848
-    function clsRecordprizesSearch($RelativePath, & $Parent)
+//Class_Initialize Event @2-A70BCF53
+    function clsRecordSearchPrize($RelativePath, & $Parent)
     {
 
         global $FileName;
         $this->Parent = & $Parent;
         $this->RelativePath = $RelativePath;
         $this->Errors = new clsErrors();
-        $this->ErrorBlock = "Record prizesSearch/Error";
+        $this->ErrorBlock = "Record SearchPrize/Error";
         $this->ReadAllowed = true;
         if($this->Visible)
         {
-            $this->ComponentName = "prizesSearch";
+            $this->ComponentName = "SearchPrize";
             $this->Attributes = new clsAttributes($this->ComponentName . ":");
             $CCSForm = explode(":", CCGetFromGet("ccsForm", ""), 2);
             if(sizeof($CCSForm) == 1)
     }
 //End CheckErrors Method
 
-//Operation Method @2-4990FBAA
+//Operation Method @2-A90C088C
     function Operation()
     {
         if(!$this->Visible)
                 $this->PressedButton = "Button_DoSearch";
             }
         }
-        $Redirect = "prizes_list.php";
+        $Redirect = "list_prize.php";
         if($this->Validate()) {
             if($this->PressedButton == "Button_DoSearch") {
-                $Redirect = "prizes_list.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", array("Button_DoSearch", "Button_DoSearch_x", "Button_DoSearch_y")));
+                $Redirect = "list_prize.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", array("Button_DoSearch", "Button_DoSearch_x", "Button_DoSearch_y")));
                 if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick", $this->Button_DoSearch)) {
                     $Redirect = "";
                 }
     }
 //End Show Method
 
-} //End prizesSearch Class @2-FCB6E20C
+} //End SearchPrize Class @2-FCB6E20C
 
 class clsGridListPrizes { //ListPrizes class @6-6E5C20DC
 
     }
 //End Initialize Method
 
-//Show Method @6-87E963B0
+//Show Method @6-387A7860
     function Show()
     {
         $Tpl = & CCGetTemplate($this);
                     if(!is_array($this->Prize_Credits->Value) && !strlen($this->Prize_Credits->Value) && $this->Prize_Credits->Value !== false)
                         $this->Prize_Credits->SetText(0);
                     $this->Prize_ID->SetValue($this->DataSource->Prize_ID->GetValue());
-                    $this->Prize_ID->Parameters = "";
-                    $this->Prize_ID->Parameters = CCAddParam($this->Prize_ID->Parameters, "prize_id", $this->DataSource->f("prize_id"));
+                    $this->Prize_ID->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
+                    $this->Prize_ID->Parameters = CCAddParam($this->Prize_ID->Parameters, "Prize_ID", $this->DataSource->f("Prize_ID"));
                     $this->Prize_Name->SetValue($this->DataSource->Prize_Name->GetValue());
                     $this->Prize_DisplayName->SetValue($this->DataSource->Prize_DisplayName->GetValue());
                     $this->Prize_ClaimURL->SetValue($this->DataSource->Prize_ClaimURL->GetValue());
                     if(!is_array($this->Alt_Prize_Credits->Value) && !strlen($this->Alt_Prize_Credits->Value) && $this->Alt_Prize_Credits->Value !== false)
                         $this->Alt_Prize_Credits->SetText(0);
                     $this->Alt_Prize_ID->SetValue($this->DataSource->Alt_Prize_ID->GetValue());
-                    $this->Alt_Prize_ID->Parameters = "";
-                    $this->Alt_Prize_ID->Parameters = CCAddParam($this->Alt_Prize_ID->Parameters, "prize_id", $this->DataSource->f("prize_id"));
+                    $this->Alt_Prize_ID->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
+                    $this->Alt_Prize_ID->Parameters = CCAddParam($this->Alt_Prize_ID->Parameters, "Prize_ID", $this->DataSource->f("Prize_ID"));
                     $this->Alt_Prize_Name->SetValue($this->DataSource->Alt_Prize_Name->GetValue());
                     $this->Alt_Prize_DisplayName->SetValue($this->DataSource->Alt_Prize_DisplayName->GetValue());
                     $this->Alt_Prize_ClaimURL->SetValue($this->DataSource->Alt_Prize_ClaimURL->GetValue());
         $this->ErrorBlock = "Grid ListPrizes";
         $this->Initialize();
         $this->Prize_ID = new clsField("Prize_ID", ccsInteger, "");
-
+        
         $this->Prize_Name = new clsField("Prize_Name", ccsText, "");
-
+        
         $this->Prize_DisplayName = new clsField("Prize_DisplayName", ccsText, "");
-
+        
         $this->Prize_ClaimURL = new clsField("Prize_ClaimURL", ccsText, "");
-
+        
         $this->Prize_DisplayURLOrText = new clsField("Prize_DisplayURLOrText", ccsText, "");
-
+        
         $this->Prize_Credits = new clsField("Prize_Credits", ccsInteger, "");
-
+        
         $this->Prize_Active = new clsField("Prize_Active", ccsText, "");
-
+        
         $this->Alt_Prize_ID = new clsField("Alt_Prize_ID", ccsInteger, "");
-
+        
         $this->Alt_Prize_Name = new clsField("Alt_Prize_Name", ccsText, "");
-
+        
         $this->Alt_Prize_DisplayName = new clsField("Alt_Prize_DisplayName", ccsText, "");
-
+        
         $this->Alt_Prize_ClaimURL = new clsField("Alt_Prize_ClaimURL", ccsText, "");
-
+        
         $this->Alt_Prize_DisplayURLOrText = new clsField("Alt_Prize_DisplayURLOrText", ccsText, "");
-
+        
         $this->Alt_Prize_Credits = new clsField("Alt_Prize_Credits", ccsInteger, "");
-
+        
         $this->Alt_Prize_Active = new clsField("Alt_Prize_Active", ccsText, "");
-
+        
 
     }
 //End DataSourceClass_Initialize Event
     function SetOrder($SorterName, $SorterDirection)
     {
         $this->Order = "";
-        $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
-            array("Sorter_Prize_ID" => array("Prize_ID", ""),
-            "Sorter_Prize_Name" => array("Prize_Name", ""),
-            "Sorter_Prize_DisplayName" => array("Prize_DisplayName", ""),
-            "Sorter_Prize_ClaimURL" => array("Prize_ClaimURL", ""),
-            "Sorter_Prize_DisplayURLOrText" => array("Prize_DisplayURLOrText", ""),
-            "Sorter_Prize_Credits" => array("Prize_Credits", ""),
+        $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, 
+            array("Sorter_Prize_ID" => array("Prize_ID", ""), 
+            "Sorter_Prize_Name" => array("Prize_Name", ""), 
+            "Sorter_Prize_DisplayName" => array("Prize_DisplayName", ""), 
+            "Sorter_Prize_ClaimURL" => array("Prize_ClaimURL", ""), 
+            "Sorter_Prize_DisplayURLOrText" => array("Prize_DisplayURLOrText", ""), 
+            "Sorter_Prize_Credits" => array("Prize_Credits", ""), 
             "Sorter_Prize_Active" => array("Prize_Active", "")));
     }
 //End SetOrder Method
 
-//Prepare Method @6-BE84C5C8
+//Prepare Method @6-54F8881F
     function Prepare()
     {
         global $CCSLocales;
         $this->wp->AddParameter("1", "urls_keyword", ccsText, "", "", $this->Parameters["urls_keyword"], "", false);
         $this->wp->AddParameter("2", "urls_keyword", ccsText, "", "", $this->Parameters["urls_keyword"], "", false);
         $this->wp->AddParameter("3", "urls_keyword", ccsText, "", "", $this->Parameters["urls_keyword"], "", false);
-        $this->wp->AddParameter("4", "urls_keyword", ccsMemo, "", "", $this->Parameters["urls_keyword"], "", false);
+        $this->wp->AddParameter("4", "urls_keyword", ccsText, "", "", $this->Parameters["urls_keyword"], "", false);
         $this->wp->AddParameter("5", "urls_keyword", ccsText, "", "", $this->Parameters["urls_keyword"], "", false);
         $this->wp->AddParameter("6", "urls_keyword", ccsText, "", "", $this->Parameters["urls_keyword"], "", false);
-        $this->wp->Criterion[1] = $this->wp->Operation(opContains, "prize_name", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText),false);
-        $this->wp->Criterion[2] = $this->wp->Operation(opContains, "prize_displayname", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
-        $this->wp->Criterion[3] = $this->wp->Operation(opContains, "prize_claimurl", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsText),false);
-        $this->wp->Criterion[4] = $this->wp->Operation(opContains, "prize_claimtext", $this->wp->GetDBValue("4"), $this->ToSQL($this->wp->GetDBValue("4"), ccsMemo),false);
-        $this->wp->Criterion[5] = $this->wp->Operation(opContains, "prize_display_url_or_text", $this->wp->GetDBValue("5"), $this->ToSQL($this->wp->GetDBValue("5"), ccsText),false);
-        $this->wp->Criterion[6] = $this->wp->Operation(opContains, "prize_active", $this->wp->GetDBValue("6"), $this->ToSQL($this->wp->GetDBValue("6"), ccsText),false);
+        $this->wp->Criterion[1] = $this->wp->Operation(opContains, "Prize_Name", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText),false);
+        $this->wp->Criterion[2] = $this->wp->Operation(opContains, "Prize_DisplayName", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
+        $this->wp->Criterion[3] = $this->wp->Operation(opContains, "Prize_ClaimURL", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsText),false);
+        $this->wp->Criterion[4] = $this->wp->Operation(opContains, "Prize_ClaimText", $this->wp->GetDBValue("4"), $this->ToSQL($this->wp->GetDBValue("4"), ccsText),false);
+        $this->wp->Criterion[5] = $this->wp->Operation(opContains, "Prize_DisplayURLOrText", $this->wp->GetDBValue("5"), $this->ToSQL($this->wp->GetDBValue("5"), ccsText),false);
+        $this->wp->Criterion[6] = $this->wp->Operation(opContains, "Prize_Active", $this->wp->GetDBValue("6"), $this->ToSQL($this->wp->GetDBValue("6"), ccsText),false);
         $this->Where = $this->wp->opOR(
              true, $this->wp->opOR(
              false, $this->wp->opOR(
              false, $this->wp->opOR(
              false, $this->wp->opOR(
-             false,
-             $this->wp->Criterion[1],
-             $this->wp->Criterion[2]),
-             $this->wp->Criterion[3]),
-             $this->wp->Criterion[4]),
-             $this->wp->Criterion[5]),
+             false, 
+             $this->wp->Criterion[1], 
+             $this->wp->Criterion[2]), 
+             $this->wp->Criterion[3]), 
+             $this->wp->Criterion[4]), 
+             $this->wp->Criterion[5]), 
              $this->wp->Criterion[6]);
     }
 //End Prepare Method
         $this->SQL = "SELECT *, Prize_ID \n\n" .
         "FROM Prizes {SQL_Where} {SQL_OrderBy}";
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
-        if ($this->CountSQL)
+        if ($this->CountSQL) 
             $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
         else
             $this->RecordsCount = "CCS not counted";
 $CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage);
 //End Before Initialize
 
-//Initialize Objects @1-E2BAD085
+//Initialize Objects @1-FACF0CD0
 $DBConnection = new clsDBConnection();
 $MainPage->Connections["Connection"] = & $DBConnection;
 $Attributes = new clsAttributes("page:");
 // Controls
 $header = new clsheader("", "header", $MainPage);
 $header->Initialize();
-$prizesSearch = new clsRecordprizesSearch("", $MainPage);
+$SearchPrize = new clsRecordSearchPrize("", $MainPage);
 $ListPrizes = new clsGridListPrizes("", $MainPage);
 $footer = new clsfooter("", "footer", $MainPage);
 $footer->Initialize();
 $MainPage->header = & $header;
-$MainPage->prizesSearch = & $prizesSearch;
+$MainPage->SearchPrize = & $SearchPrize;
 $MainPage->ListPrizes = & $ListPrizes;
 $MainPage->footer = & $footer;
 $ListPrizes->Initialize();
 $Attributes->Show();
 //End Initialize HTML Template
 
-//Execute Components @1-7E869AA4
+//Execute Components @1-21F533D1
 $footer->Operations();
-$prizesSearch->Operation();
+$SearchPrize->Operation();
 $header->Operations();
 //End Execute Components
 
-//Go to destination page @1-C9F7930F
+//Go to destination page @1-63A3AF9C
 if($Redirect)
 {
     $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
     header("Location: " . $Redirect);
     $header->Class_Terminate();
     unset($header);
-    unset($prizesSearch);
+    unset($SearchPrize);
     unset($ListPrizes);
     $footer->Class_Terminate();
     unset($footer);
 }
 //End Go to destination page
 
-//Show Page @1-15E364B5
+//Show Page @1-61D60B98
 $header->Show();
-$prizesSearch->Show();
+$SearchPrize->Show();
 $ListPrizes->Show();
 $footer->Show();
 $Tpl->block_path = "";
 if ($CCSEventResult) echo $main_block;
 //End Show Page
 
-//Unload Page @1-D671465C
+//Unload Page @1-D12000D1
 $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
 $DBConnection->close();
 $header->Class_Terminate();
 unset($header);
-unset($prizesSearch);
+unset($SearchPrize);
 unset($ListPrizes);
 $footer->Class_Terminate();
 unset($footer);

File admin/list_tickets.html

           <!-- BEGIN Desc_Off --><a href="{Desc_URL}"><img border="0" src="../Styles/{CCS_Style}/Images/DescOff.gif"></a><!-- END Desc_Off --><!-- END Sorter Sorter_Ticket_Email_Address --></th>
  
           <th>
+          <!-- BEGIN Sorter Sorter_Ticket_IPAddress -->IP Address 
+          <!-- BEGIN Asc_On --><img id="ListTicketsSorter_Ticket_IPAddress" border="0" src="../Styles/{CCS_Style}/Images/Asc.gif"><!-- END Asc_On -->
+          <!-- BEGIN Asc_Off --><a href="{Asc_URL}"><img border="0" src="../Styles/{CCS_Style}/Images/AscOff.gif"></a><!-- END Asc_Off -->
+          <!-- BEGIN Desc_On --><img border="0" src="../Styles/{CCS_Style}/Images/Desc.gif"><!-- END Desc_On -->
+          <!-- BEGIN Desc_Off --><a href="{Desc_URL}"><img border="0" src="../Styles/{CCS_Style}/Images/DescOff.gif"></a><!-- END Desc_Off --><!-- END Sorter Sorter_Ticket_IPAddress -->&nbsp;</th>
+ 
+          <th>
           <!-- BEGIN Sorter Sorter_Ticket_DrawDate -->Draw Date 
           <!-- BEGIN Asc_On --><img id="ListTicketsSorter_Ticket_DrawDate" border="0" src="../Styles/{CCS_Style}/Images/Asc.gif"><!-- END Asc_On -->
           <!-- BEGIN Asc_Off --><a href="{Asc_URL}"><img border="0" src="../Styles/{CCS_Style}/Images/AscOff.gif"></a><!-- END Asc_Off -->
         <tr class="Row">
           <td style="TEXT-ALIGN: right"><a href="{Ticket_ID_Src}">{Ticket_ID}</a>&nbsp;</td> 
           <td>{Ticket_Email_Address}&nbsp;</td> 
+          <td>{Display_Ticket_IPAddress}&nbsp;</td> 
           <td>{Ticket_DrawDate}&nbsp;</td> 
           <td style="TEXT-ALIGN: right">{Ticket_Number_1}&nbsp;</td> 
           <td style="TEXT-ALIGN: right">{Ticket_Number_2}&nbsp;</td> 
         <tr class="AltRow">
           <td style="TEXT-ALIGN: right"><a href="{Alt_Ticket_ID_Src}">{Alt_Ticket_ID}</a>&nbsp;</td> 
           <td>{Alt_Ticket_Email_Address}&nbsp;</td> 
+          <td>{Alt_Display_Ticket_IPAddress}&nbsp;</td> 
           <td>{Alt_Ticket_DrawDate}&nbsp;</td> 
           <td style="TEXT-ALIGN: right">{Alt_Ticket_Number_1}&nbsp;</td> 
           <td style="TEXT-ALIGN: right">{Alt_Ticket_Number_2}&nbsp;</td> 
  <!-- END AltRow -->
         <!-- BEGIN NoRecords -->
         <tr class="NoRecords">
-          <td colspan="11">No records</td>
+          <td colspan="12">No records</td>
         </tr>
         <!-- END NoRecords -->
         <tr class="Footer">
-          <td colspan="11"><a href="{AddTicket_Link_Src}">Add Ticket</a> 
+          <td colspan="12"><a href="{AddTicket_Link_Src}">Add Ticket</a> 
             <!-- BEGIN Navigator Navigator -->
             <!-- BEGIN First_On --><a href="{First_URL}"><img border="0" src="../Styles/{CCS_Style}/Images/en/ButtonFirst.gif"></a> <!-- END First_On -->
             <!-- BEGIN First_Off --><img border="0" src="../Styles/{CCS_Style}/Images/en/ButtonFirstOff.gif"><!-- END First_Off -->

File admin/list_tickets.php

 <?php
 /*
 ##############################################################################
-# PHP Scratch And Win                                           Version 4.01 #
+# PHP Scratch And Win                                           Version 4.02 #
 # Copyright 2012                                          www.YourPHPPro.com #
 #                                                                            #
 # For questions concerning licensing, please read license.txt                #
     }
 //End CheckErrors Method
 
-//Operation Method @2-842E0C5E
+//Operation Method @2-258E4D3F
     function Operation()
     {
         if(!$this->Visible)
                 $this->PressedButton = "Button_DoSearch";
             }
         }
-        $Redirect = "ticket_list.php";
+        $Redirect = "list_tickets.php" . "?" . CCGetQueryString("QueryString", array("ccsForm"));
         if($this->Validate()) {
             if($this->PressedButton == "Button_DoSearch") {
-                $Redirect = "ticket_list.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", array("Button_DoSearch", "Button_DoSearch_x", "Button_DoSearch_y")));
+                $Redirect = "list_tickets.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", array("Button_DoSearch", "Button_DoSearch_x", "Button_DoSearch_y")), CCGetQueryString("QueryString", array("s_keyword", "ccsForm")));
                 if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick", $this->Button_DoSearch)) {
                     $Redirect = "";
                 }
 
 class clsGridListTickets { //ListTickets class @6-4AC042F1
 
-//Variables @6-48BD3ADB
+//Variables @6-B2571788
 
     // Public variables
     public $ComponentType = "Grid";
     public $Sorter_Ticket_Pick_4;
     public $Sorter_Ticket_Played;
     public $Sorter_Ticket_Winner;
+    public $Sorter_Ticket_IPAddress;
 //End Variables
 
-//Class_Initialize Event @6-F4F8D383
+//Class_Initialize Event @6-7B95E460
     function clsGridListTickets($RelativePath, & $Parent)
     {
         global $FileName;
         $this->Ticket_Pick_4 = new clsControl(ccsLabel, "Ticket_Pick_4", "Ticket_Pick_4", ccsInteger, "", CCGetRequestParam("Ticket_Pick_4", ccsGet, NULL), $this);
         $this->Ticket_Played = new clsControl(ccsLabel, "Ticket_Played", "Ticket_Played", ccsText, "", CCGetRequestParam("Ticket_Played", ccsGet, NULL), $this);
         $this->Ticket_Winner = new clsControl(ccsLabel, "Ticket_Winner", "Ticket_Winner", ccsText, "", CCGetRequestParam("Ticket_Winner", ccsGet, NULL), $this);
+        $this->Display_Ticket_IPAddress = new clsControl(ccsLabel, "Display_Ticket_IPAddress", "Display_Ticket_IPAddress", ccsText, "", CCGetRequestParam("Display_Ticket_IPAddress", ccsGet, NULL), $this);
         $this->Alt_Ticket_ID = new clsControl(ccsLink, "Alt_Ticket_ID", "Alt_Ticket_ID", ccsInteger, "", CCGetRequestParam("Alt_Ticket_ID", ccsGet, NULL), $this);
         $this->Alt_Ticket_ID->Page = "edit_tickets.php";
         $this->Alt_Ticket_Email_Address = new clsControl(ccsLabel, "Alt_Ticket_Email_Address", "Alt_Ticket_Email_Address", ccsText, "", CCGetRequestParam("Alt_Ticket_Email_Address", ccsGet, NULL), $this);
         $this->Alt_Ticket_Pick_4 = new clsControl(ccsLabel, "Alt_Ticket_Pick_4", "Alt_Ticket_Pick_4", ccsInteger, "", CCGetRequestParam("Alt_Ticket_Pick_4", ccsGet, NULL), $this);
         $this->Alt_Ticket_Played = new clsControl(ccsLabel, "Alt_Ticket_Played", "Alt_Ticket_Played", ccsText, "", CCGetRequestParam("Alt_Ticket_Played", ccsGet, NULL), $this);
         $this->Alt_Ticket_Winner = new clsControl(ccsLabel, "Alt_Ticket_Winner", "Alt_Ticket_Winner", ccsText, "", CCGetRequestParam("Alt_Ticket_Winner", ccsGet, NULL), $this);
+        $this->Alt_Display_Ticket_IPAddress = new clsControl(ccsLabel, "Alt_Display_Ticket_IPAddress", "Alt_Display_Ticket_IPAddress", ccsText, "", CCGetRequestParam("Alt_Display_Ticket_IPAddress", ccsGet, NULL), $this);
         $this->Sorter_Ticket_ID = new clsSorter($this->ComponentName, "Sorter_Ticket_ID", $FileName, $this);
         $this->Sorter_Ticket_Email_Address = new clsSorter($this->ComponentName, "Sorter_Ticket_Email_Address", $FileName, $this);
         $this->Sorter_Ticket_DrawDate = new clsSorter($this->ComponentName, "Sorter_Ticket_DrawDate", $FileName, $this);
         $this->Navigator->PageSizes = array("1", "5", "10", "25", "50");
         $this->AddTicket_Link = new clsControl(ccsLink, "AddTicket_Link", "AddTicket_Link", ccsText, "", CCGetRequestParam("AddTicket_Link", ccsGet, NULL), $this);
         $this->AddTicket_Link->Page = "edit_tickets.php";
+        $this->Sorter_Ticket_IPAddress = new clsSorter($this->ComponentName, "Sorter_Ticket_IPAddress", $FileName, $this);
     }
 //End Class_Initialize Event
 
     }
 //End Initialize Method
 
-//Show Method @6-28B83400
+//Show Method @6-F455466E
     function Show()
     {
         $Tpl = & CCGetTemplate($this);
             $this->ControlsVisible["Ticket_Pick_4"] = $this->Ticket_Pick_4->Visible;
             $this->ControlsVisible["Ticket_Played"] = $this->Ticket_Played->Visible;
             $this->ControlsVisible["Ticket_Winner"] = $this->Ticket_Winner->Visible;
+            $this->ControlsVisible["Display_Ticket_IPAddress"] = $this->Display_Ticket_IPAddress->Visible;
             while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) &&  ($this->HasRecord = $this->DataSource->has_next_record()))) {
                 $this->RowNumber++;
                 if ($this->HasRecord) {
                 {
                     $Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
                     $this->Ticket_ID->SetValue($this->DataSource->Ticket_ID->GetValue());
-                    $this->Ticket_ID->Parameters = "";
+                    $this->Ticket_ID->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
                     $this->Ticket_ID->Parameters = CCAddParam($this->Ticket_ID->Parameters, "Ticket_ID", $this->DataSource->f("Ticket_ID"));
                     $this->Ticket_Email_Address->SetValue($this->DataSource->Ticket_Email_Address->GetValue());
                     $this->Ticket_DrawDate->SetValue($this->DataSource->Ticket_DrawDate->GetValue());
                     $this->Ticket_Pick_4->SetValue($this->DataSource->Ticket_Pick_4->GetValue());
                     $this->Ticket_Played->SetValue($this->DataSource->Ticket_Played->GetValue());
                     $this->Ticket_Winner->SetValue($this->DataSource->Ticket_Winner->GetValue());
+                    $this->Display_Ticket_IPAddress->SetValue($this->DataSource->Display_Ticket_IPAddress->GetValue());
                     $this->Attributes->SetValue("rowNumber", $this->RowNumber);
                     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
                     $this->Attributes->Show();
                     $this->Ticket_Pick_4->Show();
                     $this->Ticket_Played->Show();
                     $this->Ticket_Winner->Show();
+                    $this->Display_Ticket_IPAddress->Show();
                     $Tpl->block_path = $ParentPath . "/" . $GridBlock;
                     $Tpl->parse("Row", true);
                 }
                 {
                     $Tpl->block_path = $ParentPath . "/" . $GridBlock . "/AltRow";
                     $this->Alt_Ticket_ID->SetValue($this->DataSource->Alt_Ticket_ID->GetValue());
-                    $this->Alt_Ticket_ID->Parameters = "";
+                    $this->Alt_Ticket_ID->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
                     $this->Alt_Ticket_ID->Parameters = CCAddParam($this->Alt_Ticket_ID->Parameters, "Ticket_ID", $this->DataSource->f("Ticket_ID"));
                     $this->Alt_Ticket_Email_Address->SetValue($this->DataSource->Alt_Ticket_Email_Address->GetValue());
                     $this->Alt_Ticket_DrawDate->SetValue($this->DataSource->Alt_Ticket_DrawDate->GetValue());
                     $this->Alt_Ticket_Pick_4->SetValue($this->DataSource->Alt_Ticket_Pick_4->GetValue());
                     $this->Alt_Ticket_Played->SetValue($this->DataSource->Alt_Ticket_Played->GetValue());
                     $this->Alt_Ticket_Winner->SetValue($this->DataSource->Alt_Ticket_Winner->GetValue());
+                    $this->Alt_Display_Ticket_IPAddress->SetValue($this->DataSource->Alt_Display_Ticket_IPAddress->GetValue());
                     $this->Attributes->SetValue("rowNumber", $this->RowNumber);
                     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
                     $this->Attributes->Show();
                     $this->Alt_Ticket_Pick_4->Show();
                     $this->Alt_Ticket_Played->Show();
                     $this->Alt_Ticket_Winner->Show();
+                    $this->Alt_Display_Ticket_IPAddress->Show();
                     $Tpl->block_path = $ParentPath . "/" . $GridBlock;
                     $Tpl->parseto("AltRow", true, "Row");
                 }
         $this->Sorter_Ticket_Winner->Show();
         $this->Navigator->Show();
         $this->AddTicket_Link->Show();
+        $this->Sorter_Ticket_IPAddress->Show();
         $Tpl->parse();
         $Tpl->block_path = $ParentPath;
         $this->DataSource->close();
     }
 //End Show Method
 
-//GetErrors Method @6-1B666C93
+//GetErrors Method @6-0920A40C
     function GetErrors()
     {
         $errors = "";
         $errors = ComposeStrings($errors, $this->Ticket_Pick_4->Errors->ToString());
         $errors = ComposeStrings($errors, $this->Ticket_Played->Errors->ToString());
         $errors = ComposeStrings($errors, $this->Ticket_Winner->Errors->ToString());
+        $errors = ComposeStrings($errors, $this->Display_Ticket_IPAddress->Errors->ToString());
         $errors = ComposeStrings($errors, $this->Alt_Ticket_ID->Errors->ToString());
         $errors = ComposeStrings($errors, $this->Alt_Ticket_Email_Address->Errors->ToString());
         $errors = ComposeStrings($errors, $this->Alt_Ticket_DrawDate->Errors->ToString());
         $errors = ComposeStrings($errors, $this->Alt_Ticket_Pick_4->Errors->ToString());
         $errors = ComposeStrings($errors, $this->Alt_Ticket_Played->Errors->ToString());
         $errors = ComposeStrings($errors, $this->Alt_Ticket_Winner->Errors->ToString());
+        $errors = ComposeStrings($errors, $this->Alt_Display_Ticket_IPAddress->Errors->ToString());
         $errors = ComposeStrings($errors, $this->Errors->ToString());
         $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
         return $errors;
 
 class clsListTicketsDataSource extends clsDBConnection {  //ListTicketsDataSource Class @6-1F42FAD2
 
-//DataSource Variables @6-2C7CD6B9
+//DataSource Variables @6-6376D234
     public $Parent = "";
     public $CCSEvents = "";
     public $CCSEventResult;