| 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/storage/framework/views/ |
Upload File : |
<?php $__env->startSection('content'); ?>
<style>
.compromisso-event {
transition:.6s;
transform:scale(1);
}
.gone{
transform:scale(0);
}
.fc-event {
line-height: 6 !important;
}
</style>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Oferta
<small>Listagem</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">Oferta</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div id="flex-calendar">
<div class="box">
<div class="box-body">
<div id="fullcalendar"></div>
</div>
</div>
</div>
<div class="overlay"></div>
<div id="modal-evento" class="modal fade">
<form method="/" id="formEvento" type="POST">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 id="time-label"></h4>
</div>
<div class="modal-body" id="conteudo-modal-evento">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
</div>
</div>
</div>
</form>
</div>
</section>
<link href="<?php echo e(url('plugins/fullcalendar/fullcalendar.css')); ?>" rel="stylesheet" type="text/css" />
<script src="<?php echo e(url('plugins/fullcalendar/lib/moment.min.js')); ?>"></script>
<script src="<?php echo e(url('plugins/fullcalendar/fullcalendar.min.js')); ?>"></script>
<script src="<?php echo e(url('plugins/fullcalendar/locale/pt-br.js')); ?>"></script>
<script type="text/javascript">
$(document).ready(function() {
var colors = [];
$('#lista-usuarios .checkbox input').each(function(index){
colors[$(this).val()] = $(this).data('color');
});
$('#modal-evento [type="submit"]').click(function(e){
if ($('#formEvento')[0].checkValidity()) {
e.preventDefault();
var dataInicial = $('#modal-evento').data('dataInicial');
var dataFinal = $('#modal-evento').data('dataFinal');
var diaTodo = $('#modal-evento').data('diaTodo');
var start = $('#modal-evento').data('start');
var end = $('#modal-evento').data('end');
var typeEvent = $('[name="type_event"]:checked').val();
var assunto = $('#inputs-evento [name="assunto"]').val();
var idEtapa = $('[name="projeto-etapa"] option:selected').val();
switch(typeEvent){
case 'compromisso':
var urlForm = '/compromisso/add';
var dataForm = {
"compromisso-fieldset[assunto]": assunto,
"compromisso-fieldset[dataInicio]":dataInicial,
"compromisso-fieldset[dataFim]":dataFinal,
"compromisso-fieldset[diaTodo]": diaTodo,
"compromisso-fieldset[privacidade]": 'PRI',
"compromisso-fieldset[disponibilidade]": 'OCU',
"compromisso-fieldset[idTipoCompromisso]": 1,
"compromisso-fieldset[idUser]": "<?php //echo $session->offsetGet('userId'); ?>",
"compromisso-fieldset[atividadeRecorrente]": 0,
};
break;
case 'atividade':
var urlForm = '/atividade/add';
var dataForm = {
"idEtapa": idEtapa,
"atividade-fieldset[assunto]": assunto,
"atividade-fieldset[dataInicio]":dataInicial,
"atividade-fieldset[dataFim]":dataFinal,
"atividade-fieldset[diaTodo]": diaTodo,
"atividade-fieldset[privacidade]": 'PRI',
"atividade-fieldset[disponibilidade]": 'OCU',
"atividade-fieldset[idTipoCompromisso]": 1,
"atividade-fieldset[idUser]": "<?php //echo $session->offsetGet('userId'); ?>",
"atividade-fieldset[idTipoAtividade]": 1,
"atividade-fieldset[atividadeRecorrente]": 0,
};
break;
case 'demanda':
var urlForm = '/compromisso/add';
var dataForm = {
"compromisso-fieldset[assunto]": assunto,
"compromisso-fieldset[dataInicio]":dataInicial,
"compromisso-fieldset[dataFim]":dataFinal,
"compromisso-fieldset[diaTodo]": diaTodo,
"compromisso-fieldset[privacidade]": 'PRI',
"compromisso-fieldset[disponibilidade]": 'OCU',
"compromisso-fieldset[idTipoCompromisso]": 1,
"compromisso-fieldset[idUser]": "<?php //echo $session->offsetGet('userId'); ?>",
"compromisso-fieldset[atividadeRecorrente]": 0,
};
break;
}
$.ajax({
url: urlForm,
type: 'POST',
data: dataForm,
dataType:'JSON',
beforeSend:function(){
$('.loading').fadeIn();
},
success:function(response){
if(response.IsSuccess){
eventData = {
title: assunto,
start: start,
end: end,
className: response.typeEvent+"-event event-user-"+response.idUser,
color:colors[response.idUser],
dataIdUser: response.idUser,
id: response.typeEvent+'-'+response.idEvent,
dataId: response.idEvent,
dataType: response.typeEvent,
};
$('#fullcalendar').fullCalendar('renderEvent', eventData, true); // stick? = true
bf2Util.alertSuccess(response.Msg);
}else{
bf2Util.alertError(response.Msg);
}
$('.modal').modal("hide");
$('#modal-evento input[name="assunto"]').val("");
$('.loading').fadeOut();
},
});
}
});
$('#fullcalendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month'
},
defaultDate: '<?php echo date('Y-m-d'); ?>',
minTime: '08:00:00',
maxTime: '20:00:00',
defaultView: 'month',
navLinks: true, // can click day/week names to navigate views
selectable: true,
selectHelper: true,
eventRender: function(event, element, view) {
if(event.estoque){
estoque = 'Disponibilidade: <span class="estoque">'+event.estoque+'</span>';
}else{
estoque = '<span class="estoque">ESGOTADO</span>';
}
return $('<div class="open-oferta" data-slug="'+event.slug+'"><div class="text"><span class="title">' + event.title + '</span><span class="subtitle">'+event.subtitulo+'</span> <span class="preco_inicial">'+event.preco_inicial+'</span> <span class="preco_final">'+event.preco_total+'</span><br>'+estoque+'</div><div class="img"> <img src="'+event.imagem+'"/> </div></div>');
},
select: function(start, end) {
if(typeof start._i == 'string' && typeof end._i == 'string'){
var diaTodo = 1;
}else{
var diaTodo = 0;
}
var dataInicial = ("0"+ start._d.getUTCDate()).slice(-2)+'/'+("0"+(parseInt(start._d.getUTCMonth())+1)).slice(-2)+'/'+start._d.getFullYear()+' '+("0"+start._d.getUTCHours()).slice(-2)+':'+("0"+start._d.getUTCMinutes()).slice(-2)+':'+("0"+start._d.getUTCSeconds()).slice(-2);
var dataFinal = ("0"+end._d.getUTCDate()).slice(-2)+'/'+("0"+(parseInt(end._d.getUTCMonth())+1)).slice(-2)+'/'+end._d.getFullYear()+' '+("0"+end._d.getUTCHours()).slice(-2)+':'+("0"+end._d.getUTCMinutes()).slice(-2)+':'+("0"+end._d.getUTCSeconds()).slice(-2);
$('#modal-evento').data('dataInicial', dataInicial);
$('#modal-evento').data('dataFinal', dataFinal);
$('#modal-evento').data('diaTodo', diaTodo);
$('#modal-evento').data('start', start);
$('#modal-evento').data('end', end);
$.ajax({
url: 'admin/oferta/add',
type: 'GET',
beforeSend:function(){
$('.loading').fadeIn();
},
success:function(data){
$('.loading').fadeOut();
$('#conteudo-modal-evento').html(data);
$('#data').val(start._d.getFullYear()+'-'+("0"+(parseInt(start._d.getUTCMonth())+1)).slice(-2)+'-'+("0"+ start._d.getUTCDate()).slice(-2));
$('#data').closest('.ffl-wrapper').addClass('ffl-floated');
if(data.status){
//bf2Util.alertSuccess(data.message);
//$('#fullcalendar').fullCalendar('removeEvents', calEvent._id);
}else{
//bf2Util.alertError(data.message);
}
}
});
$('#time-label').text("Oferta do dia - " + ("0"+ start._d.getUTCDate()).slice(-2)+'/'+("0"+(parseInt(start._d.getUTCMonth())+1)).slice(-2)+'/'+start._d.getFullYear());
$('#modal-evento').modal('show');
//var title = prompt('Event Title:');
$('#fullcalendar').fullCalendar('unselect');
},
eventMouseover: function(calEvent, domEvent) {
var layer = "<div id='events-layer' class='fc-transparent' style='position:absolute; width:100%; height:100%; top:-1px; text-align:right; z-index:100'><a class='edit-"+calEvent.dataType+"-"+calEvent.dataId+"'><i class='fa fa-pencil-alt'></i></a> <a class='delete-"+calEvent.dataType+"-"+calEvent.dataId+"'><i class='fa fa-times'></i></a></div>";
$(this).append(layer);
$(".delete-"+calEvent.dataType+"-"+calEvent.dataId).click(function(){
$.ajax({
url: '/'+calEvent.dataType+'/delete/'+calEvent.dataId,
type: 'POST',
dataType: 'JSON',
data: { 'delete-confirmation' : 'yes' },
beforeSend:function(){
$('.loading').fadeIn();
},
success:function(data){
$('.loading').fadeOut();
if(data.status){
bf2Util.alertSuccess(data.message);
$('#fullcalendar').fullCalendar('removeEvents', calEvent._id);
}else{
bf2Util.alertError(data.message);
}
}
});
});
$(".edit-"+calEvent.dataType+"-"+calEvent.dataId).click(function(){
window.location.href="/"+calEvent.dataType+"/edit/"+calEvent.dataId;
});
},
eventMouseout: function(calEvent, domEvent) {
$("#events-layer").remove();
},
eventDrop: function(event,dayDelta,minuteDelta,allDay,revertFunc) {
console.log(event);
$.ajax({
url:"/admin/oferta/change_date/"+event.slug,
type: "POST",
dataType: "JSON",
data: {
'timeLapse' : dayDelta.asMilliseconds(),
'allDay' : event.allDay,
'type' : 'drop',
},
beforeSend:function(){
$('.loading').fadeIn();
},
success:function(data){
if(data.status){
bf2Util.alertSuccess(data.message);
}else{
bf2Util.alertError(data.message);
}
$('.loading').fadeOut();
}
});
},
eventResize: function( event, delta, revertFunc, jsEvent, ui, view ) {
$.ajax({
url:"/"+event.dataType+"/edit/"+event.dataId,
type: "POST",
dataType: "JSON",
data: {
'timeLapse' : delta._milliseconds,
'allDay' : 0,
'type' : 'resize',
},
beforeSend:function(){
$('.loading').fadeIn();
},
success:function(data){
if(data.status){
bf2Util.alertSuccess(data.message);
}else{
bf2Util.alertError(data.message);
}
$('.loading').fadeOut();
}
});
},
editable: true,
eventLimit: true, // allow "more" link when too many events
events: {
url: '/admin/oferta/atualizar-agenda',
data: function() { // a function that returns an object
return {
dynamic_value: Math.random()
};
}
}
/*events: [
<?php /*foreach($listaEventos as $evento){ ?>
{
title: '<?php echo $evento->getAssunto(); ?>',
start: '<?php echo str_replace(" ","T",$evento->getDataInicio()->format('Y-m-d H:i:s')); ?>',
end: '<?php echo str_replace(" ","T",$evento->getDataFim()->format('Y-m-d H:i:s')); ?>',
<?php if($evento->getDiaTodo()){ ?>
allDay: true,
<?php } ?>
<?php if(get_class($evento) == 'Compromisso\Model\Compromisso'){ ?>
className: "compromisso-event event-user-<?php echo $evento->getIdUser()->getIdUser(); ?>",
color:colors["<?php echo $evento->getIdUser()->getIdUser(); ?>"],
dataIdUser: "<?php echo $evento->getIdUser()->getIdUser(); ?>",
id: "compromisso-<?php echo $evento->getIdCompromisso(); ?>",
dataId: "<?php echo $evento->getIdCompromisso(); ?>",
dataType: "compromisso",
<?php }elseif(get_class($evento) == 'Atividade\Model\Atividade'){ ?>
className: "atividade-event event-user-<?php echo $evento->getIdUser()->getIdUser(); ?>",
color:colors["<?php echo $evento->getIdUser()->getIdUser(); ?>"],
dataIdUser: "<?php echo $evento->getIdUser()->getIdUser(); ?>",
id: "atividade-<?php echo $evento->getIdAtividade(); ?>",
dataId: "<?php echo $evento->getIdAtividade(); ?>",
dataType: "atividade",
<?php }else{ ?>
className: "demanda-event event-user-<?php echo $evento->getIdUser()->getIdUser(); ?>",
color:colors["<?php echo $evento->getIdUser()->getIdUser(); ?>"],
dataIdUser: "<?php echo $evento->getIdUser()->getIdUser(); ?>",
id: "demanda-<?php echo $evento->getIdDemanda(); ?>",
dataId: "<?php echo $evento->getIdDemanda(); ?>",
dataType: "compromisso",
<?php } ?>
},
<?php } */?>
]*/
});
});
$('.fclose').click(function(){
$('.modal').fadeOut();
});
$('[name="projeto"]').change(function(eventProjeto){
var id_projeto = $(this).find('option:selected').val();
$.ajax({
url:'projeto-etapa/lista-etapas',
type:'POST',
data:{ idProjeto : id_projeto },
dataType:'JSON',
beforeSend:function(){
if (eventProjeto.originalEvent !== undefined)
{
$('.loading').fadeIn();
}
},
success:function(response){
$('[name="projeto-etapa"] option').remove();
$.each(response,function(key,value){
$('[name="projeto-etapa"]').append('<option value="'+key+'">'+value+'</option>');
});
},
error:function(){
if(eventProjeto.originalEvent !== undefined){
bf2Util.alertError('Erro 404','Não foi possível carregar as etapas do projeto');
}
},
complete:function(){
$('.loading').fadeOut();
},
});
}); $('[name="projeto"]').trigger('change');
$('[name="type_event"]').on('ifChanged',function(){
if($(this).val() == 'atividade'){
$('#projeto-div').fadeIn();
$('#projeto-etapa-div').fadeIn();
$('#projeto-div select').prop('required',true);
$('#projeto-etapa-div select').prop('required',true);
}else{
$('#projeto-div').fadeOut();
$('#projeto-etapa-div').fadeOut();
$('#projeto-div select').prop('required',false);
$('#projeto-etapa-div select').prop('required',false);
}
});
$('[name="filtro-type-event"]').on('ifChanged', function(){
if($('[name="filtro-type-event"][value="compromisso"]').is(':checked')){
$('.compromisso-event').each(function(){
var id_user = this.className.match(/event-user-(\d+)/)[1];
if($('[name="filtro-user"][value="'+id_user+'"]').is(':checked')){
$(this).removeClass('gone');
}
});
}else{
$('.compromisso-event').addClass('gone');
}
if($('[name="filtro-type-event"][value="atividade"]').is(':checked')){
$('.atividade-event').each(function(){
var id_user = this.className.match(/event-user-(\d+)/)[1];
if($('[name="filtro-user"][value="'+id_user+'"]').is(':checked')){
$(this).removeClass('gone');
}
});
}else{
$('.atividade-event').addClass('gone');
}
if($('[name="filtro-type-event"][value="demanda"]').is(':checked')){
$('.demanda-event').each(function(){
var id_user = this.className.match(/event-user-(\d+)/)[1];
if($('[name="filtro-user"][value="'+id_user+'"]').is(':checked')){
$(this).removeClass('gone');
}
});
}else{
$('.demanda-event').addClass('gone');
}
});
$('[name="filtro-user"]').on('change', function(){
$('[name="filtro-user"]').each(function(){
if($(this).is(':checked')){
$('.event-user-'+$(this).val()).each(function(){
if($(this).hasClass('atividade-event') && $('[name="filtro-type-event"][value="atividade"]').is(':checked') || $(this).hasClass('compromisso-event') && $('[name="filtro-type-event"][value="compromisso"]').is(':checked') || $(this).hasClass('demanda-event') && $('[name="filtro-type-event"][value="demanda"]').is(':checked')){
$(this).removeClass('gone');
}
});
}else{
$('.event-user-'+$(this).val()).addClass('gone');
}
});
});
$(document).on('click', '.open-oferta', function(){
$.ajax({
url: '/admin/oferta/edit/'+$(this).data('slug'),
type: 'GET',
beforeSend:function(){
$('.loading').fadeIn();
},
success:function(data){
$('.loading').fadeOut();
$('#conteudo-modal-evento').html(data);
$('#modal-evento').modal('show');
}
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make($current_template, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>