| Server IP : 54.94.228.101 / Your IP : 172.28.1.13 Web Server : Apache System : Linux ip-172-28-29-189 6.5.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Feb 15 15:27:06 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.2.34-43+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/vinumday2_0/app/Modules/Confraria/Views/admin/ |
Upload File : |
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Data Abertura</th>
<th>Data Fechamento</th>
<th>Qtd Pedidos</th>
<th>Qtd Produtos</th>
<th>Valor Total</th>
<th>Entrega</th>
<th>Status</th>
<th></th>
<th>Ação</th>
</tr>
</thead>
<tbody>
<?php foreach ($adegas as $adega): ?>
<tr data-id="<?php echo $adega->id; ?>">
<td><a target="_blank" href="<?php echo url('admin/adega/edit/'.$adega->id);?>"><?php echo $adega->id; ?></a></td>
<td><?php echo date('d/m/Y H:i', strtotime($adega->data_abertura)); ?></td>
<td><?php echo $adega->data_fechamento ? date('d/m/Y H:i', strtotime($adega->data_fechamento)) : ''; ?></td>
<td><span id="adega_quantidade_pedidos_<?php echo $adega->id;?>"><?php echo $adega->quantidade_pedidos; ?></span></td>
<td><span id="adega_quantidade_produtos_<?php echo $adega->id;?>"><?php echo $adega->quantidade_produtos; ?></span></td>
<td><span id="adega_valor_total_<?php echo $adega->id;?>"><?php echo number_format($adega->valor_total,2,',','.'); ?></span></td>
<td><?php echo $adega->pedidoEntrega ? '<a target="_blank" href="'.url('admin/pedido-entrega/edit/'.$adega->pedidoEntrega->id).'">'.$adega->pedidoEntrega->id.'</a>' : ''; ?></td>
<td><?php echo $adega->status == 'A' ? 'Aberta' : 'Fechada'; ?></td>
<td class="text-center">
<i class="ver-detalhes-adega fa fa-plus-circle"></i>
</td>
<td>
<?php if($adega->status == 'A'){ ?>
<button type="button" class="btn btn-success btn-sm" onclick="solicitarEntrega({{ $adega->id_cliente }}, {{ $adega->confraria_id }})">Solicitar Entrega</button>
<a target="_blank" href="{{ url('admin/pedido-venda/add?id_cliente='.$adega->id_cliente.'&confraria_id='.$adega->confraria_id) }}" class="btn btn-default btn-sm">Adicionar Pedido</a>
<?php } if($adega->status == 'A' && !$adega->saldos){ ?>
<button type="button" class="btn btn-success btn-sm" id="btn-atualizar-adega-{{ $adega->id }}" onclick="atualizarAdega({{ $adega->id }}, {{ $adega->id_cliente }}, {{ $adega->confraria_id }})">Atualizar Adega</button>
<?php } ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<script type="text/javascript">
$(document).on('click', '.ver-detalhes-adega', function(){
var icon = $(this);
var tr = icon.closest('tr');
var id_adega = tr.data('id');
$.ajax({
url:'/admin/cadastro/buscar-detalhes-adega',
type:'POST',
data:{
id_adega: id_adega
},
success:function(data){
if(data.status){
tr.after(data.html);
icon.removeClass('fa-plus-circle');
icon.removeClass('ver-detalhes-adega');
icon.addClass('esconder-detalhes-adega');
icon.addClass('fa-minus-circle');
}else{
alertUtil.alertError(data.message);
}
}
});
});
$(document).on('click', '.esconder-detalhes-adega', function(){
var next = $(this).closest('tr').next();
while(next.hasClass('detalhes-item')){
var aux = next.next();
next.remove();
next = aux;
}
$(this).removeClass('esconder-detalhes-adega');
$(this).addClass('ver-detalhes-adega');
$(this).addClass('fa-plus-circle');
$(this).removeClass('fa-minus-circle');
});
$(document).on('click', '.ver-detalhes', function(){
if($(this).hasClass('fa-plus-circle')){
var next = $(this).closest('tr').next();
while(next.hasClass('detalhes-combo')){
next.show();
next = next.next();
}
$(this).removeClass('fa-plus-circle');
$(this).addClass('fa-minus-circle');
}else{
var next = $(this).closest('tr').next();
while(next.hasClass('detalhes-combo')){
next.hide();
next = next.next();
}
$(this).removeClass('fa-minus-circle');
$(this).addClass('fa-plus-circle');
}
});
</script>