Path: C:\
<?php
date_default_timezone_set('America/Sao_Paulo');
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
<title>Transwar</title>
<link rel="icon" type="image/png" href="img/favicon.ico">
<link rel="stylesheet" href="css/redmond/jquery-ui-1.10.1.custom.css" />
<link rel="stylesheet" href="css/estilo.css" type="text/css" />
<script src="js/jquery-1.9.1.js" type="text/javascript"></script>
<script src="js/jquery-ui.js" type="text/javascript"></script>
<script type="text/javascript">
function Click() {
location.href="index.php";
}
function showCarga(){
document.getElementById('carga').style.display="block";
}
function hideCarga(){
document.getElementById('carga').style.display="none";
}
$(function() {
var dates = $( "#from, #to" ).datepicker({
altField: '#dia_to', defaultDate: null, setDate:null,
altField: '#dia_from', defaultDate: null, setDate:null,
showOtherMonths: true,
maxDate: "0d",
minDate: "-1y",
dayNamesMin: ['D','S','T','Q','Q','S','S','D'],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb','Dom'],
dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado'],
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
dateFormat: 'dd-mm-yy',
nextText: 'Próximo',
prevText: 'Anterior',
onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
}
});
$("input[name=Data]").click(function(e){
$('#carga').show();
e.preventDefault();
var di = $("#from").val();
var df = $("#to").val();
if($("#op0").is(":checked")){var op0 = $("#op0").val();}
if($("#op1").is(":checked")){var op1 = $("#op1").val();}
if($("#op2").is(":checked")){var op2 = $("#op2").val();}
if($("#op3").is(":checked")){var op3 = $("#op3").val();}
if($("#op4").is(":checked")){var op4 = $("#op4").val();}
if($("#op5").is(":checked")){var op5 = $("#op5").val();}
if($("#op6").is(":checked")){var op6 = $("#op6").val();}
if($("#op7").is(":checked")){var op7 = $("#op7").val();}
if($("#op8").is(":checked")){var op8 = $("#op8").val();}
if($("#op9").is(":checked")){var op9 = $("#op9").val();}
if($("#op10").is(":checked")){var op10 = $("#op10").val();}
if($("#op11").is(":checked")){var op11 = $("#op11").val();}
if($("#op12").is(":checked")){var op12 = $("#op12").val();}
if($("#op13").is(":checked")){var op13 = $("#op13").val();}
if($("#op14").is(":checked")){var op14 = $("#op14").val();}
if($("#op15").is(":checked")){var op15 = $("#op15").val();}
if($("#op16").is(":checked")){var op16 = $("#op16").val();}
if($("#op17").is(":checked")){var op17 = $("#op17").val();}
$.post(
"searchCTe.php",
{ di: di, df: df, op0: op0, op1: op1, op2: op2, op3: op3, op4: op4, op5: op5, op6: op6, op7: op7, op8: op8, op9: op9, op10: op10, op11: op11, op12: op12, op13: op13, op14: op14, op15: op15, op16: op16, op17: op17},
function(data){
$("#resultados").html(data);
}
);
});
});
</script>
</head>
<body>
<div id="geral">
<table width="100%">
<tr>
<td width="33%" align="center">
<img src="img/logo.png" width="300" height="80"/>
</td>
<td width="34%" align="center">
<h2><span class="label label-primary"> RELATÓRIO CRODA ROTA </span></h2>
</td>
<td width="33%" align="center">
<img src="img/logo_croda.png" width="230" height="70"/>
</td>
</table>
<div id="corpo">
<table width="100%" >
<form id="form" name="form" method="post" action="searchCTe.php" enctype="multipart/form-data">
<tr>
<td colspan="4" align="center" >
<h2 align="center">Escolha Período e Status de CTes e Minutas:</h2>
</td>
</tr>
<tr>
<td align="center" rowspan="4" valign="TOP" width="30%" >
<div id="from">
<font size="4"><strong>Data Inicial:</strong></font><br>
<input type="hidden" name="dia_from" required id="dia_from" value="<?php echo $dateadded;?>" class="form-control">
</div>
</td>
<th width="20%" align="left"> CTe:</th>
<th width="20%" align="left"> Minuta:</th>
<td align="center" rowspan="4" valign="TOP" width="30%" >
<div id="to">
<font size="4"><strong>Data Final:</strong></font><br>
<input type="hidden" name="dia_to" required id="dia_to" value="<?php echo $dateadded;?>" class="form-control">
</div>
</td>
</tr>
<tr>
<td style="display: block;" align="left">
<input type="checkbox" id="op0" name="op0" value="0">
<label for="op0"> Cadastrado</label><br>
<input type="checkbox" id="op1" name="op1" value="1">
<label for="op1"> Emitido</label><br>
<input type="checkbox" id="op2" name="op2" value="2" checked>
<label for="op2"> Em Trânsito</label><br>
<input type="checkbox" id="op3" name="op3" value="3" checked>
<label for="op3"> Entregue</label><br>
<input type="checkbox" id="op4" name="op4" value="4">
<label for="op4"> Cancelado</label><br>
<input type="checkbox" id="op5" name="op5" value="5" checked>
<label for="op5"> Não Entregue</label><br>
<input type="checkbox" id="op6" name="op6" value="6">
<label for="op6"> Inutilizado</label><br>
</td>
<td align="left">
<input type="checkbox" id="op7" name="op7" value="0">
<label for="op7"> Cadastrada</label><br>
<input type="checkbox" id="op8" name="op8" value="1">
<label for="op8"> Agendada</label><br>
<input type="checkbox" id="op9" name="op9" value="2">
<label for="op9"> Tentativa</label><br>
<input type="checkbox" id="op10" name="op10" value="3" checked>
<label for="op10"> Coleta Parcial</label><br>
<input type="checkbox" id="op11" name="op11" value="4" checked>
<label for="op11"> Coletada</label><br>
<input type="checkbox" id="op12" name="op12" value="5">
<label for="op12"> Problema</label><br>
<input type="checkbox" id="op13" name="op13" value="6">
<label for="op13"> Cancelada</label><br>
<input type="checkbox" id="op14" name="op14" value="7">
<label for="op14"> Inutilizada</label><br>
<input type="checkbox" id="op15" name="op15" value="8" checked>
<label for="op15"> Em Trânsito</label><br>
<input type="checkbox" id="op16" name="op16" value="9" checked>
<label for="op16"> Em Execução</label><br>
<input type="checkbox" id="op17" name="op17" value="10" checked>
<label for="op17"> Finalizada</label><br>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" name="Data" id="Data" class="button2" value="Gerar Arquivo" />
<div align="center" class="loading" id="carga" >
<img class="imgloading" src="img/tempo.gif" style="height:30; width:240">
</div>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<?php
if (isset($_GET['arquivo'])) {$arqxlsx=$_GET['arquivo'];
echo '
<div id="alert" align="center">
<strong>Arquivo EXCEL gerado com sucesso!</strong><br>
<a href="Excel/'.$arqxlsx.'" download onclick="Click(this);">Tecle p/ Baixar EXCEL</a>
</div>';}
?>
</td>
</tr>
</form>
</table>
</div>
<div id="resultados"></div>
</div>
</body>
</html>