<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(URL::asset('js/views/cadastro/baixa.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('titulo'); ?>
    <?php echo e(Auth::user()->Unidade->getNome()); ?>

<?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="hdnUnidade"    name="idunidade"    data="<?php echo e(Auth::user()->getUnidade()); ?>"/> -->
    <input type="hidden" id="hdnId"         name="id"           data=""/>
    <input type="hidden" id="hdnIdAgenda"   name="idagenda"     data=""/>
    <input type="hidden" id="hdnPreco"      name="preco"        data=""/>
    <input type="hidden" id="hdnIdPessoa"   name="idpessoa"     data=""/>
    <input type="hidden" id="hdnUf"         name="hdnuf"        data=""/>
    <input type="hidden" id="hdnCidade"     name="hdncidade"    data=""/>
    <input type="hidden" id="hdnStatus"     name="hdnstatus"    data=""/>
    <input type="hidden" id="hdnDataMov"    name="hdndatamov"   data=""/>

    <div class="container-fluid mt-2">
        <?php echo csrf_field(); ?>


        <div id="listaagenda" class="card mt-2" style="display: none; background-color:#f0f0f0; 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-md-12">
                        <h5 style="color:#056367;"><i class="fas fa-check"></i> Baixa Agenda</h5>
                    </div>
                </div>
                <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                    <div class="col-md-3">
                        <label id="txtBusca_label" for="txtNome3"  class="col-form-label text-md-left">Busca</label>
                        <input id="txtBusca" class="form-control" name="busca" type="text" maxlength="50" value=""/>
                    </div>
                    <div class="col-md-3"></div>
                    <div class="col-md-6 text-right">
                        <label id="txtButton3_label" for="txtBusca"  class="col-form-label text-md-left">&nbsp;</label><br>
                        <button id="btnPesquisar" type="button" class="btn btn-primary" aria-label="Left Align" >
                            <i class="fas fa-search"></i> Pesquisar
                        </button>
                    </div>
                </div>
                <div class="row" >
                    <div class="col panel panel-primary table-responsive">

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

                            </tbody>
                        </table>

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


       
        <div id="agenda" class="card mt-2" style="display: none; background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
            
            <div class="card-body">
                <div class="card-body">
                    <div class="row" style="padding-right: 2px;">
                        <div class="col-md-12">
                            <h5 style="color:#056367;"><i class="fas fa-check"></i> Baixa - Agenda</h5>
                        </div>
                    </div>
                    <div class="row" style="padding-right: 2px;">
                        
                        <div class="col-md-10">
                            <div class="col text-right">
                                <button id="btnVoltarA2" type="button" class="btn btn-secondary" aria-label="Left Align" >
                                    <i class="fas fa-arrow-left"></i> Voltar
                                </button>

                                <button id="btnSalvarA2" type="button" data="" class="btn btn-warning" aria-label="Left Align" >
                                    <i class="fas fa-check"></i> Baixar
                                </button>
                                
                                <button id="btnExcluirA2" type="button" data="" class="btn btn-danger" aria-label="Left Align" >
                                    <i class="fas fa-ban"></i> Cancelar
                                </button>
                                
                            </div>
                        </div>
                        
                    </div>
                </div>
                <hr></hr>
                <div class="card-body">
                    <div class="row" >
                        <div class="col-lg-10 col-12">
                            <div class="row" >
                                
                                <div class="col-md-9">
                                    <label id="txtNome2_label" for="txtNome"  class="col-form-label text-md-left">Nome</label>
                                    <input id="txtNome2" class="form-control" name="nome" type="text" maxlength="50" value=""/>
                                </div>
                                <div class="col-md-3">
                                    <label id="txtDataAgenda_label" for="txtDataAgenda"  class="col-form-label text-md-left">Data/Hora</label>
                                    <input id="txtDataAgenda" class="form-control" name="dataagenda" type="text" onKeyUp="mascara_data(this)" maxlength="10" value="" />
                                </div>

                            </div>

                            <div class="row" >
                                <div class="col-md-12">
                                    <label id="txtObsagenda_label" for="txtFone"  class="col-form-label text-md-left">Observação</label>
                                    <input id="txtObsagenda" class="form-control" name="obsagenda" type="text" maxlength="500"  value="" />
                                </div>
                            </div>

                            <div class="row" >
                                
                                <div class="col-md-2">
                                    <label id="txtTotal_label" for="txtTotal"  class="col-form-label text-md-left">Total Serv (R$)</label>
                                    <input id="txtTotal" class="form-control" name="total" type="text" maxlength="10" value="" />
                                </div>
                                <div class="col-md-2">
                                    <label id="txtTotal_label" for="txtDesconto"  class="col-form-label text-md-left">Desconto (R$)</label>
                                    <input id="txtDesconto" class="form-control" onkeyup="calcula()" name="desconto" type="text" maxlength="10" value="" />
                                </div>
                                <div class="col-md-2">
                                    <label id="txtPagar_label" for="txtPagar"  class="col-form-label text-md-left">Total (R$)</label>
                                    <input id="txtPagar" class="form-control" name="pagar" type="text" maxlength="10" value="" />
                                </div>
                                <div class="col-md-3">
                                    <label id="cbForma_label" for="cbForma" class="col-form-label text-md-left">Forma Pgto <span style="color: #ff0000;">*</span></label>
                                    <br/>
                                    <select id="cbForma" class="form-control">
                                        <option value="">...Selecione</option>
                                        <option value="CC">CARTÃO CRÉDITO</option>
                                        <option value="CD">CARTÃO DÉBITO</option>
                                        <option value="DN">ESPÉCIE</option>
                                    </select>
                                </div>
                                <div class="col-md-3">
                                    <label id="cbConta_label" for="cbConta" class="col-form-label text-md-left">Conta Financeira <span style="color: #ff0000;">*</span></label>
                                    <br/>
                                    <select id="cbConta" class="form-control">
                                        <option value="">...Selecione</option>
                                        
                                    </select>
                                </div>
                            </div>

                            
                        </div>
                    </div>

                    <div class="row mt-2" style="padding-right: 2px;">
                        
                        <div class="col-md-10">
                            <div class="col text-right">
                                <button id="btnVoltarA4" type="button" class="btn btn-secondary" aria-label="Left Align" >
                                    <i class="fas fa-arrow-left"></i> Voltar
                                </button>

                                <button id="btnSalvarA4" type="button" data="" class="btn btn-warning" aria-label="Left Align" >
                                    <i class="fas fa-check"></i> Baixar
                                </button>
                                
                              
                                
                            </div>
                        </div>
                        
                    </div>
                </div>

                <div class="card-body">
                    <div class="row" >
                        <div class="col-lg-10 col-12">
                           
                            <div id="procedimento" class="row" style="display: none;">
                                <div class="col-md-5">
                                    <label id="cbProcedimento_label" for="cbProcedimento" class="col-form-label text-md-left">Procedimento</label>
                                    <br/>
                                    <select id="cbProcedimento" class="form-control">
                                        
                                    </select>
                                </div>
                               
                                <div class="col-md-5">
                                    <label id="cbProfissional_label" for="cbProfissional" class="col-form-label text-md-left">Profissional</label>
                                    <br/>
                                    <select id="cbProfissional" class="form-control">
                                        
                                    </select>
                                </div>
                                <div class="col-md-2 text-right">
                                    <label id="txtProc_label" for="btnProced" class="col-form-label text-md-left">&nbsp;</label><br>
                                    <button id="btnIncluirProcedimento" type="button" class="btn btn-success" aria-label="Left Align" >
                                        <i class="fas fa-plus"></i> Incluir Proc.
                                    </button>
                                </div>
                            </div>

                            <div class="row mt-2" id="listaprocedimento">
                                <div class="col-md-12">
                                    <div class="col panel panel-primary table-responsive">

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

                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </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 += '';
        }
    
    }

    /* function mascara_letras(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode :
        ((evt.which) ? evt.which : 0));
    if (charCode > 31 && (charCode < 65 || charCode > 90) &&
        (charCode < 97 || charCode > 122)) {
        alert("Permitido somente letras!");
        return false;
    }
    return true;
} */

/* function ApenasLetras(e, t) {
    try {
        if (window.event) {
            var charCode = window.event.keyCode;
        } else if (e) {
            var charCode = e.which;
        } else {
            return true;
        }
        if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123))
            return true;
        else
            return false;
    } catch (err) {
        alert(err.Description);
    }
} */
</script>

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