diff --git a/adminwww/application/controllers/Dash.php b/adminwww/application/controllers/Dash.php index 7239f33..c0a45de 100644 --- a/adminwww/application/controllers/Dash.php +++ b/adminwww/application/controllers/Dash.php @@ -45,56 +45,85 @@ class Dash extends Admin_Controller { private function dashData() { $data = []; - - - - //$query = $this->db->query("SELECT count(*) FROM members WHERE acc_link IS NULL AND status = 1")->num_rows(); - // $query = $this->db->query(" SELECT count(*) FROM members WHERE acc_link IS NOT NULL AND status = 1")->num_rows(); - $data["new_patient"] = $this->db->query("SELECT id FROM members WHERE acc_link IS NULL AND status = 1")->num_rows(); $data["establish_pateint"] = $this->db->query(" SELECT id FROM members WHERE acc_link IS NOT NULL AND status = 1")->num_rows(); $data['deleted_users'] = $this->db->query(" SELECT id FROM members WHERE status <> 1")->num_rows(); - $data["new_patient_percent"] = ceil(100 * $data["establish_pateint"] / ($data["establish_pateint"] + $data["new_patient"])); $data["establish_pateint_percent"] = ceil(100 * $data["new_patient"] / ($data["establish_pateint"] + $data["new_patient"])); - - // $data["new_patient"] = $this->db->query("SELECT id FROM members WHERE acc_link IS NULL AND status = 1")->num_rows(); - //$data["establish_pateint"] = $this->db->query(" SELECT id FROM members WHERE acc_link IS NOT NULL AND status = 1")->num_rows(); - return $data; } public function pendingpractice() { + $case_statement = "(CASE WHEN status=1 THEN 'Pending' WHEN status=0 THEN 'Deleted' WHEN status=3 THEN 'Deleted' WHEN status=5 THEN 'Acive' ELSE 'Unknown' END)"; $data = array(); $data["page_title"] = "Pending Practice"; - $this->load->library('table'); $this->table->set_template($this->template); - $mysql = "SELECT '' AS process, + echo $mysql = "SELECT '' AS process, '' AS semail, - status, - practice_name,username,email,added::date from practice_pending ORDER BY id DESC LIMIT 20"; + $case_statement AS status, + practice_name,username,email,added::date from practice_pending ORDER BY id DESC LIMIT 200"; $data['pending_practice'] = ""; $query = $this->db->query($mysql); - //$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px')); $this->table->set_heading(array('data' => 'Process', 'style' => 'width:50px'), 'Resend Email', 'Status', 'Practice Name', 'Username', 'Email', array('data' => 'Date Added', 'style' => 'width:40px')); $data['pending_practice'] = $this->table->generate($query); $this->renderAdminPage('view_pendingpractice', $data); } public function pendingusers() { + $case_statement = "(CASE WHEN status=1 THEN 'Active' WHEN status=0 THEN 'Inactive' ELSE 'Unknown' END)"; $data = array(); $data["page_title"] = "Pending Members"; $this->load->library('table'); $this->table->set_template($this->template); $data['recent_members'] = ""; + $mysql = "SELECT '' AS process," + . "username,firstname,lastname,added::date,loc,last_login,acc_link FROM members ORDER by id DESC LIMIT 15"; + $query = $this->db->query($mysql); + $this->table->set_heading(array('data' => 'Select', 'style' => 'width:50px'), 'Username', 'Firstname', 'Lastname', 'Added', 'Location', 'Last Login', 'Link'); + $data['recent_members'] = $this->table->generate($query); + $this->renderAdminPage('view_pendingusers', $data); + } + + public function invoices() { + $data = array(); + $data["page_title"] = "Invoices"; + $this->load->library('table'); + $this->table->set_template($this->template); + $data['recent_members'] = ""; $mysql = "SELECT id,username,firstname,lastname,added::date,loc,last_login,acc_link FROM members ORDER by id DESC LIMIT 15"; $query = $this->db->query($mysql); //$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px')); $data['recent_members'] = $this->table->generate($query); - $this->renderAdminPage('view_pendingusers', $data); + $this->renderAdminPage('view_invoices', $data); + } + + public function payments() { + $data = array(); + $data["page_title"] = "Payments"; + $this->load->library('table'); + $this->table->set_template($this->template); + $data['recent_members'] = ""; + $mysql = "SELECT id,username,firstname,lastname,added::date,loc,last_login,acc_link FROM members ORDER by id DESC LIMIT 15"; + $query = $this->db->query($mysql); + //$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px')); + $data['recent_members'] = $this->table->generate($query); + $this->renderAdminPage('view_payments', $data); + } + + public function usersactivities() { + $data = array(); + $data["page_title"] = "Users Activities"; + $this->load->library('table'); + $this->table->set_template($this->template); + $data['recent_members'] = ""; + $mysql = "SELECT id,username,firstname,lastname,added::date,loc,last_login,acc_link FROM members ORDER by id DESC LIMIT 15"; + $query = $this->db->query($mysql); + //$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px')); + $data['recent_members'] = $this->table->generate($query); + $this->renderAdminPage('view_usersactivities', $data); } protected function renderAdminPage($page_name, $data) { diff --git a/adminwww/application/views/template/secure_header.php b/adminwww/application/views/template/secure_header.php index 53ec407..898a56d 100644 --- a/adminwww/application/views/template/secure_header.php +++ b/adminwww/application/views/template/secure_header.php @@ -1,335 +1,331 @@ -
-