public function get_district_drill_down_detail($district_id, $date_of_activation) { $district_data = ""; $county_id = $this->session->userdata('county_id'); $get_facility_data = facilities::get_facilities_reg_on_($district_id, urldecode($date_of_activation)); foreach ($get_facility_data as $facility_data) { $facility_code = $facility_data->facility_code; $facility_user_data = users::get_user_info($facility_code); $facility_name = $facility_data->facility_name; $district_data .= '<span class="" width="100%"><b>' . $facility_name . '</b></span> <table class="row-fluid table table-hover table-bordered table-update" width="100%"> <thead> <tr> <th>First Name</th><th>Last Name</th><th>Email </th><th>Phone No.</th> </tr> </thead> <tbody>'; foreach ($facility_user_data as $user_data_) { $district_data .= "<tr><td>" . $user_data_['fname'] . "</td><td>" . $user_data_['lname'] . "</td><td>" . $user_data_['email'] . "</td><td>" . $user_data_['telephone'] . "</td>\n\t\t\t\t\t<tr>"; } $district_data .= "</tbody></table>"; } echo $district_data; }
public function get_district_drill_down_detail($district_id, $option, $date_of_activation) { $district_data = ""; $county_id = $this->session->userdata('county_id'); if ($option == 'monthly') { $get_facility_data = facilities::get_facilities_reg_on_($district_id, urldecode($date_of_activation)); foreach ($get_facility_data as $facility_data) { $facility_code = $facility_data->facility_code; $facility_user_data = user::get_user_info($facility_code); $facility_name = $facility_data->facility_name; $district_data .= '<span class="label label-info" width="100%">' . $facility_name . '</span> <table class="data-table" width="100%"> <thead> <tr> <th>First Name</th><th>Last Name</th><th>Email </th><th>Phone No.</th> </tr> </thead> <tbody>'; foreach ($facility_user_data as $user_data_) { $district_data .= "<tr>\n\t<td>{$user_data_->fname}</td><td>{$user_data_->lname}</td><td>{$user_data_->email}</td><td>{$user_data_->telephone}</td>\n\t<tr>"; } $district_data .= "</tbody></table>"; } } elseif ($option = "total") { $get_facility_data = facilities::get_facilities_online_per_district($county_id); $district_data .= ' <table class="data-table" width="100%"> <thead> <tr> <th>District Name</th><th>MFL No</th><th>Facility Name</th><th>Date Activated</th> </tr> </thead> <tbody>'; foreach ($get_facility_data as $facility_data) { $facility_code = $facility_data['facility_code']; $facility_name = $facility_data['facility_name']; $district_name = $facility_data['district']; $date = $facility_data['date']; $district_data .= "<tr>\n\t<td>{$district_name}</td><td>{$facility_code}</td><td>{$facility_name}</td><td>{$date}</td>\n\t<tr>"; } $district_data .= "</tbody></table>"; } echo $district_data; }