MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/lms_cafsinfotech_in/application/models/DashboardModel.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class DashboardModel extends CI_Model {
    public function __construct() {
        parent::__construct();
        $this->load->database();
    }

    function categories_count() { 
        return $this->db->select('count(*) as count')->get('category')->row();
    }
     function branch_count() { 
        return $this->db->select('count(*) as count')->get('branch')->row();
    }
    function user_count() {
        return $this->db->select('count(*) as count')->get('users')->row();
    }
    function pages_count() {
        return $this->db->select('count(*) as count')->get('pages')->row();
    }
    function quiz_count() {
        return $this->db->select('count(*) as count')->get('quizes')->row();
    }

    function blog_count() {
        return $this->db->select('count(*) as count')->get('blog_post')->row();
    }
    function langues_count() {
        return $this->db->select('count(*) as count')->get('language')->row();
    }
    // 
    function payment_count() {
        return $this->db->select('SUM(item_price) as price,(select count(id) from payments)as count')->where('payment_status','succeeded')->get('payments')->row();
        
    }
}