function getBranches($station_id) { Debug::Text('Getting Branches 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) { $blf = new BranchListFactory(); $blf->getByCompanyIdAndStatus($company_id, 10); if ($blf->getRecordCount() > 0) { $x = 0; foreach ($blf as $b_obj) { $branch_list["'{$x}'"] = array('id' => (int) $b_obj->getId(), 'manual_id' => (int) $b_obj->getManualID(), 'name' => $b_obj->getName()); $x++; } if (isset($branch_list)) { return $branch_list; } } } } return FALSE; }