6 $returnArray = MonthReport($dbh, $SYSENV,
false);
8 if (!isset($returnArray)) { ?>
9 <h1>No data available</h1>
11 $monthRecord = $returnArray[
"record"][0];
14 $dateTime =
new DateTime($monthRecord[
"month"]);
15 $month = $dateTime->format(
"F Y");
16 }
catch (exception $e) {
17 $month =
"(No Month)";
21 <div
class=
"container_12">
23 <div
id=
"formValidateMainDiv" class=
"k-block k-error-colored" style=
"display:none;">
24 <?php
if ($returnArray[
"status"] !==
"000") { ?>
25 <p>The following errors were detected:</p>
27 <li><?php echo $returnArray[
"error"]; ?></li>
33 <table
class=
"plainGrid">
34 <tr
class=
"monthHeader">
35 <th colspan=
"6"><?php echo $month; ?></th>
38 <td colspan=
"6"> </td>
40 <?php $outerIndex = 1;
43 if (isset($monthRecord[
"cus"])) {
44 foreach($monthRecord[
"cus"] as $cuRecord) {
45 $grandTotal += $cuRecord[
"totalAmount"];
46 $totalFormatted = $cuRecord[
"totalAmount"] < 0 ?
"$(" . number_format(abs($cuRecord[
"totalAmount"]), 2) .
")" 47 :
"$" . number_format($cuRecord[
"totalAmount"], 2);
50 <td colspan=
"6"><?php echo $cuRecord[
"cuName"]; ?> (<?php echo $cuRecord[
"cu"]; ?>)</td>
52 <tr
class=
"invoiceHeader">
56 <td style=
"text-align:right;">Quantity</td>
58 <td style=
"text-align:right;">Amount</td>
60 <?php $innerIndex = 1;
61 foreach($cuRecord[
"invoices"] as $invoiceRecord) {
62 $innerClass = $innerIndex++ % 2 == 0 ?
"innerEven" :
"innerOdd";
63 $amountFormatted = $invoiceRecord[
"amount"] < 0 ?
"$(" . number_format(abs($invoiceRecord[
"amount"]), 2) .
")" 64 :
"$" . number_format($invoiceRecord[
"amount"], 2);
66 <tr
class=
"<?php echo "$innerClass
"; ?>">
68 <td><?php echo $invoiceRecord[
"productDescription"]; ?></td>
69 <td><?php echo $invoiceRecord[
"featureDescription"]; ?></td>
70 <td style=
"text-align:right;"><?php echo $invoiceRecord[
"quantity"]; ?></td>
72 <td style=
"text-align:right;"><?php echo $amountFormatted; ?></td>
77 <td style=
"text-align:right;">Total: </td>
78 <td style=
"text-align:right;"><?php echo $totalFormatted; ?></td>
81 <td colspan=
"6"> </td>
85 $grandTotalFormatted = $grandTotal < 0 ?
"$(" . number_format(abs($grandTotal), 2) .
")" :
"$" . number_format($grandTotal, 2);
88 <td colspan=
"6"> </td>
90 <tr
class=
"grandTotalFooter">
92 <td style=
"text-align:right;">Grand Total: </td>
93 <td style=
"text-align:right;"><?php echo $grandTotalFormatted; ?></td>