-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuy.php
84 lines (71 loc) · 2.66 KB
/
buy.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
session_start();
$_SESSION['page'] = 'buy';
$_SESSION['choosen_event'] = stristr($_POST['choosen_event'], ' ');
require_once 'get_choosen_event.php'; //подтягиваем информацию о выбранном событии
require 'get_spots.php'; //подтягиваем информацию о заполненности зала
?>
<!DOCTYPE html>
<html lang="ru" dir="ltr">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/seats.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<title>Выбор билета</title>
</head>
<body>
<?php require "blocks/sidenav.php" ?>
<?php require 'blocks/header.php'; ?>
<div class="auth_main">
<div class="container">
<label style="margin-left: 10px; font-size: 25px">Дата проведения: </label>
<?php
echo (date("d.m.Y", strtotime($_SESSION['choosen_event_info']['date_time'])));
?>
<br>
<label style="margin-left: 10px; font-size: 25px">Время проведения: </label>
<?php
echo (date("H:i", strtotime($_SESSION['choosen_event_info']['date_time'])));
?>
<br>
<label style="margin-left: 10px; font-size: 25px">Название: </label>
<?php
echo ($_SESSION['choosen_event_info']['title']);
?>
<br>
<label style="margin-left: 10px; font-size: 25px">Место проведения: </label>
<?php
echo ($_SESSION['choosen_event_info']['site']);
?>
</div>
<div class="buy-main">
<h3><b>Выбор места</b></h3>
<form action="cart.php" class="seat" method="post">
<?php
for ($i = 1; $i <= 25; ++$i) {
$mod = 1;
for ($j=0; $j < count(array_values($_SESSION['taken_spots'])); $j++) {
if ($i == array_values($_SESSION['taken_spots'])[$j])
$mod = 0;
}
$disabled = 'disabled="true"';
if ($mod == 1) {
$disabled = '';
}
echo
'<label class="seat-select" for="seat-' .$i. '">
<input ' . $disabled . '" id="seat-' .$i. '" name="' . strval($i) . '" type="checkbox" ></input>
<span>' . strval($i) . '</span>
</label>';
// echo (var_dump(array_values($_SESSION['taken_spots'])[$i]));
} ?>
<a href= "cart.php">
<button type="submit" class="signupbtn">В корзину</button>
</a>
</form>
</div>
<?php require 'blocks/footer.php'; ?>
</div>
</body>
</html>