public function edit($record_no) { $sql = "SELECT p.*,\n\t\t rst.Name as service_name,\n\t\t dp.child,\n\t\t s.secondary_spouse \n\t\t FROM patient p \n\t\t LEFT JOIN regimen_service_type rst ON rst.id=p.service \n\t\t LEFT JOIN dependants dp ON p.patient_number_ccc=dp.parent \n\t\t \t LEFT JOIN spouses s ON p.patient_number_ccc=s.primary_spouse\n\t\t WHERE p.id='{$record_no}'\n\t\t GROUP BY p.id"; $query = $this->db->query($sql); $results = $query->result_array(); if ($results) { $results[0]['other_illnesses'] = $this->extract_illness($results[0]['other_illnesses']); $data['results'] = $results; } $data['record_no'] = $record_no; $data['districts'] = District::getPOB(); $data['genders'] = Gender::getAll(); $data['statuses'] = Patient_Status::getStatus(); $data['sources'] = Patient_Source::getSources(); $data['drug_prophylaxis'] = Drug_Prophylaxis::getAll(); $data['service_types'] = Regimen_Service_Type::getHydratedAll(); $data['facilities'] = Facilities::getAll(); $data['family_planning'] = Family_Planning::getAll(); $data['other_illnesses'] = Other_Illnesses::getAll(); $data['pep_reasons'] = Pep_Reason::getActive(); $data['regimens'] = Regimen::getRegimens(); $data['drugs'] = Drugcode::getAllEnabled(); $data['who_stages'] = Who_Stage::getAllHydrated(); $data['content_view'] = 'edit_patients_v'; //Hide side menus $data['hide_side_menu'] = '1'; $this->base_params($data); }