<?php
    class ManageModel {

        private $_db;

        /* CONSTRUCTOR */
        public function __construct() {
            $this->_db = new Base;
     
        }

        public function getCountStudents() {
            $query = "SELECT COUNT(*) as count FROM estudiantes";
            $this->_db->query($query);
            $this->_db->execute();

            if($this->_db->rowCount() > 0){
                return $this->_db->rows_assoc();
            }else{
                return false;
            }
        }

        public function getCoutnCourses() {
            $query = "SELECT COUNT(*) as count FROM cursos";
            $this->_db->query($query);
            $this->_db->execute();

            if($this->_db->rowCount() > 0){
                return $this->_db->rows_assoc();
            }else{
                return false;
            }
        }   

        public function getCountAcuerdos() {
            $query = "SELECT COUNT(*) as count FROM acuerdos";
            $this->_db->query($query);
            $this->_db->execute();

            if($this->_db->rowCount() > 0){
                return $this->_db->rows_assoc();
            }else{
                return false;
            }
        }

        public function getCountEstadosAcademicos() {
            $query = "SELECT COUNT(*) as count FROM estados_academicos";
            $this->_db->query($query);
            $this->_db->execute();

            if($this->_db->rowCount() > 0){
                return $this->_db->rows_assoc();
            }else{
                return false;
            }
        }

        public function getCountArchivos() {
            $query = "SELECT COUNT(*) as count FROM archivos";
            $this->_db->query($query);
            $this->_db->execute();

            if($this->_db->rowCount() > 0){
                return $this->_db->rows_assoc();
            }else{
                return false;
            }
        }

        public function getCountProgramas() {
            $query = "SELECT COUNT(*) as count FROM programas";
            $this->_db->query($query);
            $this->_db->execute();

            if($this->_db->rowCount() > 0){
                return $this->_db->rows_assoc();
            }else{
                return false;
            }
        }
    }

?>