<?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/>.

    ini_set('default_charset','UTF-8');
    include "conectar.php";
    $nivel = $_SESSION['usuarioNivel'];
    $id_temp = $_SESSION['usuarioID'];
    $unid_temp = $_SESSION['usuarioUnidade'];
    $unid_master = $_SESSION['usuarioUnid_temp'];
    $av = $_SESSION['usuarioAv'];
    $hp = '';
    $hp_ = 0;
    $hp_buscar_ = $pdo_sgt->prepare("SELECT * FROM tb_hd_c WHERE para=:para AND status<:status");
    $hp_buscar_->bindValue(":para",$id_temp);
    $hp_buscar_->bindValue(":status",4);
    $hp_buscar_->execute();
    $hp_ = $hp_buscar_->rowCount();
    if($hp_ > 0){
        $hp = ' - '.$hp_;
    }
    $sql_temp = $pdo_sgt->prepare("SELECT * FROM tb_usuarios WHERE id=:id_temp");
    $sql_temp->bindValue(":id_temp","$id_temp");
    $sql_temp->execute();
    $temp = $sql_temp->fetch(PDO::FETCH_ASSOC);
    if($unid_master != $temp['unid_temp']){
       $unid_master = $temp['unid_temp'];
    }
?>