class Regle
{
function Regle(){}
function setRegle($id, $type, $libelle, $preambule){}
function getRegle (){}
}
/*************************/
class regleMembre extends Regle {
var $idtxt;
var $typetxt;
var $libelletxt;
var $preambuletxt;
function regleMembre($id=''){
if ($id <> ""){
$sql = "Select * From regle Where IDTXT=".$id;
$result = runquery($sql);
$answer = mysql_fetch_row($result);
$this->IDTXT=$answer[0];
$this->typetxt=$answer[1];
$this->libelletxt=stripslashes($answer[2]);
$this->preambuletxt=stripslashes($answer[3]);
}
}
//property
function getTypetxt(){return $this->typetxt;}
function getLibelletxt(){return $this->libelletxt;}
//methodes
function setRegle($id, $type, $libelle, $preambule){
$this->idtxt=$id;
$this->typetxt=$type;
$this->libelletxt=stripslashes($libelle);
$this->preambuletxt=stripslashes($preambule);
}
function getRegle(){
$p ="
";
$chap = new Chapitres($IDR);
$p .= $chap->lireChapitres();
return $p;
}
}
//*************************************************
class baseChapitre
{
function baseChapitre(){}
function setChapitre($id, $regle, $code, $libelle){}
function getChapitre(){}
}
//*************
class Chapitre extends baseChapitre
{
var $IDCHAP; // type : int
var $IDTXT; // type : int
var $CodeChap; // type : string
var $LibelleChap; // type : string
function Chapitre($idChap=''){
if ($idChap <> ""){
$sql = "Select * From chapitre Where IDCHAP=".$idChap;
$result = runquery($sql);
$answer = mysql_fetch_row($result);
$this->IDCHAP=$answer[0];
$this->IDTXT=$answer[1];
$this->CodeChap=stripslashes($answer[2]);
$this->LibelleChap=stripslashes($answer[3]);
}
}
//properties
function getCode(){ return $this->CodeChap;}
function getLibelle(){ return $this->LibelleChap;}
function getRegle(){ return $this->IDTXT;}
//methodes
function setChapitre($id, $regle, $code, $libelle){
$this->IDCHAP=$id;
$this->IDTXT=$regle;
$this->CodeChap=stripslashes($code);
$this->LibelleChap=stripslashes($libelle);
}
function getChapitre(){
global $Z;
$p = "
";
$arts = new Articles($chap);
$p .= $arts->lireArticles();
$artSec = new Sections($chap);
$p .= $artSec->lireSections($chap);
return $p;
}
}
//****************
class Article
{
var $IDART; // type : int
var $IDSEC; // type : int
var $IDCHAP; // type : int
var $CodeArt; // type : string
var $ContenuArt; // type : string
function Article(){}
function setArticle($id, $section, $chapitre, $code, $content){
$this->IDART=$id;
$this->IDSEC=$section;
$this->IDCHAP=$chapitre;
$this->CodeArt=stripslashes($code);
$this->ContenuArt=stripslashes($content);
}
function getArticle(){
$p = "
";
return $p;
}
}
//********************
class Articles
{
var $items;
function Articles($chapitre, $section=''){
if ($section != '') {
$sql = "Select * From article Where (IDCHAP=".$chapitre." and IDSEC=".$section.") Order by CodeArt";
}else{
$sql = "Select * From article Where (IDCHAP=".$chapitre." and IDSEC=0) Order by CodeArt";
}
$result = runquery($sql);
while ($answer = mysql_fetch_array($result)) {
$item = new Article;
$item->setArticle($answer[0], $answer[1], $answer[2], $answer[3], $answer[4]);
$this->items[] = $item;
}
}
function lireArticles(){
$content = "";
if ( !isset($this->items)) return;
foreach ($this->items as $i => $value) {
$content .= $this->items[$i]->getarticle();
}
return $content;
}
}
//****************
class Section
{
var $IDSEC; // type : int
var $IDCHAP; // type : int
var $CodeSec; // type : string
var $LibelleSec; // type : string
function Section(){}
function setSection($id, $chapitre, $code, $content){
$this->IDSEC=$id;
$this->IDCHAP=$chapitre;
$this->CodeSec=stripslashes($code);
$this->LibelleSec=stripslashes($content);
}
function getSection($chap){
$p = "
";
return $p;
}
}
//*************************
class Sections {
var $items;
function Sections($chapitre){
$sql = "Select * From section Where (IDCHAP=".$chapitre.") Order By CodeSec";
$result = runquery($sql);
while ($answer = mysql_fetch_array($result)) {
$item = new Section;
$item->setSection($answer[0], $answer[1], $answer[2], $answer[3]);
$this->items[] = $item;
}
}
function lireSections($chapitre){
$content = "";
if ( !isset($this->items)) return;
foreach ($this->items as $i => $value) {
$content .= $this->items[$i]->getSection($chapitre);
}
return $content;
}
}
?>
Pharmacie du Point G