-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStoreSalesSummaryCode.php
More file actions
38 lines (33 loc) · 1.27 KB
/
StoreSalesSummaryCode.php
File metadata and controls
38 lines (33 loc) · 1.27 KB
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
<?php
function GetStoreSalesSummary()
{
$dir = "C:/ProgramData/SimpleReceipt/";
if (is_dir($dir)) {
$filenames = glob($dir . "*.json");
foreach($filenames as $filename) {
$data = file_get_contents($filename);
}
$data = file_get_contents("C:/ProgramData/SimpleReceipt/tickets_data_04022020.json");
$tickets = json_decode($data, true);
return $tickets;
echo("<br>");
echo("<br>");
echo("<br>");
foreach($tickets as $ticket) {
echo $ticket['TicketNo'] . "<br/>";
echo $ticket['TicketDate'] . "<br/>";
echo "--------------------------------------------------------------------";
echo "<br>";
for ($i=0; $i < count($ticket['TicketLineItem']); $i++) {
# code...
echo "SrNo: " . $ticket['TicketLineItem'][$i]['ItemIndex'] . "<br/>";
echo "Quantity: " . $ticket['TicketLineItem'][$i]['Qty'] . "<br/>";
echo "Rate: " . $ticket['TicketLineItem'][$i]['Rate'] . "<br/>";
echo "Total: " . $ticket['TicketLineItem'][$i]['TotalItemPrice'] . "<br/>";
echo "--------------------------------------------------------------------";
echo "<br>";
}
}
}
}
?>