public function county_rtk_mapping() { $data = array(); $data['title'] = "Facility Mapping"; $data['banner_text'] = "Facility Mapping"; $data['content_view'] = ""; $data['county'] = Counties::getAll(); $owner_array = array("GOK", "CBO", "FBO", "NGO", "Private", "Other"); $counties = Counties::getAll(); $table_body = ''; foreach ($counties as $county_detail) { $id = $county_detail->id; $table_body .= "<tr><td><a class='ajax_call_1' id='county_facility' name='get_rtk_county_detail/{$id}' href='#'> {$county_detail->county} </a></td>"; $county_detail = facilities::get_total_facilities_rtk($id); $table_body .= "<td>" . $county_detail[0]['total_facilities'] . "</td><td>" . $county_detail[0]['total_rtk'] . "</td>"; foreach ($owner_array as $key => $value) { $owner_count = facilities::get_total_facilities_rtk_ownership($id, $value); $table_body .= "<td>" . $owner_count[0]['ownership_count'] . "</td>"; } $table_body .= "</tr>"; } $data['table_body'] = $table_body; $this->load->view("rtk/rtk/ajax_view/county_rtk_v", $data); }