{% extends 'MDS/GreenPatioBundle/base-reservations.html.twig' %}
{% block pagetitleinterno %}
<div class="page-title">
<h4><i class="icon-list position-left"></i> <span class="text-semibold">{% trans %}Green Patio{% endtrans %}</span> - {% trans %}Estadísticas{% endtrans %}</h4>
</div>
{% endblock %}
{% block breadcrumbs %}
<ul class="breadcrumb">
<li><a href="/loungeadmin/list"><i class="icon-home2 position-left"></i>{% trans %}Home{% endtrans %}</a></li>
</ul>
{% endblock %}
{% block contentReservation %}
<div class="row settings-page" id="client-client-subpage">
<div class="col-sm-12">
<div class="page-header">
<div class="col-sm-12 text-right">
{% if dateStartReq is not empty and dateEndReq is not empty %}
<form name="PrintForecast" method="post" target="_blank" action="/pdf/greenpatioforecast/" class="form-horizontal" autocomplete="off">
<input type="hidden" id="dateStartReq" name="forecast[date_start]" class="form-control hidden" value="{{ dateStartReq }}" />
<input type="hidden" id="dateEndReq" name="forecast[date_end]" class="form-control hidden" value="{{ dateEndReq }}" />
<div class="col-md-6">
<div class="form-group form-group-material">
<button type="submit" id="forecast_submit" name="forecast_button[send]" class="btn bg-black btn-info btn-lg">{% trans %}Previsión de Ventas en PDF{% endtrans %}</button>
</div>
</div>
</form>
{% endif %}
<a href="/reservations-greenpatio/listloungedetails" class="btn btn-info btn-gl">{% trans %}List Lounge{% endtrans %} <i class="icon-list position-right"></i></a>
<a href="/reservations-greenpatio/listperiod" class="btn btn-success btn-gl">{% trans %}List Period{% endtrans %} <i class="icon-list position-right"></i></a>
<a href="/reservations-greenpatio/listgpprices" class="btn btn-info btn-gl">{% trans %}List Price{% endtrans %} <i class="icon-list position-right"></i></a>
<a href="/reservations-greenpatio/list" class="btn btn-warning btn-gl">{% trans %}Reservation List{% endtrans %} <i class="icon-book position-right"></i></a>
</div>
</div>
</div>
{% for flashMessage in app.session.flashbag.get('mensajeclient') %}
<div class="hidden alertFlashMensaje" data-mensaje="{{ flashMessage }}"></div>
{% endfor %}
<div class="col-sm-12 margen-15">
<div class="panel">
<div class="panel-body">
<div class="col-md-12" ><strong class="text-info">
<legend class="border-teal-800">{% trans %}Consulta de Reservas{% endtrans %}</legend></strong>
</div>
<form name="ViewForecast" method="post" action="/reservations-greenpatio/responseliststatistics/" class="form-horizontal" autocomplete="off">
<div class="col-md-2" style="margin-left: 20px">
<label class="control-label" for="forecast_date_start_title">{% trans %}Fecha de inicio{% endtrans %}: </label>
{#<input type="date" id="forecast_date_start" name="forecast[date_start]" class="form-control">#}
{% if dateStartReq is null %}
<input type="date" id="forecast_date_start" name="forecast[date_start]" class="form-control">
{% else %}
<input type="date" id="forecast_date_start" name="forecast[date_start]" class="form-control" value="{{ dateStartReq|date("Y-m-d") }}">
{% endif %}
</div>
<div class="col-md-2" style="margin-left: 20px">
<label class="control-label" for="forecast_date_end_title">{% trans %}Fecha de fin{% endtrans %}: </label>
{#<input type="date" id="forecast_date_start" name="forecast[date_end]" class="form-control">#}
{% if dateEndReq is null %}
<input type="date" id="forecast_date_end" name="forecast[date_end]" class="form-control">
{% else %}
<input type="date" id="forecast_date_end" name="forecast[date_end]" class="form-control" value="{{ dateEndReq|date("Y-m-d") }}">
{% endif %}
</div>
<div class="col-md-2" style="margin-left: 20px">
<div class="col-md-6"><label class="control-label text-left">{% trans %}Client{% endtrans %}</label></div>
<div class="col-md-12">
<select id="client" name="client" class="form-control">
<option value="">{% trans %}Select a client{% endtrans %}</option>
{% for client in clients %}
{% if client.Id == clientId %}
<option value="{{ client.id }}" selected="selected">{{ client.name|capitalize }} </option>
{% else %}
<option value="{{ client.id }}">{{ client.name|capitalize }} </option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
<div class="col-xs-12 col-lg-5" style="margin-left: 20px; z-index: 1;">
<div class="col-xs-12"><label class="control-label text-center">{% trans %}Estado de la reserva{% endtrans %}</label></div>
<div class="col-xs-12"></div>
<div class="col-xs-6 col-lg-2" style="padding-top: -5px; padding-left: 10px">
<div class="checkbox checkbox-switchery switchery-lg switchery-double text-left" title="">
<label>
{#<input type="checkbox" class="switchery-info boolDelete" id="boolBlocked" name="boolStatus[Blocked]" checked="checked" onchange="changeChkLounge();">#}
{% if boolBlocked is defined and boolBlocked == true %}
<input type="checkbox" class="switchery-info boolDelete" id="boolBlocked" name="boolStatus[Blocked]" checked="checked" onchange="changeChkLounge();">
{% else %}
<input type="checkbox" class="switchery-info boolDelete" id="boolBlocked" name="boolStatus[Blocked]" onchange="changeChkLounge();">
{% endif %}
</label>
<label class="control-label text-left" style="padding-top: 10px">{% trans %}Bloqueado{% endtrans %}</label>
</div>
</div>
<div class="col-xs-6 col-lg-2" style="padding-top: -5px; padding-left: 10px">
<div class="checkbox checkbox-switchery switchery-lg switchery-double text-left" title="">
<label>
{#<input type="checkbox" class="switchery-info boolDelete" id="boolConfirmed" name="boolStatus[Confirmed]" checked="checked" onchange="changeChkLounge();">#}
{% if boolConfirmed is defined and boolConfirmed == true %}
<input type="checkbox" class="switchery-info boolDelete" id="boolConfirmed" name="boolStatus[Confirmed]" checked="checked" onchange="changeChkLounge();">
{% else %}
<input type="checkbox" class="switchery-info boolDelete" id="boolConfirmed" name="boolStatus[Confirmed]" onchange="changeChkLounge();">
{% endif %}
</label>
<label class="control-label text-left" style="padding-top: 10px">{% trans %}Confirmado{% endtrans %}</label>
</div>
</div>
<div class="col-xs-6 col-lg-2" style="padding-top: -5px; padding-left: 10px">
<div class="checkbox checkbox-switchery switchery-lg switchery-double text-left" title="">
<label>
{#<input type="checkbox" class="switchery-info boolDelete" id="boolQuoted" name="boolStatus[Quoted]" checked="checked" onchange="changeChkLounge();">#}
{% if boolQuoted is defined and boolQuoted == true %}
<input type="checkbox" class="switchery-info boolDelete" id="boolQuoted" name="boolStatus[Quoted]" checked="checked" onchange="changeChkLounge();">
{% else %}
<input type="checkbox" class="switchery-info boolDelete" id="boolQuoted" name="boolStatus[Quoted]" onchange="changeChkLounge();">
{% endif %}
</label>
<label class="control-label text-left" style="padding-top: 10px">{% trans %}Cotizado{% endtrans %}</label>
</div>
</div>
<div class="col-xs-6 col-lg-2" style="padding-top: -5px; padding-left: 10px">
<div class="checkbox checkbox-switchery switchery-lg switchery-double text-left" title="">
<label>
{#<input type="checkbox" class="switchery-info boolDelete" id="boolInvoiced" name="boolStatus[Invoiced]" checked="checked" onchange="changeChkLounge();">#}
{% if boolInvoiced is defined and boolInvoiced == true %}
<input type="checkbox" class="switchery-info boolDelete" id="boolInvoiced" name="boolStatus[Invoiced]" checked="checked" onchange="changeChkLounge();">
{% else %}
<input type="checkbox" class="switchery-info boolDelete" id="boolInvoiced" name="boolStatus[Invoiced]" onchange="changeChkLounge();">
{% endif %}
</label>
<label class="control-label text-left" style="padding-top: 10px">{% trans %}Facturado{% endtrans %}</label>
</div>
</div>
<div class="col-xs-6 col-lg-2" style="padding-top: -5px; padding-left: 10px">
<div class="checkbox checkbox-switchery switchery-lg switchery-double text-left" title="">
<label>
{#<input type="checkbox" class="switchery-info boolDelete" id="boolInvoiced" name="boolStatus[Cancel]" checked="checked" onchange="changeChkLounge();">#}
{% if boolCancel is defined and boolCancel == true %}
<input type="checkbox" class="switchery-info boolDelete" id="boolCancel" name="boolStatus[Cancel]" checked="checked" onchange="changeChkLounge();">
{% else %}
<input type="checkbox" class="switchery-info boolDelete" id="boolCancel" name="boolStatus[Cancel]" onchange="changeChkLounge();">
{% endif %}
</label>
<label class="control-label text-left" style="padding-top: 10px">{% trans %}Cancelado{% endtrans %}</label>
</div>
</div>
</div>
<div class="col-md-12" style="margin-top: 20px"></div>
<style>
/* Estilo para ajustar la lista dropdown */
.dropdown-menu {
max-height: 200px;
overflow-y: auto;
}
/* Ajustar la apariencia de la lista */
.dropdown-menu label {
padding: 5px 15px;
display: block;
}
/* Estilo adicional para alinear los checkbox con el texto */
.checkbox-inline input {
margin-right: 10px;
}
</style>
<div class="col-md-12 col-xs-12" style="padding-left: 40px; padding-right: 40px">
<div class="form-group form-group-material">
{#<label class="control-label is-visible">#}
{#<label for="supplier_tags2" class="control-label is-visible required">{% trans %}Tags{% endtrans %}</label>#}
{#</label>#}
<div id="multiselect_tags" class="input-group col-sm-12 InputTagsSpinner multi-select-full" style="width: 100%">
<div class="dropdown" style="width: 100%">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="width: 100%">
{% trans %}Todas las Salas{% endtrans %}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu" style="width: 100%">
{% for sala in salas %}
<li>
<label class="checkbox-inline">
<input type="checkbox" name="tags[tags2][]" value="{{ sala.id }}"> {{ sala.name }}
</label>
</li>
{% endfor %}
</ul>
</div>
<input type="hidden" id="selected_salas" name="selected_salas" value="">
</div>
<span class="help-block"></span>
</div>
</div>
<div class="col-md-12" style="margin-top: 20px"></div>
<div class="col-md-4"></div>
<div class="col-md-4">
<div class="form-group form-group-material">
<button type="submit" id="forecast_submit" name="forecast_button[send]" class="btn bg-success btn-block btn-lg">{% trans %}Buscar{% endtrans %}</button>
</div>
</div>
</form>
</div>
</div>
</div>
{% if data is not empty %}
<div class="col-md-12 margen-15">
<div class="panel">
<div class="panel-heading">
<div class="panel-body border-blue">
<div class="col-md-12 col-xs-12" ><strong class="text-info">
<legend class="border-teal-800">{% trans %}Listado de Reservas{% endtrans %}</legend></strong>
{{ consulta }}
<br>
<br>
<br>
</div>
<table id="table-client" class="table datatable-sum table-bordered table-hover datatable-highlight">
<thead>
<tr>
<th>{% trans %}Fecha de inicio{% endtrans %}</th>
<th>{% trans %}Client{% endtrans %}</th>
<th>{% trans %}Título{% endtrans %}</th>
<th>{% trans %}Status{% endtrans %}</th>
<th>{% trans %}Espacios{% endtrans %}</th>
<th>{% trans %}Venta Neta{% endtrans %}</th>
<th>{% trans %}Iva{% endtrans %}</th>
<th class="text-center">{% trans %}Actions{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% for resv in data %}
<tr>
<td><div class="hidden">{{ resv.dateStart|date("Y/m/d") }}</div>{{ resv.dateStart|date('d/m/Y')}}</td>
<td>{{ resv.clientName }}</td>
<td>{{ resv.title }}</td>
<td>{{ resv.status }}</td>
<td>
{% for key, spaceName in resv.txtArrayLoungesNames %}
{% if key > 21 and key < 30 %}
<span class="badge bg-primary-400 heading-text" style="font-size: small"> {{ spaceName }} </span> {# CVR #}
{% else %}
{% if key > 29 %}
<span class="badge bg-brown-400 heading-text" style="font-size: small"> {{ spaceName }} </span> {# BLV #}
{% else %}
<span class="badge badge-success text-center" style="font-size: small"> {{ spaceName }} </span> {# GP #}
{% endif %}
{% endif %}
{% endfor %}
</td>
<td>{{ resv.neto|number_format(2, ',', '.')}}</td>
<td>{{ resv.vat|number_format(2, ',', '.')}}</td>
<td class="text-center">
<ul class="icons-list">
<li class="dropdown">
<a class="btn border-info text-info btn-flat btn-rounded btn-icon btn-lg" href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-menu9"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right bg-teal-400">
<li><a href="/reservations-greenpatio/editsimple/{{ resv.reservationId }}"><i class="icon-eye pull-right"></i> {% trans %}Ver Reserva{% endtrans %}</a></li>
</ul>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th colspan="5" class="text-right">Previsión de Venta en tabla: </th>
<th colspan="1"></th>
<th colspan="1"></th>
<th colspan="1"></th>
</tr>
</tfoot>
</table>
<form name="ExcelForecast" method="post" action="/reservations-greenpatio/xlsstatistics/" class="form-horizontal" autocomplete="off">
<input id="xlsDateStartReq" name="xls[dateStartReq]" class="hidden" value="{{ dateStartReq }}">
<input id="xlsDateEndReq" name="xls[dateEndReq]" class="hidden" value="{{ dateEndReq }}">
<input id="xlsClientId" name="xls[clientId]" class="hidden" value="{{ clientId }}">
<input id="xlsBoolBlocked" name="xls[boolBlocked]" class="hidden" value="{{ boolBlocked }}">
<input id="xlsBoolConfirmed" name="xls[boolConfirmed]" class="hidden" value="{{ boolConfirmed }}">
<input id="xlsBoolQuoted" name="xls[boolQuoted]" class="hidden" value="{{ boolQuoted }}">
<input id="xlsBoolInvoiced" name="xls[boolInvoiced]" class="hidden" value="{{ boolInvoiced }}">
<input id="xlsBoolCancel" name="xls[boolCancel]" class="hidden" value="{{ boolCancel }}">
<input id="arraySalasId" name="xls[arraySalasId]" class="hidden" value="{{ arraySalasId }}">
<input id="selectedSalasNames" name="xls[selectedSalasNames]" class="hidden" value="{{ selectedSalasNames }}">
<div class="col-md-10"></div>
<div class="col-md-2">
<div class="form-group form-group-material">
<button type="submit" id="excel_submit" name="excel_button[send]" class="btn bg-info btn-block btn-lg"><i class="icon-file-excel position-right"></i>{% trans %} Exportar a Excel{% endtrans %}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('assets/js/plugins/forms/styling/uniform.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/forms/styling/switch.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/form_checkboxes_radios.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/forms/selects/select2.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/greenpatio/list-reservation.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/forms/styling/switchery.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/proposal/switchery-proposal.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/tables/datatables/datatables.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/tables/datatables/extensions/responsive.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/greenpatio/datatables_sum_gp_statistics.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/datatables_advanced.js') }}"></script>
<script>
var checkboxes = document.querySelectorAll('.dropdown-menu input[type="checkbox"]');
var dropdownButton = document.querySelector('#dropdownMenu');
var hiddenInput = document.querySelector('#selected_salas');
checkboxes.forEach(function (checkbox) {
checkbox.addEventListener('change', updateSelections); // Event for PC
checkbox.addEventListener('click', updateSelections); // Add click for mobile
checkbox.addEventListener('touchstart', updateSelections); // Add touchstart for mobile
});
function updateSelections() {
var selected = [];
checkboxes.forEach(function (checkbox) {
if (checkbox.checked) {
selected.push(checkbox.parentElement.textContent.trim());
}
});
dropdownButton.textContent = selected.length > 0 ? selected.join(', ') : 'Todas las Salas';
hiddenInput.value = selected.join(',');
}
</script>
{% endblock %}