level; } public function setLevel($val) { $this->level = $val; } public function getPoints() { return $this->points; } public function setPoints($val) { $this->points = $val; } public function calcPoints($lvl) { $lvls = array(100, 200, 300, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 125000, 250000, 500000, 1000000); return $lvls[$lvl]; } public function getResult() { return $this->getPoints()." punkti"; } public function save() { global $kdb; $aid = $this->getAnswerID(); parent::save(); if ( $aid == null ) { $sql = "INSERT INTO ".$this->table." (answerID, level, points) values(".$this->getAnswerID().", '".$this->getLevel()."', '".$this->getPoints()."')"; $kdb->query($sql); } else { // update answer - not in this version of Krihvel } } } ?>