<?php ?>
a jesli cd to
<?php ?>
wiem ze trzeba zastosowac warunek lecz nie umiem go zastosowac.Prosze o pomoc
<?php ?>
<?php ?>
<?php if($_POST['nosnik']='dvd') { $obliczenie = obliczDVD(); }elseif($_POST['nosnik']='cd') { $obliczenie = obliczCD(); } else { } ?>
<?php ?>
<?php class Zestawienie{ private $ilosc; private $typ; public $cena; public $cenaKuriera; __construct($inIlosc,$inTyp,$inCenaKuriera='14.5') { $this->$ilosc = $inIlosc; $this->$typ = $inTyp; $this->$cenaKuriera = $inCenaKuriera; } public function getIlosc() { return $this->$ilosc; } public function getCena() { return $this->obliczCene(); } private function obliczCene() { if($this->$typ = 'cd'){ $this->obliczCD(); } elseif ($this->$typ = 'dvd') { $this->obliczDVD; } else { } private function obliczCD() { //kod liczacy cene return $this->$cena; } private function obliczDVD() { // kod liczacy cene return $this->$cena; } } ?>
<?php $zestawienie = new Zestawienie($_POST['ilosc'],$_POST['typ']); ?>
<table> <tr> </tr> <tr> </tr> <tr> </tr> </table>