Beispiel #1
0
            //print_r($allCompMembArray);
            //get all members for the whole contest    Deltagartoppen
            //if the member ranks lower than DELTAGARTOPPEN_MAX then add her the the array
            $allMembArray = Tavling::getResultAllMembers($tid, DELTAGARTOPPEN_MAX);
            //print_r($allMembArray);
            $lagArray = Tavling::getResultTeam($tid);
            //get all the teams with median  Lagtoppen
            //print_r($foretagLagArray);
            $allForetagArray = Tavling::getResultCompany($tid, FORETAGSTOPPEN_MAX);
            //get all companys average   Foretagstoppen
            //print_r($allForetagArray);
            $foretag = Foretag::loadById($fid);
            break;
        default:
            throw new UserException('Något har gått fel', 'Prova igen senare eller rapportera felet till support@motiomera.se');
            break;
    }
}
$smarty->assign("foretagArray", $foretagArray);
$smarty->assign("allaLag", $allaLag);
$smarty->assign("foretagLagArray", $foretagLagArray);
$smarty->assign("allCompMembArray", $allCompMembArray);
$smarty->assign("allMembArray", $allMembArray);
$smarty->assign("lagArray", $lagArray);
$smarty->assign("allForetagArray", $allForetagArray);
//these two highlites the user on tavlingsresultat.php !?!?
$smarty->assign("tavlingsresultatsidan", true);
$smarty->assign("foretagCustomBild", CustomForetagsbild::getImgUrlIfValidFile($foretag_id));
$bildblock = FotoalbumBild::loadForetagsBildblock($foretag, $antal = 20);
$smarty->assign("bildblock", $bildblock);
$smarty->display('contest_results_template_from_db.tpl', $foretag_id);
Beispiel #2
0
 $i = 0;
 $positioner = array();
 foreach ($topplistan as $lag) {
     $positioner[$i] = $lag;
     $i++;
 }
 $positioner = array_reverse($positioner);
 if (count($positioner) > 10) {
     $positioner = array_slice($positioner, count($positioner) - 10, 10);
 }
 $smarty->assign("positioner", $positioner);
 $smarty->assign("nr", $nr);
 $smarty->assign("multiply", $multiplier);
 $smarty->assign("topplistan", $topplistan);
 //false if no custom added
 $foretagCustomBild = CustomForetagsbild::getImgUrlIfValidFile($foretag->getId());
 $smarty->assign("foretagCustomBild", $foretagCustomBild);
 $bildblock = FotoalbumBild::loadForetagsBildblock($foretag, $antal = 20);
 $smarty->assign("bildblock", $bildblock);
 //
 // Global toplists.
 //
 $tf = array();
 $tfObjects = Foretag::listAll();
 $tf = array();
 foreach ($tfObjects as $tForetag) {
     if (!empty($tForetag) && strtotime($tForetag->getSlutDatum()) >= $slutDatum_ts) {
         $stegindex = $tForetag->getStegIndex();
         if ($stegindex != 0) {
             $foretag_ids[] = $tForetag->getId();
             $tNamn = $tForetag->getNamn();
 public static function cleanImages($foretagsid)
 {
     Security::demand(FORETAG);
     $names = CustomForetagsbild::getImgUrls($foretagsid);
     foreach ($names as $name) {
         if (is_file(FORETAGS_BILD_PATH . "/" . $name)) {
             unlink(FORETAGS_BILD_PATH . "/" . $name);
         }
     }
 }