| Server IP : 54.94.228.101 / 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/storage/framework/views/ |
Upload File : |
<?php $__env->startSection('content'); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Estoque
<small>Importação Saldos</small>
</h1>
<ol class="breadcrumb">
<li><a href="<?php echo e(url('admin')); ?>"><i class="fa fa-dashboard"></i> Dashboard</a></li>
<li class="active">Estoque/Importação Saldos</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header no-print">
<h4>Filtros</h4>
<form method="POST" action="<?php echo url('admin/estoque/importacao-saldos'); ?>" enctype="multipart/form-data">
<div class="row">
<div class="col-md-3">
<div class="row">
<div class="col-md-12">
<h5>Empresa:</h5>
<select id="empresa_id" required class="form-control select2" name="empresa_id">
<option value="0">Selecione a empresa</option>
<?php foreach ($empresas as $empresa): ?>
<option <?php echo (isset($empresa_id) && $empresa_id == $empresa->id) ? 'selected' : ''; ?> value="<?php echo $empresa->id; ?>"><?php echo $empresa->nome; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<div class="col-md-2">
<div class="row">
<div class="col-md-12">
<h5>Arquivo:</h5>
<input name="file" id="file" type="file" />
</div>
</div>
</div>
<div class="col-md-2">
<div class="row">
<div class="col-md-12">
<button type="submit" class="btn btn-block btn-primary" style="margin-top:35px;">Importar Saldos</button>
</div>
</div>
</div>
</div>
</form>
</div>
<!-- /.box-header -->
<div class="box-body relatorio-saldos">
<?php if(isset($atualizados)): ?>
<h5>Número de Registros Atualizados: <?php echo count($atualizados); ?> / Tabela Registros não atualizados/localizados: <?php echo e((count($falhas) -1)); ?></h5>
<table class="table table-bordered table-striped">
<thead>
<tr>
<?php foreach($cabecalhos as $header): ?>
<th><?php echo e($header); ?></th>
<?php endforeach; ?>
<th>Mensagem</th>
</tr>
</thead>
<tbody>
<?php foreach ($falhas as $falha): ?>
<tr>
<?php foreach ($falha['dados'] as $row): ?>
<td><?php echo e(utf8_encode($row)); ?></td>
<?php endforeach;?>
<td><?php echo e($falha['message']); ?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php endif; ?>
</div>
<!-- /.box-body -->
<div class="box-footer">
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<script type="text/javascript">
$('[name="selecionar_todos"]').click(function(){
if($(this).is(':checked')){
$('[name="item_produto[]"]').prop('checked', true);
}else{
$('[name="item_produto[]"]').prop('checked', false);
}
});
$(document).ready(function(){
$('.select2').select2();
$('#btn-atualiza-saldos').click(function(e){
if(!confirm('Você tem certeza?')){
e.preventDefault();
}else{
var produtos_selecionados = [];
$('[name="item_produto[]"]:checked').each(function(){
produtos_selecionados.push($(this).val());
});
if(produtos_selecionados.length > 0){
$.ajax({
url:'/admin/produto/atualizar-saldos',
type:'POST',
data:{
ids_produto:produtos_selecionados
},
beforeSend:function(){
$('.carregando').fadeIn();
},
success:function(data){
if (data.status) {
alertUtil.alertSuccess(data.message);
setTimeout(function(){
window.location.href = window.location.href;
}, 1500);
}else{
alertUtil.alertWarning(data.message);
}
$('.carregando').fadeOut();
}
});
}else{
alertUtil.alertError('Você deve selecionar ao menos um produto');
}
}
});
$('.btn-atualiza-saldo').click(function(e){
var self = this;
var produto_id = $(this).data('id');
$.ajax({
url: '/admin/produto/atualizar-saldo-produto',
type: 'POST',
data: {produto_id: produto_id},
beforeSend:function(){
$('.carregando').fadeIn();
},
success:function(data){
$('.carregando').fadeOut();
$('#ultima_atualizacao_' + produto_id).text(data.ultima_atualizacao);
alertUtil.alertSuccess(data.message);
},
error:function(){
$('.loading').fadeOut();
alertUtil.alertError('Erro durante atualização saldo!');
}
});
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make($current_template, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>