function htmlOrderStatusLine($order, $field, $title, $since = "") { $retvalue = ""; if ($order[$field] != 0) { $retvalue .= "<tr><td>{$title}</td><td>"; if ($since) { $retvalue .= date("Y-M-d", $order[$field]); } $retvalue .= "</td><td>"; if ($since) { $retvalue .= "" . daysCalculator($order[$field]) . " days since {$since}"; } $retvalue .= "</td></tr>\n"; } return $retvalue; }
function showShipping($order, $page_id, $oid, $edit) { echo "<table class=\"tightTable\"><tr><td><table class=\"tightTable\">\n"; $lightUpRelease = current_user_can("can_release_to_shipping") && !$order["ShippedDate"] && !$order["WasCanceled"]; // Release for shipment section - just marks the order as release for shipment echo "<tr><td style=\"white-space:nowrap\">" . standardIcon("released") . "</td><td style=\"white-space:nowrap\">"; if ($order["ReleasedToShipping"]) { echo clickableBox($page_id, $oid, true, "unrelease", false, $lightUpRelease); echo " Order was released " . daysCalculator($order["ReleasedToShipping"]) . " days ago"; } else { echo clickableBox($page_id, $oid, false, "release", false, $lightUpRelease); echo " Order hasn't yet been released to shipping."; } echo "</td><td>\n"; // then do release button if ($order["ReleasedToShipping"]) { echo prettyButton($page_id, $oid, "UN-Release To Shipping", "unrelease", false, $lightUpRelease) . "</td>\n"; echo "<td>Un-release this order to shipping.<br>Can't do if order has already been shipped.\n</td>"; } else { echo prettyButton($page_id, $oid, "Release To Shipping", "release", false, $lightUpRelease) . "</td>\n"; echo "<td>Release this order to Shipping.<br>Can't do if order has already been shipped.\n</td>"; } echo "</tr>"; // partial row for showing the packing list button $lightUpShipped = current_user_can("can_mark_shipped") && !$order["WasCanceled"]; echo "<tr><td></td><td></td><td>"; echo prettyButton($page_id, $oid, "Packing List", "packing", "confirm", $lightUpShipped) . "</td>\n"; echo "<td>View or print the packing list for shipment.<br> \n</td>"; echo "</tr>"; // row for shipping echo "<tr><td style=\"white-space:nowrap\">" . standardIcon("shipped") . "</td><td style=\"white-space:nowrap\">"; if ($order["ShippedDate"]) { echo clickableBox($page_id, $oid, true, "shipit", false, $lightUpShipped); echo " Order has been shipped."; } else { echo clickableBox($page_id, $oid, false, "unshipit", false, $lightUpShipped); echo " Order has not yet been shipped."; } echo "</td><td style=\"white-space:nowrap\">"; if ($order["ShippedDate"]) { echo prettyButton($page_id, $oid, "Mark UN-shipped", "unshipit", false, $lightUpShipped) . "</td>\n"; echo "<td>Mark this order as NOT being shipped.</td>\n"; } else { echo prettyButton($page_id, $oid, "Mark Shipped", "shipit", false, $lightUpShipped) . "</td>\n"; echo "<td>Mark this order as SHIPPED!<br>You will be prompted for shipment information.\n</td>"; } echo "</tr></table>"; // end of row for shipping echo "</table>\n"; }