function getOrdersSummary($sort, $reverse, $all) { switch ($sort) { case "PaidDate": case "ReleasedToShipping": case "ShippedDate": case "IsExpedited": case "RequestedPay": case "Charity": $reverse = !$reverse; break; } return dbGetOrdersSummary($sort, $reverse, $all); }
function populateListOrderSummary() { $rows = dbGetOrdersSummary(); $list = ' <head> <style> center td {align: center; } .topline {outline: thin solid black;} tr:hover td { background-color: #FFFAF0; color: #000; } </style> <script> function rowClick(number) { alert("You clicked " + number); } </script> </head> <table frame="box" style="width:100%"> <tr class="topline"> <td align="center"> Customer ID </td> <td align="center"> Order ID </td> <td align="center"> First Name </td> <td align="center"> Last Name </td> <td align="center"> Ordered Date </td> <td align="center"> Item Count </td> <td align="center"> Paid? </td> <td align="center"> Shipped? </td> <td align="center"> Expedited? </td> <td align="center"> Order Notes </td> </tr> '; foreach ($rows as $row) { $canceled = $row["WasCanceled"]; $cid = $row["CID"]; $oid = $row["OID"]; $firstName = $row["FirstName"]; $lastName = $row["LastName"]; $orderDate = $row["OrderedDate"]; $itemCount = $row["itemCount"]; $paidDate = $row["PaidDate"]; $shippedDate = $row["ShippedDate"]; $isExpedited = $row["IsExpedited"]; $orderNotes = $row["OrderNotes"]; $paid = '☐'; /* Empty Box special Character */ $shipped = '☐'; /* Empty Box special Character */ $expedited = '☐'; /* Empty Box special Character */ if ($paidDate == 0) { $paid = '☐'; /* Empty Box special Character */ } else { $paid = '☑'; /* Check Box Special Character */ } if ($shippedDate == 0) { $shipped = '☐'; /* Empty Box special Character */ } else { $shipped = '☑'; /* Check Box Special Character */ } if ($isExpedited) { $expedited = '☑'; /* Check Box Special Character */ } else { $expedited = '☐'; /* Empty Box special Character */ } if ($canceled) { $list .= "<tr class=\"strikeout\">"; } else { $list .= "<tr onclick=\"rowClick({$oid});\">"; } $list .= "\n\n <td align='center'> {$cid} </td>\n <td align='center'> {$oid} </td>\n <td> {$firstName} </td>\n <td> {$lastName} </td>\n <td class='center' align='center'> {$orderDate} </td>\n <td align='center'> {$itemCount} </td>\n <td align='center'> {$paid} </td>\n <td align='center'> {$shipped} </td>\n <td align='center'> {$expedited} </td>\n <td> {$orderNotes} </td>\n </tr>\n\n"; } $list .= " \n\n</table>\n"; print $list; }