-
Notifications
You must be signed in to change notification settings - Fork 0
/
confirm.php
52 lines (49 loc) · 1.22 KB
/
confirm.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
<?php
include_once('models.php');
include_once('functions.php');
session_start();
if($_SERVER['REQUEST_METHOD']=='POST'){
$customer = new CustomerInfo($_REQUEST);
$_SESSION['customer_info'] = $customer;
}
else{
$customer = $_SESSION['customer_info'];
}
if (!isset($_SESSION['cart'])){
header( 'Location: sessions.php' );
exit();
}
$cart = $_SESSION['cart'];
file_put_contents('storage/record.json',json_encode(Array(
"customer_info" => $customer,
"shopping_cart" => $cart
)));
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php foreach($cart->items as $booking){
$session = SessionModel::get('id',$booking->session_id);
$movie = MovieModel::get('id',$session->movie_id);
render('receipt.php',array(
'customer' => $customer,
'session' => $session,
'movie' => $movie,
'booking' => $booking
));
$booking->each_row(function($row)use(&$session,&$movie){
for($i=0;$i<$row['quantity'];$i++){
render('ticket.php',array(
'movie_title' => $movie->title,
'day' => $session->day,
'time' => $session->time,
'type' => $row['type_name']
));
}
});
}?>
</body>
<?php include_once("/home/eh1/e54061/public_html/wp/debug.php"); ?>
</html>