$notas = $cont->getAllNotasforDof($prov, $mes_post, $ano_post);
        } else {
            $notas = $cont->getAllNotasforDof($prov);
        }
        if (count($notas) > 0) {
            if ($notas[0]['id'] != null) {
                foreach ($notas as $nota) {
                    $tpl->UO = $nota['unidade'];
                    $tpl->UC = $nota['rgi'] . " - [ <small>" . $nota['compl'] . "</small> ]";
                    $tpl->EMPRESA = $nota['nome'];
                    $tpl->DATAREF = getMesNome($nota['mes_ref']) . "/" . $nota['ano_ref'];
                    $tpl->CONSUMO = tratarValor($nota['consumo']);
                    $tpl->VALOR = tratarValor($nota['valor'], true);
                    $tpl->EMISSAO = setDateDiaMesAno($nota['emissao']);
                    $tpl->LANCTO = ExplodeDateTime($nota['criado'], true);
                    $tpl->SUBMIT = $nota['pagto'] == '0000-00-00' ? '<input type="button" value="PAGO" class="button" name="' . $nota['id'] . '" />' : setDateDiaMesAno($nota['pagto']);
                    $tpl->NOTAID = $nota['id'];
                    $tpl->PROV = $nota['provisoria'];
                    $tpl->block('EACH_NOTAS');
                }
            } else {
                $tpl->SQL = $notas[0]['sql'];
            }
        } else {
            $tpl->block('SEM_NOTAS');
        }
        $tpl->block('POSTED');
    }
}
/*if(mysql_num_rows($query_cont) > 0){
		
     while ($res = mysql_fetch_array($query_cont)) {
         $contrato = new Contrato($res['id']);
         $tpl->AUTOS = $i . " - " . $contrato->geraNome();
         $tpl->PERIODO = getMesNome($mes_ref, false) . "/" . $ano_ref;
         $notas = $contrato->getAllNotasByRef($mes_ref, $ano_ref, false);
         if (count($notas) > 0) {
             if ($notas[0]['id'] != null) {
                 foreach ($notas as $nota) {
                     $tpl->NOTANUM = $nota['numero'];
                     $tpl->UO = $nota['unidade'];
                     $tpl->UC = $nota['rgi'] . " - [ <small>" . $nota['compl'] . "</small> ]";
                     $tpl->EMPRESA = $nota['nome'];
                     $tpl->DATAREF = getMesNome($nota['mes_ref']) . "/" . $nota['ano_ref'];
                     $tpl->CONSUMO = tratarValor($nota['consumo']);
                     $tpl->VALOR = tratarValor($nota['valor'], true);
                     $tpl->EMISSAO = setDateDiaMesAno($nota['emissao']);
                     $tpl->LANCTO = ExplodeDateTime($nota['criado'], true);
                     $tpl->SUBMIT = '<input type="button" value="EDITAR" class="button" name="ope_editarNota.php?chave=' . $nota['id'] . '" />';
                     $tpl->NOTAID = $nota['id'];
                     $tpl->block('EACH_NOTAS');
                 }
             } else {
                 $tpl->block('SEM_NOTAS');
             }
         }
         //$tpl->SQL = $notas;
         $tpl->block("EACH_CONTRATO");
         $i++;
     }
     $tpl->block("TABLE_BODY");
 }
 $cons_soma = 0;
 if (count($uc->getAllNotas(false)) >= 1) {
     foreach ($uc->getAllNotas(false) as $notaRes) {
         $nota = new Nota($notaRes['id']);
         if (!$nota->isEmpenho()) {
             $tpl->NFMESANO = $nota->get('data_ref');
             $tpl->NFNUMERO = $nota->get('numero');
             $nota->get('nome') != "" ? $nota->get('numero') . " - " . $nota->get('nome') : $nota->get('numero');
             $tpl->NFNOME = $nota->get('nome') != "" ? "- " . $nota->get('nome') : "";
             $tpl->NFDATA = setDateDiaMesAno($nota->get('emissao'));
             $tpl->NFCONS = tratarValor($nota->get('consumo'));
             $tpl->NFPAGO = tratarValor($nota->get('valor'), true);
             $tpl->NFPROV = $nota->get('provisoria');
             $tpl->NFLANCPOR = $nota->get('usuario')->get('login');
             $tpl->NFSAIDA = setDateDiaMesAno($nota->get('saida'));
             $tpl->NFPAGODATA = setDateDiaMesAno($nota->get('pagoem'));
             $cumulativo += $nota->get('valor');
             $tpl->NFCUMULATIVO = tratarValor($cumulativo, true);
             $cons_soma += $nota->get('consumo');
         }
         $tpl->BLOCK('EACH_FINANCEIRO');
     }
 }
 $tpl->HISTCONSTOTAL = tratarValor($cons_soma);
 $tpl->HISTPAGOTOTAL = tratarValor($cumulativo, true);
 /*********************************
 		   MOSTRAR RELATÓRIOS ANALÍTICOS
 		 *********************************/
 $exercicioPassado = $uc->getExercicioMensal($anoAtual - 1);
 $r = 1;
 $s = 1;
Beispiel #4
0
        $ferias_it = 0;
        $ferias_sql = "SELECT * FROM ferias WHERE pront = '{$pront}'";
        $ferias_query = mysql_query($ferias_sql);
        $ferias_qtd = mysql_num_rows($ferias_query);
        while ($ferias = mysql_fetch_array($ferias_query, MYSQL_ASSOC)) {
            $ferias_it++;
            $tpl->PERIODO = setDateDiaMesAno($ferias['aquisicao_ini']) . " a " . setDateDiaMesAno($ferias['aquisicao_fin']);
            if ($today_date > $ferias['aquisicao_fin'] && $ferias_it == $ferias_qtd) {
                $tpl->PERIODO .= ' <span class="glyphicon glyphicon-asterisk" style="color:red"></span><span style="color:red">vencido</span>';
            }
            // Esses sobrepõem os dados colocados no form anteriormente.
            $tpl->AQUIS_INI_FORM = setDateDiaMesAno(date('Y-m-d', strtotime("+1 day", strtotime($ferias['aquisicao_fin']))));
            $tpl->AQUIS_FIN_FORM = setDateDiaMesAno(date('Y-m-d', strtotime("+1 year", strtotime($ferias['aquisicao_fin']))));
            $tpl->FERIAS_INI_FORM = setDateDiaMesAno(date('Y-m-d', strtotime("+1 year +1 day", strtotime($ferias['aquisicao_fin']))));
            $tpl->FERIAS_FIN_FORM = setDateDiaMesAno(date('Y-m-d', strtotime("+1 year +31 days", strtotime($ferias['aquisicao_fin']))));
            $tpl->FERIAS = setDateDiaMesAno($ferias['ferias_ini']) . " a " . setDateDiaMesAno($ferias['ferias_fin']);
            $tpl->ABONO = $ferias['abono'] ? "SIM" : "NÃO";
            $tpl->ADIANTA = $ferias['adiantamento'] ? "SIM" : "NÃO";
            $tpl->FERIAS_ID = $ferias['id'];
            $tpl->block('EACH_FERIAS');
        }
        /*
         * Colocar datas no form. Se houver última data, preencher com ela.
         * Se não, colocar data de admissão. Fim de período será preenchido com JS
         */
        //$tpl->AQUISICAO_INI = $aquisi_ini;
    } else {
        header("Location: index.php");
    }
} else {
    header("Location: index.php");
Beispiel #5
0
 $tpl->NOTAQTD = count($notas);
 $i = 1;
 foreach ($notas as $nota) {
     $consTipo = $nota['constipo'];
     $cores = $rel->cores;
     $tpl->UO = $nota['unidade'];
     $tpl->UC = "<b>" . $nota['rgi'] . "</b> - [ <small>" . $nota['compl'] . "</small> ]";
     $tpl->UC .= $nota['desc'] != "" ? " <font color='red'>*</font>" : "";
     $tpl->UC .= "<br /><small>Tipo: <font color='" . $cores[$consTipo] . "'>" . $tipos[$consTipo] . "</font></small>";
     $tpl->UC .= $nota['ativo'] == 0 ? " - <small><font color='red'>[ Inativo ]</font></small>" : " - <small><font color='green'>[ Ativo ]</font></small>";
     $tpl->STATUS = $nota['ativo'] == 0 ? "<small><font color='red'>INATIVO</font></small>" : "<small><font color='green'>ATIVO</font></small>";
     $tpl->EMISSAO = setDateDiaMesAno($nota['emissao']);
     $tpl->LANCTO = ExplodeDateTime($nota['criado'], true);
     $tpl->VENCTO = setDateDiaMesAno($nota['vencto']);
     $tpl->SAIDA = setDateDiaMesAno($nota['saida']);
     $tpl->PAGOEM = setDateDiaMesAno($nota['pagto']);
     $tpl->CONSUMO = tratarValor($nota['consumo'], false);
     $tpl->VALOR = tratarValor($nota['valor'], true);
     $tpl->USUARIO = $nota['login'];
     $tpl->NOTAID = substr(sha1($nota['id']), 0, 5);
     $tpl->NUMERO = $nota['id'];
     $autos1 = $nota['pasta'] == 0 ? "Autos " : "Processo ";
     $autos2 = $nota['pasta'] == 0 ? number_format($nota['num'], 0, ',', '.') : $nota['num'];
     $autos3 = $nota['autos'];
     $tpl->AUTOS = $autos1 . " n°" . $autos2 . " - " . $autos3;
     $tpl->PROV = $nota['provisoria'];
     $tpl->COMPL = $nota['endereco'] == "" ? $nota['compl'] : $nota['endereco'];
     $tpl->EMPRESA = $nota['empresa'];
     $tpl->OBS = $rel->getObs($nota['desc']);
     $tpl->MESREF = getMesNome($nota['mes_ref'], true) . "/" . $nota['ano_ref'];
     $tpl->INDEX = $i;
        $udds = $rel->udds;
        $cores = $rel->cores;
        $tipos = $rel->ucTipos;
        if (mysql_num_rows($query_cont) > 0) {
            while ($res = mysql_fetch_array($query_cont)) {
                $contrato = new Contrato($res['id']);
                $notas = $contrato->getFaltaNotas($mes, $ano);
                if ($notas[0]['ucid'] != null) {
                    $qtd += count($notas);
                    foreach ($notas as $nota) {
                        $consTipo = $nota['tipo'];
                        $tpl->UO = $udds[$nota['uo']];
                        $tpl->AUTOS = $contrato->geraNome();
                        $tpl->UC = "<b>" . $nota['rgi'] . "</b> - [ <small>" . $nota['endereco'] . "</small> ]";
                        $tpl->UC .= "<br /><small><font color='" . $cores[$consTipo] . "'>" . $tipos[$consTipo] . "</font></small>";
                        $tpl->VENCTO = setDateDiaMesAno($nota['vencto']);
                        $i++;
                        $tpl->INDEX = $i;
                        $tpl->block('EACH_NOTAS');
                    }
                }
            }
        }
        $tpl->NOTAQTD = $qtd;
        $tpl->block("RESULT_BLOCK");
    }
}
$fim = execucao();
$tempo = number_format($fim - $inicio, 6);
$tpl->EXECTIME = "Tempo de Execução: <b>" . $tempo . "</b> segundos ";
$tpl->show();
Beispiel #7
0
 */
$func_sql = "SELECT pront,nome,rg2,admissao FROM usuario WHERE admissao <> '' ORDER BY nome";
$func_query = mysql_query($func_sql);
$today_date = Date('Y-m-d');
$tpl->TODAY = setDateDiaMesAno($today_date, true);
if (mysql_num_rows($func_query) > 0) {
    // Colocando resultado da consulta em array $funcionarios e buscando seus períodos de férias
    while ($linha = mysql_fetch_array($func_query, MYSQL_ASSOC)) {
        $tpl->PRONT = $linha['pront'];
        $tpl->NAME = $linha['nome'];
        $tpl->RG = $linha['rg2'];
        $tpl->ADMISS = setDateDiaMesAno($linha['admissao']);
        //Buscar férias de funcionario
        $fer_sql = "SELECT aquisicao_ini, aquisicao_fin, ferias_ini, ferias_fin FROM ferias WHERE pront = '" . $linha['pront'] . "' ORDER BY aquisicao_ini DESC limit 1";
        $fer_query = mysql_query($fer_sql);
        if (mysql_num_rows($fer_query) == 1) {
            $ferias = mysql_fetch_assoc($fer_query);
            $tpl->FERIAS = setDateDiaMesAno($ferias['ferias_ini']) . " a " . setDateDiaMesAno($ferias['ferias_fin']);
            $tpl->PERIODO = setDateDiaMesAno($ferias['aquisicao_ini']) . " a " . setDateDiaMesAno($ferias['aquisicao_fin']);
            if ($today_date > $ferias['aquisicao_fin']) {
                $tpl->PERIODO .= ' <span class="glyphicon glyphicon-asterisk" style="color:red"></span>';
            }
        } else {
            // Para não mostrar férias nem períodos
            $tpl->FERIAS = "sem dados";
            $tpl->PERIODO = "sem dados";
        }
        $tpl->block('EACH_FUNC');
    }
}
//$fin = date('Y-m-d', strtotime("+1 year -1 day",strtotime($linha['aquisicao_ini'])));