示例#1
0
         $foretag_ids[] = $foretag["id"];
     }
 }
 $sql = "SELECT foretag_id, medlem_id, aNamn FROM " . Foretag::KEY_TABLE . " f INNER JOIN " . Medlem::TABLE . " m ON f.medlem_id=m.id WHERE medlem_id > 0 AND foretag_id IN (" . implode(",", $foretag_ids) . ")";
 $res = $db->query($sql);
 while ($row = mysql_fetch_array($res)) {
     try {
         $tForetag = Foretag::loadById($row["foretag_id"]);
         $medlem_id = $row["medlem_id"];
         $medlem_anamn = $row["aNamn"];
     } catch (Exception $e) {
         // Foretag doesn't exist (we check this just in case)
         continue;
     }
     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);