<?php

class MostrarChoferes {

    private $conexion;

    public function __construct($conn) {
        $this->conexion = $conn;
    }

    public function ObtenerTodosLosChoferes() {

        // Consulta para obtener todos los choferes
        $sql = "SELECT * FROM choferes";

        $result = $this->conexion->executeQuery($sql);

        $choferes = array();

        if ($result->num_rows > 0) {
            while($row = $result->fetch_assoc()) {
                $choferes[] = $row;
            }
        }

        return $choferes;
    }
}
