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

<?php $__env->startSection('titulo'); ?>
  SGP - <?php echo e(Auth::user()->Unidade->getNome()); ?></b> - <i class="fas fa-bulborn"></i> Chamar para Sair
<?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="hdnCliente"    name="idcliente" data="<?php echo e(Auth::user()->getCliente()); ?>"/>
    <input type="hidden" id="hdnDestino"    name="iddestino" data="<?php echo e(Auth::user()->getDestino()); ?>"/>
    <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="hdnNome"       name="nome"      data=""/>
    <input type="hidden" id="hdnPlaca"      name="placa"     data=""/>
    <input type="hidden" id="hdnCelular"    name="celular"   data=""/>
    <input type="hidden" id="hdnDestino"    name="destino"   data=""/>
    <input type="hidden" id="hdnData"       name="data"      data=""/>
    <input type="hidden" id="hdnDataChamada" name="datachamada" 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-8">
                        <!-- <h4 style="color:#056367;"><i class="fas fa-bullhorn"></i> Veículos no Pátio (chamada para sair)</h4> -->
                    </div>
                    <div class="col-md-4">
                        <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-bullhorn"></i> Chamar para sair
                            </button>

                            <button id="btnDesfaz" type="button" data="" class="btn btn-danger" aria-label="Left Align" >
                                <i class="fas fa-times"></i> Desfaz Chamada
                            </button>
                        </div>

                    </div>
                    
                </div>
                <br>
                <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-4">
                        <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-4">
                        <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>

                <br>
                <h6><i class="fas fa-user-tie fa-lg"></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><i class="fas fa-box fa-lg"></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>
                        <input id="txtCliente" class="form-control" name="cliente" type="text" maxlength="7" value="" />
                    </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 (ton)</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="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 Entrada <span style="color: #ff0000;"></span></label>
                        <input id="txtEntrada" class="form-control" name="data"  type="text" maxlength="10" value="" required/>
                    </div>
                    <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-4">
                        <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>
                <div class="row" >
                    <div class="col-md-2">
                        <label id="txtObs_label" for="txtObs"  class="col-form-label text-md-left">Tipo Operação</label>
                        <input id="txtOperacao" class="form-control" name="operacao" type="text" maxlength="200" value="" />
                    </div>
                    <div class="col-md-10">
                        <label id="txtObs_label" for="txtObs"  class="col-form-label text-md-left">Fórmula</label>
                        <input id="txtFormula" class="form-control" name="formula" type="text" maxlength="200" value="" />
                    </div>
                </div>
                <div class="row" >
                    <div class="col-md-12">
                        <label id="txtObs_label" for="txtObs"  class="col-form-label text-md-left">Observação</label>
                        <input id="txtObs" class="form-control" name="marca" type="text" maxlength="200" value="" />
                    </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-bullhorn"></i> Chamar para sair
                            </button>

                            <button id="btnDesfaz2" type="button" data="" class="btn btn-danger" aria-label="Left Align" >
                                <i class="fas fa-times"></i> Desfaz Chamada
                            </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" style="padding-bottom: 5px; padding-right: 2px;">
                    
                    <div class="col col-lg-3 col-12 text-left">
                        <label for="cbClientePesq" class="col-form-label text-md-left">Agendado para</label>
                        <br/>
                        <select id="cbClientePesq" class="form-control">
                            
                        </select>
                        <select id="cbInspecao" class="form-control">
                            
                        </select>
                    </div>
                    <div class="col-md-3">
                        <label id="txtForm_label" for="txtForm"  class="col-form-label text-md-left">Fórmula</label><br>
                        <select id="cbFormulaSel" class="form-control">
                            
                        </select>
                    </div>
                    <div class="col col-lg-4 col-12 text-left">
                        <label for="cbOrdem" class="col-form-label text-md-left">Ordenado por</label>
                        <br/>
                        <select id="cbOrdem" class="form-control">
                            <option value="">...Selecione</option>
                            <option value="1" selected>DATA CHEGADA - CRESCENTE</option>
                            <option value="2" >DATA CHEGADA - DECRESCENTE</option>
                            <option value="3" >DATA PREVISTA - CRESCENTE</option>
                            <option value="4">PLACA</option>
                            
                        </select>
                    </div>
                    <div class="col-md-2 text-right">
                        <label for="cbOrdem" 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="tbChamar" 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>

    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(); ?>