Example #1
0
<?php

include $_SERVER["DOCUMENT_ROOT"] . '/php/init.php';
define("DELTAGARTOPPEN_MAX", 200);
define("LAGTOPPEN_MAX", 25);
define("FORETAGSTOPPEN_MAX", 400);
!empty($_REQUEST['id']) ? $mid = $_REQUEST['id'] : ($mid = null);
!empty($_REQUEST['tid']) ? $tid = $_REQUEST['tid'] : ($tid = null);
!empty($_REQUEST['fid']) ? $fid = $_REQUEST['fid'] : ($fid = null);
if ($tid != null) {
    //$smarty = new MMSmarty(true, -1); // Caches the contest content indefinitely
    $smarty = new MMSmarty();
    switch (true) {
        case isset($mid):
            $medlemArray = Tavling::getBasicMemberData($tid, $mid);
            //print_r($medlemArray);
            $foretag_namn = $medlemArray[0]['foretag_namn'];
            $foretag_id = $medlemArray[0]['foretag_id'];
            $foretagArray = Tavling::getResultCompany($tid, -1, $foretag_id);
            //get the submitted companys data
            //print_r($foretagArray);
            $foretagLagArray = Tavling::getResultTeam($tid, $foretag_id);
            //get all the teams with median for the submitted company  Lagtoppen
            //print_r($foretagLagArray);
            $allaLag = array();
            //get all the teams with member data for the submitted company   Slutresultat inom lagen
            foreach ($foretagLagArray as $key => $lag) {
                $foretagMedlemArray = Tavling::getResultCompanyTeamMember($tid, $lag['lag_id']);
                array_push($allaLag, $foretagMedlemArray);
            }
            //print_r($allaLag);