Example #1
0
 public function get_atrasos_intervalo_func($data_inicio, $data_final, $id_funcionario)
 {
     $sql = new Sql();
     $sql->conn_bd();
     $g = new Glob();
     $func = new Funcionario();
     $aux = 0;
     $return = array();
     $query = "SELECT * FROM horarios WHERE data >= '" . $data_inicio . "' && data <= '" . $data_final . "' && id_funcionario = '" . $id_funcionario . "' && situacao LIKE '%+%' ORDER BY data, hora ASC";
     // echo '<script> alert("'.$query.'") </script>';
     // $query_tra = $g->tratar_query($query, $data);
     $query_ex = mysql_query($query);
     while ($result = mysql_fetch_array($query_ex)) {
         // echo '<script> alert("'.$query.'") </script>';
         $hora = $result['situacao'];
         $minuto = $hora[3];
         if (preg_match("/^([0-9]+)\$/i", $hora[4])) {
             $minuto .= $hora[4];
         }
         if ($hora[1] > 0 || $minuto > $_SESSION['temp_limit_atraso']) {
             $return[$aux][0] = $result['id'];
             $return[$aux][1] = $result['hora'];
             $return[$aux][2] = $result['situacao'];
             $return[$aux][3] = $func->get_nome_by_id($result['id_funcionario']);
             if ($result['tipo'] == 1) {
                 $return[$aux][4] = "Iniciou o expediente";
             } else {
                 if ($result['tipo'] == 2) {
                     $return[$aux][4] = "Saiu para almoço";
                 } else {
                     if ($result['tipo'] == 3) {
                         $return[$aux][4] = "Encerrou o almoço";
                     } else {
                         $return[$aux][4] = "Encerrou o expediente";
                     }
                 }
             }
             $return[$aux][5] = $result['id_obs_supervisor'];
             $return[$aux][6] = $result['data'];
             $return[$aux][7] = $result['observacao_funcionario'];
             $aux++;
         }
     }
     return $return;
 }
Example #2
0
         echo '<tr style="background-color:#ddd; ">';
     }
     if ($tipo_id_qtd[0] == 0) {
         $res = Patrimonio_geral::get_patrimonio_geral_id($tipo_id_qtd[1]);
         // echo '<li style="margin-left:10px;"><span>'.$res->nome.': </span><input readonly style="width:30%; border: 0" type="number" value="'.$tipo_id_qtd[2].'"></li>';
         echo '<td style="padding: 3 10 3 10px;"><span>' . $res->nome . ' </span></td><td style="padding: 3 10 3 10px;"><span>' . $tipo_id_qtd[2] . '</span></td>';
     } else {
         if ($tipo_id_qtd[0] == 1) {
             $res = Maquinario::get_maquinario_id($tipo_id_qtd[1]);
             $func_res = Funcionario::get_nome_by_id($res->id_responsavel);
             // echo '<li style="margin-left:10px;"><span>'.$res->modelo.': </span><input readonly style="width:30%; border: 0" type="number" value="'.$tipo_id_qtd[2].'"></li>';
             echo '<td style="padding: 3 10 3 10px;"><span>' . $res->modelo . ' / <a href="#" onclick="busca_funcionarios_disponiveis(\'altera_resp\',\'1\',\'' . $res->id . '\')">' . $func_res[0] . '</a> </span></td><td style="padding: 3 10 3 10px;"><span>' . $tipo_id_qtd[2] . '</span></td>';
         } else {
             $res = Veiculo::get_veiculo_id($tipo_id_qtd[1]);
             // echo "<script>alert('".$res->id_responsavel."');</script>";
             $func_res = Funcionario::get_nome_by_id($res->id_responsavel);
             // if($func_res !=){
             // echo '<li style="margin-left:10px;"><span>'.$res->modelo.': </span><input readonly style="width:30%; border: 0" type="number" value="'.$tipo_id_qtd[2].'"></li>';
             echo '<td style="padding: 3 10 3 10px;"><span>' . $res->modelo . ' / <a  onclick="busca_funcionarios_disponiveis(\'altera_resp\',\'1\',\'' . $res->id . '\')" title="Clique para alterar o funcionário responsável" href="#">' . $func_res[0] . '</a> </span></td><td style="padding: 3 10 3 10px;"><span>' . $tipo_id_qtd[2] . '</span></td>';
             // }
         }
     }
     echo '</tr>';
     // if(count($patrimonio)>1)
     //  for($aux = 0; $aux < count($patrimonio); $aux++ ){
     //      echo 'id '. $patrimonio[$aux][1].'<br />';
     //  }
     // else
     //  echo 'id '. $patrimonio[0][1].'<br />';
 }
 echo '</table>';
 //$return[$aux][4] = id_endereco
 //$return[$aux][5] = id_cbo
 //$return[$aux][6] = data_dem
 //$return[$aux][7] = qtd_horas_sem
 //$return[$aux][8] = data_fim
 //$return[$aux][9] = id_supervisor
 //$return[$aux][10] = id_turno
 //$return[$aux][11] = is_admin
 //$return[$aux][12] = email
 //$return[$aux][13] = data_ini
 $turno = new Turno();
 $turno = $turno->getTurnoById($alterados[10]);
 $cbo = new CBO();
 $cbo = $cbo->get_cbo_by_id($alterados[5]);
 if ($alterados[9] != 0) {
     $supervisor = Funcionario::get_nome_by_id($alterados[9]);
 }
 // if($alterados[11] == 1) // logica para imprimir administrador
 // {
 //     $adm = "SIM";
 // }else{
 //     $adm = "NÃO";
 // }
 // $data = explode('-', $alterados[8]);
 // $data_fim = $data[2].'/'.$data[1].'/'.$data[0];
 $data_hora_ini = explode(' ', $alterados[13]);
 $expl_date_ini = explode('-', $data_hora_ini[0]);
 $data_ini = $expl_date_ini[2] . '/' . $expl_date_ini[1] . '/' . $expl_date_ini[0];
 $data_ini .= '</b> às <b>' . $data_hora_ini[1];
 if ($alterados[8] != '0000-00-00 00:00:00') {
     $data_hora_fim = explode(' ', $alterados[8]);
Example #4
0
 $veiculos_obra = 1;
 $maquinarios_obra = 1;
 echo '<table class="table_geral" style="text-align:left" border="0">';
 $contColl = 0;
 $tableZebrada = 0;
 foreach ($dados_obra as $key => $value) {
     if ($contColl == 0) {
         if ($tableZebrada % 2 == 0) {
             echo '<tr class="tr-1">';
         } else {
             echo '<tr class="tr-2">';
         }
         $tableZebrada++;
     }
     if ($key == 'id_responsavel_obra') {
         $nome_idTurno = Funcionario::get_nome_by_id($value);
         echo '<td><b>' . transformaLabel($key) . ":</b> {$nome_idTurno[0]}</td>";
         $contColl++;
     } else {
         if ($key == 'id_cliente') {
             $nome = Cliente::get_name_by_id($value);
             echo '<td><b>' . transformaLabel($key) . ":</b> {$nome}</td>";
             $contColl++;
         } else {
             if ($key == 'data_inicio_previsto') {
                 $data = data_padrao_brasileiro($value);
                 echo '<td><b>' . transformaLabel($key) . ":</b> {$data}</td>";
                 $contColl++;
             } else {
                 if ($key == 'id_regiao_trabalho') {
                     $nome = Regiao::get_name_regiao_by_id($value);
Example #5
0
function get_esquecidos($data, $tipo)
{
    // echo 'Aguarde...';
    $horario = new Horarios();
    $array = $horario->get_registros_esquecidos($data, $tipo);
    $config = new Config();
    $TEMP_LIMIT_ATRASO = $config->get_config("temp_limit_atraso");
    // tempo limite de atraso ou adiantamento aceito
    // echo "<script>alert('".count($array)."');</script>";
    if (count($array) > 0) {
        // verifica se existe registro
        echo '<div class="content-right" id="content-right">
                    <div class="box-atrasos" style="width:96%">';
        echo '<table class="table-atrasos" border="0" style="box-shadow:0px 0px 5px #ccc;">';
        // echo '<tr><td colspan="4"><img src="../images/rel.png"></td></tr>';
        if ($tipo == 0) {
            echo '<tr><td colspan="4">' . date("d/m/Y") . '<br />' . '<a href="logado.php?desc=mes" style="font-size:12px">Ver mês inteiro</a>' . '</td></tr>';
        } else {
            echo '<tr><td colspan="4">' . date("m/Y") . '<br />' . '<a href="logado.php" style="font-size:12px">Ver hoje</a>' . '</td></tr>';
        }
        echo '<tr><td colspan="4"><b>Atenção</b></td></tr>';
        echo '<tr><td colspan="4"><span>Os funcionários abaixo esqueceram ou não bateram o ponto</span></td></tr>';
        $title = 'Clique para justificar o atraso';
        $funcionario = new Funcionario();
        $turno = new Turno();
        $table_color = 0;
        // para fazer a tabela zebrada
        $total_registros = 0;
        echo '<tr>
                         <td colspan="4">';
        echo '<div style="overflow-y: scroll; height: 190px;">';
        echo '<table style="text-align:center; width:100%" border="0">';
        echo '<tr><td><b>Funcionário</b></td><td><b>Tipo</b></td>';
        if ($tipo == 1) {
            echo '<td><b>Data</b></td>';
        }
        echo '</tr>';
        for ($aux = 0; $aux < count($array); $aux++) {
            /*
              $array[$aux][0] -> 'id'
              $array[$aux][1] -> 'data'
              $array[$aux][2] -> 'id_funcionario'
              $array[$aux][3] -> 'tipo_1'
              $array[$aux][4] -> 'tipo_2'
              $array[$aux][5] -> 'tipo_3'
              $array[$aux][6] -> 'tipo_0'
            */
            $nome_turno_funcionario = $funcionario->get_nome_by_id($array[$aux][2]);
            $turno = $turno->getTurnoById($nome_turno_funcionario[1]);
            // date_default_timezone_set('America/Sao_Paulo');
            $hora = strtotime(date('H:i:s'));
            $hora_turno['ini_exp'] = strtotime($turno->ini_exp) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['ini_alm'] = strtotime($turno->ini_alm) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['fim_alm'] = strtotime($turno->fim_alm) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['fim_exp'] = strtotime($turno->fim_exp) + $TEMP_LIMIT_ATRASO * 60;
            // echo $hora;
            if ($array[$aux][3] == 0 && ($hora > $hora_turno['ini_exp'] || strtotime($data) < strtotime($array[$aux][1]))) {
                //tipo_1
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Inicio expediente</b></a></td>';
                if ($tipo == 1) {
                    echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][4] == 0 && ($hora > $hora_turno['ini_alm'] || strtotime($data) < strtotime($array[$aux][1])) && $turno->sem_hor_almoco != '1') {
                //tipo_2
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Inicio Almoço</b></a></td>';
                if ($tipo == 1) {
                    echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][5] == 0 && ($hora > $hora_turno['fim_alm'] || strtotime($data) < strtotime($array[$aux][1])) && $turno->sem_hor_almoco != '1') {
                //tipo_3
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Fim Almoço</b></a></td>';
                if ($tipo == 1) {
                    echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][6] == 0 && ($hora > $hora_turno['fim_exp'] || strtotime($data) < strtotime($array[$aux][1]))) {
                //tipo_0
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Fim expediente</b></a></td>';
                if ($tipo == 1) {
                    echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
        }
        echo '</table>';
        echo '</div>';
        echo '</td></tr>';
        if ($total_registros > 0) {
            echo '<tr><td colspan="4" style="text-align: right; padding-top: 5px; color:#555; font-size: 12px;">';
            if ($tipo == 1) {
                echo '<div style="border-radius: 50%; border: 1px solid#555; float:left; height: 11px; width:11px; background-color:rgba(250,10,10,0.3)"></div><div style="float:left; margin-left: 5px;"> Sábados e domingos</div>';
            }
            echo 'Clique para corrigir </td></tr>';
            echo "<script>document.getElementById('content-right').style.display='block'</script>";
        } else {
            echo '<tr><td colspan="4" style="padding-top: 15px; color:#555; font-size: 12px;">Nenhum horário registrado!</td></tr>';
        }
        echo '<div class="cont" style="color:#f33;font-size:15px;  text-align:center"><b>' . $total_registros . '</b></div>';
        echo '</table>';
    }
    //fim if count($array) > 0
    echo '</div>
            </div>';
}
Example #6
0
function get_esquecidos($data, $tipo, $data2)
{
    // echo 'Aguarde...';
    $horario = new Horarios();
    $array = $horario->get_registros_esquecidos($data, $tipo, $data2);
    $config = new Config();
    $TEMP_LIMIT_ATRASO = $config->get_config("temp_limit_atraso", $_SESSION['id_empresa']);
    // tempo limite de atraso ou adiantamento aceito
    // echo "<script>alert('".count($array)."');</script>";
    if (count($array) > 0) {
        // verifica se existe registro
        echo '<div class="content-right" id="content-right">
                    <div class="box-atrasos" style="">';
        echo '<div class="cont" style="margin-left:480px;"><a name="exibe_box_sem_registros" onclick="oculta(this.name)"><img width="20px" src="../images/icon-fechar.png" onmouseover="info(\'pop1\')" onmouseout="fecharInfo(\'pop1\')"></a>
                              <div id="pop1" class="pop" style="display:none">
                                  <div id="titulo1" class="title-info-config"><span>Informações</span></div>
                                  <div id="content1" class="content-info">Clique para ocultar esse bloco, você pode exibi-lo novamente a qualquer momento em:<br /><b>Configurações > Layout</b></div>   
                              </div>
                         </div>';
        echo '<table class="table-atrasos" border="0" style="box-shadow:0px 0px 5px #ccc;">';
        // echo '<tr><td colspan="4"><img src="../images/rel.png"></td></tr>';
        // if($tipo == 0){
        echo '<tr><td colspan="4">';
        echo '<a href="principal" style="font-size:12px">Ver hoje</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="principal?desc=mes" style="font-size:12px">Ver mês inteiro</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="exibe_oculta(\'intervalo_datas\')" style="cursor: pointer; font-size:12px">Ver por período</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="exibe_oculta(\'funcionario\')" style="cursor: pointer;font-size:12px">Ver por funcionário</a>';
        echo '<br />';
        if ($tipo == 0) {
            echo '<span style="color:#aaa">Exibindo registros de hoje ' . date("d/m/Y") . '</span><br />';
        } else {
            if ($tipo == 1) {
                echo '<span style="color:#aaa">Exibindo registros para o mês ' . date("m/Y") . '</span><br />';
            } else {
                echo '<span style="color:#aaa">Exibindo registros de ' . date("d/m/Y", strtotime($data)) . ' até ' . date("d/m/Y", strtotime($data2)) . '</span><br />';
            }
        }
        echo '</td></tr>';
        // }else{
        //      echo '<tr><td colspan="4">'.date("m/Y").'<br />'. '<a href="principal" style="font-size:12px">Ver hoje</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="exibe_oculta(\'intervalo_datas\')" style="font-size:12px">Ver por período</a>'.'</td></tr>';
        // }
        echo '<tr id="intervalo_datas" style="display:none; ">
                                <td colspan="4">
                                    <form name="dataini_datafim" action="principal" method="POST">
                                      <span>Inicio: </span> <input  onclick="carregaMascaras()" type="date" name="ini" id="ini" style="border: 1px solid#cdcdcd; border-radius: 5px">&nbsp;&nbsp;<span>Fim: </span><input  onclick="carregaMascaras()" id="fim" name="fim" style="border: 1px solid#cdcdcd; border-radius: 5px" type="date"> <input type="submit" value="Buscar">
                                    <form>
                                </td>
                              </tr>';
        echo '<tr id="funcionario" style="display:none; ">
                                <td colspan="4">
                                    <form name="nome_func" action="principal" method="POST">
                                      <span>Nome: </span> <input type="text" name="funcionario" style="padding-left:5px;border: 1px solid#cdcdcd; border-radius: 5px"> <input type="submit" value="Buscar">
                                    <form>
                                </td>
                              </tr>';
        echo '<tr><td colspan="4"><b>Atenção</b></td></tr>';
        echo '<tr><td colspan="4"><span>Os funcionários abaixo esqueceram ou não bateram o ponto</span></td></tr>';
        $title = 'Clique para justificar o atraso';
        $funcionario = new Funcionario();
        $turno = new Turno();
        $table_color = 0;
        // para fazer a tabela zebrada
        $total_registros = 0;
        echo '<tr>
                         <td colspan="4">';
        echo '<div style="overflow-y: scroll; height: 190px;">';
        echo '<table style="text-align:center; width:100%" border="0">';
        echo '<tr><td><b>Funcionário</b></td><td><b>Tipo</b></td>';
        if ($tipo == 1) {
            echo '<td><b>Data</b></td>';
        }
        echo '</tr>';
        for ($aux = 0; $aux < count($array); $aux++) {
            /*
              $array[$aux][0] -> 'id'
              $array[$aux][1] -> 'data'
              $array[$aux][2] -> 'id_funcionario'
              $array[$aux][3] -> 'tipo_1'
              $array[$aux][4] -> 'tipo_2'
              $array[$aux][5] -> 'tipo_3'
              $array[$aux][6] -> 'tipo_0'
            */
            $nome_turno_funcionario = $funcionario->get_nome_by_id($array[$aux][2]);
            $turno = $turno->getTurnoById($nome_turno_funcionario[1]);
            $hora = strtotime(date('H:i:s'));
            $hora_turno['ini_exp'] = strtotime($turno->ini_exp) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['ini_alm'] = strtotime($turno->ini_alm) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['fim_alm'] = strtotime($turno->fim_alm) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['fim_exp'] = strtotime($turno->fim_exp) + $TEMP_LIMIT_ATRASO * 60;
            // echo $hora;
            if ($array[$aux][3] == 0 && ($hora > $hora_turno['ini_exp'] || strtotime($data) < strtotime($array[$aux][1]))) {
                //tipo_1
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="principal?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Inicio expediente</b></a></td>';
                if ($tipo == 1 || $tipo == 3) {
                    echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][4] == 0 && ($hora > $hora_turno['ini_alm'] || strtotime($data) < strtotime($array[$aux][1])) && $turno->sem_hor_almoco != '1') {
                //tipo_2
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="principal?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Inicio Almoço</b></a></td>';
                if ($tipo == 1 || $tipo == 3) {
                    echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][5] == 0 && ($hora > $hora_turno['fim_alm'] || strtotime($data) < strtotime($array[$aux][1])) && $turno->sem_hor_almoco != '1') {
                //tipo_3
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="principal?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Fim Almoço</b></a></td>';
                if ($tipo == 1 || $tipo == 3) {
                    echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][6] == 0 && ($hora > $hora_turno['fim_exp'] || strtotime($data) < strtotime($array[$aux][1]))) {
                //tipo_0
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="principal?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Fim expediente</b></a></td>';
                if ($tipo == 1 || $tipo == 3) {
                    echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
        }
        echo '</table>';
        echo '</div>';
        echo '</td></tr>';
        if ($total_registros > 0) {
            echo '<tr><td colspan="4" style="text-align: right; padding-top: 5px; color:#555; font-size: 12px;">';
            if ($tipo == 1) {
                echo '<div style="border-radius: 50%; border: 1px solid#555; float:left; height: 11px; width:11px; background-color:rgba(250,10,10,0.3)"></div><div style="float:left; margin-left: 5px;"> Sábados e domingos</div>';
            }
            echo 'Clique para corrigir </td></tr>';
            echo "<script>document.getElementById('content-right').style.display='block'</script>";
        } else {
            echo '<tr><td colspan="4" style="padding-top: 15px; color:#555; font-size: 12px;">Nenhum horário registrado!</td></tr>';
        }
        echo '<div class="cont" style="color:#f33;font-size:15px;  text-align:left"><b>' . $total_registros . '</b></div>';
        echo '</table>';
    } else {
        //fim if count($array) > 0
        echo '<div class="content-right" id="content-right">
                    <div class="box-atrasos" style="">';
        echo '<table class="table-atrasos" border="0" style="box-shadow:0px 0px 5px #ccc;">';
        // echo '<tr><td colspan="4"><img src="../images/rel.png"></td></tr>';
        // if($tipo == 0){
        echo '<tr><td colspan="4">';
        echo '<a href="principal" style="font-size:12px">Ver hoje</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="principal?desc=mes" style="font-size:12px">Ver mês inteiro</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="exibe_oculta(\'intervalo_datas\')" style="cursor: pointer;font-size:12px">Ver por período</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="exibe_oculta(\'intervalo_datas\')" style="cursor: pointer;font-size:12px">Ver por funcionário</a>';
        echo '<br />';
        if ($tipo == 0) {
            echo '<span style="color:#aaa">Exibindo registros de hoje ' . date("d/m/Y") . '</span><br />';
        } else {
            if ($tipo == 1) {
                echo '<span style="color:#aaa">Exibindo registros para o mês ' . date("m/Y") . '</span><br />';
            } else {
                echo '<span style="color:#aaa">Exibindo registros de ' . date("d/m/Y", strtotime($data)) . ' até ' . date("d/m/Y", strtotime($data2)) . '</span><br />';
            }
        }
        echo '</td></tr>';
        $total_registros = 0;
        echo '<tr>
                         <td colspan="4">';
        echo 'NENHUM REGISTRO FOI ENCONTRADO NESSE PERÍODO';
        echo '</td></tr>';
        echo '<div class="cont" style="color:#f33;font-size:15px;  text-align:left"><b>' . $total_registros . '</b></div>';
        echo '</table>';
        echo '</div></div>';
    }
    echo '</div>
            </div>';
}