<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(URL::asset('js/views/patio/manutencao.js?123456789')); ?>"></script>
    <!-- <script src="<?php echo e(URL::asset('js/tempus-dominus/tempusdominus-bootstrap-4.min.js')); ?>"></script> -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('titulo'); ?>
  <h4><b>&nbsp;&nbsp;SGP - <?php echo e(Auth::user()->Unidade->getNome()); ?></b> - <i class="fas fa-wrench"></i> Manutenção de Estadias</h4> 
<?php $__env->stopSection(); ?>

<?php $__env->startSection('pagina'); ?>
    

<div class="content-wrapper">
    <input type="hidden" id="hdnUsuario"    name="idusuario" data="<?php echo e(Auth::user()->getId()); ?>"/>
    <input type="hidden" id="hdnId"         name="id"        data=""/>
    <input type="hidden" id="hdnVeiculo"    name="veiculo"   data=""/>
    <input type="hidden" id="hdnMotorista"  name="motorista" data=""/>
    <input type="hidden" id="hdnData"       name="data"      data=""/>
    <input type="hidden" id="hdnUnidade"    name="unidade"   data=""/>
    

    <div class="container-fluid mt-2">
        
        <div id="cadastro" class="card mt-2" style="display: none; background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
            
            <?php echo csrf_field(); ?>
            
            <div class="card-body">
                <div class="row" style="padding-right: 2px;">
                    <div class="col-md-4">
                        <h6 style="color: #000;"><i class="fas fa-truck fa-2x"></i><b> Dados do Veículo</b></h6>
                    </div>
                    <div class="col-md-8">
                        <div class="col text-right">
                            
                            <button id="btnVoltar" type="button" class="btn btn-secondary" aria-label="Left Align" >
                                <i class="fas fa-arrow-left"></i> Voltar
                            </button>

                            <button id="btnSalvar" type="button" data="" class="btn btn-success" aria-label="Left Align" >
                                <i class="fas fa-save"></i> Salvar
                            </button>

                            <button id="btnInspecao" type="button" data="" class="btn btn-info" aria-label="Left Align" >
                                <i class="far fa-star"></i> Gerar Inspeção
                            </button>

                            <a target="_blank" href="<?php echo e(route('patio.imprecibo')); ?>">
                                <button id="btnImprimirRecibo" type="button" class="btn btn-warning" aria-label="Left Align" >
                                    <i class="fas fa-print fa-lg"></i> Recibo Soene
                                </button>
                            </a>
                            

                            <!-- <button id="ir-para-recibo" type="button" class="btn btn-warning" aria-label="Left Align">
                                <i class="fas fa-print fa-lg"></i> Imprimir recibo
                            </button> -->


                            <a target="_blank" href="<?php echo e(route('patio.impreciboroma')); ?>">
                                <button id="btnImprimirReciboRoma" type="button" class="btn btn-warning" aria-label="Left Align" >
                                    <i class="fas fa-print fa-lg"></i> Recibo Roma
                                </button>
                            </a>
                            
                        </div>
                    </div>
                    
                </div>

                <div id="inspecao" class="row mt-2">
                    <div class="col-lg-12 col-12">
                        <div class="card" style="background-color:#ffff80; color:#8c8c8c; border-radius: 0px 0px 0px 0px;">
                        <div class="card-header" style="background-color:#ffff00; color: #8c8c8c;"><h4><b>ATENÇÃO</b></h4></div>
                        <div class="card-body">
                            <div class="row">
                                <div class="col-lg-2">
                                    <center>
                                        <i class="far fa-star fa-4x" style="color: #8c8c8c;"></i> 
                                    </center>
                                </div>
                                <div class="col-lg-6">
                                    <h4 class="card-text">Você irá gerar um registro de inspeção do veículo de forma manual. Lembramos que havendo algum registro na inspeção, este será excluído, dando lugar à um novo, necessitando o preenchimento da inspeção.</h4>
                                    <h3 id="sucesso" style="color: #ff0000;">INSPEÇÃO CRIADA COM SUCESSO!</h3>
                                </div>
                                <div class="col-lg-4" >
                                    <div class="col text-right">
                                        <button id="btnVoltarInsp" type="button" class="btn btn-secondary" aria-label="Left Align" >
                                            <i class="fas fa-arrow-left"></i> Fechar
                                        </button>

                                        <button id="btnSalvarInsp" type="button" data="" class="btn btn-info" aria-label="Left Align" >
                                            <i class="fas fa-save"></i> Confirmar Gerar Inspeção
                                        </button>
                                    </div>
                                </div>
                            </div>
                           
                        </div>
                        </div>
                    </div>
                </div>
                
                <!-- <h6><i class="fas fa-truck fa-lg"></i><b> Dados do Veículo</b></h6> -->
                <!-- <hr style="color:gray;"></hr> -->
                <div class="row" >
                    <div class="col-md-2">
                        <label id="txtPlaca_label" for="txtPlaca"  class="col-form-label text-md-left">Placa Cavalo <span style="color: #ff0000;">*</span></label>
                        <input id="txtPlaca" class="form-control" name="placa" type="text" maxlength="7" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtPlaca_carreta_label" for="txtPreco"  class="col-form-label text-md-left">Placa Carreta</label>
                        <input id="txtPlaca_carreta" class="form-control" name="placa_carreta" type="text" maxlength="7" value="" />
                    </div>
                    <div class="col-md-3">
                        <label id="txtMarca_label" for="txtMarca"  class="col-form-label text-md-left">Marca</label>
                        <input id="txtMarca" class="form-control" name="marca" type="text" maxlength="50" value="" />
                    </div>
                    <div class="col-md-3">
                        <label id="txtModelo_label" for="txtModelo"  class="col-form-label text-md-left">Modelo</label>
                        <input id="txtModelo" class="form-control" name="modelo" type="text" maxlength="50" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtTipo_label" for="txtForm"  class="col-form-label text-md-left">Tipo Veículo</label><br>
                        <select id="cbTipo" class="form-control">
                            
                        </select>
                    </div>
                </div>

                <br>
                <h6 style="color: #000;"><i class="fas fa-user-tie fa-2x"></i><b> Dados do Motorista</b></h6>
                <!-- <hr style="color:gray;"></hr> -->
                <div class="row" >
                    <div class="col-md-2">
                        <label id="txtCpf_label" for="txtCpf"  class="col-form-label text-md-left">CPF <span style="color: #ff0000;">*</span></label>
                        <input id="txtCpf" class="form-control" name="cpf" type="text" maxlength="11" value="" />
                    </div>
                    <div class="col-md-5">
                        <label id="txtNome_carreta_label" for="txtNome"  class="col-form-label text-md-left">Nome do Motorista <span style="color: #ff0000;">*</span></label>
                        <input id="txtNome" class="form-control" name="nome" type="text" maxlength="50" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtCelular_label" for="txtCelular"  class="col-form-label text-md-left">Celular (com DDD)<span style="color: #ff0000;">*</span></label>
                        <input id="txtCelular" class="form-control" name="celular" type="text" maxlength="11" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtCnh_label" for="txtCnh"  class="col-form-label text-md-left">CNH</label>
                        <input id="txtCnh" class="form-control" name="cnh" type="text" maxlength="20" value="" />
                    </div>
                    <div class="col-md-1">
                        <label id="txtCategoria_label" for="txtCategoria"  class="col-form-label text-md-left">Categoria</label>
                        <input id="txtCategoria" class="form-control" name="categoria" type="text" maxlength="3" value="" />
                    </div>
                </div>

                <br>
                <h6 style="color: #000;"><i class="fas fa-box fa-2x"></i><b> Dados da Carga</b></h6>
                <!-- <hr style="color:gray;"></hr> -->
                <div class="row" >
                    <div class="col-md-3">
                        <label id="txtCliente_label" for="txtCliente"  class="col-form-label text-md-left">Cliente <span style="color: #ff0000;">*</span></label>
                        <br/>
                        <select id="cbCliente" class="form-control">
                            
                        </select>
                    </div>
                    <div class="col-md-4">
                        <label id="txtPlaca_label" for="txtPlaca"  class="col-form-label text-md-left">Produto <span style="color: #ff0000;">*</span></label>
                        <select id="cbProduto" class="form-control">
                            
                        </select>
                    </div>
                    <div class="col-md-1">
                        <label id="txtQtde_label" for="txtQtde"  class="col-form-label text-md-left">Qtde (kG)</label>
                        <input id="txtQtde" class="form-control" name="qtde" type="text" maxlength="10" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtPedido_label" for="txtPedido"  class="col-form-label text-md-left">Pedido</label>
                        <input id="txtPedido" class="form-control" name="pedido" type="text" maxlength="20" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="cbTipocarga_label" for="cbTipocarga"  class="col-form-label text-md-left">Tipo de Carga <span style="color: #ff0000;">*</span></label>
                        <select id="cbTipocarga" class="form-control">
                            <option value="" selected>...Todos</option>
                            <option value="BG">BAGS</option>
                            <option value="CS">CARGA GERAL</option>
                            <option value="GR">GRANEL</option>
                            <option value="SA">SACARIA</option>
                            <option value="TQ">TANQUE</option>
                            
                        </select>
                    </div>
                </div>
                <div class="row" >
                    <div class="col-md-2">
                        <label id="txtData_label" for="txtData"  class="col-form-label text-md-left">Data Prevista <span style="color: #ff0000;">*</span></label>
                        <input id="txtData" class="form-control" name="data" onKeyUp="mascara_data(this)" type="text" maxlength="10" value="" required/>
                    </div>
                    <div class="col-md-1">
                        <label id="txtHora_label" for="txtHora"  class="col-form-label text-md-left">Hora <span style="color: #ff0000;">*</span></label>
                        <input id="txtHora" class="form-control" name="hora" onKeyUp="mascara_hora(this)" type="text" maxlength="5" value="" />
                    </div>
                    <div class="col-md-3">
                        <label id="cbDestino_carreta_label" for="cbDestino"  class="col-form-label text-md-left">Destino <span style="color: #ff0000;">*</span></label>
                        <select id="cbDestino" class="form-control">
                            
                        </select>
                    </div>
                    <div class="col-md-4">
                        <label id="cbTransp_label" for="cbTransp"  class="col-form-label text-md-left">Transportador <span style="color: #ff0000;">*</span></label>
                        <select id="cbTransp" class="form-control">
                            
                        </select>
                    </div>
                    <div class="col-md-2">
                        <label id="cbTipooper_label" for="cbTipocarga"  class="col-form-label text-md-left">Tipo de Operação <span style="color: #ff0000;">*</span></label>
                        <select id="cbTipoOper" class="form-control">
                            <option value="" selected>...Selecione</option>
                            <option value="C">CARREGAR</option>
                            <option value="D">DESCARREGAR</option>
                        </select>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-2">
                        <label id="cbStatus_label" for="cbStatus"  class="col-form-label text-md-left">Status</label>
                        <select id="cbStatus" class="form-control">
                            <option value="" selected>...Todos</option>
                            <option value="AG">AGENDADO</option>
                            <option value="PA">NO PATIO</option>
                            <option value="ET">EM TRANSITO</option>
                            <option value="FN">FINALIZADO</option>
                            <option value="CL">CANCELADO</option>
                        </select>
                    </div>

                </div>
                <div class="row" >
                    <div class="col-md-5">
                        <label id="txtForm_label" for="txtForm"  class="col-form-label text-md-left">Fórmulas</label>
                        <textarea id="txtFormula" name="txtFormula" style="width: 100%" rows="3" maxlength="200"></textarea>
                    </div>
                    <div class="col-md-1">
                        <label id="txtForm_label" for="txtForm"  class="col-form-label text-md-left">&nbsp;</label><br>
                        <button id="btnNovaFormula" type="button" data="" class="btn btn-warning" aria-label="Left Align" >
                            <i class="fas fa-flask"></i>
                        </button>
                        
                        <!-- <div id="grpFormula" class="btn-group" role="group" aria-label="Formula" width="100%;"> -->
                            <button id="btnLimpaFormula" type="button" data="" class="btn btn-danger" aria-label="Left Align" title="limpa lista de fórmulas"><i class="fas fa-times"></i></button>    
                            <button id="btnIncluirFormula" data="formula" type="button" class="btn btn-success" title="Inclui a fórmula"><i class="fas fa-check"></i></button>
                            
                        <!-- </div> -->
                    </div>
                    <div class="col-md-2">
                        <label id="txtForm_label" for="txtForm"  class="col-form-label text-md-left">&nbsp;</label><br>
                        <select id="cbFormula" class="form-control">
                            
                        </select>
                    </div>
                    <div class="col-md-4">
                        <label id="txtObs_label" for="txtObs"  class="col-form-label text-md-left">Observação</label>
                        <textarea id="txtObs" name="txtObs" style="width: 100%" rows="3" maxlength="200"></textarea>
                    </div>
                </div>
                <div class="row  mt-2">
                    <div class="col-md-12">
                        <div class="col text-right">
                            
                            <button id="btnVoltar2" type="button" class="btn btn-secondary" aria-label="Left Align" >
                                <i class="fas fa-arrow-left"></i> Voltar
                            </button>

                            <button id="btnSalvar2" type="button" data="" class="btn btn-success" aria-label="Left Align" >
                                <i class="fas fa-save"></i> Salvar
                            </button>
                            
                        </div>
                    </div>
                </div>

            </div>
            
        </div>

        <div id="lista" class="card mt-2" style="background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
            <div class="card-body">
                
                <div class="row">
                    <div class="col-md-2">
                        <label id="cbStatusPesq_label" for="cbstatusSel"  class="col-form-label text-md-left">Status</label>
                        <select id="cbStatusPesq" class="form-control">
                            <option value="" selected>...Todos</option>
                            <option value="AG">AGENDADO</option>
                            <option value="PA">NO PATIO</option>
                            <option value="ET">EM TRANSITO</option>
                            <option value="FN">FINALIZADO</option>
                            <option value="CL">CANCELADO</option>
                        </select>
                    </div>
                    <div class="col col-lg-4 col-12 text-left">
                        <label for="cbClientePesq" class="col-form-label text-md-left">Cliente</label>
                        <br/>
                        <select id="cbClientePesq" class="form-control">
                            
                        </select>
                    </div>
                    <div class="col-md-2">
                        <label id="txtPlacaPesq_label" for="txtPlaca"  class="col-form-label text-md-left">Busca Placa</label>
                        <input id="txtPlacaPesq" class="form-control" name="placa" type="text" maxlength="7" value="" />
                    </div>
                    <div class="col-md-4 text-right">
                        <label for="cbClientePesq" class="col-form-label text-md-left">&nbsp;</label>
                        <br/>
                        <button id="btnPesquisar" type="button" class="btn btn-secondary" aria-label="Left Align" >
                            <i class="fas fa-search"></i> Pesquisar
                        </button>
                        
                    </div>
                </div>
                <div class="row mt-2" >
                    <div class="col panel panel-primary table-responsive">

                        <table id="tbEstadia" class="table table-striped table-bordered text-left ">
                            <thead  style="background-color:#404040; color: #ccc; font-weight: bold;">
                                <tr>
                                    <th>Dados das Estadias</th>
                                    <th></th>
                                </tr>
                            </thead>
                            <tbody>
                                

                            </tbody>
                        </table>

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


<script>

    document.getElementById('ir-para-recibo').addEventListener('click', function () {
        window.location.href = '/patio/imprecibo?id=' + $('#hdnId').attr('data');
        //target = "_blank";
        ///*  */done = 1;
    });

    function mascara_data(campo) {
        if (campo.value.length == 2) {
            campo.value += '/';
        }
        if (campo.value.length == 5) {
            campo.value += '/';
        }
    }

    function mascara_hora(campo) {
        if (campo.value.length == 2) {
            campo.value += ':';
        }
    }

    function mascara_letra(campo) {
        if (campo.value == '-') {
            campo.value += '';
        }
        if (campo.value == '=') {
            campo.value += '';
        }
    
    }

</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>