From 1bfb74c79c57c0d7d799609f6f09ae879b56ec28 Mon Sep 17 00:00:00 2001 From: suseendhiran17 <58357088+suseendhiran17@users.noreply.github.com> Date: Fri, 13 Jan 2023 15:18:47 +0530 Subject: [PATCH] suseendhiran --- .../Dashboard/controllers/Dashboard.php | 11 +- .../Dashboard/models/Dashboard_model.php | 34 ++ .../modules/Dashboard/views/dashboard.php | 302 +++++++----------- 3 files changed, 161 insertions(+), 186 deletions(-) diff --git a/application/modules/Dashboard/controllers/Dashboard.php b/application/modules/Dashboard/controllers/Dashboard.php index 57a97d0..576d3ed 100644 --- a/application/modules/Dashboard/controllers/Dashboard.php +++ b/application/modules/Dashboard/controllers/Dashboard.php @@ -56,7 +56,16 @@ public function index() $expired_insurance_count = $this->Dashboard_model->get_expired_insurance_count(user()->business_id); $this->layout->set('expired_insurance_count', $expired_insurance_count); - + + + + $amc = $this->Dashboard_model->get_amc(user()->business_id); + // print_r(json_encode($amc));die(); + $this->layout->set('amc', $amc); + + $insurence = $this->Dashboard_model->get_insurence(user()->business_id); + // print_r(json_encode($insurence));die(); + $this->layout->set('insurence', $insurence); } $this->layout->buffer('main_content', 'dashboard/dashboard'); $this->layout->render('default_layout'); diff --git a/application/modules/Dashboard/models/Dashboard_model.php b/application/modules/Dashboard/models/Dashboard_model.php index 4c20c9f..978dd43 100644 --- a/application/modules/Dashboard/models/Dashboard_model.php +++ b/application/modules/Dashboard/models/Dashboard_model.php @@ -75,4 +75,38 @@ public function get_expired_insurance_count($business_id) } + + + + + public function get_amc($business_id) + { + $this->db->select('a.* , asset.name as asset_name' ); + $this->db->from('amc a'); + $this->db->join('asset', 'asset.id=a.asset_id', 'left'); + $this->db->where('a.business_id', $business_id); + $this->db->where('a.is_active', 1); + $this->db->where('a.type', 3); + $this->db->order_by('asset_id', "ASC"); + $query = $this->db->get(); + $query = $query->result(); + return $query; + } + + + public function get_insurence($business_id) + { + $this->db->select('a.* , asset.name as asset_name' ); + $this->db->from('amc a'); + $this->db->join('asset', 'asset.id=a.asset_id', 'left'); + $this->db->where('a.business_id', $business_id); + $this->db->where('a.is_active', 1); + $this->db->where('a.type', 4); + $this->db->order_by('asset_id', "ASC"); + $query = $this->db->get(); + $query = $query->result(); + return $query; + } + + } \ No newline at end of file diff --git a/application/modules/Dashboard/views/dashboard.php b/application/modules/Dashboard/views/dashboard.php index c0481f4..626baa7 100644 --- a/application/modules/Dashboard/views/dashboard.php +++ b/application/modules/Dashboard/views/dashboard.php @@ -115,11 +115,11 @@