-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.php
104 lines (104 loc) · 5.07 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
<h2 class="text-center shadow-sm font-weight-bold"
style='border:1px; border-style:solid; border-color:#F1F1F1; padding: 20px;border-radius:40px 40px;'>
ยืนยันการเลือกบริการเสริม
</h2>
<div class="alert alert-primary" role="alert">
<p id="dear_title" class="font-weight-bold" style="font-size:18px;">
เรียน คุณลูกค้า
</p>
<p style="text-indent:20px;">
เรามีความยินดีที่ท่านสนใจบริการของการไฟฟ้าส่วนภูมิภาค
เพื่อความสะดวกในการรับบริการ ท่านสามารถเลือกวันที่ต้องการให้พนักงาน กฟภ. ติดต่อกลับ
เพื่อยืนยันวันนัดหมาย ผ่านช่อง "วันที่ให้พนักงานติดต่อกลับ" ในแต่ละรายการบริการด้านล่างค่ะ
</p>
<p class="blockquote-footer text-right" style="font-size:18px;">ขอบคุณค่ะ</p>
</div>
<img class="animated fadeInUp img-fluid" style="display: block;margin-left:auto;margin-right:auto;" src="./assets/images/appointment.jpg" />
<h4 class="font-roboto font-weight-bold"><i class="fas fa-list-alt"></i> รายการบริการที่ท่านสนใจ</h4>
<?php
$GET_PURCHASE_ID = $_GET['purchase_id'];
$fetch_purchase_lineitem = "
SELECT purchase_lineitem_id
, lineitem.cate_id
, cate_name
, warranty
, picture_name
, des
FROM purchase_lineitem lineitem JOIN product_category product
ON lineitem.cate_id = product.cate_id
WHERE product.is_product = 'Y' AND lineitem.purchase_id = '$GET_PURCHASE_ID';
";
$lineitem_result_set = mysqli_query($conn, $fetch_purchase_lineitem);
// $lineitem_result = $lineitem_result_set->fetch_all(MYSQLI_ASSOC);
?>
<form action="checkout-success.php" method="POST">
<input type="hidden" name="purchase_id" value="<?=$GET_PURCHASE_ID ?>" />
<ul class="list-group list-group-flush">
<?php
$i = 1;
while($product = $lineitem_result_set->fetch_assoc()){
?>
<li class="list-group-item">
<div class="text-center">
<label class="font-weight-bold text-white bg-dark py-2 px-5 shadow-sm" style="font-size:22px;border-radius: 20px;">
<i class="fas fa-check"></i>
บริการที่ <?= $i++ ?>
</label>
</div>
<p style="font-size:20px;">
<span class='font-weight-bold text-success'>
<i class="far fa-handshake"></i> บริการ:
</span>
<span class="pl-1">
<?=$product['cate_name']?>
</span>
</p>
<p style="font-size:20px;">
<span class='font-weight-bold text-secondary'>
<i class="fas fa-comment-dots"></i> ความต้องการเพิ่มเติม:
</span>
<br/>
<span>
<?php
$desc = null;
if($product['des'] !== null){
$desc = $product['des'];
}
?>
<textarea class="form-control"
name="purchases[<?=$product['purchase_lineitem_id']?>][desc]"
placeholder="ท่านไม่มีความต้องการเพิ่มเติมในบริการนี้" autocomplete="off" ><?= $desc ?></textarea>
</span>
</p>
<p class="font-weight-bold" style="font-size:20px;">
<i class="far fa-calendar-alt"></i> วันที่ให้พนักงานติดต่อกลับ:
</p>
<p>
<input class="form-control text-center datepicker"
style="font-size:22px;"
placeholder="เลือกวันที่ให้พนักงาน กฟภ. ติดต่อกลับ"
type="text"
data-cate-id="<?=$product['cate_id']?>"
id="<?=$product['cate_id']?>_appointment_date"
name="purchases[<?=$product['purchase_lineitem_id']?>][appointment_date]"
required
autocomplete="off" />
</p>
</li>
<?php
}
?>
</ul>
<br/>
<div class="btn-block">
<button type="submit" class="btn btn-block btn-lg btn-success">
<i class="fas fa-paper-plane"></i> ส่งข้อมูล
</button>
<button type="button" href="javascript:void(0);"
onclick="javascript: window.location.href='?action=liff_service';"
class="btn btn-block btn-lg btn-outline-danger">
<i class="fas fa-chevron-circle-left"></i>
กลับไปเลือกสินค้า
</button>
</div>
</form>