<?php
#   SGT - The SGT for Internet - http://sgt.eti.br
#   Copyright (c) 2016-2018, Jean Azevedo. All rights reserved.

#   This file is part of SGT.

#   SGT is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   any later version.

#   SGT is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.

#   You should have received a copy of the GNU General Public License
#   along with Foobar.  If not, see <http://www.gnu.org/licenses/>.

?>
<div>
    <?php
        include "conectar.php"; // Chama a conexao com o banco de dados
        $cont_comp = 0;
        $cont_mon = 0;
        $cont_eqp = 0;
        $cont_ip = 0;
        $buscarc = $pdo_sgt->query("SELECT * FROM tb_computadores WHERE ativo='1'");
        $cont_comp = $buscarc->rowCount();
        $buscarm = $pdo_sgt->query("SELECT * FROM tb_monitores WHERE ativo='1'");
        $cont_mon = $buscarm->rowCount();
        $buscare = $pdo_sgt->query("SELECT * FROM tb_equipamentos WHERE ativo='1'");
        $cont_eqp = $buscare->rowCount();
        $buscarip = $pdo_sgt->query("SELECT * FROM tb_map_ip");
        $cont_ip = $buscarip->rowCount();
    ?>
    <div>
        <?php
            echo 'Total de Computadores: '.$cont_comp;
        ?>
    </div>
    <div>
        <?php
            echo 'Total de Monitores: '.$cont_mon;
        ?>
    </div>
    <div>
        <?php
            echo 'Total de Equipamentos: '.$cont_eqp;
        ?>
    </div>
    <div>
        <?php
            echo 'Total de IPs: '.$cont_ip;
        ?>
    </div>
</div>