All pastes #36565 Raw Edit

Stuff

public php v1 · immutable
#36565 ·published 2006-01-12 09:52 UTC
rendered paste body
class personne {	//Variables	var $nom;	var $adresse1;	var $adresse2;	var $cp;	var $ville;	var $telephone;	//Méthodes	//Constructeur	function personne($nom="") {		if(!empty($nom)) $this->nom=$nom; else $this->nom="pas de nom précisé";	}}class client extends personne {		//init les info du client à partir de son id	function getClientInfo($idClient=-1) {			global $cnx;			$requete = "SELECT * FROM client WHERE id_client='".$idClient."' ORDER BY nom";			$resCli = ExecRequete ($requete, $cnx);			$cClient=LigneSuivante ($resCli);			$this->nom=$cClient->nom;			$this->ville=$cClient->ville;	}		//init les info du client à partir de son id	function setClientInfo($nom, $prenom, $ville) {			$this->nom=$nom;			$this->nom=$prenom;			$this->ville=$ville;	}	}class clientListe extends client {	//var	var $aClient;	//methodes	function clientListe($aId=array()) {		global $cnx;		if(!empty($aId)) {}		else {			$requete = "SELECT * FROM client ORDER BY nom";			$resCli = ExecRequete ($requete, $cnx);			while($cClient=LigneSuivante ($resCli)) {				$objClient=new client();				$objClient->setClientInfo($cClient->nom, $cClient->prenom, $cClient->ville);				$lClient[]=$objClient;			}			$this->aClient=$lClient;		}				}	}