Child in Booking Form, calculate, show, validate, mail, success

git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3447 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
adametz 2018-08-20 11:40:10 +00:00
parent 48131f72e2
commit 22af43b07a
18 changed files with 1147 additions and 209 deletions

View file

@ -233,6 +233,14 @@
background: linear-gradient(145deg, #f0bcbc 49%,#f2f2f2 50%,#f0bcbc 51%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f0bcbc', endColorstr='#f0bcbc',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
.table > tbody > tr > td.calendar-day-disabled-half-booked {
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#f0bcbc+49,f2f2f2+50,f0bcbc+51 */
background: #f0bcbc; /* Old browsers */
background: -moz-linear-gradient(-35deg, #f0bcbc 49%, #f2f2f2 50%, #C5DCC6 51%); /* FF3.6-15 */
background: -webkit-linear-gradient(-35deg, #f0bcbc 49%,#f2f2f2 50%,#C5DCC6 51%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(145deg, #f0bcbc 49%,#f2f2f2 50%,#C5DCC6 51%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f0bcbc', endColorstr='#C5DCC6',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
.table > tbody > tr > td.active {
background-color: rgba(88, 155, 92, 0.35);
padding: 0;
@ -256,6 +264,13 @@
display: block;
height: 100%;
}
.table > tbody > tr > td a {
font-weight: 700;
width: 100%;
display: block;
height: 100%;
padding: 8px;
}
</style>

View file

@ -2,7 +2,7 @@
<tbody>
{% for summary_entry in summary %}
<tr>
<td class="st-position-price-col">
<td class="st-position-price-col" style="min-width: 120px;">
{{ summary_entry.value|number_format(2) }}
</td>
<td class="st-position-name-col">
@ -13,20 +13,20 @@
<tr class="st-total-tr">
<td class="st-position-price-col">
<td class="st-position-price-col" style="min-width: 120px;">
<span class="st-total-price">= {{ total_price|number_format(2) }} €</span>
</td>
<td class="st-position-name-col">Gesamtpreis der Reise</td>
</tr>
<tr class="">
<td class="st-position-price-col">
<td class="st-position-price-col" style="min-width: 120px;">
<span class="st-deposit-price">{{ booking_price_info.deposit_total|number_format(2) }} €</span>
</td>
<td class="st-position-name-col">Anzahlung (ist sofort fällig)</td>
</tr>
<tr class="">
<td class="st-position-price-col">
<td class="st-position-price-col" style="min-width: 120px;">
<span class="st-final-price">{{ booking_price_info.final_payment|number_format(2) }} €</span>
</td>
<td class="st-position-name-col">Restzahlung ({{ booking_price_info.final_payment_date_str}})</td>

View file

@ -8,25 +8,33 @@ Reisezeitraum: {{ travel_date.start|date }} - {{ travel_date.end|date }
Abfahrts-/Abflugort: {{ booking_request.departure.name }} {{ booking_request.departure.extraCharge|number_format(2) }} € p.P.
{% for room in booking_price_info['rooms'] %}
1x {{ room['name'] }} [Personen: {{ room.adults }} x {{ room['price']|number_format(2) }}]
1x {{ room['name'] }} [Personen: {{ room.adults }} x {{ room['price']|number_format(2) }} {% if room['children'] > 0 %} + Kind: {{ room['price_children']|number_format(2) }}{% endif %}]
{% endfor %}
{{ booking_request.departure.extraCharge < 0 ? 'Aufschlag' : 'Abzug' }} Abfahrts-/Abflugort {{ booking_request.departure.name }}{#
#} {{ booking_request.travelerCount }} x {{ booking_request.departure.extraCharge|number_format(2) }} €: {{
#} {{ (booking_request.travelerCount + booking_request.childrenCount) }} x {{ booking_request.departure.extraCharge|number_format(2) }} €: {{
(booking_request.travelerCount * booking_request.departure.extraCharge)|number_format(2) }} €
{% for insuranceInfo in booking_price_info['insurances'] %}
{{ insuranceInfo['count'] }}x RV {{ insuranceInfo['insurance'].name }} ({{ insuranceInfo['insurancePrice'].code -}}
) {{ insuranceInfo['insurancePriceValue']|number_format(2) }} €: {{ (insuranceInfo['count'] *
insuranceInfo['insurancePriceValue'])|number_format(2) }} €
{% for insuranceInfo in booking_price_info['insurancesOut'] %}
{{ insuranceInfo['count'] }}x {{ insuranceInfo['label_first'] }} [ {{ insuranceInfo['label_last'] }} ] {{ insuranceInfo['value']|number_format(2) }}
{% endfor %}
{% for option in booking_request.travelOptions %}
{{ booking_request.travelerCount }}x zugebuchte Leistung (Erwachsener): {{ option.name }} {{ option.price|number_format(2) -}}
€: {{ (booking_request.travelerCount * option.price)|number_format(2) }}
{{ (booking_request.travelerCount + booking_request.childrenCount) }}x zugebuchte Leistung: {{ option.name }} [Erwachsener: {{ option.price|number_format(2) -}}€ ]
{% if option.priceChildren > 0 %}[Kind: {{ option.priceChildren|number_format(2) -}} €] {% endif %}
{{ ((booking_request.travelerCount * option.price) + (booking_request.childrenCount * option.priceChildren))|number_format(2) }}
{% endfor %}
{% for classOption in booking_price_info['classOptions'] %}
{{ classOption['count'] }}x {{ classOption['name'] }} {{ classOption['price']|number_format(2) }} €: {{
(classOption['count'] * classOption['price'])|number_format(2) }} €
{% endfor %}
{% for discount in booking_price_info['discount'] %}
{{ discount['count'] }}x {{ discount['label_first'] }} [ {{ discount['label_last'] }} ] {{ discount['value']|number_format(2) }}
{% endfor %}
Gesamtpreis: {{ booking_price_info['total']|number_format(2) }}
Anzahlung: {{ booking_price_info.deposit_total|number_format(2) }} € (ist sofort fällig)
@ -65,20 +73,32 @@ Reiseteilnehmer:
Zimmernummer, Zimmertyp, Geschlecht, Vorname, Nachname, Geburtsdatum
=====================================================================================
{% set travelerIndex = 0 %}
{% set travelerCollection = booking_request.travelers|slice(0, booking_request.travelerCount) %}
{% set travelerCollection = booking_request.travelers|slice(0, (booking_request.travelerCount + booking_request.childrenCount)) %}
{% for room in booking_request.occupiedRooms %}
{% if(room.type == 1) %}
{{ loop.index }}. Einzelzimmer, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{{ loop.index }}. Einzelzimmer Erwachsener, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{% set travelerIndex = travelerIndex + 1 %}
{% if(room.child == 1) %}
{{ loop.index }}. Einzelzimmer Kind, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{% set travelerIndex = travelerIndex + 1 %}
{% endif %}
{% elseif (room.type == 2) %}
{{ loop.index }}. Doppelzimmer, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{{ loop.index }}. Doppelzimmer, {{ travelerCollection[travelerIndex+1].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex+1].firstName }}, {{ travelerCollection[travelerIndex+1].lastName -}}, {{ travelerCollection[travelerIndex+1].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{{ loop.index }}. Doppelzimmer Erwachsener, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{{ loop.index }}. Doppelzimmer Erwachsener, {{ travelerCollection[travelerIndex+1].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex+1].firstName }}, {{ travelerCollection[travelerIndex+1].lastName -}}, {{ travelerCollection[travelerIndex+1].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{% set travelerIndex = travelerIndex + 2 %}
{% if(room.child == 1) %}
{{ loop.index }}. Doppelzimmer Kind, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{% set travelerIndex = travelerIndex + 1 %}
{% endif %}
{% elseif (room.type == 3) %}
{{ loop.index }}. Dreibettzimmer, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{{ loop.index }}. Dreibettzimmer, {{ travelerCollection[travelerIndex+1].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex+1].firstName }}, {{ travelerCollection[travelerIndex+1].lastName -}}, {{ travelerCollection[travelerIndex+1].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{{ loop.index }}. Dreibettzimmer, {{ travelerCollection[travelerIndex+2].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex+2].firstName }}, {{ travelerCollection[travelerIndex+2].lastName -}}, {{ travelerCollection[travelerIndex+2].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{{ loop.index }}. Dreibettzimmer Erwachsener, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{{ loop.index }}. Dreibettzimmer Erwachsener, {{ travelerCollection[travelerIndex+1].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex+1].firstName }}, {{ travelerCollection[travelerIndex+1].lastName -}}, {{ travelerCollection[travelerIndex+1].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{{ loop.index }}. Dreibettzimmer Erwachsener, {{ travelerCollection[travelerIndex+2].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex+2].firstName }}, {{ travelerCollection[travelerIndex+2].lastName -}}, {{ travelerCollection[travelerIndex+2].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{% set travelerIndex = travelerIndex + 3 %}
{% if(room.child == 1) %}
{{ loop.index }}. Dreibettzimmer Kind, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName }}
{% set travelerIndex = travelerIndex + 1 %}
{% endif %}
{% endif %}
{% endfor %}

View file

@ -41,6 +41,22 @@
<form class="st-booking-form" method="post" data-toggle="validator">
{{ form_errors(form) }}
{% spaceless %}
{% if not form.vars.valid %}
<ul>
{% for error in form.vars.errors.form.getErrors(true) %}
<li>{{ error.message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endspaceless %}
{{ form_errors(form.email) }}
@ -77,9 +93,13 @@
</tr>
{# TODO folgendes evtl noch weiter verallgemeinern #}
{% set priceTypeIds = [] %}
{% set priceTypeChildIds = [] %}
{% for price in travel_date.prices %}
{% if(price.available == "1") %}
{% set priceTypeIds = priceTypeIds|merge([price.priceTypeId]) %}
{% if(price.priceChildren > 0) %}
{% set priceTypeChildIds = priceTypeChildIds|merge([price.priceTypeId]) %}
{% endif %}
{% endif %}
{% endfor %}
@ -94,6 +114,20 @@
{{ form_errors(form.singleRoomCount) }}
</td>
</tr>
{% if "1" in priceTypeChildIds %}
<tr>
{% else %}
<tr style="display:none">
{% endif %}
<td>{{ form_label(form.singleRoomChildCount, 'Einzelzimmer mit Kind') }}</td>
<td>
{{ form_widget(form.singleRoomChildCount) }}
{{ form_errors(form.singleRoomChildCount) }}
</td>
</tr>
{% if "3" in priceTypeIds %}
<tr>
{% else %}
@ -105,18 +139,41 @@
{{ form_errors(form.doubleRoomCount) }}
</td>
</tr>
{% if "5" in priceTypeIds %}
{% if "3" in priceTypeChildIds %}
<tr>
{% else %}
<tr style="display:none">
{% endif %}
{% endif %}
<td>{{ form_label(form.doubleRoomChildCount, 'Doppelzimmer mit Kind') }}</td>
<td>
{{ form_widget(form.doubleRoomChildCount) }}
{{ form_errors(form.doubleRoomChildCount) }}
</td>
</tr>
{% if "5" in priceTypeIds %}
<tr>
{% else %}
<tr style="display:none">
{% endif %}
<td>{{ form_label(form.tripleRoomCount, 'Dreibettzimmer') }}</td>
<td>
{{ form_widget(form.tripleRoomCount) }}
{{ form_errors(form.tripleRoomCount) }}
</td>
</tr>
{% if "5" in priceTypeChildIds %}
<tr>
{% else %}
<tr style="display:none">
{% endif %}
<td>{{ form_label(form.tripleRoomChildCount, 'Dreibettzimmer mit Kind') }}</td>
<td>
{{ form_widget(form.tripleRoomChildCount) }}
{{ form_errors(form.tripleRoomChildCount) }}
</td>
</tr>
<tr>
<td>Zubuchbare Leistungen</td>
@ -494,7 +551,7 @@
data-st-traveler-index="{{ currentIndex }}"
data-room-index="{{ loop.parent.loop.index }}"
data-room-type="{{ room.vars.value.type }}"
style="display: none; border-bottom:2px solid #ffc926; margin-bottom: 20px; padding-bottom: 10px;">
style="display: ; border-bottom:2px solid #ffc926; margin-bottom: 20px; padding-bottom: 10px;">
<div class="col-md-12 col-sm-12 col-xs-12" style="margin-bottom:10px; padding-bottom:10px; border-bottom:1px solid #fff;">
<button class="btn btn-primary btn-sm border-radius st-traveller-index" type="button">
@ -508,14 +565,17 @@
{% set roomType = "Dreibettzimmer" %}
{% endif %}
{% endif %}
Reiseteilnehmer | {{ roomType }}
</button>
</div>
Reiseteilnehmer | {{ roomType }}
</button>
{% if traveler.vars.value.child %}
<br><i>bis einschließlich 11 Jahre</i>
{% endif %}
</div>
<div class="col-md-3 col-sm-12 col-xs-12">
<div class="form-group" style="margin-top:5px;">
<div class="required">
<div class="">
{{ form_field_pho(traveler.sex, 'Geschlecht', {
required: false
}) }}
@ -526,7 +586,7 @@
<div class="col-md-4 col-sm-12 col-xs-12">
<div class="form-group">
<div class="required">
<div class="">
{{ form_field_pho(traveler.firstName, 'Vorname') }}
</div>
<div class="help-block with-errors"></div>
@ -535,7 +595,7 @@
<div class="col-md-5 col-sm-12 col-xs-12">
<div class="form-group">
<div class="required">
<div class="">
{{ form_field_pho(traveler.lastName, 'Nachname') }}
</div>
<div class="help-block with-errors"></div>
@ -544,7 +604,7 @@
<div class="col-md-offset-3 col-md-4 col-sm-12 col-xs-12">
<div class="form-group" style="margin-top:5px;">
<div class="required nationality_select" data-toggle="#nationality_entry_{{ currentIndex }}">
<div class=" nationality_select" data-toggle="#nationality_entry_{{ currentIndex }}">
{{ form_field_pho(traveler.nationality, 'Nationalität') }}
</div>
<div class="help-block with-errors"></div>
@ -554,7 +614,7 @@
<div class="col-md-5 col-sm-12 col-xs-12">
<div class="form-group">
<div class="required">
<div class="">
{{ form_field_pho(traveler.birthDate, 'Geburtsdatum') }}
</div>
<div class="help-block with-errors"></div>
@ -723,11 +783,6 @@
</button>
</div>
{{ form_rest(form) }}
</form>

View file

@ -220,7 +220,7 @@
<style>
.table > tbody > tr > td.calendar-day-non {
background-color: transparent;
background-color: #fff;
}
.table > tbody > tr > td.calendar-day-past {
background-color: rgba(242, 242, 242, 0.5);
@ -236,15 +236,23 @@
background: linear-gradient(145deg, #f0bcbc 49%,#f2f2f2 50%,#f0bcbc 51%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f0bcbc', endColorstr='#f0bcbc',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
.table > tbody > tr > td.calendar-day-disabled-half-booked {
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#f0bcbc+49,f2f2f2+50,f0bcbc+51 */
background: #f0bcbc; /* Old browsers */
background: -moz-linear-gradient(-35deg, #f0bcbc 49%, #f2f2f2 50%, #C5DCC6 51%); /* FF3.6-15 */
background: -webkit-linear-gradient(-35deg, #f0bcbc 49%,#f2f2f2 50%,#C5DCC6 51%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(145deg, #f0bcbc 49%,#f2f2f2 50%,#C5DCC6 51%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f0bcbc', endColorstr='#C5DCC6',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
.table > tbody > tr > td.active {
background-color: #f2f2f2;
background-color: rgba(88, 155, 92, 0.35);
padding: 0;
}
.table > tbody > tr > td.active:hover {
background-color: #648859;
}
.table > tbody > tr > td a {
color: #598a58;
color: #5a5a5a;
font-weight: 700;
width: 100%;
display: block;
@ -259,6 +267,14 @@
display: block;
height: 100%;
}
.table > tbody > tr > td a {
font-weight: 700;
width: 100%;
display: block;
height: 100%;
padding: 8px;
}
</style>

View file

@ -37,7 +37,7 @@
{#
<div id="booking_form" class="booking_form" style="display:none;">
<form class="st-booking-form" method="post" data-toggle="validator">
@ -269,6 +269,7 @@
</form>
</div><!-- end contact-form -->
#}
</div>