function getDepartments($station_id) { Debug::Text('Getting Departments for Station ID: ' . $station_id, __FILE__, __LINE__, __METHOD__, 10); if ($station_id == '') { return FALSE; } //Gets all users allowed to punch in/out from this station $slf = new StationListFactory(); $slf->getByStationID($station_id); if ($slf->getRecordCount() > 0) { $s_obj = $slf->getCurrent(); $company_id = $s_obj->getCompany(); if ($company_id != FALSE) { $dlf = new DepartmentListFactory(); $dlf->getByCompanyIdAndStatus($company_id, 10); if ($dlf->getRecordCount() > 0) { $x = 0; foreach ($dlf as $d_obj) { $department_list["'{$x}'"] = array('id' => (int) $d_obj->getId(), 'manual_id' => (int) $d_obj->getManualID(), 'name' => $d_obj->getName()); $x++; } if (isset($department_list)) { return $department_list; } } } } return FALSE; }