<?php
include '../config/conexion.php';

$database = new Connection();
$db = $database->open();

// Total Conductores
$smart = $db->prepare('SELECT IFNULL(count(*), 0) total FROM conductor');
$smart->execute();
$num_rows_conductores = $smart->fetchColumn();
//Usuarios
$smart = $db->prepare('SELECT IFNULL(count(*), 0) total FROM usuarios');
$smart->execute();
$num_rows_user = $smart->fetchColumn();
//Usuarios
$smart = $db->prepare('SELECT IFNULL(count(*), 0) total FROM flota');
$smart->execute();
$num_rows_vehiculos = $smart->fetchColumn();
//Seguro
$smart = $db->prepare('SELECT IFNULL(count(*), 0) total FROM seguro');
$smart->execute();
$num_rows_seguro = $smart->fetchColumn();

//total registros de mantenimientos

$smart = $db->prepare('SELECT IFNULL(count(*), 0) total FROM cambio_aceite');
$smart->execute();
$num_rows_cambio_aceite = $smart->fetchColumn();

//Alertas enviadas por conductores

$smart = $db->prepare('SELECT IFNULL(count(*), 0) total FROM alerta where DATE(fecha_registro) = CURDATE();');
$smart->execute();
$num_rows_alertas = $smart->fetchColumn();



?>