<?php

include_once 'config.php';

class complaints_model
{

    public $link;

    public function __construct()
    {
        $db_connection = new dbConnection();
        $this->link = $db_connection->connect();
    }

    public function countComplaints() {
        $sql = "SELECT COUNT(*) AS total FROM hrdc_complaints WHERE complaint_state IN(0,1)";
        $stmt = $this->link->prepare($sql);
        $stmt->execute();
        return $stmt->fetchColumn();
    }



}