/** * Return all active companys for today or a submitted date * Krillo 12-09-10 * * @global type $db * @param type $date * @return array of all companys */ public static function getAllActiveCompanys($date = false) { global $db; $jDate = new JDate($date); $theDate = $jDate->getDate(); $sql = "SELECT count(n.id) AS count, f.id id, namn, startdatum, slutdatum FROM mm_foretag f, mm_foretagsnycklar n WHERE f.id = n.foretag_id AND isvalid = 1 AND '{$theDate}' BETWEEN startdatum AND slutdatum group by f.id order by namn asc"; return $db->allValuesAsArray($sql); }