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

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

<?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=""/>
    <input type="hidden" id="hdnDataAgenda" name="hddataagenda" data=""/>
    <input type="hidden" id="hdnIdPessoa"   name="hdidpessoa"   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> Parceiros (clientes/fornecedores)</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="btnNovo2" type="button" class="btn btn-primary" aria-label="Left Align" >
                                <i class="fas fa-plus-circle"></i> Novo
                            </button>
                        </div>
                    </div>
                    
                </div>
                <hr></hr>
                <div class="row" >
                    
                    <div class="col-md-5">
                        <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" type="text" maxlength="50" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtApelido_label" for="txtApelido"  class="col-form-label text-md-left">Apelido</label>
                        <input id="txtApelido" class="form-control" name="nome" type="text" maxlength="50" value="" />
                    </div>
                    <div class="col-md-2">
                        <label id="txtPessoa_label" for="txtTipo" class="col-form-label text-md-left">Tipo Pessoa <span style="color: #ff0000;">*</span></label>
                        <select id="cbPessoa" class="form-control">
                            <option value="" selected>...Selecione</option>
                            <option value="F">FÍSICA</option>
                            <option value="J">JURÍDICA</option>
                        </select>
                    </div>  
                    <div class="col-md-2">
                        <label id="txtTipo_label" for="txtTipo" class="col-form-label text-md-left">Cliente/Fornecedor <span style="color: #ff0000;">*</span></label>
                        <select id="cbTipo" class="form-control">
                            <option value="" selected>...Selecione</option>
                            <option value="C">CLIENTE</option>
                            <option value="F">FORNECEDOR</option>
                        </select>
                    </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-8">
                        <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>
                
                <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-4">
                        <div class="col text-left">
                            <label id="txtLegenda_label" for="txtLegenda"  ><span style="color: #ff0000;">( * )</span> Campos obrigatórios</label>
                        </div>
                    </div>
                    <div class="col-md-8">
                        <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>
                            <button id="btnNovo3" type="button" class="btn btn-primary" aria-label="Left Align" >
                                <i class="fas fa-plus-circle"></i> Novo
                            </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-md-6">
                        <h5 style="color:#056367;"><i class="fas fa-user-tie"></i> Parceiros (clientes/fornecedores)</h5>
                    </div>
                </div>
                <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                    <div class="col-md-3">
                        <label id="txtPalavra_label" for="txtNome"  class="col-form-label text-md-left">Palavra chave <span style="color: #C0C0C0;">Enter</span></label>
                        <input id="txtPalavra" class="form-control" name="palavra" type="text" maxlength="50" value="" style="background-color: #ffffb3;" title="Digite palavra para buscar e dê [Enter]"/>
                    </div>
                    <div class="col col-lg-2 col-12 text-left">
                        <label for="cbStatusPesq" class="col-form-label text-md-left">Tipo</label>
                        <br/>
                        <select id="cbTipoPesq" class="form-control">
                            <option value="" selected>...Todos</option>
                            <option value="C" >CLIENTE</option>
                            <option value="F">FORNECEDOR</option>
                        </select>
                    </div>
                    <div class="col col-lg-2 col-12 text-left">
                        <label for="cbStatusPesq" class="col-form-label text-md-left">Pessoa Física/Jurídica</label>
                        <br/>
                        <select id="cbPessoaPesq" class="form-control">
                            <option value="" selected>...Todos</option>
                            <option value="F" >FÍSICA</option>
                            <option value="J" >JURÍDICA</option>
                        </select>
                    </div>
                    <div class="col col-lg-2 col-12 text-left">
                        <label for="cbStatusPesq" class="col-form-label text-md-left">Status</label>
                        <br/>
                        <select id="cbStatusPesq" class="form-control">
                            <option value="">...Todos</option>
                            <option value="1" selected>ATIVOS</option>
                            <option value="0">INATIVOS</option>
                        </select>
                    </div>
                    <div class="col-md-3 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
                        </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 Parceiro</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(); ?>