| Server IP : 54.233.248.239 / Your IP : 172.28.20.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 : |
<div class="minha-conta__right">
<div class="box">
<div class="spacer"></div>
<?php if(count($entregas)){ ?>
<?php $tamanho = count($entregas); ?>
<?php foreach ($entregas as $key => $entrega): ?>
<table class="table table-bordered tabela entrega-item no-margin" data-entrega="<?php echo $entrega->id; ?>">
<?php //if ($key == 0): ?>
<tr <?php echo $key ? 'class="invisible"' : ''; ?>>
<th>ID</th>
<th>Data \ Hora</th>
<th>Endereço</th>
<th>Cidade</th>
<th>Estado</th>
<th>Status</th>
<th>Valor Frete</th>
<th>Qtd. Produtos</th>
<th></th>
</tr>
<?php //endif ?>
<tr style="<?php echo $key+1 == $tamanho ? '' : 'border-bottom:2px solid #e1e1e1;'; ?>">
<td><a target="_blank" href="<?php echo url('admin/pedido-entrega/edit/'.$entrega->id); ?>"><?php echo $entrega->id; ?></a></td>
<td><?php echo date('d/m/Y H:i', strtotime($entrega->data_solicitacao)); ?></td>
<td class="text-center"><?php echo $entrega->endereco ? $entrega->endereco->logradouro : ''; ?></td>
<td class="text-center"><?php echo ($entrega->endereco && $entrega->endereco->cidade) ? $entrega->endereco->cidade->nome : ''; ?></td>
<td class="text-center"><?php echo ($entrega->endereco && $entrega->endereco->estado) ? $entrega->endereco->estado->sigla : ''; ?></td>
<td class="text-center"><?php echo ($entrega->statusAtualCliente()) ? $entrega->statusAtualCliente()->status->nome : ''; ?></td>
<td><?php echo $entrega->pedidoVendaFrete ? number_format($entrega->pedidoVendaFrete->total,2,',','.') : ''; ?></td>
<td><?php echo $entrega->adega->quantidade_produtos; ?> Gr.</td>
<td><i class="fa fa-plus-circle ver-detalhes-entrega"></i></td>
</tr>
</table>
<div class="detalhes-entrega">
</div>
<?php endforeach ?>
<?php }else{ ?>
<div class="spacer">
<h4><i> Você não possui nenhuma entrega solicitada.</i></h4>
</div>
<?php } ?>
</div>
</div>
<script type="text/javascript">
$(document).on('click', '.btn-solicitar-entrega', function(){
var id_cliente = $(this).data('cadastro-id');
var produtos_selecionados = [];
$('[name="item_produto[]"]:checked').each(function(){
produtos_selecionados.push($(this).val());
});
var produtos = '';
if(produtos_selecionados.length > 0){
produtos = '&produtos=' + produtos_selecionados.join('-');
}
var getUrl = window.location;
var baseUrl = getUrl .protocol + "//" + getUrl.host + "/admin/pedido-entrega/add?id_cliente=" + id_cliente+produtos;
window.location.href = baseUrl;
});
$(document).on('click', '.btn-atualizar-adega', function(){
var id_adega = $(this).data('adega-id');
var $button = $(this);
$.ajax({
url:'/admin/adega/atualiza-adega',
type:'POST',
data : {id_adega : id_adega, confraria_id : '<?php echo $confraria->id;?>'},
beforeSend:function(){
$('.carregando').fadeIn();
},
success:function(data){
$('.carregando').fadeOut();
if(data.status){
alertUtil.alertSuccess(data.message);
$button.hide();
$('#adega_quantidade_pedidos_' + id_adega).text(data.quantidade_pedidos);
$('#adega_quantidade_produtos_' + id_adega).text(data.quantidade_produtos);
$('#adega_valor_total_' + id_adega).text(data.valor_total);
}else{
alertUtil.alertWarning(data.message);
}
}
});
});
$(document).on('click', '.ver-detalhes-entrega', function(){
entregaItem = $(this).closest('.entrega-item');
$.ajax({
url:'/perfil/detalhes-entrega',
type:'POST',
data:{
id:entregaItem.data('entrega')
},
beforeSend:function(){
},
success:function(data){
if(data.status){
console.log(data.html);
entregaItem.next().html(data.html);
entregaItem.next().slideDown();
entregaItem.find('i').removeClass('fa-plus-circle');
entregaItem.find('i').addClass('fa-minus-circle');
entregaItem.find('.ver-detalhes-entrega').addClass('esconder-detalhes');
entregaItem.find('.ver-detalhes-entrega').removeClass('ver-detalhes-entrega');
}else{
alertUtil.alertError(data.message);
}
},
error:function(data){
alertUtil.alertError('Erro ao ver os detalhes da entrega. Tente novamente mais tarde.');
}
});
});
$(document).on('click', '.esconder-detalhes', function(){
entregaItem = $(this).closest('.entrega-item');
entregaItem.next().slideUp();
entregaItem.find('i').removeClass('fa-minus-circle');
entregaItem.find('i').addClass('fa-plus-circle');
entregaItem.find('.esconder-detalhes').addClass('expandir-detalhes');
entregaItem.find('.esconder-detalhes').removeClass('esconder-detalhes');
});
$(document).on('click', '.expandir-detalhes', function(){
entregaItem = $(this).closest('.entrega-item');
entregaItem.next().slideDown();
entregaItem.find('i').removeClass('fa-plus-circle');
entregaItem.find('i').addClass('fa-minus-circle');
entregaItem.find('.expandir-detalhes').addClass('esconder-detalhes');
entregaItem.find('.expandir-detalhes').removeClass('expandir-detalhes');
});
</script>