diff --git a/application/modules/Dashboard/controllers/Dashboard.php b/application/modules/Dashboard/controllers/Dashboard.php index 038b342..8c25e66 100644 --- a/application/modules/Dashboard/controllers/Dashboard.php +++ b/application/modules/Dashboard/controllers/Dashboard.php @@ -61,11 +61,11 @@ public function index() $amc = $this->Dashboard_model->get_amc(user()->business_id); - // print_r(json_encode($amc));die(); + //print_r(json_encode($amc)); $this->layout->set('amc', $amc); - +//echo ""; $insurence = $this->Dashboard_model->get_insurence(user()->business_id); - // print_r(json_encode($insurence));die(); + //print_r(json_encode($insurence));die(); $this->layout->set('insurence', $insurence); } $this->layout->buffer('main_content', 'dashboard/dashboard'); diff --git a/application/modules/Dashboard/models/Dashboard_model.php b/application/modules/Dashboard/models/Dashboard_model.php index 2e987dd..3b2c47e 100644 --- a/application/modules/Dashboard/models/Dashboard_model.php +++ b/application/modules/Dashboard/models/Dashboard_model.php @@ -35,7 +35,7 @@ public function get_amc_count($business_id) $this->db->where('valid_to <=', date('Y-m-d', strtotime('+30 day', strtotime(date("Y-m-d"))))); $this->db->group_by('asset_id'); $this->db->order_by('id','DESC'); - $this->db->limit(1); + //$this->db->limit(1); $query = $this->db->get(); $query = $query->num_rows(); return $query; @@ -52,7 +52,7 @@ public function get_expired_amc_count($business_id) $this->db->where('valid_to <', date("Y-m-d")); $this->db->group_by('asset_id'); $this->db->order_by('id','DESC'); - $this->db->limit(1); + //$this->db->limit(1); $query = $this->db->get(); $query = $query->num_rows(); return $query; @@ -69,7 +69,7 @@ public function get_insurance_count($business_id) $this->db->where('valid_to <=', date('Y-m-d', strtotime('+30 day', strtotime(date("Y-m-d"))))); $this->db->group_by('asset_id'); $this->db->order_by('id','DESC'); - $this->db->limit(1); + //$this->db->limit(1); $query = $this->db->get(); $query = $query->num_rows(); return $query; @@ -86,7 +86,7 @@ public function get_expired_insurance_count($business_id) $this->db->where('valid_to <', date("Y-m-d")); $this->db->group_by('asset_id'); $this->db->order_by('id','DESC'); - $this->db->limit(1); + //$this->db->limit(1); $query = $this->db->get(); $query = $query->num_rows(); return $query; @@ -105,7 +105,10 @@ public function get_amc($business_id) $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"); + + $this->db->group_by('asset_id'); + $this->db->order_by('id','DESC'); + $query = $this->db->get(); $query = $query->result(); return $query; @@ -120,7 +123,10 @@ public function get_insurence($business_id) $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"); + + $this->db->group_by('asset_id'); + $this->db->order_by('id','DESC'); + $query = $this->db->get(); $query = $query->result(); return $query; diff --git a/application/modules/Dashboard/views/dashboard.php b/application/modules/Dashboard/views/dashboard.php index 626baa7..694d253 100644 --- a/application/modules/Dashboard/views/dashboard.php +++ b/application/modules/Dashboard/views/dashboard.php @@ -15,25 +15,25 @@
Facebook Campaign
-Twitter Campaign
-Conventional Media
-Bill boards
-- Schedule meeting with new client
-- Create email address for new intern
-- Have IT fix the network printer
-- Copy backups to offsite location
-- Food truck fixie locavors mcsweeney
-- Food truck fixie locavors mcsweeney
-- Create email address for new intern
-- Have IT fix the network printer
-- Copy backups to offsite location
-