.=< { 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_departements.php

    <?php
    //Include Common Files @1-FA597495
    define("RelativePath", ".");
    define("PathToCurrentPage", "/");
    define("FileName", "recensement_departements.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_departements { //rec_departements class @3-21EBBC4D
    
    //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-DC536FAB
        function clsGridrec_departements($RelativePath, & $Parent)
        {
            global $FileName;
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->ComponentName = "rec_departements";
            $this->Visible = True;
            $this->Parent = & $Parent;
            $this->RelativePath = $RelativePath;
            $this->Errors = new clsErrors();
            $this->ErrorBlock = "Grid rec_departements";
            $this->Attributes = new clsAttributes($this->ComponentName . ":");
            $this->DataSource = new clsrec_departementsDataSource($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->departement_id = new clsControl(ccsLink, "departement_id", "departement_id", ccsInteger, "", CCGetRequestParam("departement_id", ccsGet, NULL), $this);
            $this->departement_id->Page = "";
            $this->num_departement = new clsControl(ccsLabel, "num_departement", "num_departement", ccsText, "", CCGetRequestParam("num_departement", ccsGet, NULL), $this);
            $this->region_id = new clsControl(ccsLabel, "region_id", "region_id", ccsInteger, "", CCGetRequestParam("region_id", ccsGet, NULL), $this);
            $this->departement_nom = new clsControl(ccsLabel, "departement_nom", "departement_nom", ccsText, "", CCGetRequestParam("departement_nom", ccsGet, NULL), $this);
            $this->rec_departements_Insert = new clsControl(ccsLink, "rec_departements_Insert", "rec_departements_Insert", ccsText, "", CCGetRequestParam("rec_departements_Insert", ccsGet, NULL), $this);
            $this->rec_departements_Insert->Parameters = CCGetQueryString("QueryString", array("departement_id", "ccsForm"));
            $this->rec_departements_Insert->Page = "recensement_departements.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-DDC12C99
        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["departement_id"] = $this->departement_id->Visible;
                $this->ControlsVisible["num_departement"] = $this->num_departement->Visible;
                $this->ControlsVisible["region_id"] = $this->region_id->Visible;
                $this->ControlsVisible["departement_nom"] = $this->departement_nom->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->departement_id->SetValue($this->DataSource->departement_id->GetValue());
                    $this->departement_id->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
                    $this->departement_id->Parameters = CCAddParam($this->departement_id->Parameters, "departement_id", $this->DataSource->f("departement_id"));
                    $this->num_departement->SetValue($this->DataSource->num_departement->GetValue());
                    $this->region_id->SetValue($this->DataSource->region_id->GetValue());
                    $this->departement_nom->SetValue($this->DataSource->departement_nom->GetValue());
                    $this->Attributes->SetValue("rowNumber", $this->RowNumber);
                    $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
                    $this->Attributes->Show();
                    $this->departement_id->Show();
                    $this->num_departement->Show();
                    $this->region_id->Show();
                    $this->departement_nom->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_departements_Insert->Show();
            $Tpl->parse();
            $Tpl->block_path = $ParentPath;
            $this->DataSource->close();
        }
    //End Show Method
    
    //GetErrors Method @3-C8A5EB9D
        function GetErrors()
        {
            $errors = "";
            $errors = ComposeStrings($errors, $this->departement_id->Errors->ToString());
            $errors = ComposeStrings($errors, $this->num_departement->Errors->ToString());
            $errors = ComposeStrings($errors, $this->region_id->Errors->ToString());
            $errors = ComposeStrings($errors, $this->departement_nom->Errors->ToString());
            $errors = ComposeStrings($errors, $this->Errors->ToString());
            $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
            return $errors;
        }
    //End GetErrors Method
    
    } //End rec_departements Class @3-FCB6E20C
    
    class clsrec_departementsDataSource extends clsDBcnxRecensement {  //rec_departementsDataSource Class @3-FE03A032
    
    //DataSource Variables @3-0C814408
        public $Parent = "";
        public $CCSEvents = "";
        public $CCSEventResult;
        public $ErrorBlock;
        public $CmdExecution;
    
        public $CountSQL;
        public $wp;
    
    
        // Datasource fields
        public $departement_id;
        public $num_departement;
        public $region_id;
        public $departement_nom;
    //End DataSource Variables
    
    //DataSourceClass_Initialize Event @3-0C1C9A24
        function clsrec_departementsDataSource(& $Parent)
        {
            $this->Parent = & $Parent;
            $this->ErrorBlock = "Grid rec_departements";
            $this->Initialize();
            $this->departement_id = new clsField("departement_id", ccsInteger, "");
            
            $this->num_departement = new clsField("num_departement", ccsText, "");
            
            $this->region_id = new clsField("region_id", ccsInteger, "");
            
            $this->departement_nom = new clsField("departement_nom", 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-3A2BCBCF
        function Open()
        {
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
            $this->CountSQL = "SELECT COUNT(*)\n\n" .
            "FROM rec_departements";
            $this->SQL = "SELECT departement_id, num_departement, region_id, departement_nom \n\n" .
            "FROM rec_departements {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-8FBBAC3F
        function SetValues()
        {
            $this->departement_id->SetDBValue(trim($this->f("departement_id")));
            $this->num_departement->SetDBValue($this->f("num_departement"));
            $this->region_id->SetDBValue(trim($this->f("region_id")));
            $this->departement_nom->SetDBValue($this->f("departement_nom"));
        }
    //End SetValues Method
    
    } //End rec_departementsDataSource Class @3-FCB6E20C
    
    class clsRecordrec_departements1 { //rec_departements1 Class @16-BD2B691E
    
    //Variables @16-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 @16-78E975AF
        function clsRecordrec_departements1($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_departements1/Error";
            $this->DataSource = new clsrec_departements1DataSource($this);
            $this->ds = & $this->DataSource;
            $this->InsertAllowed = true;
            $this->UpdateAllowed = true;
            $this->DeleteAllowed = true;
            $this->ReadAllowed = true;
            if($this->Visible)
            {
                $this->ComponentName = "rec_departements1";
                $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->num_departement = new clsControl(ccsTextBox, "num_departement", "Num Departement", ccsText, "", CCGetRequestParam("num_departement", $Method, NULL), $this);
                $this->num_departement->Required = true;
                $this->region_id = new clsControl(ccsTextBox, "region_id", "Region Id", ccsInteger, "", CCGetRequestParam("region_id", $Method, NULL), $this);
                $this->region_id->Required = true;
                $this->departement_nom = new clsControl(ccsTextBox, "departement_nom", "Departement Nom", ccsText, "", CCGetRequestParam("departement_nom", $Method, NULL), $this);
                $this->departement_nom->Required = true;
            }
        }
    //End Class_Initialize Event
    
    //Initialize Method @16-6A2EA268
        function Initialize()
        {
    
            if(!$this->Visible)
                return;
    
            $this->DataSource->Parameters["urldepartement_id"] = CCGetFromGet("departement_id", NULL);
        }
    //End Initialize Method
    
    //Validate Method @16-405CC2E4
        function Validate()
        {
            global $CCSLocales;
            $Validation = true;
            $Where = "";
            $Validation = ($this->num_departement->Validate() && $Validation);
            $Validation = ($this->region_id->Validate() && $Validation);
            $Validation = ($this->departement_nom->Validate() && $Validation);
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this);
            $Validation =  $Validation && ($this->num_departement->Errors->Count() == 0);
            $Validation =  $Validation && ($this->region_id->Errors->Count() == 0);
            $Validation =  $Validation && ($this->departement_nom->Errors->Count() == 0);
            return (($this->Errors->Count() == 0) && $Validation);
        }
    //End Validate Method
    
    //CheckErrors Method @16-5F52C739
        function CheckErrors()
        {
            $errors = false;
            $errors = ($errors || $this->num_departement->Errors->Count());
            $errors = ($errors || $this->region_id->Errors->Count());
            $errors = ($errors || $this->departement_nom->Errors->Count());
            $errors = ($errors || $this->Errors->Count());
            $errors = ($errors || $this->DataSource->Errors->Count());
            return $errors;
        }
    //End CheckErrors Method
    
    //Operation Method @16-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 @16-9F1F6801
        function InsertRow()
        {
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this);
            if(!$this->InsertAllowed) return false;
            $this->DataSource->num_departement->SetValue($this->num_departement->GetValue(true));
            $this->DataSource->region_id->SetValue($this->region_id->GetValue(true));
            $this->DataSource->departement_nom->SetValue($this->departement_nom->GetValue(true));
            $this->DataSource->Insert();
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this);
            return (!$this->CheckErrors());
        }
    //End InsertRow Method
    
    //UpdateRow Method @16-22F1BD6F
        function UpdateRow()
        {
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this);
            if(!$this->UpdateAllowed) return false;
            $this->DataSource->num_departement->SetValue($this->num_departement->GetValue(true));
            $this->DataSource->region_id->SetValue($this->region_id->GetValue(true));
            $this->DataSource->departement_nom->SetValue($this->departement_nom->GetValue(true));
            $this->DataSource->Update();
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this);
            return (!$this->CheckErrors());
        }
    //End UpdateRow Method
    
    //DeleteRow Method @16-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 @16-78A50C0C
        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->num_departement->SetValue($this->DataSource->num_departement->GetValue());
                        $this->region_id->SetValue($this->DataSource->region_id->GetValue());
                        $this->departement_nom->SetValue($this->DataSource->departement_nom->GetValue());
                    }
                } else {
                    $this->EditMode = false;
                }
            }
    
            if($this->FormSubmitted || $this->CheckErrors()) {
                $Error = "";
                $Error = ComposeStrings($Error, $this->num_departement->Errors->ToString());
                $Error = ComposeStrings($Error, $this->region_id->Errors->ToString());
                $Error = ComposeStrings($Error, $this->departement_nom->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->num_departement->Show();
            $this->region_id->Show();
            $this->departement_nom->Show();
            $Tpl->parse();
            $Tpl->block_path = $ParentPath;
            $this->DataSource->close();
        }
    //End Show Method
    
    } //End rec_departements1 Class @16-FCB6E20C
    
    class clsrec_departements1DataSource extends clsDBcnxRecensement {  //rec_departements1DataSource Class @16-0ADC7B2E
    
    //DataSource Variables @16-44F6674B
        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 $num_departement;
        public $region_id;
        public $departement_nom;
    //End DataSource Variables
    
    //DataSourceClass_Initialize Event @16-1CB2B6B0
        function clsrec_departements1DataSource(& $Parent)
        {
            $this->Parent = & $Parent;
            $this->ErrorBlock = "Record rec_departements1/Error";
            $this->Initialize();
            $this->num_departement = new clsField("num_departement", ccsText, "");
            
            $this->region_id = new clsField("region_id", ccsInteger, "");
            
            $this->departement_nom = new clsField("departement_nom", ccsText, "");
            
    
            $this->InsertFields["num_departement"] = array("Name" => "num_departement", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
            $this->InsertFields["region_id"] = array("Name" => "region_id", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
            $this->InsertFields["departement_nom"] = array("Name" => "departement_nom", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
            $this->UpdateFields["num_departement"] = array("Name" => "num_departement", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
            $this->UpdateFields["region_id"] = array("Name" => "region_id", "Value" => "", "DataType" => ccsInteger, "OmitIfEmpty" => 1);
            $this->UpdateFields["departement_nom"] = array("Name" => "departement_nom", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1);
        }
    //End DataSourceClass_Initialize Event
    
    //Prepare Method @16-9836E462
        function Prepare()
        {
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->wp = new clsSQLParameters($this->ErrorBlock);
            $this->wp->AddParameter("1", "urldepartement_id", ccsInteger, "", "", $this->Parameters["urldepartement_id"], "", false);
            $this->AllParametersSet = $this->wp->AllParamsSet();
            $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "departement_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
            $this->Where = 
                 $this->wp->Criterion[1];
        }
    //End Prepare Method
    
    //Open Method @16-574F3E22
        function Open()
        {
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
            $this->SQL = "SELECT * \n\n" .
            "FROM rec_departements {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 @16-F075DCDC
        function SetValues()
        {
            $this->num_departement->SetDBValue($this->f("num_departement"));
            $this->region_id->SetDBValue(trim($this->f("region_id")));
            $this->departement_nom->SetDBValue($this->f("departement_nom"));
        }
    //End SetValues Method
    
    //Insert Method @16-D3F1C5CD
        function Insert()
        {
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->CmdExecution = true;
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent);
            $this->InsertFields["num_departement"]["Value"] = $this->num_departement->GetDBValue(true);
            $this->InsertFields["region_id"]["Value"] = $this->region_id->GetDBValue(true);
            $this->InsertFields["departement_nom"]["Value"] = $this->departement_nom->GetDBValue(true);
            $this->SQL = CCBuildInsert("rec_departements", $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 @16-8A1225F2
        function Update()
        {
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->CmdExecution = true;
            $Where = "";
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent);
            $this->UpdateFields["num_departement"]["Value"] = $this->num_departement->GetDBValue(true);
            $this->UpdateFields["region_id"]["Value"] = $this->region_id->GetDBValue(true);
            $this->UpdateFields["departement_nom"]["Value"] = $this->departement_nom->GetDBValue(true);
            $this->SQL = CCBuildUpdate("rec_departements", $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 @16-87E3BDC9
        function Delete()
        {
            global $CCSLocales;
            global $DefaultDateFormat;
            $this->CmdExecution = true;
            $Where = "";
            $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent);
            $this->SQL = "DELETE FROM rec_departements";
            $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_departements1DataSource Class @16-FCB6E20C
    
    //Initialize Page @1-84B75A98
    // Variables
    $FileName = "";
    $Redirect = "";
    $Tpl = "";
    $TemplateFileName = "";
    $BlockToParse = "";
    $ComponentName = "";
    $Attributes = "";
    
    // Events;
    $CCSEvents = "";
    $CCSEventResult = "";
    $TemplateSource = "";
    
    $FileName = FileName;
    $Redirect = "";
    $TemplateFileName = "recensement_departements.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-FCB0E0C1
    include_once("./recensement_departements_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-B61AD0EC
    $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_departements = new clsGridrec_departements("", $MainPage);
    $Panel2 = new clsPanel("Panel2", $MainPage);
    $Panel2->GenerateDiv = true;
    $Panel2->PanelId = "Panel1Panel2";
    $rec_departements1 = new clsRecordrec_departements1("", $MainPage);
    $MainPage->Panel1 = & $Panel1;
    $MainPage->rec_departements = & $rec_departements;
    $MainPage->Panel2 = & $Panel2;
    $MainPage->rec_departements1 = & $rec_departements1;
    $Panel1->AddComponent("rec_departements", $rec_departements);
    $Panel1->AddComponent("Panel2", $Panel2);
    $Panel2->AddComponent("rec_departements1", $rec_departements1);
    $rec_departements->Initialize();
    $rec_departements1->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-FA63F900
    $rec_departements1->Operation();
    //End Execute Components
    
    //Go to destination page @1-5D99CA34
    if($Redirect)
    {
        $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
        $DBcnxRecensement->close();
        header("Location: " . $Redirect);
        unset($rec_departements);
        unset($rec_departements1);
        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-1AF7301B
    $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
    $DBcnxRecensement->close();
    unset($rec_departements);
    unset($rec_departements1);
    unset($Tpl);
    //End Unload Page
    
    
    ?>