include "checklogin.php";
include "dir.inc.php";
if ($handle = opendir($path)) {
$files = array();
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$data = substr($file, -10);
$tmp = explode(".", $data);
$data = $tmp[2].$tmp[1].$tmp[0];
$files[] = $file;
$files2[$data][] = $file;
}
}
closedir($handle);
}
//**** sorteando arquivos
$datas = array_keys($files2);
arsort($datas);
$files = array();
foreach($datas as $data) {
asort($files2[$data]);
$files = array_merge($files, $files2[$data]);
}//*/
$today = date("d.m.Y");
while (list($key,$val)= each($files)) {
if (ereg("Oficial",$val)) { continue; }
if (ereg(".pdf",$val)) { continue; }
else {
$toprint = rawurldecode($val);
$toprint = str_replace("dj1/","",$toprint);
$toprint = str_replace("dj2/","",$toprint);
$toprint = str_replace("dj3/","",$toprint);
$toprint = str_replace(".html","",$toprint);
if (ereg($today,$val)) {
$optionstoday[]=""; }
else {
$optionss[]=""; }
}
}
$objconn = new acesso;
$conn = $objconn->abre();
$tabela="grupo"; $chave="id"; $valor="nome";
$option=$objconn->montacombo($tabela, $conn, $chave, $valor, " where idusuario='$idusu' ");
$objconn->fecha($conn);
include_once 'tribunal_form_helper.php';
ledj_tribunal_header("DJ's anteriores");
ledj_section_header("Pesquisa por grupo de palavras");
ledj_group_form_start('relatorio.php');
ledj_group_select($option);
ledj_edition_select($optionss, 'Seção');
ledj_section_header("Formatação do Relatório");
ledj_report_format(10);
ledj_form_submit();
ledj_instant_header('relatorio.php');
ledj_instant_input();
ledj_instant_edition_select($optionss, 'Seção');
ledj_section_header("Formatação do Relatório");
ledj_report_format(10);
ledj_instant_submit();
ledj_close_card();
print '';
ledj_dicas();
?>