Ejemplo n.º 1
0
if (isset($_GET["id"]) && $_GET["id"] == floor($_GET["id"])) {
    $id = $_GET["id"];
    $medlem = Medlem::loadById($id);
    $foretag = Foretag::loadById($medlem->getForetag()->getId());
    $foretagId = $foretag->getId();
    $slutDatum = $foretag->getSlutdatum();
    // this is the active companys enddate, all companies with this enddate or later should be shown
    $slutDatum_ts = strtotime($slutDatum);
} else {
    throw new UserException('Du tillhör inte detta företag', 'Sidan du försökte komma åt kräver att man använder en länk som man får i ett mail, när man gått klart en företagstävling');
}
$smarty = new MMSmarty(true, -1);
// Caches the contest content indefinitely
$smarty->assign("medlem", $medlem);
$smarty->assign("tavlingsresultatsidan", true);
if (!$smarty->is_cached('contest_results_template.tpl', $foretagId)) {
    if (isset($foretag)) {
        $CompanyTeams = $foretag->listLag();
        $smarty->assign("CompanyTeams", $CompanyTeams);
    }
    $smarty->assign('pagetitle', ucfirst($foretag->getNamn()) . ' — Sammanfattning av tävling');
    $kommun = $foretag->getKommun();
    $smarty->assign("foretag", $foretag);
    $smarty->assign("kommun", $kommun);
    $topplistan = $foretag->getTopplistaLag(false, true);
    $flagslice = null;
    $nr = null;
    if (count($topplistan) < 2) {
        $multiplier = 0;
    } else {
        if (count($topplistan) > 10) {