-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpurc_detail_gridView.php
77 lines (73 loc) · 3.35 KB
/
purc_detail_gridView.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
<?php
session_start() ;
//--- if user is not logined, redirect to index.php
if (!isset($_SESSION["userid"])){
header("location:./index.php") ;
return ;
}
//---
include 'utility_dbinfo.php';
?>
<!DOCTYPE html>
<html>
<head>
<script>
function delCfm(id,pid){
if (confirm("Data delete! Are you sure ?"))
location.href="./purc_detail_delete.php?id="+id+"&pid="+pid ;
}
</script>
</head>
<body>
<div style="width: 100% ; height: 100px ; float: center">
<?php include 'utility_menu.php';?>
</div>
<div style="width: 100% ; height: 100px ; float: center">
<?php
//--- Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Databases connection failed: " . $conn->connect_error);
}
//--- select salse order item info
$sql = "SELECT * FROM pod WHERE purc_no ='".$_GET["id"]."'" ;
$result = $conn->query($sql);
//--- draw item table header
echo "<table style='margin: 20px auto ; background-color: #BDBDBD ; border-spacing: 1px'>".
" <tr style='background-color: #FFFFFF'>".
" <th colspan='7' style='padding: 5px'>Purchase Order ".$_GET["id"]." Quick View</th></tr>".
" <tr style='background-color: #FFFFFF'>".
" <th style='padding: 5px'>Purchase No</th>".
" <th style='padding: 5px'>Product id</th>".
" <th style='padding: 5px'>Unit price</th>".
" <th style='padding: 5px'>Quantity</th>".
" <th style='padding: 5px'>Price</th>".
" <th colspan='2' style='padding: 5px'></th>".
" </tr>" ;
//--- draw item table data
if ($result->num_rows > 0){
while($row = $result->fetch_assoc()) {
echo " <tr style='background-color: #FFFFFF'>".
" <td style='padding: 5px'><a href='./purc_detail_dataView.php?id=".$row["purc_no" ]."&pid=".$row["prod_id" ]."'>".$row["purc_no" ]."</a></td>".
" <td style='padding: 5px'><a href='./purc_detail_dataView.php?id=".$row["prod_id" ]."&pid=".$row["prod_id" ]."'>".$row["prod_id" ]."</a></td>".
" <td style='padding: 5px'><a href='./purc_detail_dataView.php?id=".$row["purc_price" ]."&pid=".$row["purc_price" ]."'>".$row["purc_price"]."</a></td>".
" <td style='padding: 5px'><a href='./purc_detail_dataView.php?id=".$row["purc_qty" ]."&pid=".$row["purc_qty" ]."'>".$row["purc_qty" ]."</a></td>".
" <td style='padding: 5px'><a href='./purc_detail_dataView.php?id=".$row["exte_price" ]."&pid=".$row["exte_price" ]."'>".$row["exte_price"]."</a></td>".
" <td style='padding: 5px'><a href='./purc_detail_updateView.php?id=".$row["purc_no"]."&pid=".$row["prod_id"]."'>Edit</a></td>".
" <td style='padding: 5px ; text-decoration: underline ; cursor: pointer' onclick=\"delCfm('".$row["purc_no"]."','".$row["prod_id"]."')\">Delete</a></td>".
" </tr>" ;
}
}
//--- draw item table footer
echo " <tr style='background-color: #FFFFFF'>".
" <td colspan='7' style='padding: 5px'>".
" <a href='./purc_detail_insertView.php?id=".$_GET["id"]."'>Insert</a>".
" <a href='./purc_gridView.php' style='margin-left: 15px'>Back</a>".
" </td>".
" </tr>".
"</table>" ;
?>
</div>
</body>
</html>