   <?php	
        include ("cabecalho.php");
    ?>
      
        <div class='col-md-2'></div>
        <div class='col-md-8'>
        <div class="parceiro">
            <div class="col-sm-12">
                    <h3>2ª via de nota fiscal</h3><br/>
                     <div id="SemNotas" style ="display:none" class="alert alert-success" role="alert"><br /><center><h4>Não existem <strong>notas fiscais</strong> para o período selecionado.</h4></center></div>
                     <div id="QteNotas" style ="display:none"  class="alert alert-warning" role="alert"><br /><center><h4>Você possui <strong><span id="TotalNotas">  </span> notas fiscais</strong> para o período selecionado.</h4></center></div>
            </div>
            <form onSubmit="return BuscaNotaFiscal()" class="form">
                <div class="form-inline">                   
                    <div class="form-group col-sm-5">
                            <label for="datainicial">Data Início Emissão:</label>                
                            <div class='input-group date' id='dataInicial'>
                                <input type='text' class="form-control" required />
                                <span class="input-group-addon">
                                    <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                            </div>
                    </div>
                    <div class="form-group col-sm-5 ">
                            <label for="datainicial">Data Fim Emissão:</label>                
                            <div class='input-group date' id='dataFinal'>
                                <input type='text' class="form-control" required />
                                <span class="input-group-addon">
                                    <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                            </div>
                    </div> 
                    <div class="form-group col-sm-1" style="top:4px">                                        
                        <button type="submit" title='Buscar Notas' class="btn btn-success" style="height:32px" ><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button>                    
                    </div>                  
                </div><br/><br/>
                <script type="text/javascript">       
                    var date = new Date();
                    $(function () {
                        $('#dataInicial').datetimepicker({
                            locale: 'pt-BR',
                            format: "DD/MM/YYYY",
                            date: new Date(date.getFullYear(), (date.getMonth()-1) , 1)
                        });
                        $('#dataFinal').datetimepicker({
                            locale: 'pt-BR',
                            format: "DD/MM/YYYY",
                            date: new Date()
                        });
                    });     
                            
                </script>                                
                
                <table class="table table-striped table-responsive" id="tblNotas">
                    <thead>
                        <tr>
                        <th scope="col"></th>
                        <th scope="col">Nº Nota</th>
                        <th scope="col">Modelo</th>
                        <th scope="col">Data de Emissão</th>
                        <th scope="col">Valor (R$)</th>
                        <th scope="col">Vencimento</th>
                        <th scope="col"></th>
                        </tr>
                    </thead>
                    <tbody></tbody>

                    <?php
                    //    }
                    ?>                
                </table>
            </form>
        </div>
            <script src="js/funcoes.js"></script>  
</body>            
            <script defer src="https://use.fontawesome.com/releases/v5.0.2/js/all.js"></script>
            <a id='dwnldLnk1' style="display:none;" />     
            <script type="text/javascript">
                    $(document).ready(function(){
                        BuscaNotaFiscal();
                    });
            </script>

