<?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";
        $cont_user = 0;
        $cont_unid = 0;
        $cont_comp = 0;
        $cont_mon = 0;
        $cont_eqp = 0;
        $cont_marc = 0;
        $cont_mod = 0;
        $cont_off = 0;
        $cont_sis = 0;
        $cont_proc = 0;
        $cont_vid = 0;
        $cont_ip = 0;
        $buscar_user = $pdo_sgt->query("SELECT * FROM tb_usuarios");
        $cont_user = $buscar_user->rowCount();
        $buscar_unid = $pdo_sgt->query("SELECT * FROM tb_unidades");
        $cont_unid = $buscar_unid->rowCount();
        $buscar_comp = $pdo_sgt->query("SELECT * FROM tb_computadores WHERE ativo='1'");
        $cont_comp = $buscar_comp->rowCount();
        $buscar_mon = $pdo_sgt->query("SELECT * FROM tb_monitores WHERE ativo='1'");
        $cont_mon = $buscar_mon->rowCount();
        $buscar_eqp = $pdo_sgt->query("SELECT * FROM tb_equipamentos WHERE ativo='1'");
        $cont_eqp = $buscar_eqp->rowCount();
        $buscar_marc = $pdo_sgt->query("SELECT * FROM tb_marcas");
        $cont_marc = $buscar_marc->rowCount();
        $buscar_mod = $pdo_sgt->query("SELECT * FROM tb_modelos");
        $cont_mod = $buscar_mod->rowCount();
        $buscar_off = $pdo_sgt->query("SELECT * FROM tb_offices");
        $cont_off = $buscar_off->rowCount();
        $buscar_sis = $pdo_sgt->query("SELECT * FROM tb_sistemas");
        $cont_sis = $buscar_sis->rowCount();
        $buscar_proc = $pdo_sgt->query("SELECT * FROM tb_proc");
        $cont_proc = $buscar_proc->rowCount();
        $buscar_vid = $pdo_sgt->query("SELECT * FROM tb_videos");
        $cont_vid = $buscar_vid->rowCount();
        $buscarip = $pdo_sgt->query("SELECT * FROM tb_map_ip");
        $cont_ip = $buscarip->rowCount();
    ?>
    <div>
        <?php
            echo 'Total de Usuários: '.$cont_user;
        ?>
    </div>
    <div>
        <?php
            echo 'Total de Unidades: '.$cont_unid;
        ?>
    </div>
    <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 Marcas: '.$cont_marc;
        ?>
    </div>
    <div>
        <?php
            echo 'Total de Modelos: '.$cont_mod;
        ?>
    </div>
    <div>
        <?php
            echo 'Total de Office: '.$cont_off;
        ?>
    </div>
    <div>
        <?php
            echo 'Total de Sistemas: '.$cont_sis;
        ?>
    </div>
    <div>
        <?php
            echo 'Total de Processadores: '.$cont_proc;
        ?>
    </div>
    <div>
        <?php
            echo 'Total de Placas de Vídeo: '.$cont_vid;
        ?>
    </div>
    <div>
        <?php
            echo 'Total de IPs: '.$cont_ip;
        ?>
    </div>
</div>

