} if (!empty($medlem_id)) { $stegindex = Medlem::getStegIndexForMedlemId($medlem_id, $tForetag); if ($tForetag != null && $stegindex != null && strtotime($tForetag->getSlutDatum()) >= $slutDatum_ts) { $tm[] = array("stegindex" => $stegindex, "namn" => $medlem_anamn, "id" => $medlem_id); } } } unset($tForetag); unset($medlem_stegtotal_cache); unset($res); if (count($tm) != 0) { array_multisort($tm, SORT_DESC); } unset($positioner); unset($topplistan); unset($tmObjects); unset($tlObjects); unset($tfObjects); $smarty->assign("medlemmar", $medlemmar); $topplistaDeltagare = new Topplista(); $topplistaDeltagare->addParameter(Topplista::PARAM_FORETAG, $foretag); $topplistaDeltagare->addParameter(Topplista::PARAM_START, $foretag->getStartdatum()); $smarty->assign("topplistaDeltagare", $topplistaDeltagare); $smarty->assign("startDatum", $foretag->getStartdatum()); $smarty->assign("slutDatum", $slutDatum); $smarty->assign("topplista_foretag", $tf); $smarty->assign("topplista_lag", $tl); $smarty->assign("topplista_medlem", $tm); } $smarty->display('contest_results_template.tpl', $foretagId);
} $smarty->assign("gruppnamn", $grupp->getNamn()); $requests = $grupp->listRequests(); if (count($requests) > 0) { $smarty->assign("requests", $requests); } } else { // medlemmen är INTE gruppens ägare //$smarty->assign("owner", false); $requestable = $grupp->isRequestable($USER); $ismember = $grupp->isMember($USER); $smarty->assign("requestable", $requestable); $smarty->assign("ismember", $ismember); } // Topplista $topplista = new Topplista(); $topplista->setGrupp($grupp); $topplista->makeMedlemTopplista(); $dataArr = $topplista->getData(); $smarty->assign("topplista", $dataArr); // Fotoalbum $bildblock = FotoalbumBild::loadGruppsBildblock($grupp, $antal = 16); $smarty->assign("bildblock", $bildblock); /* // Skapa anslagstavla om detta saknas (temp, behövs bara när grupper finns som skapades innan anslagstavlorna fanns) if($grupp->getAnslagstavlaId() == 0) { $grupp->setAnslagstavla(new Anslagstavla($grupp->getId(),0)); $grupp->commit(); }*/
<?php global $USER; require $_SERVER["DOCUMENT_ROOT"] . "/php/init.php"; $smarty = new MMSmarty(); $topplista = new Topplista(); if (!empty($_POST["kommun_id"])) { $kommun = Kommun::loadById($_POST["kommun_id"]); $topplista->addParameter(Topplista::PARAM_KOMMUN, $kommun); } if (!empty($_POST["kon"])) { $topplista->addParameter(Topplista::PARAM_KON, $_POST["kon"]); } if (!empty($_POST["fodelsearFran"]) || !empty($_POST["fodelsearTill"])) { $topplista->addParameter(Topplista::PARAM_FODELSEAR, array($_POST["fodelsearFran"], $_POST["fodelsearTill"])); } if (!empty($_POST["lan"])) { $topplista->addParameter(Topplista::PARAM_LAN, utf8_encode($_POST["lan"])); } //visa inte medlemmen som utför sök $topplista->addParameter(Topplista::PARAM_DONTSHOWMEMBER, $USER->getId()); if (!empty($attribut)) { foreach ($attribut as $thisAttribut) { if (!empty($_POST["profilData" . $thisAttribut->getId()])) { $topplista->addParameter(Topplista::PARAM_PROFILINFO, array($thisAttribut->getId(), $_POST["profilData" . $thisAttribut->getId()])); } } } $nolink = array(); global $USER; $adressbok = Adressbok::loadByMedlem($USER);
$smarty->assign("lagnamn", $medlem->getLag()->getNamn()); $smarty->assign("lagid", $medlem->getLag()->getId()); } $usrForetag = $medlem->getForetag(); if (isset($usrForetag) && $usrForetag->aktivTavling()) { $smarty->assign("foretagnamn", $medlem->getForetag()->getNamn()); if ($medlem->getForetag()->getStartDatum() > date("Y-m-d")) { $smarty->assign("tavlingstart", Misc::getDagarMellanTvaDatum(date("Y-m-d"), $medlem->getForetag()->getStartDatum())); } } if (count($grupper) > 0) { $smarty->assign("grupper", $grupper); } // Topplistor $forraVeckan = date("Y-m-d H:i:s", strtotime('-7 days')); $topplista = new Topplista(); $topplista->addParameter(Topplista::PARAM_START, $forraVeckan); $smarty->assign("topplista", $topplista); $topplista_array = array($medlem->getId(), ""); $smarty->assign("topplista_array", $topplista_array); $smarty->assign("medlem", $medlem); $visningsbild = $medlem->getVisningsbild(); $smarty->assign("visningsbild", $visningsbild); $rutt = new Rutt($medlem); $currentKommun = $rutt->getCurrentKommun(); $smarty->assign("currentKommun", $currentKommun); $latestKommun = $medlem->getLatestKommun(); $smarty->assign("latestKommun", $latestKommun); if (isset($USER) && isset($medlem) && $medlem->getId() != $USER->getId()) { $minaGrupper = $USER->listCreatedGroups(); if (count($minaGrupper) > 0) {
$sel_fodelsear = isset($_POST["fodelsear"]) ? $_POST["fodelsear"] : ""; $smarty->assign("opt_fodelsear", $opt_fodelsear); $smarty->assign("sel_fodelsear", $sel_fodelsear); // Profildata $attribut = ProfilData::listAll(); foreach ($attribut as $thisAttribut) { $alternativ = $thisAttribut->getProfilDataVals(); $opt_alternativ = array("" => "Välj..."); foreach ($alternativ as $thisAlternativ) { $opt_alternativ[$thisAlternativ->getId()] = $thisAlternativ->getVarde(); } $sel_alternativ = !empty($_POST["profilData" . $thisAttribut->getId()]) ? $_POST["profilData" . $thisAttribut->getId()] : ""; $profilData[$thisAttribut->getId()] = array("namn" => $thisAttribut->getNamn(), "opt" => $opt_alternativ, "sel" => $sel_alternativ, "formId" => "profilData" . $thisAttribut->getId()); } $smarty->assign("profilData", $profilData); $topplista = new Topplista(); if (!empty($_POST["kommun_id"])) { $kommun = Kommun::loadById($_POST["kommun_id"]); $topplista->addParameter(Topplista::PARAM_KOMMUN, $kommun); } if (!empty($_POST["kon"])) { $topplista->addParameter(Topplista::PARAM_KON, $_POST["kon"]); } if (!empty($_POST["fodelsear"])) { $topplista->addParameter(Topplista::PARAM_FODELSEAR, $_POST["fodelsear"]); } if (!empty($_POST["lan"])) { $topplista->addParameter(Topplista::PARAM_LAN, $_POST["lan"]); } foreach ($attribut as $thisAttribut) { if (!empty($_POST["profilData" . $thisAttribut->getId()])) {
} } $topplista_sju->addParameter(Topplista::PARAM_START, $forraVeckan); $smarty->assign("topplista_sju", $topplista_sju); $fyraVeckor = date("Y-m-d H:i:s", strtotime("-28 days")); $topplista_28 = new Topplista(); if (isset($klubb)) { $topplista_28->addParameter(Topplista::PARAM_GRUPP, $klubb); if ($klubb->getStart() > $fyraVeckor) { $fyraVeckor = $klubb->getStart(); } } $topplista_28->addParameter(Topplista::PARAM_START, $fyraVeckor); $smarty->assign("topplista_28", $topplista_28); $quiz = date("Y-m-d H:i:s", strtotime(date("Y-m-d")) - 60 * 60 * 24 * 7); $topplista_quiz = new Topplista(Topplista::TOPPLISTA_QUIZ); if (isset($klubb)) { $topplista_quiz->addParameter(Topplista::PARAM_GRUPP, $klubb); } $topplista_quiz->addParameter(Topplista::PARAM_QUIZ_START, $fyraVeckor); $smarty->assign("topplista_quiz", $topplista_quiz); $topplista_kommuner = new Topplista(Topplista::TOPPLISTA_KOMMUNER); if (isset($klubb)) { $topplista_kommuner->addParameter(Topplista::PARAM_GRUPP, $klubb); if ($klubb->getStart() > $fyraVeckor) { $fyraVeckor = $klubb->getStart(); } } $topplista_kommuner->addParameter(Topplista::PARAM_KOMMUNER_START, $forraVeckan); $smarty->assign("topplista_kommuner", $topplista_kommuner); $smarty->display('topplistor.tpl');
} $topplistan = array_reverse($topplistan); $i = 0; $positioner = array(); foreach ($topplistan as $position) { $positioner[$position["medlem"]->getId()] = round($i * $multiplier); $i++; } $smarty->assign("positioner", $positioner); } $foretag2 = $lag->getForetag(); $smarty->assign("foretag2", $foretag2); $smarty->assign("medlem", $USER); // Topplistor $forraVeckan = date("Y-m-d H:i:s", strtotime(date("Y-m-d")) - 60 * 60 * 24 * 7); $topplista = new Topplista(); $topplista->addParameter(Topplista::PARAM_START, $forraVeckan); $topplista->addParameter(Topplista::PARAM_START, $lag->getStart()); $topplista->addParameter(Topplista::PARAM_STOP, $foretag->getSlutdatum()); $topplista->addParameter(Topplista::PARAM_LAG, $lag); $smarty->assign("topplista", $topplista); // Fotoalbum $bildblock = FotoalbumBild::loadLagsBildblock($lag, $antal = 16); $smarty->assign("bildblock", $bildblock); $anslagstavla = $lag->getAnslagstavla(); //$anslagstavlaRader = $anslagstavla->getAllaRader(); //$anslagstavlaAntalRader = $anslagstavla->getAntalRader(); //$smarty->assign("anslagstavlarader", $anslagstavlaRader); //$smarty->assign("anslagstavlaantalrader", $anslagstavlaAntalRader); $aTavla = $anslagstavla->getAnslagstavalaLista(); $nbrPosts = count($aTavla);