<?php
class HomeModel extends Query{
    public function __construct()
    {
        parent::__construct();
    }
    public function getVerificar(string $table)
    {
        $sql = "SELECT * FROM $table";
        $data = $this->select($sql);
        return $data;
    }

    public function verificarPermisos($id_user, $permiso)
    {
        $sql = "SELECT p.id, p.permiso, d.* FROM permisos p INNER JOIN detalle_permisos d ON p.id = d.id_permiso WHERE d.id_usuario = $id_user AND p.permiso = '$permiso'";
        $existe = $this->select($sql);
        return $existe;
    }

    public function getUsuario(string $usuario)
    {
        $sql = "SELECT * FROM usuarios WHERE usuario = '$usuario' AND estado = 1";
        $data = $this->select($sql);
        return $data;
    }

}

?>