-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistPoDetail.php
143 lines (137 loc) · 4.07 KB
/
listPoDetail.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
include('class.php');
$oBj = new Main;
$buyid = 0;
if(isset($_GET['buyid'])){
$buyid = $_GET['buyid'];
};
$data = $oBj->detailBill($buyid);
include('template/header.php');
include('template/menu.php');
echo '
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
<!-- Custom styles for this template -->
<link href="//getbootstrap.com/docs/4.4/examples/starter-template/starter-template.css" rel="stylesheet">
</head>
<body>
';
echo '<main role="main" class="container">
<div class="starter-template">';
include('template/menuPart.php');
echo "
<br>
<h1> รายการใบสั่งซื้อ </h1>
<hr>
";
if($buyid != 0){
echo "
<table>
<tr style='background-color:lightblue'>
<td>
ใบสั่งซื้อเลขที่ " . $buyid . " " . $oBj->getStatusPo($buyid) . "
</td>
</tr>
<tr>
<td>
<table width='100%'>
<tr>
<td>
ผู้ขาย " . $oBj->getNameSupplier($buyid) . "
</td>
<td>
วันที่ออก " . $oBj->getDatebuy($buyid) . "
</td>
<td>
ยอดรวมสุทธิ " . $oBj->costPo($buyid) . " บาท
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width='100%'>
<tr>
<td>รหัสสินค้า</td>
<td>ชื่อสินค้า</td>
<td>จำนวน</td>
<td style='text-align: right;'>ราคา</td>
</tr>
";
for($i = 0 ; count($data) > $i ; $i++){
echo "
<tr>
<td>" . $data[$i]['part_id'] ."</td>
<td>" . $data[$i]['part_desc'] ."</td>
<td>" . $data[$i]['order_amount'] ."</td>
<td style='text-align: right;'>" . $data[$i]['(order_amount * part_list.part_cost)'] ."</td>
</tr>
";
}
echo "
</table>
</td>
</tr>
<tr>
<td>
<table width='100%'>
<tr>
<td style='text-align: right;'>
<b>ยอดรวมสุทธิ</b>
<br>
" . $oBj->costPo($buyid) . " บาท
<br>
";
if($oBj->checkPay($buyid) == 0){
echo "
<form action='' method='POST'>
<input type='text' name='idtoupdate' value='".$buyid."' hidden>
<input type='submit' value='ชำระค่าบริการ'>
</form>
";
}else if($oBj->getStatusPo($buyid) == "รออนุมัติ"){
echo "
ชำระค่าสินค้าแล้ว
<form action='' method='POST'>
<input type='text' name='activateBill' value='".$buyid."' hidden>
<input type='submit' value='อนุมัติรายการ'>
</form>
";
}else {
echo "
ชำระค่าสินค้าแล้ว <br>
อนุมัติรายการแล้ว
";
}
if(isset($_POST['idtoupdate'])){
echo $oBj->payBill($buyid);
}
if(isset($_POST['activateBill'])){
echo $oBj->activateBill($buyid);
}
echo "
</td>
</tr>
</table>
</td>
</tr>
</table>
";
}else{
echo "fail";
}
?>