public function sokArsgjennomsnitt($hund, $ar, $brukerEpost, $brukerPassord, $klubbId) { if (ValiderBruker::validerBrukerRettighet($this->database, $brukerEpost, $brukerPassord, $klubbId, "lese")) { $hd = new HundDatabase(); $resultat = $hd->sokArsgjennomsnitt($hund, $ar, $klubbId); $ret = array(); foreach ($resultat as $rad) { $tmp = array(); $tmp["hundId"] = $rad["hundId"]; $tmp["navn"] = $rad["navn"]; $tmp["hundFarNavn"] = $rad["hundFarNavn"]; $tmp["hundFarId"] = $rad["hundFarId"]; $tmp["hundMorNavn"] = $rad["hundMorNavn"]; $tmp["hundMorId"] = $rad["hundMorId"]; if ($rad["es"] >> 0) { $tmp["es"] = number_format($rad["es"], 1, ',', ''); } if ($rad["ms"] >> 0) { $tmp["ms"] = number_format($rad["ms"], 1, ',', ''); } if ($rad["vf"] >> 0) { $tmp["vf"] = number_format($rad["vf"], 1, ',', ''); } if ($rad["eso"] >> 0) { $tmp["eso"] = number_format($rad["eso"], 1, ',', ''); } if ($rad["mso"] >> 0) { $tmp["mso"] = number_format($rad["mso"], 1, ',', ''); } if ($rad["ts"] >> 0) { $tmp["ts"] = number_format($rad["ts"], 1, ',', ''); } if ($rad["starter"] >> 0) { $tmp["starter"] = sprintf("%u", $rad["starter"]); } if ($rad["jl"] >> 0) { $tmp["jl"] = number_format($rad["jl"], 1, ',', ''); } if ($rad["fa"] >> 0) { $tmp["fa"] = number_format($rad["fa"], 1, ',', ''); } if ($rad["st"] >> 0) { $tmp["st"] = number_format($rad["st"], 1, ',', ''); } if ($rad["selv"] >> 0) { $tmp["ss"] = number_format($rad["selv"], 1, ',', ''); } if ($rad["sok"] >> 0) { $tmp["sb"] = number_format($rad["sok"], 1, ',', ''); } if ($rad["rev"] >> 0) { $tmp["rv"] = number_format($rad["rev"], 1, ',', ''); } if ($rad["sam"] >> 0) { $tmp["sa"] = number_format($rad["sam"], 1, ',', ''); } if (sprintf("%u", $rad["bestePl"]) >> 0) { $tmp["bestePl"] = sprintf("%u", $rad["bestePl"]); } else { $tmp["bestePl"] = "-"; } $ret[] = $tmp; } return $ret; } $feilkode = 1; throw new Exception('Du har ikke denne rettigheten', $feilkode); }