-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.php
121 lines (109 loc) · 5.04 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
<?php
require "layout/header.php"
?>
<?php
$conn = mysqli_connect('localhost', 'root', '', 'wsts-1');
require 'DBconnext.php';
include "thuvien.php";
if (!isset($_SESSION['giohang'])) $_SESSION['giohang'] = [];
function dathang()
{
if (isset($_SESSION["nguoidung"])) {
echo '<div class="row">
<div class="col-md-12">
<h2 style="margin-left: 550px;">Thông tin khách hàng</h2>
</div>
<div class="col-md-12">
<div class="row">
<div class="col-md-6" style="margin-left: 355px;">
<div class="form-group">
<label for="exampleFormControlInput4">Email <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="email" value="'.$_SESSION["nguoidung"][1].'" required>
</div>
<div class="form-group">
<label for="exampleFormControlInput1">Họ tên <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="tenNguoiMua" value="'.$_SESSION["nguoidung"][3].'" required>
</div>
<div class="form-group">
<label for="exampleFormControlInput2">Số điện thoại <span class="text-danger">*</span></label>
<input type="number" class="form-control" name="sdt" value="'.$_SESSION["nguoidung"][5].'" required>
</div>
<div class="form-group">
<label for="exampleFormControlInput3">Địa chỉ <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="diaChi" value="'.$_SESSION["nguoidung"][4].'" required>
</div>
<div class="form-group">
<label for="exampleFormControlTextarea1">Ghi chú</label>
<textarea class="form-control" name="ghiChu" required></textarea>
</div>
<div class="form-group">
<button type="submit" value="ĐỒNG Ý ĐẶT HÀNG" name="dongydathang" class="btn btn-primary">Đặt hàng</button>
</div>
</div>
</div>
</div>
</div>';
} else {
echo '<div class="row">
<div class="col-md-12">
<h2>Thông tin khách hàng</h2>
</div>
<div class="col-md-12">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="exampleFormControlInput4">Email <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="email" required>
</div>
<div class="form-group">
<label for="exampleFormControlInput1">Họ tên <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="tenNguoiMua" required>
</div>
<div class="form-group">
<label for="exampleFormControlInput2">Số điện thoại <span class="text-danger">*</span></label>
<input type="number" class="form-control" name="sdt" required>
</div>
<div class="form-group">
<label for="exampleFormControlInput3">Địa chỉ <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="diaChi" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleFormControlTextarea1">Ghi chú</label>
<textarea class="form-control" name="ghiChu" required></textarea>
</div>
<div class="form-group">
<button type="submit" value="ĐỒNG Ý ĐẶT HÀNG" name="dongydathang" class="btn btn-primary">Đặt hàng</button>
</div>
</div>
</div>
</div>
</div>';
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<div class="all-page-title page-breadcrumb">
<div class="container text-center">
<div class="row">
<div class="col-lg-12">
<h1>Thanh toán</h1>
</div>
</div>
</div>
</div>
<form action="bill.php" method="post">
<?php dathang(); ?>
</form>
</body>
</html>
<?php
require "layout/footer.php"
?>