-
Notifications
You must be signed in to change notification settings - Fork 0
/
vendor.php
39 lines (39 loc) · 1.12 KB
/
vendor.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
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<div class="printer">
<table style="margin-left: auto; margin-right: auto;">
<tr style="position: sticky; top: 0; z-index: 1000;">
<th>itemcode</th>
<th>desc</th>
<th>cost</th>
<th>sell</th>
</tr>
<?php
error_reporting(E_ALL);
if($_GET["id"]){
$CODE = $_GET["id"];
$dbh_v = new PDO("sqlite:/saru/www-data/hourly.sqlite3");
$t_cost = $dbh_v->beginTransaction();
$stmt_sql_cost = $dbh_v->prepare(
"SELECT sih_current.itemcode AS itemcode, desc, sih_current.cost/sih AS cost, sih_current.sell/sih AS sell FROM product_vendors JOIN sih_current ON sih_current.itemcode = product_vendors.itemcode WHERE vendorcode=?"
);
$stmt_v = $stmt_sql_cost->execute([
$CODE
]);
$data_v = $stmt_sql_cost->fetchAll();
$dbh_v->commit();
foreach($data_v as $product){
echo "<tr>";
echo "<td>" . json_encode($product["itemcode"]) . "</td>";
echo "<td>" . json_encode($product["desc"]) . "</td>";
echo "<td>" . json_encode($product["cost"]) . "</td>";
echo "<td>" . json_encode($product["sell"]) . "</td>";
echo "</tr>";
}
} else {
die("ID missing");
}
?>
</table>
</div>