-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheckout.php
128 lines (124 loc) · 4.88 KB
/
checkout.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!doctype html>
<html lang="en">
<head>
<title>Checkout | Simple8</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="styles/css/base.css">
<link rel="stylesheet" href="styles/css/checkout.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<?php
require_once 'module/header.php';
require_once 'module/vietnam_provinces.php';
require_once 'module/vndFormat.php';
require_once 'module/cover.php';
coverSection('Thanh toán', 'img/files/shop.jpg');
?>
<!-- END COVER -->
<section class="billing">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-12 col-12">
<form action="checkout-complete.php" method="post">
<div class="checkbox-form">
<h3>Thông tin thanh toán</h3>
<div class="row">
<div class="col-md-12">
<div class="country-select">
<label for="city">Tỉnh/Thành phố <span class="required">*</span></label>
<select name="city">
<?php
foreach ($city as $key => $value) {
echo '<option value="' . $value . '">' . $value . '</option>';
}
?>
</select>
</div>
</div>
<div class="col-md-12">
<div class="checkout-form-list">
<label>Họ tên <span class="required">*</span></label>
<input type="text" id="name" name="name" placeholder="Nhập họ tên" title="Vui lòng nhập đúng họ tên" pattern="/[a-zA-Z]+/" required oninput="validate('name')">
<!-- oninvalid="this.setCustomValidity('Witinnovation')" onvalid="this.setCustomValidity('')"-->
</div>
</div>
<div class="col-md-12">
<div class="checkout-form-list">
<label>Địa chỉ cụ thể <span class="required">*</span></label>
<input type="text" id="address" name="address" placeholder="Ví dụ: Ngõ 125, đường Minh Khai" pattern="/[a-zA-Z0-9]+/" title="Vui lòng nhập đúng địa chỉ" required oninvalid="validate('address')">
</div>
</div>
<div class="col-md-6">
<div class="checkout-form-list">
<label>Số điện thoại <span class="required">*</span></label>
<input type="text" id="phone" name="phone" placeholder="Nhập số điện thoại" pattern="(\+84|0)\d{9,10}" title="Vui lòng nhập số điện thoại" required oninvalid="validate('phone')">
</div>
</div>
<div class="col-md-6">
<div class="checkout-form-list">
<label>Địa chỉ Email</label>
<input type="email" id="email" name="email" placeholder="Nhập địa chỉ Email" title="Vui lòng nhập đúng định dạng email" oninvalid="validate('email')">
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-12 col-12">
<div class="your-order">
<h3>Đơn hàng của bạn</h3>
<div class="your-order-table table-responsive">
<table>
<thead>
<tr>
<th class="product-name">Sản phẩm</th>
<th class="product-total">Thành tiền</th>
</tr>
</thead>
<tbody>
<?php
foreach ((array)$_SESSION['cart'] as $value) : ?>
<tr class="cart_item">
<td class="product-name"><?= $value['name'] ?><strong class="product-quantity"> × <?= $value['quantity'] ?></strong>
<p class="product-type"><?= $value['color'] . ' - ' . $value['size'] ?></p>
</td>
<td class="product-total">
<span class="amount"><?= vndFormat(vndtoNumber($value['cost']) * $value['quantity']) ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr class="cart-subtotal">
<th>Tổng đơn hàng</th>
<td><span class="amount"><?= vndFormat($_SESSION['total']) ?></span></td>
</tr>
<tr class="order-total">
<th>Thanh toán</th>
<td><strong><span class="amount" style="color: rgb(238, 35, 71); "><?= vndFormat($_SESSION['total']) ?></span></strong>
</td>
</tr>
</tfoot>
</table>
</div>
<div class="order-button-payment">
<?php
if (!isset($_SESSION['cart']) || !empty($_SESSION['cart']) || $_SESSION['count'] == 0 || $_SESSION['total'] == 0) {
echo '<input id="submit" type="submit" value="Đặt hàng">';
}
?>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- END BILLING -->
<?php require_once 'module/footer.php' ?>
<script src="script/validateForm.js"></script>
</body>
</html>