<?php $__env->startSection('titulo'); ?>
    <i class="fas fa-calendar-alt"></i> Agendamento
<?php $__env->stopSection(); ?>

<?php $__env->startSection('css'); ?>
    <link rel="stylesheet" href="<?php echo e(URL::asset('css/bootstrap-select-1.13.2/bootstrap-select.min.css')); ?>" />
    <link rel="stylesheet" href="<?php echo e(URL::asset('js/jquery-ui-1.12.1/jquery-ui.min.css')); ?>" />
    <link rel="stylesheet" href="<?php echo e(URL::asset('css/slick/slick.css')); ?>" />
    <link rel="stylesheet" href="<?php echo e(URL::asset('css/slick/slick-theme.css')); ?>" />

    <link rel="stylesheet" href="<?php echo e(URL::asset('css/bootstrap-datetimepicker/bootstrap-datetimepicker.css')); ?>" />
    <link rel="stylesheet" href="<?php echo e(URL::asset('css/steps/steps.css')); ?>" />

    <style>
        .ui-autocomplete-loading
        {
            background: white url("../img/ui-anim_basic_16x16.gif") right no-repeat;
        }
    </style>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(URL::asset('js/bootstrap-select-1.13.2/bootstrap-select.min.js')); ?>"></script>
    <script src="<?php echo e(URL::asset('js/jquery-ui-1.12.1/jquery-ui.min.js')); ?>"></script>
    <script src="<?php echo e(URL::asset('js/slick/slick.js')); ?>"></script>

    <script src="<?php echo e(URL::asset('js/moment/min/moment-with-locales.min.js')); ?>"></script>
    <script src="<?php echo e(URL::asset('js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js')); ?>"></script>

    <script src="<?php echo e(URL::asset('js/views/operacao/agendamento.js')); ?>" ></script>
    <script src="<?php echo e(URL::asset('js/views/operacao/agendamento_autocompletes.js')); ?>" ></script>
    <script src="<?php echo e(URL::asset('js/views/operacao/agendamento_steps.js')); ?>" ></script>
<?php $__env->stopSection(); ?>

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

    <div id="conteudoPagina" class="container-fluid">
        <div class="card">
            <div class="card-body">

                <div class="row">
                    <div class="col col-lg-6">

                        <form id="formAgendaEstadia" method="POST" enctype="multipart/form-data" action="<?php echo e(route('operacao.agenda.salvar')); ?>" >
                            <?php echo csrf_field(); ?>

                            <div class="container-fluid">
                                <ul class="progressbar">
                                    <li id="step-index-0" class="active">Veículo/Motorista</li>
                                    <li id="step-index-1">Cliente/Destino</li>
                                    <li id="step-index-2">Produto/Fórmula</li>
                                </ul>
                            </div>

                            <div id="steps">

                                <!-- PASSO 1 -->
                                <div class="step container-fluid">

                                <!---------- VEÍCULO ---------->
                                    <fieldset>
                                        <legend>Veículo</legend>

                                        <input type="hidden" id="hdnVeiculo" name="id_veiculo"/>

                                        <div class="form-group row">
                                            <div class="col col-form col-sm-3">
                                                <label for="txtPlaca">Placa</label>
                                                <br/>
                                                <input id="txtPlaca" type="text"class="required form-control mask_placa text-uppercase" autofocus/>
                                            </div>

                                            <div class="col col-form col-sm-5">
                                                <label for="txtTipoVeiculo">Tipo Veículo</label>
                                                <br/>
                                                <input id="txtTipoVeiculo" type="text"class="required form-control" disabled/>
                                            </div>

                                            <div class="col col-form col-sm-4">
                                                <label for="txtSituacao">Situação</label>
                                                <br/>
                                                <input id="txtSituacao" type="text"class="required form-control" disabled/>
                                            </div>
                                        </div>

                                        
                                        <div class="form-group row">

                                            <div class="col col-form col-sm-2">
                                                <label for="txtAno">Ano</label>
                                                <br/>
                                                <input id="txtAno" type="text"class="required form-control" disabled/>
                                            </div>
                                            <div class="col col-form col-sm-5">
                                                <label for="txtMarca">Marca</label>
                                                <br/>
                                                <input id="txtMarca" type="text"class="required form-control" disabled/>
                                            </div>
                                            <div class="col col-form col-sm-5">
                                                <label for="txtModelo">Modelo</label>
                                                <br/>
                                                <input id="txtModelo" type="text"class="required form-control" disabled/>
                                            </div>

                                        </div>
                                    </fieldset>
                                    <br/>
                                <!---------- MOTORISTA ---------->
                                    <fieldset>
                                        <legend>Motorista</legend>

                                        <input type="hidden" id="hdnMotorista" name="id_motorista"/>

                                        <div class="form-group row">
                                            <div class="col col-form col-sm-3">
                                                <label for="txtCpf">CPF</label>
                                                <br/>
                                                <input id="txtCpf" type="text"class="form-control mask_cpf text-uppercase"/>
                                            </div>

                                            <div class="col col-form col-sm-5">
                                                <label for="txtNome">Nome</label>
                                                <br/>
                                                <input id="txtNome" type="text"class="form-control" disabled/>
                                            </div>

                                            <div class="col col-form col-sm-4">
                                                <label for="txtCelular">Celular</label>
                                                <br/>
                                                <input id="txtCelular" type="text" class="form-control mask_celular" disabled/>
                                            </div>
                                        </div>

                                    </fieldset>


                                </div>

                                <!-- PASSO 2 -->
                                <div id="step2" class="step container-fluid d-none">

                                <!---------- CLIENTE ---------->
                                    <fieldset>
                                        <legend>Cliente</legend>
                                        <div class="form-group row">
                                            <div class="col col-form col-sm-12">
                                                <select id="cbCliente"
                                                        name="cliente"
                                                        class="form-control selectpicker"
                                                        data-size="5"
                                                        data-live-search="true"
                                                        title="Selecione o cliente">
                                                    <?php $__currentLoopData = $clientes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cli): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($cli->getId()); ?>"><?php echo e($cli->getNomeFantasia()); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                                </select>
                                            </div>
                                        </div>
                                    </fieldset>

                                    <fieldset>
                                        <legend>Transportador</legend>
                                        <div class="form-group row">
                                            <div class="col col-form col-sm-12">
                                                <select id="cbTransportador"
                                                        name="transportador"
                                                        class="form-control selectpicker"
                                                        data-size="5"
                                                        data-live-search="true"
                                                        title="Selecione o transportador">
                                                    <?php $__currentLoopData = $transportador; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($transp->getId()); ?>"><?php echo e($transp->getNomeFantasia()); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                                </select>
                                            </div>
                                        </div>
                                    </fieldset>

                                    <!---------- DESTINO ---------->
                                    <fieldset>
                                        <legend>Destino</legend>
                                        <div class="form-group row">
                                            <div class="col col-form col-sm-12">
                                                <select id="cbDestino"
                                                    class="form-control selectpicker"
                                                    name="destino"
                                                    data-size="5"
                                                    data-live-search="true"
                                                    title="Selecione o Destino">
                                                <?php $__currentLoopData = $destinos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $destino): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($destino->getId()); ?>"><?php echo e('('.$destino->getSigla().') '.$destino->getDescricao()); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                                </select>
                                            </div>
                                        </div>
                                    </fieldset>

                                    <!---------- ORIGEM ---------->
                                    <fieldset>
                                        <legend>Origem</legend>

                                        <div class="form-group row">
                                            <div class="col col-form col-sm-4">
                                                <label for="cbEstado">Estado</label>
                                                <br/>
                                                <select id="cbEstado"
                                                        class="form-control "
                                                        data-size="5"
                                                        data-live-search="true"
                                                        placement="top-start"
                                                        title="Selecione o Estado">
                                                        <option value="">Selecione</option>
                                                    <?php $__currentLoopData = $estados; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $valor=>$nome): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($valor); ?>"><?php echo e($nome); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>

                                            <div class="col col-form col-sm-8">
                                                <label for="cbCidade">Cidade</label>
                                                <br/>
                                                <select id="cbCidade"
                                                        class="form-control "
                                                        name="cidade"
                                                        data-size="5"
                                                        data-live-search="true"
                                                        title="Selecione a cidade" disabled>

                                                </select>
                                            </div>
                                        </div>
                                    </fieldset>

                                </div>

                                <!-- PASSO 3 -->
                                <div id="step3" class="step container-fluid d-none">

                                    <!---------- PRODUTO ---------->
                                    <fieldset>
                                        <legend>Produto</legend>
                                        <div class="form-group row">
                                            <div class="col col-form col-sm-12">
                                                <select id="cbProduto"
                                                    class="form-control selectpicker"
                                                    name="produto"
                                                    data-size="5"
                                                    data-live-search="true"
                                                    title="Selecione o Produto">
                                                <?php $__currentLoopData = $produtos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $produto): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($produto->getId()); ?>"><?php echo e('('.$produto->getNcm().') '.$produto->getDescricao()); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>
                                    </fieldset>

                                    <!---------- FÓRMULA ---------->
                                    <fieldset>
                                        <legend>Fórmula</legend>

                                        <input type="hidden" id="hdnFormula" name="id_formula"/>

                                        <div class="form-group row">
                                            <div class="col col-form col-sm-12">
                                                    <select id="cbFormula"
                                                    class="form-control selectpicker"
                                                    name="formula"
                                                    data-size="5"
                                                    data-live-search="true"
                                                    title="Selecione a Fórmula">
                                                <?php $__currentLoopData = $formulas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $formula): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($formula->getId()); ?>"><?php echo e($formula->getDescricao()); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>
                                    </fieldset>

                                    <!---------- DATAS ---------->
                                    <fieldset>
                                        <legend>Data Prevista</legend>

                                        <div class="form-group row">

                                            <div class="col col-form col-sm-4">
                                                <input id="txtDtPrevista" name="data_prevista" type="text" class="form-control" />
                                            </div>

                                        </div>
                                    </fieldset>

                                </div>


                            </div>

                            <div class="row">
                                <div class="col col-sm-12">
                                    <button id="btnAnterior" type="button" class="float-left btn btn-default d-none"><i class="fas fa-arrow-left"></i> Anterior</button>
                                    <button id="btnProximo" type="button" class="float-right btn btn-primary">Próximo <i class="fas fa-arrow-right"></i></button>
                                    <button id="btnConcluir" type="submit" class="float-right btn btn-success d-none">Concluir <i class="fas fa-check"></i></button>
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
            </div>
        </div>
        <br/>
    </div>
<?php $__env->stopSection(); ?>



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