<?php $__env->startSection('titulo'); ?>
    <i class="fas fa-user-tie"></i> Consulta Cliente
<?php $__env->stopSection(); ?>

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

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

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

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

        <div class="card rounded text-left">
            <div class="card-body">
                <div class="row" >
                    <div class="col col-sm-3 text-left">
                        <label for="txtClientePesquisa" class="col-form-label text-md-left">Cliente</label>
                        <br/>
                        <input id="txtClientePesquisa" class="form-control" type="text"/>
                    </div>

                    <div class="col col-sm-2 text-left">
                        <label for="txtStatusPesquisa" class="col-form-label text-md-left">Status</label>
                        <br/>
                        <select id="txtStatusPesquisa" class="form-control">
                            <option value="">Todos...</option>
                            <option value="1">Ativo</option>
                            <option value="0">Inativo</option>
                        </select>
                    </div>
					
					 <div class="col col-sm-2 text-left">
						<label for="txtCidadePesquisa" class="col-form-label text-md-left">&nbsp;</label>
						<br/>
						<button id="btnPesquisaCliente"  class="btn btn-secondary btn-group-justified"><i class="fas fa-search"></i> Pesquisar</button>
					</div>
                </div>

            </div>
        </div>

        <div class="card mt-2">
            <div class="card-body">
                <div class="row" >
                    <div class="col panel panel-primary table-responsive">
                        <table id="tbCliente" class="table table-hover text-left">
                            <thead>
                                <tr>
                                    <th>Razão Social</th>
                                    <th>Nome Fantasia</th>
                                    <th>CNPJ</th>
                                    <th>Contato</th>
                                    <th>Fone</th>
                                    <th>Celular</th>
                                    <th>Email</th>
                                    <th>Cidade</th>
                                    <th>Status</th>
                                </tr>
                            </thead>
                            <tbody>

                                <?php $__currentLoopData = $cliente; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cli): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td id="<?php echo e($cli->getId()); ?>_razao_social"><?php echo e($cli->getRazaoSocial()); ?></td>
                                        <td id="<?php echo e($cli->getId()); ?>_nome_fantasia"><?php echo e($cli->getNomeFantasia()); ?></td>
                                        <td id="<?php echo e($cli->getId()); ?>_cnpj"><?php echo e($cli->getCnpj()); ?></td>
                                        <td id="<?php echo e($cli->getId()); ?>_contato"><?php echo e($cli->getContato()); ?></td>
                                        <td id="<?php echo e($cli->getId()); ?>_contato_fone"><?php echo e($cli->getContato_fone()); ?></td>
                                        <td id="<?php echo e($cli->getId()); ?>_contato_celular"><?php echo e($cli->getContato_celular()); ?></td>
                                        <td id="<?php echo e($cli->getId()); ?>_contato_email"><?php echo e($cli->getContato_email()); ?></td>
                                        <td id="<?php echo e($cli->getId()); ?>_cidade"
                                            data="<?php echo e($cli->getFkCidade()); ?>"
                                            data2="<?php echo e($cli->Cidade->getFkEstado()); ?>">
                                            <?php echo e($cli->Cidade->getNome()); ?>

                                        </td>
                                        <input type="hidden" id="<?php echo e($cli->getId()); ?>_endereco" value="<?php echo e($cli->getEndereco()); ?>"/>
                                        <input type="hidden" id="<?php echo e($cli->getId()); ?>_bairro" value="<?php echo e($cli->getBairro()); ?>"/>
                                        <input type="hidden" id="<?php echo e($cli->getId()); ?>_nro" value="<?php echo e($cli->getNro()); ?>"/>
                                        <input type="hidden" id="<?php echo e($cli->getId()); ?>_complemento" value="<?php echo e($cli->getComplemento()); ?>"/>
                                        <input type="hidden" id="<?php echo e($cli->getId()); ?>_cep" value="<?php echo e($cli->getCep()); ?>"/>
                                        <input type="hidden" id="<?php echo e($cli->getId()); ?>_bairro" value="<?php echo e($cli->getBairro()); ?>"/>
                                        <input type="hidden" id="<?php echo e($cli->getId()); ?>_observacao" value="<?php echo e($cli->getObservacao()); ?>"/>
                                                                        
                                        <td id="<?php echo e($cli->getId()); ?>_ativo" data="<?php echo e($cli->getAtivo()); ?>">
                                            <?php if($cli->getAtivo()): ?>
                                                <span class="badge badge-success">Ativo</span>
                                            <?php else: ?>
                                                <span class="badge badge-danger">Inativo</span>
                                            <?php endif; ?>
                                        </td>
                                        
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                            </tbody>
                        </table>

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