<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Dashboard_Model extends CI_Model {


    function CountTotalLocation() {
        $this->db->where('status','active');
        $query = $this->db->get('tbl_province');
        $result = $query->num_rows();
        return $result;
    }   
    function CountTotalEnquiry() {
        $this->db->where('status','active');
        $query = $this->db->get('tbl_contact_us');
        $result = $query->num_rows();
        return $result;
    }   
    function CountTotalCoupon() {
        $this->db->where('status','active');
        $query = $this->db->get('tbl_coupons');
        $result = $query->num_rows();
        return $result;
    }   
    function CountTotalOrders() {      
        $this->db->where('is_delete','no');
        $query = $this->db->get('tbl_order');
        $result = $query->num_rows();
        return $result;
    }   
    function TotalPendingOrder() {
        $this->db->where('order_status','pending');
        $this->db->where('is_delete','no');
        $query = $this->db->get('tbl_order');
        $result = $query->num_rows();
        return $result;
    }   
    function TotalCancelledOrder() {
        $this->db->where('order_status','cancelled');
        $this->db->where('is_delete','no');
        $query = $this->db->get('tbl_order');
        $result = $query->num_rows();
        return $result;
    }   
    function TotalCompletedOrder() {
        $this->db->where('order_status','completed');
        $this->db->where('is_delete','no');
        $query = $this->db->get('tbl_order');
        $result = $query->num_rows();
        return $result;
    }   
    function TotalStaticPages() {   
        $this->db->where('status','active');
        $query = $this->db->get('tbl_page');
        $result = $query->num_rows();
        return $result;
    }  
    
}
