<div class="row">
    <div class="col-lg-4 ">
        <div class="portlet ui-sortable">
            <div class="portlet-heading bg-theme">
                <h3 class="portlet-title">
                    <span class="icon"><i class="fa fa-file-pdf-o"></i></span> Todas Peças
                </h3>
                <div class="portlet-widgets">
                </div>
                <div class="clearfix"></div>
            </div>
            <div id="bg-primary1" class="panel" style="">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-block">
                            <div class="media-right white text-center">
                                <a href="#" id="todasManutencoes" style="text-decoration: none">
                                    <i class="fa fa-4x fa-wrench"></i>
                                    <p style="font-weight: bold"> Imprimir Peças</p>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <div class="col-lg-8 ">
        <div class="portlet ui-sortable">
            <div class="portlet-heading bg-theme">
                <h3 class="portlet-title">
                    <span class="icon"><i class="fa fa-file-pdf-o"></i></span> Relatório Personalizado
                </h3>
                <div class="portlet-widgets">
                </div>
                <div class="clearfix"></div>
            </div>
            <div id="bg-primary1" class="panel" style="">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-block">
                            <form action="<?php echo base_url()?>relatorios/visualizarPecas" method="post" target="relatorio"  name="formRelatorioManutencao" id="formRelatorioManutencao" class="floating-labels m-t-40">
                                <div class="form-body">
                                    <input type="hidden" id="peca_id" name="peca_id">
                                    <input type="hidden" id="servico_id" name="servico_id" value="2">
                                    <div class="row p-t-20 ">

                                        <div class="form-group col-lg-6 ">
                                            <div class="form-group">
                                                <select class="form-control p-0" id="tipoVeiculo" name="tipoVeiculo" required="">
                                                    <option value="Todos">Todos</option>
                                                    <option value="P">Padrão</option>
                                                    <option value="B">Articulado</option>
                                                </select><span class="bar"></span>
                                                <label for="input6">Modelos Ônibus</label>
                                            </div>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <div class="form-group">
                                                <select class="form-control p-0" id="tipoManutencao" name="tipoManutencao" required="">
                                                    <option value="Todos">Todos</option>
                                                    <option value="C">Corretiva</option>
                                                    <option value="P">Preventiva</option>
                                                </select><span class="bar"></span>
                                                <label for="input6">Tipo Manutenção</label>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="row p-t-20 ">
                                        <div class="form-group col-lg-6 ">
                                            <div class="form-group">
                                                <select class="form-control" id="tecnico" name="tecnico" required="">
                                                    <option value="Todos">Todos</option>
                                                    <?php
                                                    foreach ($resultscomboFuncionarios as $r) {
                                                        ?>
                                                        <option value="<?php echo $r->idFuncionario ?>"><?php echo $r->nomeFuncionario ?></option>
                                                    <?php } ?>
                                                </select><span class="bar"></span>
                                                <label for="input6">Técnico</label>
                                            </div>
                                        </div>





                                        <div class="form-group col-lg-6">
                                            <div class="form-group">
                                                <select class="form-control p-0" id="garagem" name="garagem" required="">
                                                    <option value="Todos">Todos</option>
                                                    <option>GAMA</option>
                                                    <option>ITAPOA</option>
                                                    <option>SANTA MARIA</option>
                                                </select><span class="bar"></span>
                                                <label for="input6">Garagem</label>
                                            </div>
                                        </div>



                                    </div>
                                    <div class="row p-t-20 ">

                                        <div class="form-group col-lg-6 ">
                                            <div class="form-group">
                                                <input type="date" class="form-control text-center" id="dataInicial"
                                                       name="dataInicial"
                                                       required value="<?php echo date('Y-m-d')?>">
                                                <label for="input6">Inicial</label>
                                            </div>
                                        </div>





                                        <div class="form-group col-lg-6">
                                            <div class="form-group">
                                                <input type="date" class="form-control text-center" id="dataFinal"
                                                       name="dataFinal"
                                                       required value="<?php echo date('Y-m-d')?>">
                                                <label for="input6">Final</label>
                                            </div>
                                        </div>



                                    </div>


                                </div>

                                <div class="modal-footer">
                                    <button type="submit" onclick="postaDados();" id="botaoPecaServico" class="btn btn-inverse" ><i class="fa fa-print"></i> Imprimir
                                    </button>
                                </div>

                            </form>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

<script>

    function relatorioTodasManutencoes() {
        var url = "<?php echo base_url() ?>relatorios/visualizarPecas/";
        var win = window.open(url, name = "_blank", "left=400,top=300,width=700,height=500,location=yes,menubar=no,toolbar=no");
        win.print();
    }

    $(document).ready(function () {
        $("#todasManutencoes").click(function () {
            relatorioTodasManutencoes();
            return false;
        })
    });
    function postaDados() {
        var win = window.open("about:blank", "relatorio", "left=400,top=300,width=700,height=500,location=yes,menubar=yes,toolbar=no");
    }
</script>