File "recensement_all.php"
Full path: /home/meharicl/www/recensement2/recensement_all.php
File
size: 19.6 B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
//Include Common Files @1-D15D6BC1
define("RelativePath", ".");
define("PathToCurrentPage", "/");
define("FileName", "recensement_all.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_mehari { //rec_mehari class @2-C2FBDC88
//Variables @2-2C46CABC
// 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;
public $Sorter_mehari_id;
public $Sorter_mehari_an;
public $Sorter_mehari_type;
public $Sorter_mehari_numero_serie;
public $Sorter_mehari_date_circulation;
public $Sorter_mehari_modele;
public $Sorter_departement_id;
public $Sorter_mehari_couleur;
public $Sorter_mehari_place;
//End Variables
//Class_Initialize Event @2-BFC08E42
function clsGridrec_mehari($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "rec_mehari";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid rec_mehari";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clsrec_mehariDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 10000;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 10000)
$this->PageSize = 10000;
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->SorterName = CCGetParam("rec_mehariOrder", "");
$this->SorterDirection = CCGetParam("rec_mehariDir", "");
$this->mehari_id = new clsControl(ccsLabel, "mehari_id", "mehari_id", ccsInteger, "", CCGetRequestParam("mehari_id", ccsGet, NULL), $this);
$this->mehari_an = new clsControl(ccsLabel, "mehari_an", "mehari_an", ccsText, "", CCGetRequestParam("mehari_an", ccsGet, NULL), $this);
$this->mehari_type = new clsControl(ccsLabel, "mehari_type", "mehari_type", ccsText, "", CCGetRequestParam("mehari_type", ccsGet, NULL), $this);
$this->mehari_numero_serie = new clsControl(ccsLabel, "mehari_numero_serie", "mehari_numero_serie", ccsText, "", CCGetRequestParam("mehari_numero_serie", ccsGet, NULL), $this);
$this->mehari_date_circulation = new clsControl(ccsLabel, "mehari_date_circulation", "mehari_date_circulation", ccsDate, $DefaultDateFormat, CCGetRequestParam("mehari_date_circulation", ccsGet, NULL), $this);
$this->mehari_modele = new clsControl(ccsLabel, "mehari_modele", "mehari_modele", ccsText, "", CCGetRequestParam("mehari_modele", ccsGet, NULL), $this);
$this->departement_nom = new clsControl(ccsLabel, "departement_nom", "departement_nom", ccsText, "", CCGetRequestParam("departement_nom", ccsGet, NULL), $this);
$this->couleur_desc = new clsControl(ccsLabel, "couleur_desc", "couleur_desc", ccsText, "", CCGetRequestParam("couleur_desc", ccsGet, NULL), $this);
$this->place_desc = new clsControl(ccsLabel, "place_desc", "place_desc", ccsText, "", CCGetRequestParam("place_desc", ccsGet, NULL), $this);
$this->Sorter_mehari_id = new clsSorter($this->ComponentName, "Sorter_mehari_id", $FileName, $this);
$this->Sorter_mehari_an = new clsSorter($this->ComponentName, "Sorter_mehari_an", $FileName, $this);
$this->Sorter_mehari_type = new clsSorter($this->ComponentName, "Sorter_mehari_type", $FileName, $this);
$this->Sorter_mehari_numero_serie = new clsSorter($this->ComponentName, "Sorter_mehari_numero_serie", $FileName, $this);
$this->Sorter_mehari_date_circulation = new clsSorter($this->ComponentName, "Sorter_mehari_date_circulation", $FileName, $this);
$this->Sorter_mehari_modele = new clsSorter($this->ComponentName, "Sorter_mehari_modele", $FileName, $this);
$this->Sorter_departement_id = new clsSorter($this->ComponentName, "Sorter_departement_id", $FileName, $this);
$this->Sorter_mehari_couleur = new clsSorter($this->ComponentName, "Sorter_mehari_couleur", $FileName, $this);
$this->Sorter_mehari_place = new clsSorter($this->ComponentName, "Sorter_mehari_place", $FileName, $this);
}
//End Class_Initialize Event
//Initialize Method @2-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 @2-D28D36B8
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["mehari_id"] = $this->mehari_id->Visible;
$this->ControlsVisible["mehari_an"] = $this->mehari_an->Visible;
$this->ControlsVisible["mehari_type"] = $this->mehari_type->Visible;
$this->ControlsVisible["mehari_numero_serie"] = $this->mehari_numero_serie->Visible;
$this->ControlsVisible["mehari_date_circulation"] = $this->mehari_date_circulation->Visible;
$this->ControlsVisible["mehari_modele"] = $this->mehari_modele->Visible;
$this->ControlsVisible["departement_nom"] = $this->departement_nom->Visible;
$this->ControlsVisible["couleur_desc"] = $this->couleur_desc->Visible;
$this->ControlsVisible["place_desc"] = $this->place_desc->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->mehari_id->SetValue($this->DataSource->mehari_id->GetValue());
$this->mehari_an->SetValue($this->DataSource->mehari_an->GetValue());
$this->mehari_type->SetValue($this->DataSource->mehari_type->GetValue());
$this->mehari_numero_serie->SetValue($this->DataSource->mehari_numero_serie->GetValue());
$this->mehari_date_circulation->SetValue($this->DataSource->mehari_date_circulation->GetValue());
$this->mehari_modele->SetValue($this->DataSource->mehari_modele->GetValue());
$this->departement_nom->SetValue($this->DataSource->departement_nom->GetValue());
$this->couleur_desc->SetValue($this->DataSource->couleur_desc->GetValue());
$this->place_desc->SetValue($this->DataSource->place_desc->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->mehari_id->Show();
$this->mehari_an->Show();
$this->mehari_type->Show();
$this->mehari_numero_serie->Show();
$this->mehari_date_circulation->Show();
$this->mehari_modele->Show();
$this->departement_nom->Show();
$this->couleur_desc->Show();
$this->place_desc->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->Sorter_mehari_id->Show();
$this->Sorter_mehari_an->Show();
$this->Sorter_mehari_type->Show();
$this->Sorter_mehari_numero_serie->Show();
$this->Sorter_mehari_date_circulation->Show();
$this->Sorter_mehari_modele->Show();
$this->Sorter_departement_id->Show();
$this->Sorter_mehari_couleur->Show();
$this->Sorter_mehari_place->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @2-9021663F
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->mehari_id->Errors->ToString());
$errors = ComposeStrings($errors, $this->mehari_an->Errors->ToString());
$errors = ComposeStrings($errors, $this->mehari_type->Errors->ToString());
$errors = ComposeStrings($errors, $this->mehari_numero_serie->Errors->ToString());
$errors = ComposeStrings($errors, $this->mehari_date_circulation->Errors->ToString());
$errors = ComposeStrings($errors, $this->mehari_modele->Errors->ToString());
$errors = ComposeStrings($errors, $this->departement_nom->Errors->ToString());
$errors = ComposeStrings($errors, $this->couleur_desc->Errors->ToString());
$errors = ComposeStrings($errors, $this->place_desc->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End rec_mehari Class @2-FCB6E20C
class clsrec_mehariDataSource extends clsDBcnxRecensement { //rec_mehariDataSource Class @2-76414677
//DataSource Variables @2-F3FA7E9E
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $mehari_id;
public $mehari_an;
public $mehari_type;
public $mehari_numero_serie;
public $mehari_date_circulation;
public $mehari_modele;
public $departement_nom;
public $couleur_desc;
public $place_desc;
//End DataSource Variables
//DataSourceClass_Initialize Event @2-4848C081
function clsrec_mehariDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid rec_mehari";
$this->Initialize();
$this->mehari_id = new clsField("mehari_id", ccsInteger, "");
$this->mehari_an = new clsField("mehari_an", ccsText, "");
$this->mehari_type = new clsField("mehari_type", ccsText, "");
$this->mehari_numero_serie = new clsField("mehari_numero_serie", ccsText, "");
$this->mehari_date_circulation = new clsField("mehari_date_circulation", ccsDate, $this->DateFormat);
$this->mehari_modele = new clsField("mehari_modele", ccsText, "");
$this->departement_nom = new clsField("departement_nom", ccsText, "");
$this->couleur_desc = new clsField("couleur_desc", ccsText, "");
$this->place_desc = new clsField("place_desc", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @2-259A277B
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "rec_mehari.mehari_id DESC";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_mehari_id" => array("mehari_id", ""),
"Sorter_mehari_an" => array("mehari_an", ""),
"Sorter_mehari_type" => array("mehari_type", ""),
"Sorter_mehari_numero_serie" => array("mehari_numero_serie", ""),
"Sorter_mehari_date_circulation" => array("mehari_date_circulation", ""),
"Sorter_mehari_modele" => array("mehari_modele", ""),
"Sorter_departement_id" => array("departement_id", ""),
"Sorter_mehari_couleur" => array("mehari_couleur", ""),
"Sorter_mehari_place" => array("mehari_place", "")));
}
//End SetOrder Method
//Prepare Method @2-14D6CD9D
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
}
//End Prepare Method
//Open Method @2-07C627BF
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*) FROM (((((rec_mehari LEFT JOIN rec_departements ON\n" .
"rec_mehari.departement_id = rec_departements.departement_id) LEFT JOIN rec_regions ON\n" .
"rec_departements.region_id = rec_regions.region_id) LEFT JOIN rec_couleurs ON\n" .
"rec_mehari.mehari_couleur = rec_couleurs.couleur_id) LEFT JOIN rec_places ON\n" .
"rec_mehari.mehari_place = rec_places.place_id) LEFT JOIN rec_pays ON\n" .
"rec_regions.pays_id = rec_pays.pays_id) LEFT JOIN rec_modele ON\n" .
"rec_mehari.modele_id = rec_modele.modele_id";
$this->SQL = "SELECT rec_mehari.*, num_departement, departement_nom, region_nom, pays_nom, couleur_desc, place_desc, modele_desc\n" .
"FROM (((((rec_mehari LEFT JOIN rec_departements ON\n" .
"rec_mehari.departement_id = rec_departements.departement_id) LEFT JOIN rec_regions ON\n" .
"rec_departements.region_id = rec_regions.region_id) LEFT JOIN rec_couleurs ON\n" .
"rec_mehari.mehari_couleur = rec_couleurs.couleur_id) LEFT JOIN rec_places ON\n" .
"rec_mehari.mehari_place = rec_places.place_id) LEFT JOIN rec_pays ON\n" .
"rec_regions.pays_id = rec_pays.pays_id) LEFT JOIN rec_modele ON\n" .
"rec_mehari.modele_id = rec_modele.modele_id {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 @2-7F5176EA
function SetValues()
{
$this->mehari_id->SetDBValue(trim($this->f("mehari_id")));
$this->mehari_an->SetDBValue($this->f("mehari_an"));
$this->mehari_type->SetDBValue($this->f("mehari_type"));
$this->mehari_numero_serie->SetDBValue($this->f("mehari_numero_serie"));
$this->mehari_date_circulation->SetDBValue(trim($this->f("mehari_date_circulation")));
$this->mehari_modele->SetDBValue($this->f("modele_desc"));
$this->departement_nom->SetDBValue($this->f("departement_nom"));
$this->couleur_desc->SetDBValue($this->f("couleur_desc"));
$this->place_desc->SetDBValue($this->f("place_desc"));
}
//End SetValues Method
} //End rec_mehariDataSource Class @2-FCB6E20C
//Include Page implementation @22-11B45D65
include_once(RelativePath . "/top.php");
//End Include Page implementation
//Initialize Page @1-1A34CE1F
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
$Attributes = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$TemplateSource = "";
$FileName = FileName;
$Redirect = "";
$TemplateFileName = "recensement_all.html";
$BlockToParse = "main";
$TemplateEncoding = "UTF-8";
$ContentType = "text/html";
$PathToRoot = "./";
$PathToRootOpt = "";
$Scripts = "|";
$Charset = $Charset ? $Charset : "utf-8";
//End Initialize Page
//Before Initialize @1-E870CEBC
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage);
//End Before Initialize
//Initialize Objects @1-3369F363
$DBcnxRecensement = new clsDBcnxRecensement();
$MainPage->Connections["cnxRecensement"] = & $DBcnxRecensement;
$Attributes = new clsAttributes("page:");
$Attributes->SetValue("pathToRoot", $PathToRoot);
$MainPage->Attributes = & $Attributes;
// Controls
$rec_mehari = new clsGridrec_mehari("", $MainPage);
$top = new clstop("", "top", $MainPage);
$top->Initialize();
$MainPage->rec_mehari = & $rec_mehari;
$MainPage->top = & $top;
$rec_mehari->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);
$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-DC3EC8FB
$top->Operations();
//End Execute Components
//Go to destination page @1-3ECF908F
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBcnxRecensement->close();
header("Location: " . $Redirect);
unset($rec_mehari);
$top->Class_Terminate();
unset($top);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-9D810039
$rec_mehari->Show();
$top->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-5B6E1DCD
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBcnxRecensement->close();
unset($rec_mehari);
$top->Class_Terminate();
unset($top);
unset($Tpl);
//End Unload Page
?>