first commit
This commit is contained in:
33
templates/tickets/add-ticket.php
Normal file
33
templates/tickets/add-ticket.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<script>
|
||||
$( 'body' ).on( 'click', '.article_file_edit', function()
|
||||
{
|
||||
var file_name = $( this ).val();
|
||||
var file_id = $( this ).attr( 'file_id' );
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/admin/ajax.php',
|
||||
data:
|
||||
{
|
||||
a: 'article_file_name_change',
|
||||
file_id: file_id,
|
||||
file_name: file_name
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
$( '#overlay' ).show();
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
$( '#overlay' ).hide();
|
||||
|
||||
response = jQuery.parseJSON( data );
|
||||
|
||||
if ( response.status !== 'ok' )
|
||||
create_error( response.msg );
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
57
templates/tickets/basket-form.php
Normal file
57
templates/tickets/basket-form.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
<h3>BILETY</h3>
|
||||
</th>
|
||||
<th>
|
||||
<h3>CENA</h3>
|
||||
</th>
|
||||
<th>
|
||||
<h3>WARTOŚĆ</h3>
|
||||
</th>
|
||||
<th>
|
||||
<h3>ZMIENIĆ ILOŚĆ</h3>
|
||||
</th>
|
||||
<th>
|
||||
<h3>USUŃ</h3>
|
||||
</th>
|
||||
</tr>
|
||||
<?php foreach ($this->cart as $ticket_id => $combinations) : ?>
|
||||
<?php foreach ($combinations as $key => $value) : ?>
|
||||
<tr>
|
||||
<td><?= $this->settings['tickets'][$ticket_id]['name']; ?> (x<?= $value["quantity"]; ?>)</td>
|
||||
<td><?= $value['ticket_price']; ?> zł</td>
|
||||
<td><?= $value['ticket_price'] * $value["quantity"]; ?> zł</td>
|
||||
<td>
|
||||
<?php if ( $ticket_id != 'gift-price' and $ticket_id != 'ticket-protection' ):?>
|
||||
<button class="btn_t1 add" ticket_id="<?= $ticket_id; ?>" combination_key="<?= $key; ?>">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</button>
|
||||
<button class="btn_t1 subtract" ticket_id="<?= $ticket_id; ?>" combination_key="<?= $key; ?>">
|
||||
<i class="fa-solid fa-minus"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ( $ticket_id != 'gift-price' ):?>
|
||||
<? if ( $ticket_id == 'ticket-protection' ) : ?>
|
||||
<a href="/tickets/basket_view/ticket_protection=false" class="btn_t1">
|
||||
<i class="fa-solid fa-trash-can"></i>
|
||||
</a>
|
||||
<? else : ?>
|
||||
<button class="btn_t1 delete" ticket_id="<?= $ticket_id; ?>" combination_key="<?= $key; ?>">
|
||||
<i class="fa-solid fa-trash-can"></i>
|
||||
</button>
|
||||
<? endif; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<div class="basket_protection">
|
||||
<a href="/tickets/basket_view/ticket_protection=true" class="ticket_protection">Dodaj ochronę kupującego (5 zł / bilet)</a>
|
||||
<div class="basket_protection__text">
|
||||
<p>Wszystkie bilety zostaną objęte ochroną kupującego. Pozwoli Ci to na zmianę terminu biletu.</p>
|
||||
</div>
|
||||
</div>
|
||||
19
templates/tickets/basket-summary.php
Normal file
19
templates/tickets/basket-summary.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<div class="basket_summary__wrapper">
|
||||
<h2>Suma:</h2>
|
||||
<?php
|
||||
$finalPrice = 0;
|
||||
foreach ( $this -> cart as $data => $value )
|
||||
{
|
||||
foreach ( $value as $key => $val )
|
||||
{
|
||||
$price = $val['ticket_price'];
|
||||
$quantity = $val['quantity'];
|
||||
|
||||
$finalPrice += $price * $quantity;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p><?= $finalPrice; ?> zł</p>
|
||||
|
||||
<button class="buy-btn" type="submit">Płacę</button>
|
||||
</div>
|
||||
294
templates/tickets/basket-view.php
Normal file
294
templates/tickets/basket-view.php
Normal file
@@ -0,0 +1,294 @@
|
||||
<?php if(empty($_SESSION['basket'])){
|
||||
header ('location: /tickets/main_view/');
|
||||
exit;
|
||||
} else {
|
||||
$basket = \S::get_session('basket');
|
||||
|
||||
$giftKeys = array_filter(array_keys($basket), function ($key) {
|
||||
return strpos($key, "gift-price") !== false;
|
||||
});
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="basket_page">
|
||||
<div class="basket_content">
|
||||
<div class="container">
|
||||
<div class="box_01">
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
<h3>BILETY</h3>
|
||||
</th>
|
||||
<th>
|
||||
<h3>CENA</h3>
|
||||
</th>
|
||||
<th>
|
||||
<h3>WARTOŚĆ</h3>
|
||||
</th>
|
||||
<th>
|
||||
<h3>ZMIENIĆ ILOŚĆ</h3>
|
||||
</th>
|
||||
<th>
|
||||
<h3>USUŃ</h3>
|
||||
</th>
|
||||
</tr>
|
||||
<?php foreach ($this->cart as $ticket_id => $combinations) : ?>
|
||||
<?php foreach ($combinations as $key => $value) : ?>
|
||||
<tr>
|
||||
<td><?= $this->settings['tickets'][$ticket_id]['name']; ?> (x<?= $value["quantity"]; ?>)</td>
|
||||
<td><?= $value['ticket_price']; ?> zł</td>
|
||||
<td><?= $value['ticket_price'] * $value["quantity"]; ?> zł</td>
|
||||
<td>
|
||||
<?php if ( $ticket_id != 'gift-price' and $ticket_id != 'ticket-protection' ):?>
|
||||
<button class="btn_t1 add" ticket_id="<?= $ticket_id; ?>" combination_key="<?= $key; ?>">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</button>
|
||||
<button class="btn_t1 subtract" ticket_id="<?= $ticket_id; ?>" combination_key="<?= $key; ?>">
|
||||
<i class="fa-solid fa-minus"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ( $ticket_id != 'gift-price' ):?>
|
||||
<button class="btn_t1 delete" ticket_id="<?= $ticket_id; ?>" combination_key="<?= $key; ?>">
|
||||
<i class="fa-solid fa-trash-can"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<div class="basket_protection">
|
||||
<a href="/tickets/basket_view/ticket_protection=true" class="ticket_protection">Dodaj ochronę kupującego (5 zł / bilet)</a>
|
||||
<div class="basket_protection__text">
|
||||
<p>Wszystkie bilety zostaną objęte ochroną kupującego. Pozwoli Ci to na zmianę terminu biletu.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_02">
|
||||
<form action="/tickets/basketFormHandler/" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-xs-12 basket_user_data">
|
||||
<div class="basket_user_data__wrapper">
|
||||
<h2>TWOJE DANE</h2>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="name" class="col-lg-4 col-form-label">Imię*</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="name" name="name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="surname" class="col-lg-4 col-form-label">Nazwisko*</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="surname" name="surname" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="email" class="col-lg-4 col-form-label">Email*</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="email" class="form-control" id="email" name="email" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="zip_code" class="col-lg-4 col-form-label">Kod pocztowy<span class="form-vat-option">*</span></label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="zip_code" name="zip_code">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="city" class="col-lg-4 col-form-label">Miejscowość<span class="form-vat-option">*</span></label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="city" name="city">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="street" class="col-lg-4 col-form-label">Ulica<span class="form-vat-option">*</span></label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="street" name="street">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($giftKeys)) : ?>
|
||||
<div class="form-group row mb-lg-2" id="gift_address_box">
|
||||
<label for="gift_address" class="col-lg-4 col-form-label">Dane do wysyłki biletu prezentowego*</label>
|
||||
<div class="col-lg-8">
|
||||
<textarea rows="5" type="text" class="form-control" id="gift_address" name="gift_address" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="vat" class="col-lg-4 form-check-label"><strong>Chcę otrzymać fakturę VAT</strong></label>
|
||||
<div class="col-lg-8">
|
||||
<input type="checkbox" class="form-check-input" id="vat" name="vat">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-vat-box">
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="company_name" class="col-lg-4 col-form-label">Nazwa firmy*</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="company_name" name="company_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="nip" class="col-lg-4 col-form-label">NIP*</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="nip" name="nip">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" value="" id="regulamin" required>
|
||||
<label class="form-check-label" for="regulamin">
|
||||
*akceptuję postanowienia <a href="/tickets/regulamin/">regulaminu</a>, oraz <a href="/tickets/regulamin_biletow_prezentowych/">regulaminu biletów prezentowych</a>.
|
||||
</label>
|
||||
<div class="invalid-feedback">
|
||||
Musisz wyrazić zgodę przed przesłaniem.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-xs-12 basket_summary">
|
||||
<div class="basket_summary__wrapper">
|
||||
<h2>Suma:</h2>
|
||||
<?php
|
||||
$finalPrice = 0;
|
||||
foreach ( ( $this -> cart ) as $data => $value )
|
||||
{
|
||||
foreach ( $value as $key => $val )
|
||||
{
|
||||
$price = $val['ticket_price'];
|
||||
$quantity = $val['quantity'];
|
||||
|
||||
$finalPrice += $price * $quantity;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p><?= $finalPrice; ?> zł</p>
|
||||
<button class="buy-btn" type="submit">Płacę</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
// add
|
||||
$('body').on('click', '.add', function() {
|
||||
var ticket_id = $(this).attr('ticket_id');
|
||||
var data_combination_key = $(this).attr('combination_key');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/tickets/ticket_add/',
|
||||
data: {
|
||||
ticket_id: ticket_id,
|
||||
diffdays: data_combination_key,
|
||||
basket_step_1: true
|
||||
},
|
||||
success: function(data) {
|
||||
response = jQuery.parseJSON(data);
|
||||
$('.box_01').html(response.basket_form);
|
||||
$('.box_02 .basket_summary').html(response.basket_summary);
|
||||
}
|
||||
});
|
||||
});
|
||||
// subtract
|
||||
$('body').on('click', '.subtract', function() {
|
||||
var ticket_id = $(this).attr('ticket_id');
|
||||
var data_combination_key = $(this).attr('combination_key');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/tickets/ticket_subtract/',
|
||||
data: {
|
||||
ticket_id: ticket_id,
|
||||
diffdays: data_combination_key,
|
||||
basket_step_1: true,
|
||||
},
|
||||
success: function(data) {
|
||||
response = jQuery.parseJSON(data);
|
||||
$('.box_01').html(response.basket_form);
|
||||
$('.box_02 .basket_summary').html(response.basket_summary);
|
||||
giftAddressHandler()
|
||||
if (response.cart_count <= 0) {
|
||||
window.location.replace("/tickets/main_view/");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
//remove
|
||||
$('body').on('click', '.delete', function() {
|
||||
var ticket_id = $(this).attr('ticket_id');
|
||||
var data_combination_key = $(this).attr('combination_key');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/tickets/ticket_remove/',
|
||||
data: {
|
||||
ticket_id: ticket_id,
|
||||
diffdays: data_combination_key,
|
||||
basket_step_1: true
|
||||
},
|
||||
success: function(data) {
|
||||
response = jQuery.parseJSON(data);
|
||||
$('.box_01').html(response.basket_form);
|
||||
$('.box_02 .basket_summary').html(response.basket_summary);
|
||||
giftAddressHandler()
|
||||
if (response.cart_count <= 0) {
|
||||
window.location.replace("/tickets/main_view/");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// vat
|
||||
$('body').on('click', '#vat', function() {
|
||||
if(this.checked) {
|
||||
$('.form-vat-box').slideDown()
|
||||
$('#nip').prop("required", true)
|
||||
$('#company_name').prop("required", true)
|
||||
$('#zip_code').prop("required", true)
|
||||
$('#city').prop("required", true)
|
||||
$('#street').prop("required", true)
|
||||
$('.form-vat-option').css("opacity", "1")
|
||||
} else {
|
||||
$('.form-vat-box').slideUp()
|
||||
$('#nip').prop("required", false)
|
||||
$('#company_name').prop("required", false)
|
||||
$('#zip_code').prop("required", false)
|
||||
$('#city').prop("required", false)
|
||||
$('#street').prop("required", false)
|
||||
$('.form-vat-option').css("opacity", "0")
|
||||
}
|
||||
})
|
||||
|
||||
function giftAddressHandler() {
|
||||
let hasGift = false;
|
||||
|
||||
$('.box_01 table tr button[ticket_id]').each(function(index, button) {
|
||||
const ticketId = $(button).attr('ticket_id');
|
||||
if (ticketId.includes('gift') && ticketId !== 'gift-price') {
|
||||
hasGift = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (hasGift) {
|
||||
} else {
|
||||
$('#gift_address_box').remove()
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
4
templates/tickets/disabled-sell.php
Normal file
4
templates/tickets/disabled-sell.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<div class="alert alert-danger" style="width: 100%; max-width: 800px; margin: 250px auto 0; text-align: center;">
|
||||
Sprzedaż biletów jest obecnie wyłączona.<br/>
|
||||
Zapraszamy do zakupu biletów w kasach biletowych.
|
||||
</div>
|
||||
362
templates/tickets/main-view.php
Normal file
362
templates/tickets/main-view.php
Normal file
@@ -0,0 +1,362 @@
|
||||
<?php
|
||||
if (isset($_POST['selected_date'])) {
|
||||
$selected_date = $_POST['selected_date'];
|
||||
$selected = DateTime::createFromFormat('d-m-Y', $selected_date);
|
||||
$today = new DateTime();
|
||||
|
||||
$interval = $today->diff($selected);
|
||||
$days_diff = (int)$interval->format('%r%a');
|
||||
|
||||
function date_price($item, $days_diff) {
|
||||
if($days_diff == 0) {
|
||||
$price = $item['price'] + $item['dynamic_prices']['day0'];
|
||||
return $price . ' zł';
|
||||
}
|
||||
elseif ($days_diff == 1 || $days_diff == 2) {
|
||||
$price = $item['price'] + $item['dynamic_prices']['day1_2'];
|
||||
return $price . ' zł';
|
||||
}
|
||||
elseif ($days_diff >= 3 && $days_diff <= 7) {
|
||||
$price = $item['price'] + $item['dynamic_prices']['day3_7'];
|
||||
return $price . ' zł';
|
||||
}
|
||||
else {
|
||||
$price = $item['price'];
|
||||
return $price . ' zł';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/flatpickr/dist/l10n/pl.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
|
||||
|
||||
<div class="tickets_calendar container" >
|
||||
<form id="dateForm" method="POST">
|
||||
<div class="_title">Wybierz datę przyjazdu:</div>
|
||||
<input type="text" id="flatpickr" name="selected_date" value="<?= isset($_POST['selected_date']) ? htmlspecialchars($_POST['selected_date']) : ''; ?>" style="display: none;" >
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<? if (isset($_POST['selected_date'])) : ?>
|
||||
<div class="tickets container">
|
||||
|
||||
<!-- <div class="sale-box">
|
||||
<h2>Do 31 marca ceny na wszystkie bilety <span>-20%</span></h2>
|
||||
</div> -->
|
||||
|
||||
<!-- Bilet ulgowy -->
|
||||
<div class="ticket-container">
|
||||
<div class="title-container">
|
||||
<h2 class="title">Bilet ulgowy</h2>
|
||||
<p class="description">do 140cm wzrostu</p>
|
||||
</div>
|
||||
<? foreach($this -> settings['bilety-ulgowe'] as $key => $item) : ?>
|
||||
<div class="ticket">
|
||||
<div class="ticket-description ticket-description--<?= $this -> settings['tickets'][$item]['color']; ?>">
|
||||
<h3 class="ticket__name"><?= explode( '-', $this -> settings['tickets'][$item]['name'])[0]; ?></h3>
|
||||
<p class="description">bilet całodniowy</p>
|
||||
|
||||
<? if($this -> settings['tickets'][$item]['alert']) : ?>
|
||||
<p class="ticket-alert"><?= $this -> settings['tickets'][$item]['alert']; ?></p>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<h3 class="price">
|
||||
<?php
|
||||
echo date_price(
|
||||
$this -> settings['tickets'][$item],
|
||||
$days_diff
|
||||
);
|
||||
?>
|
||||
</h3>
|
||||
<!-- <h3 class="price"><?= $this -> settings['tickets'][$item]['price']; ?> zł</h3> -->
|
||||
<div class="ticket-quantity">
|
||||
<button class="add button" ticket_id="<?= $item; ?>"><i class="fa fa-plus"></i></button>
|
||||
<span>1x</span>
|
||||
<button class="subtract button" ticket_id="<?= $item; ?>" diffdays="<?= $days_diff; ?>"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
|
||||
<!-- Bilet normalny -->
|
||||
<div class="ticket-container">
|
||||
<div class="title-container">
|
||||
<h2 class="title">Bilet normalny</h2>
|
||||
<p class="description">od 140cm wzrostu</p>
|
||||
</div>
|
||||
|
||||
<? foreach($this -> settings['bilety-normalne'] as $key => $item) : ?>
|
||||
<div class="ticket">
|
||||
<div class="ticket-description ticket-description--<?= $this -> settings['tickets'][$item]['color']; ?>">
|
||||
<h3 class="ticket__name"><?= explode( '-', $this -> settings['tickets'][$item]['name'])[0]; ?></h3>
|
||||
<p class="description">bilet całodniowy</p>
|
||||
|
||||
<? if($this -> settings['tickets'][$item]['alert']) : ?>
|
||||
<p class="ticket-alert"><?= $this -> settings['tickets'][$item]['alert']; ?></p>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<h3 class="price">
|
||||
<?php
|
||||
echo date_price(
|
||||
$this -> settings['tickets'][$item],
|
||||
$days_diff
|
||||
);
|
||||
?>
|
||||
</h3>
|
||||
<div class="ticket-quantity">
|
||||
<button class="add button" ticket_id="<?= $item; ?>"><i class="fa fa-plus"></i></button>
|
||||
<span>1x</span>
|
||||
<button class="subtract button" ticket_id="<?= $item; ?>" diffdays="<?= $days_diff; ?>"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
|
||||
<? if($selected >= DateTime::createFromFormat('d-m-Y', '28-06-2025')): ?>
|
||||
<!-- Bilet ALL OPEN -->
|
||||
<div class="ticket-container">
|
||||
<div class="title-container">
|
||||
<h2 class="title">Bilet ALL OPEN</h2>
|
||||
<p class="description">bilety do wszystkich parków</p>
|
||||
</div>
|
||||
|
||||
<? foreach($this -> settings['bilety-all-open'] as $key => $item) : ?>
|
||||
<? $pattern = "/All Open -/"; ?>
|
||||
<div class="ticket">
|
||||
<div class="ticket-description ticket-description--<?= $this -> settings['tickets'][$item]['color']; ?>">
|
||||
<!-- <h3 class="ticket__name"><?= explode( '-', $this -> settings['tickets'][$item]['name'])[1]; ?></h3> -->
|
||||
<h3 class="ticket__name"><?= preg_replace($pattern, '', $this -> settings['tickets'][$item]['name']); ?></h3>
|
||||
<p class="description">bilet całodniowy</p>
|
||||
</div>
|
||||
<h3 class="price">
|
||||
<?php
|
||||
echo date_price(
|
||||
$this -> settings['tickets'][$item],
|
||||
$days_diff
|
||||
);
|
||||
?>
|
||||
</h3>
|
||||
<div class="ticket-quantity">
|
||||
<button class="add button" ticket_id="<?= $item; ?>"><i class="fa fa-plus"></i></button>
|
||||
<span>1x</span>
|
||||
<button class="subtract button" ticket_id="<?= $item; ?>" diffdays="<?= $days_diff; ?>"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
|
||||
<? if($selected >= DateTime::createFromFormat('d-m-Y', '28-06-2025')): ?>
|
||||
<div class="ticket-container">
|
||||
<div class="title-container">
|
||||
<h2 class="title">Bilety rodzinne</h2>
|
||||
<p class="description">bilety dla rodzin</p>
|
||||
</div>
|
||||
<? foreach($this -> settings['bilety-rodzinne'] as $key => $item) : ?>
|
||||
<div class="ticket">
|
||||
<div class="ticket-description ticket-description--<?= $this -> settings['tickets'][$item]['color']; ?>">
|
||||
<h3 class="ticket__name"><?= $this -> settings['tickets'][$item]['name']; ?></h3>
|
||||
<p class="description">bilet całodniowy</p>
|
||||
</div>
|
||||
<h3 class="price">
|
||||
<?php
|
||||
echo date_price(
|
||||
$this -> settings['tickets'][$item],
|
||||
$days_diff
|
||||
);
|
||||
?>
|
||||
</h3>
|
||||
<div class="ticket-quantity">
|
||||
<button class="add button" ticket_id="<?= $item; ?>"><i class="fa fa-plus"></i></button>
|
||||
<span>1x</span>
|
||||
<button class="subtract button" ticket_id="<?= $item; ?>" diffdays="<?= $days_diff; ?>"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
|
||||
<div class="ticket-container">
|
||||
<div class="title-container">
|
||||
<h2 class="title">Karnety</h2>
|
||||
<p class="description">Na cały sezon</p>
|
||||
</div>
|
||||
<? foreach($this -> settings['karnety'] as $key => $item) : ?>
|
||||
<div class="ticket">
|
||||
<div class="ticket-description ticket-description--<?= $this -> settings['tickets'][$item]['color']; ?>">
|
||||
<h3 class="ticket__name"><?= $this -> settings['tickets'][$item]['name']; ?></h3>
|
||||
<!-- <p class="description">bilet całodniowy</p> -->
|
||||
</div>
|
||||
<h3 class="price">
|
||||
<?php
|
||||
echo date_price(
|
||||
$this -> settings['tickets'][$item],
|
||||
$days_diff
|
||||
);
|
||||
?>
|
||||
</h3>
|
||||
<div class="ticket-quantity">
|
||||
<button class="add button" ticket_id="<?= $item; ?>"><i class="fa fa-plus"></i></button>
|
||||
<span>1x</span>
|
||||
<button class="subtract button" ticket_id="<?= $item; ?>" diffdays="<?= $days_diff; ?>"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
|
||||
<div class="bottom-info">
|
||||
<div class="bottom-info__description container">
|
||||
<p>KASA NIE ZWRACA PIENIĘDZY ZA NIEWYKORZYSTANE ATRAKCJE ZE WZGLĘDU NA ZŁĄ POGODĘ, NAGŁĄ AWARIĘ TECHNICZNĄ ORAZ
|
||||
OGRANICZONĄ PRZEPUSTOWOŚĆ DANYCH ATRAKCJI.</p>
|
||||
<p>Przed zakupem biletu do Kompleksu Turystycznego BRZEZÓVKA należy zapoznać się z
|
||||
<a style="color: #72b81b;" href="/tickets/regulamin/">regulaminem</a>, oraz <a style="color: #72b81b;" href="/tickets/regulamin_biletow_prezentowych/">regulaminem biletów prezentowych</a>.</p>
|
||||
</div>
|
||||
<div class="bottom-info__background "></div>
|
||||
</div>
|
||||
<div class="shopping-cart-container">
|
||||
<div class=" <?= $this->cart ? 'shopping-cart shopping-cart--active' : "shopping-cart" ?>">
|
||||
<div class="basket"><i class="fa-solid fa-ticket"></i></div>
|
||||
<div class="quantity">
|
||||
<p>Bilety</p>
|
||||
</div>
|
||||
<ul class="tickets__list">
|
||||
<?php
|
||||
$summary = 0;
|
||||
foreach ($this->cart as $ticket_id => $combinations) :
|
||||
foreach ($combinations as $key => $value) :
|
||||
$summary_ticket = $value['ticket_price'] * $value['quantity'];
|
||||
$summary += $summary_ticket;
|
||||
?>
|
||||
<li class="ticket">
|
||||
<p class="ticket__description">
|
||||
<?= $this->settings['tickets'][$ticket_id]['name'] . ' <span>x' . $value["quantity"] . '</span>' ?>
|
||||
</p>
|
||||
<p class="ticket__price">cena: <span><?= $summary_ticket ?> zł</span> </p>
|
||||
<button class="ticket__button" data-ticket-id="<?= $ticket_id ?>" data-combination-key="<?= $key ?>">x</button>
|
||||
</li>
|
||||
<?php
|
||||
endforeach;
|
||||
endforeach;
|
||||
?>
|
||||
</ul>
|
||||
<div class="sum-section">
|
||||
<p>Łączna suma:</p>
|
||||
<p class="sum"><?= $summary ?> zł</p>
|
||||
</div>
|
||||
<a href="/tickets/basket_view/" class="buy-btn">Kup teraz</a>
|
||||
<button class="off-btn">x</button>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
$('body').on('click', '.shopping-cart .off-btn', function() {
|
||||
$('.shopping-cart').removeClass('shopping-cart--active');
|
||||
});
|
||||
|
||||
//add
|
||||
$('body').on('click', '.add', function() {
|
||||
var ticket_id = $(this).attr('ticket_id');
|
||||
var date = $('#flatpickr').val();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/tickets/ticket_add/',
|
||||
data: {
|
||||
ticket_id: ticket_id,
|
||||
date: date,
|
||||
},
|
||||
beforeSend: function() {},
|
||||
success: function(data) {
|
||||
response = jQuery.parseJSON(data);
|
||||
$('.shopping-cart-container').html(response.shopping_cart);
|
||||
|
||||
// if (!$('.shopping-cart').hasClass('shopping-cart-active'))
|
||||
// $('.shopping-cart').addClass('shopping-cart--active');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
//subtract
|
||||
$('body').on('click', '.subtract', function() {
|
||||
var ticket_id = $(this).attr('ticket_id');
|
||||
var diffdays = $(this).attr('diffdays');
|
||||
console.log(diffdays);
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/tickets/ticket_subtract/',
|
||||
data: {
|
||||
ticket_id: ticket_id,
|
||||
diffdays: diffdays
|
||||
},
|
||||
beforeSend: function() {},
|
||||
success: function(data) {
|
||||
response = jQuery.parseJSON(data);
|
||||
$('.shopping-cart-container').html(response.shopping_cart);
|
||||
// if (response.cart_count = 0)
|
||||
// $('.shopping-cart').removeClass('shopping-cart--active');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
//remove
|
||||
$('body').on('click', '.ticket__button', function() {
|
||||
var ticket_id = $(this).attr('ticket_id');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/tickets/ticket_remove/',
|
||||
data: {
|
||||
ticket_id: ticket_id
|
||||
},
|
||||
beforeSend: function() {},
|
||||
success: function(data) {
|
||||
response = jQuery.parseJSON(data);
|
||||
$('.shopping-cart-container').html(response.shopping_cart);
|
||||
|
||||
if (response.cart_count = 0)
|
||||
$('.shopping-cart').removeClass('shopping-cart--active');
|
||||
|
||||
console.log($('.shopping-cart'));
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
//
|
||||
const shoppingCart = document.querySelector(".shopping-cart");
|
||||
document.addEventListener('onChange', () => {
|
||||
let list = document.querySelectorAll(".ticket");
|
||||
let subtract = document.querySelector(".subtract");
|
||||
subtract.addEventListener("click", () => {
|
||||
if (list.length === 0) {
|
||||
shoppingCart.classList.remove("shopping-cart--active");
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
flatpickr("#flatpickr", {
|
||||
inline: true,
|
||||
dateFormat: "d-m-Y",
|
||||
disableMobile: true,
|
||||
minDate: "today",
|
||||
locale: "pl",
|
||||
theme: "material_blue",
|
||||
onChange: function(selectedDates, dateStr, instance) {
|
||||
document.getElementById('dateForm').submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
178
templates/tickets/order-confirm.php
Normal file
178
templates/tickets/order-confirm.php
Normal file
@@ -0,0 +1,178 @@
|
||||
<?php if($this->order_successful === true) : ?>
|
||||
<script type="text/javascript">
|
||||
$.alert({
|
||||
icon: 'fa-regular fa-face-smile-beam',
|
||||
title: 'Zamówienie jest złożone',
|
||||
content: 'Dziękujemy za złożenia zamówienia.',
|
||||
typeAnimated: true,
|
||||
animation: 'scale',
|
||||
closeAnimation: 'scale',
|
||||
autoClose: 'confirm|10000',
|
||||
bgOpacity: '0.5',
|
||||
type: 'green',
|
||||
theme: 'modern',
|
||||
columnClass: 'col-md-6 col-md-offset-3',
|
||||
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Zamknij',
|
||||
btnClass: 'btn-green btn-alert',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($this->order_fail === true) : ?>
|
||||
<script type="text/javascript">
|
||||
$.alert({
|
||||
icon: 'fa-solid fa-circle-exclamation',
|
||||
title: 'Błąd',
|
||||
content: 'Wystąpił błąd podczas przetwarzania zamówienia.',
|
||||
typeAnimated: true,
|
||||
animation: 'scale',
|
||||
closeAnimation: 'scale',
|
||||
autoClose: 'confirm|10000',
|
||||
bgOpacity: '0.5',
|
||||
type: 'red',
|
||||
theme: 'modern',
|
||||
columnClass: 'col-md-6 col-md-offset-3',
|
||||
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Zamknij',
|
||||
btnClass: 'btn-red btn-alert',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$orderData = $this->order;
|
||||
?>
|
||||
|
||||
<div id="basket_page">
|
||||
<div class="basket_content">
|
||||
<div class="container">
|
||||
<div class="box_01">
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
<h3>BILETY</h3>
|
||||
</th>
|
||||
<th>
|
||||
<h3>CENA</h3>
|
||||
</th>
|
||||
<th>
|
||||
<h3>WARTOŚĆ</h3>
|
||||
</th>
|
||||
</tr>
|
||||
<?php foreach ($orderData['tickets'] as $key => $value) : ?>
|
||||
<tr>
|
||||
<td><?= $value['name']; ?> ( x <?= $value["quantity"]; ?>)</td>
|
||||
<td><?= $value['price']; ?> zł</td>
|
||||
<td><?= $value['price'] * $value["quantity"]; ?> zł</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="box_02">
|
||||
<div class="form_data">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-xs-12 basket_user_data">
|
||||
<div class="basket_user_data__wrapper">
|
||||
<h2>TWOJE DANE</h2>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="name" class="col-lg-4 col-form-label">Imię*</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="name" name="name" disabled
|
||||
value="<?= $orderData['name']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="surname" class="col-lg-4 col-form-label">Nazwisko*</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="surname" name="surname" disabled
|
||||
value="<?= $orderData['surname']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="email" class="col-lg-4 col-form-label">Email*</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="email" class="form-control" id="email" name="email" disabled
|
||||
value="<?= $orderData['email']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="zip_code" class="col-lg-4 col-form-label">Kod pocztowy*</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="zip_code" name="zip_code" disabled
|
||||
value="<?= $orderData['zip_code']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="city" class="col-lg-4 col-form-label">Miejscowość*</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="city" name="city" disabled
|
||||
value="<?= $orderData['city']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<? if(!empty($orderData['gift_address'])) : ?>
|
||||
<div class="form-group row mb-lg-2" id="gift_address_box">
|
||||
<label for="gift_address" class="col-lg-4 col-form-label">Dane do wysyłki biletu prezentowego*</label>
|
||||
<div class="col-lg-8">
|
||||
<textarea rows="5" type="text" class="form-control" id="gift_address" name="gift_address" disabled><?= $orderData['gift_address']; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="vat" class="col-lg-4 form-check-label"><strong>Chcę otrzymać fakturę VAT</strong></label>
|
||||
<div class="col-lg-8">
|
||||
<input type="checkbox" class="form-check-input" id="vat" <?= $orderData['vat'] ? 'checked' : ""; ?> name="vat" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($orderData['vat']) : ?>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="company_name" class="col-lg-4 col-form-label">Nazwa firmy</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="company_name" name="company_name" disabled value="<?= $orderData['company_name']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mb-lg-2">
|
||||
<label for="nip" class="col-lg-4 col-form-label">NIP</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control" id="nip" name="nip" disabled value="<?= $orderData['nip']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-xs-12 basket_summary">
|
||||
<div class="basket_summary__wrapper">
|
||||
<h2>Suma:</h2>
|
||||
<p><?= $orderData["order_price"]; ?> zł</p>
|
||||
<hr>
|
||||
<h2>Status:</h2>
|
||||
<?php if($orderData["payment_status"]) : ?>
|
||||
<p class="c_green">Zapłacono</p>
|
||||
<img
|
||||
src="https://bilety.brzezovka.pl/orders/<?= $orderData['hash'][0]; ?>/<?= $orderData['hash'][1]; ?>/<?= $orderData['hash']; ?>.png">
|
||||
<?php else: ?>
|
||||
<p class="c_red">Nie zapłacono</p>
|
||||
<a href="/tickets/przelewy24/order=<?= $orderData['hash']; ?>" class="buy-btn">Powtórz transakcję</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
69
templates/tickets/przelewy24.php
Normal file
69
templates/tickets/przelewy24.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
$clientData = $this->order;
|
||||
$merchant_id = $this->settings['p24']['merchant_id'];
|
||||
$pos_id = $this->settings['p24']['pos_id'];
|
||||
|
||||
$crc_key = '';
|
||||
|
||||
if($this->settings['p24']['sandbox']) {
|
||||
$crc_key = $this->settings['p24']['sandbox_crc_key'];
|
||||
} else {
|
||||
$crc_key = $this->settings['p24']['crc_key'];
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="spinner_container">
|
||||
<?= \Tpl::view( 'components/spinner'); ?>
|
||||
</div>
|
||||
|
||||
<form
|
||||
action="<?= $this -> settings['p24']['sandbox'] ? 'https://sandbox.przelewy24.pl/trnDirect' : 'https://secure.przelewy24.pl/trnDirect';?>"
|
||||
method="post" class="form" id="form_data" accept-charset="ISO-8859-2">
|
||||
<input type="hidden" name="p24_session_id" value="<?= $this -> przelewy24_hash; ?>" />
|
||||
<input type="hidden" name="p24_merchant_id" value="<?= $merchant_id; ?>" />
|
||||
<input type="hidden" name="p24_pos_id" value="<?= $pos_id; ?>" />
|
||||
<input type="hidden" name="p24_amount" value="<?= $clientData['order_price'] * 100;?>" />
|
||||
<input type="hidden" name="p24_currency" value="PLN" />
|
||||
<input type="hidden" name="p24_description" value="Zamówienie nr <?= $clientData['id']; ?>" />
|
||||
<input type="hidden" name="p24_client" value="<?= $clientData['name'] . ' ' . $clientData['surname'];?>" />
|
||||
<input type="hidden" name="p24_zip" value="<?= $clientData['zip_code']; ?>" />
|
||||
<input type="hidden" name="p24_city" value="<?= $clientData['city']; ?>" />
|
||||
<input type="hidden" name="p24_country" value="PL" />
|
||||
<input type="hidden" name="p24_email" value="<?= $clientData['email']; ?>" />
|
||||
<input type="hidden" name="p24_language" value="pl" />
|
||||
<input type="hidden" name="p24_url_status"
|
||||
value="https://<?= $_SERVER['SERVER_NAME'];?>/tickets/przelewy24_response/" />
|
||||
<input type="hidden" name="p24_url_return"
|
||||
value="https://<?= $_SERVER['SERVER_NAME'];?>/tickets/order_confirm/order=<?= $this -> order['hash'];?>" />
|
||||
<input type="hidden" name="p24_api_version" value="3.2" />
|
||||
<input type="hidden" name="p24_wait_for_result" value="1">
|
||||
<input type="hidden" name="p24_method" value="227">
|
||||
<input type="hidden" name="p24_sign"
|
||||
value="<?= md5( $this -> przelewy24_hash . '|' . $merchant_id . '|' . ( $clientData['order_price'] * 100 ) . '|PLN|' . $crc_key );?>" />
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
dataLayer.push({ ecommerce: null });
|
||||
dataLayer.push({
|
||||
event: "purchase",
|
||||
ecommerce: {
|
||||
transaction_id: "<?= $this -> order['id'];?>",
|
||||
value: <?= str_replace( ',', '.', $this -> order['order_price'] );?>,
|
||||
currency: "PLN",
|
||||
shipping: 0,
|
||||
items: [
|
||||
<? foreach ( $this -> order['tickets'] as $ticket ):?>
|
||||
{
|
||||
'id': <?= (int)$ticket['product_id'];?>,
|
||||
'name': '<?= $ticket['name'];?>',
|
||||
'quantity': <?= $ticket['quantity'];?>,
|
||||
'price': <?= $ticket['price'];?>
|
||||
}<? if ( $ticket != end( $this -> order['tickets'] ) ) echo ',';?>
|
||||
<? endforeach;?>
|
||||
]
|
||||
}
|
||||
});
|
||||
$( document ).ready( function() {
|
||||
$( "#form_data" ).submit();
|
||||
});
|
||||
</script>
|
||||
61
templates/tickets/scanner-view.php
Normal file
61
templates/tickets/scanner-view.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<div id="scanner" style="width: 100%; overflow-x: hidden;"></div>
|
||||
<div class="container">
|
||||
<div id="result"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
const html5QrCode = new Html5Qrcode("scanner");
|
||||
|
||||
const qrCodeSuccessCallback = (decodedText, decodedResult) => {
|
||||
// document.getElementById('result').innerHTML = '<span class="result">' + decodedResult + '</span>';
|
||||
getData(decodedText);
|
||||
};
|
||||
|
||||
const config = {
|
||||
fps: 10,
|
||||
qrbox: {
|
||||
width: 250,
|
||||
height: 250
|
||||
}
|
||||
};
|
||||
|
||||
html5QrCode.start({
|
||||
facingMode: "environment"
|
||||
}, config, qrCodeSuccessCallback);
|
||||
|
||||
const getData = (hash) => {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/scanner/scanner_get_data/',
|
||||
data: {
|
||||
scannerData: hash,
|
||||
},
|
||||
success: function(data) {
|
||||
response = jQuery.parseJSON(data);
|
||||
$('#result').html(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$('body').on('click', '#btn-used', function() {
|
||||
var order_id = $("#order-id").val();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/scanner/use_ticket/',
|
||||
data: {
|
||||
order_id: order_id,
|
||||
},
|
||||
success: function(data) {
|
||||
response = jQuery.parseJSON(data);
|
||||
if (response.useStatus == true) {
|
||||
alert("Status zmieniono na 'Wykorzystany'")
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
71
templates/tickets/shopping-cart.php
Normal file
71
templates/tickets/shopping-cart.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<? if ($this->cart) : ?>
|
||||
|
||||
<div class="shopping-cart shopping-cart--active">
|
||||
<?php else : ?>
|
||||
<div class="shopping-cart ">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="basket">
|
||||
<i class="fa-solid fa-ticket"></i>
|
||||
</div>
|
||||
<div class="quantity">
|
||||
<p>Bilety</p>
|
||||
</div>
|
||||
<ul class="tickets__list">
|
||||
<?
|
||||
$summary = 0;
|
||||
foreach ( $this -> cart as $data => $value )
|
||||
{
|
||||
foreach ( $value as $key => $val )
|
||||
{
|
||||
$summary_ticket = $val['ticket_price'] * $val['quantity'];
|
||||
$summary += $summary_ticket;
|
||||
|
||||
$ticket_box = '
|
||||
<li class="ticket">
|
||||
<p class="ticket__description">' . $this->settings['tickets'][$data]['name'] . ' <span>x' . $val["quantity"] . '</span></p>
|
||||
<p class="ticket__price">cena: <span>' . $summary_ticket . ' zł</span> </p>
|
||||
' . write_btn($data, $key ) . '
|
||||
</li>
|
||||
';
|
||||
|
||||
echo $ticket_box;
|
||||
}
|
||||
}
|
||||
|
||||
// foreach ( $this -> cart as $ticket_id => $combinations )
|
||||
// {
|
||||
// foreach ($combinations as $key => $value)
|
||||
// {
|
||||
// $summary_ticket = $value['ticket_price'] * $value['quantity'];
|
||||
// $summary += $summary_ticket;
|
||||
|
||||
// $ticket_box = '
|
||||
// <li class="ticket">
|
||||
// <p class="ticket__description">' . $this->settings['tickets'][$ticket_id]['name'] . ' <span>x' . $value["quantity"] . '</span></p>
|
||||
// <p class="ticket__price">cena: <span>' . $summary_ticket . ' zł</span> </p>
|
||||
// ' . write_btn($ticket_id, $key ) . '
|
||||
// </li>
|
||||
// ';
|
||||
|
||||
// echo $ticket_box;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
function write_btn($data, $diffDays) {
|
||||
if (strpos($data, "gift-price") !== false) {
|
||||
return '';
|
||||
} else {
|
||||
return '<button class="ticket__button" ticket_id=' . $data . ' diffDays="' . $diffDays . '">x</button>';
|
||||
}
|
||||
};
|
||||
?>
|
||||
</ul>
|
||||
<div class="sum-section">
|
||||
<p>Łączna suma:</p>
|
||||
<p class="sum"><?= $summary ?> zł</p>
|
||||
</div>
|
||||
<a href="/tickets/basket_view/" class="buy-btn">Kup teraz</a>
|
||||
<button class="off-btn">x</button>
|
||||
</div>
|
||||
Reference in New Issue
Block a user