Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <meta charset="utf-8">
- <head>
- </head>
- <body>
- <?php
- class Osoba1{
- protected $Imie;
- protected $Nazwisko;
- protected $DataZatrudnienia;
- function __construct($ImieN,$NazwiskoN,$DataZatrudnieniaN){
- $this->Imie = $ImieN;
- $this->Nazwisko = $NazwiskoN;
- $this->DataZatrudnienia = $DataZatrudnieniaN;
- }
- function getImie(){
- return $this->Imie;
- }
- function getNazwisko(){
- return $this->Nazwisko;
- }
- function getDataZatrudnienia(){
- return $this->DataZatrudnienia;
- }
- }
- class Uczen extends Osoba1{
- protected $klasa;
- protected $srednia;
- function __construct($ImieN,$NazwiskoN,$DataZatrudnieniaN,$klasaN,$sredniaN){
- $this->Imie = $ImieN;
- $this->Nazwisko = $NazwiskoN;
- $this->DataZatrudnienia = $DataZatrudnieniaN;
- $this->klasa = $klasaN;
- $this->srednia = $sredniaN;
- }
- function getKlasa(){
- return $this->klasa;
- }
- function getSrednia(){
- return $this->srednia;
- }
- }
- class Nauczyciel extends Osoba1{
- protected $DataZatrudnienia;
- protected $Pensja;
- function __construct($ImieN,$NazwiskoN,$DataZatrudnieniaN,$PensjaN){
- $this->Imie = $ImieN;
- $this->Nazwisko = $NazwiskoN;
- $this->DataZatrudnienia = $DataZatrudnieniaN;
- $this->Pensja = $PensjaN;
- }
- function getPensja(){
- return $this->Pensja;
- }
- }
- $uczen = new Uczen('Olo','Wojtas','4','4','5');
- echo $uczen->getImie()."<br>";
- echo $uczen->getNazwisko()."<br>";
- echo $uczen->getDataZatrudnienia()."<br>";
- echo $uczen->getklasa()."<br>";
- echo $uczen->getsrednia();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement