Backend Model added
This commit is contained in:
@@ -50,10 +50,10 @@ class MER_Controller extends CI_Controller {
|
||||
// $this->load->library(array('session', 'lib_login'));
|
||||
}
|
||||
|
||||
public function wrenchboard_api($in, $out) {
|
||||
public function mermsemr_api($in, $out) {
|
||||
$this->load->model('backend_model');
|
||||
// $out = array();
|
||||
return $this->backend_model->wrenchboard_api($in, $out);
|
||||
return $this->backend_model->mermsemr_api($in, $out);
|
||||
}
|
||||
|
||||
protected function smart_htmlspecialchars($str) {
|
||||
@@ -64,6 +64,16 @@ class MER_Controller extends CI_Controller {
|
||||
|
||||
|
||||
protected function loginUser($in, $out) {
|
||||
|
||||
$data['action'] = MERMS_PROVIDERS_LOGIN;
|
||||
$data['mlog'] = $mlog;
|
||||
$data['member_id'] = $_SESSION['member_id'];
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$res = $this->backend_model->mermsemr_api($data, $out);
|
||||
|
||||
|
||||
|
||||
$_SESSION['session_id'] = "SASAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK";
|
||||
$_SESSION['username'] = "ameye";
|
||||
|
||||
@@ -111,7 +121,7 @@ class MER_Controller extends CI_Controller {
|
||||
$data['member_id'] = $_SESSION['member_id'];
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$res = $this->backend_model->wrenchboard_api($data, $out);
|
||||
$res = $this->backend_model->mermsemr_api($data, $out);
|
||||
|
||||
$this->load->model('userlog_model');
|
||||
$xy["member_id"] = $_SESSION['member_id'];
|
||||
@@ -230,42 +240,7 @@ class MER_Controller extends CI_Controller {
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
protected function getClientJobStats($client_id) {
|
||||
$out = array();
|
||||
$out['total_jobs_completed'] = $out['total_jobs_active'] = $data['total_jobs_uncompleted'] = 0;
|
||||
$out['total_pending_offers'] = 0;
|
||||
|
||||
$mysql = " SELECT count(*) AS total_jobs_completed FROM members_jobs_contract WHERE client_id =$client_id AND status = 5";
|
||||
$q = $this->db->query($mysql);
|
||||
if ($q->num_rows() > 0) {
|
||||
$out['total_jobs_completed'] = $q->row()->total_jobs_completed;
|
||||
}
|
||||
|
||||
|
||||
$mysql = " SELECT count(*) AS total_jobs_active FROM members_jobs_contract WHERE client_id =$client_id AND status IN (1,2)";
|
||||
$q = $this->db->query($mysql);
|
||||
if ($q->num_rows() > 0) {
|
||||
$out['total_jobs_active'] = $q->row()->total_jobs_active;
|
||||
}
|
||||
|
||||
|
||||
$mysql = " SELECT count(*) AS total_jobs_uncompleted FROM members_jobs_contract WHERE client_id =$client_id AND status NOT IN (1,2,5)";
|
||||
$q = $this->db->query($mysql);
|
||||
if ($q->num_rows() > 0) {
|
||||
$out['total_jobs_uncompleted'] = $q->row()->total_jobs_uncompleted;
|
||||
}
|
||||
|
||||
$mysql = " SELECT count(*) AS total_pending_offers FROM members_jobs_offer WHERE client_id =$client_id AND status=1";
|
||||
$q = $this->db->query($mysql);
|
||||
if ($q->num_rows() > 0) {
|
||||
$out['total_pending_offers'] = $q->row()->total_pending_offers;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return $out; //['escrow_c_offer'] + $out['escrow_balance'];
|
||||
}
|
||||
|
||||
protected function renderProviderSecurePage($page_name, $data) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user