commit 59d0786bc327ab3b551c9bfb6a65ec3ab6d65013 Author: Logshiro Date: Mon Sep 29 13:11:49 2025 +0200 Premier commit diff --git a/Etudiant.php b/Etudiant.php new file mode 100644 index 0000000..5b7c38a --- /dev/null +++ b/Etudiant.php @@ -0,0 +1,44 @@ +nom = $nom; + $this->prenom = $prenom; + $this->age = $age; + } + + public function afficherHtml(){ + echo "Etudiant2 :
". "Nom : ".$this->getNom()."
" + ."Prenom : ".$this->getPrenom()."
"."Age : ".$this->getAge()."
"; + } + + //accès en écriture (setter) + public function setNom($nom){ + $this->nom = $nom; + } + + public function setPrenom($prenom){ + $this->prenom = $prenom; + } + + public function setAge($age){ + $this->age = $age; + } + + public function getNom(){ + return $this->nom; + } + + public function getPrenom(){ + return $this->prenom; + } + + public function getAge(){ + return $this->age; + } + } \ No newline at end of file diff --git a/EtudiantBachelor.php b/EtudiantBachelor.php new file mode 100644 index 0000000..8d0b997 --- /dev/null +++ b/EtudiantBachelor.php @@ -0,0 +1,13 @@ +Etudiant2 :
". "Nom : ".$this->getNom()."
" + ."Prenom : ".$this->getPrenom()."
"."Age : " + .$this->getAge()."
"."Eveil : ;".$this->tempsEveil; + } + } \ No newline at end of file diff --git a/scripte1.php b/scripte1.php new file mode 100644 index 0000000..ec2041a --- /dev/null +++ b/scripte1.php @@ -0,0 +1,20 @@ + vérif du rôle + // => si pas les droits : bye + + //echo "script 1
"; + + $etu1 = new Etudiant("Dupont","Lorant","25"); + //$etu1->setNom("Durant"); + $etu1->afficherHtml(); + + $etu2 = new EtudiantBachelor("Dudu","Olivie","20"); + + $etu2->afficherHtml(); + + traitementPrive(); \ No newline at end of file diff --git a/scripte2.php b/scripte2.php new file mode 100644 index 0000000..1f1f30e --- /dev/null +++ b/scripte2.php @@ -0,0 +1,13 @@ +
Dans script 2
"; + echo "Super privé, super dangereux...
"; + + echo $a; + } + \ No newline at end of file