File "HistoricoControllers.php"

Full Path: C:/wamp64/www/casos_medicos1/controller/HistoricoControllers.php
File size: 747 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
require_once __DIR__ . "/../model/Historico.php";

class HistoricoControllers {

    private $model;

    public function __construct() {
        $this->model = new HistoricoModel();
    }

    public function index() {

        // Filtros de búsqueda
        $filtros = [
            "cedula"        => $_GET['cedula'] ?? '',
            "empresa"       => $_GET['empresa'] ?? '',
            "fecha_inicio"  => $_GET['fecha_inicio'] ?? '',
            "fecha_fin"     => $_GET['fecha_fin'] ?? ''
        ];

        $resultado = $this->model->getHistorico($filtros);

        $total_registros = $resultado['total'];
        $registros = $resultado['lista'];

        require "../views/historico.php";
    }
}