Skip to content

Commit

Permalink
Merge pull request #2593 from RamonSilva20/revert-2571-master
Browse files Browse the repository at this point in the history
Revert "Correções e melhorias em servicos.php, clientes.php, produtos.php"
  • Loading branch information
willph authored Nov 17, 2024
2 parents 1a67cd6 + b6619f1 commit 4b3dcca
Show file tree
Hide file tree
Showing 6 changed files with 1,346 additions and 1,451 deletions.
160 changes: 79 additions & 81 deletions application/views/clientes/clientes.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
<?php if (!$results): ?>
<div class="sem_registro" id="info_cadastro" style="display: block;">
<p class="titulo_sr">Clientes / Fornecedores</p>
<p class="corpo_sr">Não há clientes ou fornecedores registrados no sistema. Este procedimento é essencial para criação de vínculo na inclusão de vendas e na abertura de ordens de serviço.</p>
<a class="botao_sr" href="<?= base_url() ?>index.php/clientes/adicionar" role="button">
Novo cliente ou fornecedor
</a>
<style>
select {
width: 70px;
}
</style>
<div class="new122">
<div class="widget-title" style="margin: -20px 0 0">
<span class="icon">
<i class="fas fa-user"></i>
</span>
<h5>Clientes</h5>
</div>
<?php else: ?>

<div class="widget-box">
<div class="widget-title">
<div class="topo_modulo_tabela">
<h5>Clientes / Fornecedores</h5>
<div class="form-group">
<div class="input-group">
<input type="text" id="customSearch" class="form-control" placeholder="Buscar...">
<select id="customLength" name="tabela_length" class="form-control select_modulo_tabela" style="border-left: none;">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</div>
</div>
<div class="span12" style="margin-left: 0">
<?php if ($this->permission->checkPermission($this->session->userdata('permissao'), 'aCliente')) { ?>
<div class="span3">
<a href="<?= base_url() ?>index.php/clientes/adicionar" class="button btn btn-mini btn-success"
style="max-width: 165px">
<span class="button__icon"><i class='bx bx-plus-circle'></i></span><span class="button__text2">
Cliente / Fornecedor
</span>
</a>
</div>
</div>
<?php } ?>
<form class="span9" method="get" action="<?= base_url() ?>index.php/clientes"
style="display: flex; justify-content: flex-end;">
<div class="span3">
<input type="text" name="pesquisa" id="pesquisa"
placeholder="Buscar por Nome, Doc, Email ou Telefone..." class="span12"
value="<?= $this->input->get('pesquisa') ?>">
</div>
<div class="span1">
<button class="button btn btn-mini btn-warning" style="min-width: 30px">
<span class="button__icon"><i class='bx bx-search-alt'></i></span></button>
</div>
</form>
</div>

<div class="widget-box">
<h5 style="padding: 3px 0"></h5>
<div class="widget-content nopadding tab-content">
<table id="tabela" class="table table-bordered">
<table id="tabela" class="table table-bordered ">
<thead>
<tr>
<th>Cod.</th>
Expand All @@ -37,67 +48,54 @@
<th>Telefone</th>
<th>Celular</th>
<th>Email</th>
<th>Tipo</th>
<th>Tipo</th> <!-- Nova coluna para Fornecedor/Cliente -->
<th>Ações</th>
</tr>
</thead>
<tbody>
<?php foreach ($results as $r): ?>
<tr>
<td><?= $r->idClientes; ?></td>
<td>
<a href="<?= base_url('index.php/clientes/visualizar/' . $r->idClientes); ?>" style="margin-right: 1%;">
<?= $r->nomeCliente; ?>
</a>
</td>
<td><?= $r->contato; ?></td>
<td><?= $r->documento; ?></td>
<td><?= $r->telefone; ?></td>
<td><?= $r->celular; ?></td>
<td><?= $r->email; ?></td>
<td>
<?= $r->fornecedor == 1 ? '<span class="label label-primary">Fornecedor</span>' : '<span class="label label-success">Cliente</span>'; ?>
</td>
<td>
<?php if ($this->permission->checkPermission($this->session->userdata('permissao'), 'vCliente')): ?>
<a href="<?= base_url('index.php/clientes/visualizar/' . $r->idClientes); ?>" style="margin-right: 1%" class="btn-nwe" title="Ver mais detalhes">
<i class="bx bx-show bx-xs"></i>
</a>
<a href="<?= base_url('index.php/mine?e=' . $r->email); ?>" target="new" style="margin-right: 1%" class="btn-nwe2" title="Área do cliente">
<i class="bx bx-key bx-xs"></i>
</a>
<?php endif; ?>
<?php if ($this->permission->checkPermission($this->session->userdata('permissao'), 'eCliente')): ?>
<a href="<?= base_url('index.php/clientes/editar/' . $r->idClientes); ?>" style="margin-right: 1%" class="btn-nwe3" title="Editar Cliente">
<i class="bx bx-edit bx-xs"></i>
</a>
<?php endif; ?>
<?php if ($this->permission->checkPermission($this->session->userdata('permissao'), 'dCliente')): ?>
<a href="#modal-excluir" role="button" data-toggle="modal" cliente="<?= $r->idClientes; ?>" style="margin-right: 1%" class="btn-nwe4" title="Excluir Cliente">
<i class="bx bx-trash-alt bx-xs"></i>
</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
<?php
if (!$results) {
echo '<tr>
<td colspan="9">Nenhum Cliente Cadastrado</td>
</tr>';
}
foreach ($results as $r) {
echo '<tr>';
echo '<td>' . $r->idClientes . '</td>';
echo '<td><a href="' . base_url() . 'index.php/clientes/visualizar/' . $r->idClientes . '" style="margin-right: 1%">' . $r->nomeCliente . '</a></td>';
echo '<td>' . $r->contato . '</td>';
echo '<td>' . $r->documento . '</td>';
echo '<td>' . $r->telefone . '</td>';
echo '<td>' . $r->celular . '</td>';
echo '<td>' . $r->email . '</td>';

// Verifica se é Fornecedor ou Cliente
if ($r->fornecedor == 1) {
echo '<td><span class="label label-primary">Fornecedor</span></td>';
} else {
echo '<td><span class="label label-success">Cliente</span></td>';
}

echo '<td>';
if ($this->permission->checkPermission($this->session->userdata('permissao'), 'vCliente')) {
echo '<a href="' . base_url() . 'index.php/clientes/visualizar/' . $r->idClientes . '" style="margin-right: 1%" class="btn-nwe" title="Ver mais detalhes"><i class="bx bx-show bx-xs"></i></a>';
echo '<a href="' . base_url() . 'index.php/mine?e=' . $r->email . '" target="new" style="margin-right: 1%" class="btn-nwe2" title="Área do cliente"><i class="bx bx-key bx-xs"></i></a>';
}
if ($this->permission->checkPermission($this->session->userdata('permissao'), 'eCliente')) {
echo '<a href="' . base_url() . 'index.php/clientes/editar/' . $r->idClientes . '" style="margin-right: 1%" class="btn-nwe3" title="Editar Cliente"><i class="bx bx-edit bx-xs"></i></a>';
}
if ($this->permission->checkPermission($this->session->userdata('permissao'), 'dCliente')) {
echo '<a href="#modal-excluir" role="button" data-toggle="modal" cliente="' . $r->idClientes . '" style="margin-right: 1%" class="btn-nwe4" title="Excluir Cliente"><i class="bx bx-trash-alt bx-xs"></i></a>';
}
echo '</td>';
echo '</tr>';
} ?>
</tbody>
</table>

</div>
</div>
<div class="span12" style="margin-left: 0;">
<div style="display: flex; justify-content: flex-end;">
<?php if ($this->permission->checkPermission($this->session->userdata('permissao'), 'aCliente')): ?>
<div class="span2">
<a href="<?= base_url('index.php/clientes/adicionar'); ?>" class="button botao_modulo_tabela btn btn-success">
<span class="button__icon"><i class="bx bx-plus-circle"></i></span>
<span class="button__text2">Cliente / Fornecedor</span>
</a>
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>

</div>
<?php echo $this->pagination->create_links(); ?>

<!-- Modal -->
Expand All @@ -123,8 +121,8 @@ class="button__text2">Excluir</span></button>
</div>

<script type="text/javascript">
$(document).ready(function() {
$(document).on('click', 'a', function(event) {
$(document).ready(function () {
$(document).on('click', 'a', function (event) {
var cliente = $(this).attr('cliente');
$('#idCliente').val(cliente);
});
Expand Down
Loading

0 comments on commit 4b3dcca

Please sign in to comment.