Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <meta charset="utf-8">
  4.  
  5. <head>
  6.  
  7.  
  8. </head>
  9.  
  10. <body>
  11. <?php
  12. class Osoba1{
  13. protected $Imie;
  14. protected $Nazwisko;
  15. protected $DataZatrudnienia;
  16. function __construct($ImieN,$NazwiskoN,$DataZatrudnieniaN){
  17. $this->Imie = $ImieN;
  18. $this->Nazwisko = $NazwiskoN;
  19. $this->DataZatrudnienia = $DataZatrudnieniaN;
  20. }
  21. function getImie(){
  22. return $this->Imie;
  23. }
  24. function getNazwisko(){
  25. return $this->Nazwisko;
  26. }
  27. function getDataZatrudnienia(){
  28. return $this->DataZatrudnienia;
  29. }
  30.  
  31. }
  32. class Uczen extends Osoba1{
  33. protected $klasa;
  34. protected $srednia;
  35. function __construct($ImieN,$NazwiskoN,$DataZatrudnieniaN,$klasaN,$sredniaN){
  36. $this->Imie = $ImieN;
  37. $this->Nazwisko = $NazwiskoN;
  38. $this->DataZatrudnienia = $DataZatrudnieniaN;
  39. $this->klasa = $klasaN;
  40. $this->srednia = $sredniaN;
  41. }
  42. function getKlasa(){
  43. return $this->klasa;
  44.  
  45. }
  46. function getSrednia(){
  47. return $this->srednia;
  48.  
  49. }
  50. }
  51.  
  52. class Nauczyciel extends Osoba1{
  53. protected $DataZatrudnienia;
  54. protected $Pensja;
  55. function __construct($ImieN,$NazwiskoN,$DataZatrudnieniaN,$PensjaN){
  56. $this->Imie = $ImieN;
  57. $this->Nazwisko = $NazwiskoN;
  58. $this->DataZatrudnienia = $DataZatrudnieniaN;
  59. $this->Pensja = $PensjaN;
  60. }
  61. function getPensja(){
  62. return $this->Pensja;
  63. }
  64. }
  65. $uczen = new Uczen('Olo','Wojtas','4','4','5');
  66. echo $uczen->getImie()."<br>";
  67. echo $uczen->getNazwisko()."<br>";
  68. echo $uczen->getDataZatrudnienia()."<br>";
  69. echo $uczen->getklasa()."<br>";
  70. echo $uczen->getsrednia();
  71. ?>
  72.  
  73.  
  74.  
  75. </body>
  76.  
  77.  
  78. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement