<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(URL::asset('js/views/cadastro/pessoa.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="hdnPessoa"     name="pessoa"       data="F"/>
    <input type="hidden" id="hdnUf"         name="hdnuf"        data=""/>
    <input type="hidden" id="hdnCidade"     name="hdncidade"    data=""/>
    <input type="hidden" id="hdnStatus"     name="hdstatus"     data=""/>

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

        <div id="cadastro" class="card mt-2" style="display: none; background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
            
            <div class="card-body">
                <div class="row" style="padding-right: 2px;">
                    <div class="col-md-6">
                        <h5 style="color:#056367;"><i class="fas fa-user-tie"></i> Cliente</h5>
                    </div>
                    <div class="col-md-6">
                        <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="btnExcluir" type="button" data="" class="btn btn-danger" aria-label="Left Align" >
                                <i class="fas fa-trash-alt"></i> Excluir
                            </button>
                            
                        </div>
                    </div>
                    
                </div>
                <hr></hr>
                <div class="row" >
                    
                    <div class="col-md-7">
                        <label id="txtNome_label" for="txtNome"  class="col-form-label text-md-left">Nome <span style="color: #ff0000;">*</span></label>
                        <input id="txtNome" class="form-control" name="nome" pattern="([aA-zZ]+)" type="text" maxlength="50" value="" />
                    </div>
                    <div class="col-md-4">
                        <label id="txtApelido_label" for="txtApelido"  class="col-form-label text-md-left">Apelido</label>
                        <input id="txtApelido" class="form-control" name="apelido" type="text" maxlength="50" value="" />
                    </div>
                    
                   
                    <div class="col-md-1">
                        <label id="txtAtivo_label" for="txtAtivo"  class="col-form-label text-md-left">Ativo?</label>
                        <br/>
                        <label class="switch">
                            <input id="cbAtivo"  type="checkbox" data-off-color="danger" data-on-text="1" data-off-text="0">
                            <span class="slider round"></span>
                        </label>
                    </div>

                </div>

                <div class="row" >
                    <div class="col-md-6">
                        <label id="txtEndereco_label" for="txtEndereco"  class="col-form-label text-md-left">Endereço</label>
                        <input id="txtEndereco" class="form-control" name="endereco" type="text" maxlength="100" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtNro_label" for="txtNro"  class="col-form-label text-md-left">Nº</label>
                        <input id="txtNro" class="form-control" name="numero" type="text" maxlength="10" value="" />
                    </div>
                    <div class="col-md-4">
                        <label id="txtComplemento_label" for="txtComplemento"  class="col-form-label text-md-left">Complemento</label>
                        <input id="txtComplemento" class="form-control" name="complemento" type="text" maxlength="50" value="" />
                    </div>
                </div>

                <div class="row" >
                    <div class="col-md-4">
                        <label id="txtBairro_label" for="txtBairro"  class="col-form-label text-md-left">Bairro</label>
                        <input id="txtBairro" class="form-control" name="bairro" type="text" maxlength="50" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtCep_label" for="txtCep"  class="col-form-label text-md-left">CEP</label>
                        <input id="txtCep" class="form-control" name="cep" type="text" maxlength="10" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtUf_label" for="txtUf" class="col-form-label text-md-left">UF <span style="color: #ff0000;">*</span></label>
                        <br/>
                        <select id="cbUf" class="form-control" required>
                            
                        </select>
                    </div>
                    <div class="col-md-4">
                        <label id="txtCidade_label" for="txtCidade" class="col-form-label text-md-left">Cidade <span style="color: #ff0000;">*</span></label>
                        <br/>
                        <select id="cbCidade" class="form-control" required>
                            
                        </select>
                    </div>
                </div>

                <div class="row" >
                    <div class="col-md-2">
                        <label id="txtFone_label" for="txtFone"  class="col-form-label text-md-left">Fone</label>
                        <input id="txtFone" class="form-control" name="fone" type="text" maxlength="20" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtCelular_label" for="txtCelular"  class="col-form-label text-md-left">Celular</label>
                        <input id="txtCelular" class="form-control" name="celular" type="text" maxlength="20" value="" />
                    </div>
                    <div class="col-md-5">
                        <label id="txtEmail_label" for="txtEmail"  class="col-form-label text-md-left">Email</label>
                        <input id="txtEmail" class="form-control" name="email" type="text" maxlength="100" value="" />
                    </div>
                    <div class="col-md-3">
                        <label id="txtIndicacao_label" for="txtIndicacao"  class="col-form-label text-md-left">Indicado por</label>
                        <input id="txtIndicacao" class="form-control" name="indicacao" type="text" maxlength="50" value="" />
                    </div>
                </div>
                
                <div class="row" >
                    <div class="col-md-12">
                        <label id="txtObs_label" for="txtFone"  class="col-form-label text-md-left">Observação</label>
                        <input id="txtObs" class="form-control" name="obs" type="text" maxlength="500"  value="" />
                    </div>
                </div>
                <br>
                <div class="row" >
                    <div class="col-md-12">
                        <div class="col text-right">
                            <button id="btnVoltarB" type="button" class="btn btn-secondary" aria-label="Left Align" >
                                <i class="fas fa-arrow-left"></i> Voltar
                            </button>

                            <button id="btnSalvarB" 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="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-user-tie"></i> Cliente - Agenda</h5>
                    </div>
                </div>
                <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                    <div class="col-md-6">
                        <label id="txtNome3_label" for="txtNome3"  class="col-form-label text-md-left">Nome</label>
                        <input id="txtNome3" class="form-control" name="nome" type="text" maxlength="50" value=""/>
                    </div>
                    <div class="col-md-6 text-right">
                        <label id="txtButton3_label" for="txtNome3"  class="col-form-label text-md-left">&nbsp;</label><br>
                        <button id="btnVoltarA1" type="button" class="btn btn-secondary" aria-label="Left Align" >
                            <i class="fas fa-arrow-left"></i> Voltar
                        </button>
                        <button id="btnNovoA1" type="button" class="btn btn-primary" aria-label="Left Align" >
                            <i class="fas fa-plus-circle"></i> Nova Agenda
                        </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-8">
                            <h5 style="color:#056367;"><i class="fas fa-user-tie"></i> Cliente - Agendamento</h5>
                        </div>
                    </div>
                    <div class="row" style="padding-right: 2px;">
                        
                        <div class="col-md-8">
                            <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="btnNovoA2" type="button" class="btn btn-primary" aria-label="Left Align" >
                                    <i class="fas fa-plus"></i> Novo
                                </button>

                                <button id="btnSalvarA2" type="button" data="" class="btn btn-success" aria-label="Left Align" >
                                    <i class="fas fa-save"></i> Salvar
                                </button>
                                
                                <button id="btnExcluirA2" type="button" data="" class="btn btn-danger" aria-label="Left Align" >
                                    <i class="fas fa-trash-alt"></i> Excluir
                                </button>
                                
                            </div>
                        </div>
                        
                    </div>
                </div>
                <hr></hr>
                <div class="card-body">
                    <div class="row" >
                        <div class="col-lg-8 col-12">
                            <div class="row" >
                                
                                <div class="col-md-12">
                                    <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>

                            <div class="row" >
                                <div class="col-md-3">
                                    <label id="txtDataAgenda_label" for="txtDataAgenda"  class="col-form-label text-md-left">Data <span style="color: #ff0000;">*</span></label>
                                    <input id="txtDataAgenda" class="form-control" name="dataagenda" type="text" onKeyUp="mascara_data(this)" maxlength="10" value="" />
                                </div>

                                <div class="col-md-2">
                                    <label id="txtHora_label" for="txtHora" class="col-form-label text-md-left">Hora <span style="color: #ff0000;">*</span></label>
                                    <br/>
                                    <select id="cbHora" class="form-control">
                                        <option value="07:00">07:00</option>
                                        <option value="07:15">07:15</option>
                                        <option value="07:30">07:30</option>
                                        <option value="07:45">07:45</option>

                                        <option value="08:00">08:00</option>
                                        <option value="08:15">08:15</option>
                                        <option value="08:30">08:30</option>
                                        <option value="08:45">08:45</option>

                                        <option value="09:00">09:00</option>
                                        <option value="09:15">09:15</option>
                                        <option value="09:30">09:30</option>
                                        <option value="09:45">09:45</option>
                                        
                                        <option value="10:00">10:00</option>
                                        <option value="10:15">10:15</option>
                                        <option value="10:30">10:30</option>
                                        <option value="10:45">10:45</option>
                                        
                                        <option value="11:00">11:00</option>
                                        <option value="11:15">11:15</option>
                                        <option value="11:30">11:30</option>
                                        <option value="11:45">11:45</option>
                                        
                                        <option value="12:00">12:00</option>
                                        <option value="12:15">12:15</option>
                                        <option value="12:30">12:30</option>
                                        <option value="12:45">12:45</option>
                                        
                                        <option value="13:00">13:00</option>
                                        <option value="13:15">13:15</option>
                                        <option value="13:30">13:30</option>
                                        <option value="13:45">13:45</option>
                                        
                                        <option value="14:00">14:00</option>
                                        <option value="14:15">14:15</option>
                                        <option value="14:30">14:30</option>
                                        <option value="14:45">14:45</option>
                                        
                                        <option value="15:00">15:00</option>
                                        <option value="15:15">15:15</option>
                                        <option value="15:30">15:30</option>
                                        <option value="15:45">15:45</option>
                                        
                                        <option value="16:00">16:00</option>
                                        <option value="16:15">16:15</option>
                                        <option value="16:30">16:30</option>
                                        <option value="16:45">16:45</option>
                                        
                                        <option value="17:00">17:00</option>
                                        <option value="17:15">17:15</option>
                                        <option value="17:30">17:30</option>
                                        <option value="17:45">17:45</option>
                                        
                                        <option value="18:00">18:00</option>
                                        <option value="18:15">18:15</option>
                                        <option value="18:30">18:30</option>
                                        <option value="18:45">18:45</option>
                                        
                                        <option value="19:00">19:00</option>
                                        <option value="19:15">19:15</option>
                                        <option value="19:30">19:30</option>
                                        <option value="19:45">19:45</option>
                                        
                                        <option value="20:00">20:00</option>
                                        <option value="20:15">20:15</option>
                                        <option value="20:30">20:30</option>
                                        <option value="20:45">20:45</option>
                                        
                                        <option value="21:00">21:00</option>
                                        <option value="21:15">21:15</option>
                                        <option value="21:30">21:30</option>
                                        <option value="21:45">21:45</option>
                                        
                                        <option value="22:00">22:00</option>
                                        <option value="22:15">22:15</option>
                                        <option value="22:30">22:30</option>
                                        <option value="22:45">22:45</option>
                                    </select>
                                </div>
                                <div class="col-md-2">
                                    <label id="txtTotal_label" for="txtTotal"  class="col-form-label text-md-left">Total (R$)</label>
                                    <input id="txtTotal" class="form-control" name="total" type="text" maxlength="10" value="" />
                                </div>
                                <div class="col-md-5">
                                    <label id="txtStatus_label" for="txtStatus"  class="col-form-label text-md-left">Status</label>
                                    <input id="txtStatus" class="form-control" name="total" type="text" maxlength="50" 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>
                    </div>

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

                                <button id="btnNovoA22" type="button" class="btn btn-primary" aria-label="Left Align" >
                                    <i class="fas fa-plus"></i> Novo
                                </button>

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

                <div class="card-body">
                    <div class="row" >
                        <div class="col-lg-8 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 <span style="color: #ff0000;">*</span></label>
                                    <br/>
                                    <select id="cbProcedimento" class="form-control">
                                        
                                    </select>
                                </div>
                               
                                <div class="col-md-3">
                                    <label id="cbProfissional_label" for="cbProfissional" class="col-form-label text-md-left">Profissional <span style="color: #ff0000;">*</span></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-10">
                                    <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 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-md-2">
                        <h5 style="color:#056367;"><i class="fas fa-user-tie"></i> Clientes</h5>
                    </div>
                    <div class="col-md-4">
                        <label id="txtPalavra_label" for="txtNome"  class="col-form-label text-md-left">Palavra chave</label>
                        <input id="txtPalavra" class="form-control" name="palavra" type="text" maxlength="50" value="" required/>
                    </div>
                    <div class="col-md-6 text-right">
                        <label id="txtPesquisar_label" for="txtNome"  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>
                        <button id="btnNovo" type="button" class="btn btn-primary" aria-label="Left Align" >
                            <i class="fas fa-plus-circle"></i> Novo Cliente
                        </button>
                    </div>
                    
                </div>
                <div class="row" >
                    <div class="col panel panel-primary table-responsive">

                        <table id="tbPessoa" class="table table-striped table-bordered text-left ">
                            <thead  style="background-color:#404040; color: #ccc; font-weight: bold;">
                                <tr>
                                    <th>Dados do Cliente</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 += '';
        }
    
    }

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