diff --git a/providerwww/application/controllers/Reports.php b/providerwww/application/controllers/Reports.php index 93ba1fe..f2bd05d 100644 --- a/providerwww/application/controllers/Reports.php +++ b/providerwww/application/controllers/Reports.php @@ -6,7 +6,59 @@ class Reports extends Provider_Controller { public function index() { $data = array(); - $this->renderProviderSecurePage('dash', $data); + $this->renderProviderSecurePage('patient/patientreport', $data); } + public function addnew() { + $data = array(); + $data["account_message"] = ""; + $data["firstname"] = $data["lastname"] = $data["email"] = $data["password"]= $data["street1"] = $data["street2"]= $data["city"] = $data["zipcode"]=""; + if ($_POST){ + $data['password'] = trim($this->input->post('password')); + $data['practice_id'] = $_SESSION['practice_id']; + $data['practice_user_id'] = $_SESSION['practice_id']; + $data['username'] = "NON-USER-".rand(1000000,99999999); + $data['password'] = "NON-USER-".rand(1000000,99999999); + $data['country'] = "NG"; + $data['firstname'] = trim($this->input->post('firstname')); + $data['lastname'] = trim($this->input->post('lastname')); + $data['email'] = trim($this->input->post('email')); + + $data['street1'] = trim($this->input->post('street1')); + $data['street2'] = trim($this->input->post('street2')); + $data['city'] = trim($this->input->post('city')); + $data['state'] = trim($this->input->post('state')); +$data["loc"] = $_SERVER["REMOTE_ADDR"]; + + $data["action"] = MERMS_PROVIDERS_CREATEMEMBER; + $out = array(); + $ret = $this->mermsemr_api($data, $out); + $data["account_message"] = "This is the return ".$ret; + echo "Posted"; + } + + $out = array(); + $out = $this->getPatientList(); + $data["patient_list"] = $out["patient_list"]; + + + $this->renderProviderSecurePage('patient/newpatient', $data); + } + + private function getPatientList(){ + + $mysql = "SELECT p.practice_id,p.id AS patient_id,p.member_id,p.long_id,m.firstname,m.lastname,m.phone,p.added " + ." FROM patients p LEFT JOIN members m ON m.id=p.member_id ORDER BY p.added DESC"; + $query = $this->db->query($mysql); + $num = $query->num_rows(); + $data["patient_list"] = $query->result(); + return $data; + } + public function report() { + $data = array(); + $this->renderProviderSecurePage('patient/patientreport', $data); + } + public function chart(){ + echo "patientChart"; + } } diff --git a/providerwww/application/views/provider/reports/report.php b/providerwww/application/views/provider/reports/report.php new file mode 100644 index 0000000..e69de29