21 lines
829 B
PHP
21 lines
829 B
PHP
<?php
|
|
|
|
class Dash_model extends CI_Model {
|
|
|
|
function __construct() {
|
|
|
|
}
|
|
|
|
public function dashData() {
|
|
$data = [];
|
|
$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"]));
|
|
|
|
return $data;
|
|
}
|
|
|
|
}
|