|
|
@ -24,26 +24,16 @@ if (!Machine::exists($machineid)) {
|
|
|
|
exit("No such machine.");
|
|
|
|
exit("No such machine.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$labeltype = "machineid";
|
|
|
|
$labeltype = array_keys($SETTINGS["labels"]["templates"])[0];
|
|
|
|
switch ($VARS["labeltype"]) {
|
|
|
|
|
|
|
|
case "doortag":
|
|
|
|
if (array_key_exists($VARS["labeltype"], $SETTINGS["labels"]["templates"])) {
|
|
|
|
$labeltype = "doortag";
|
|
|
|
$labeltype = $VARS["labeltype"];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "machineidanonymous":
|
|
|
|
|
|
|
|
$labeltype = "machineidanonymous";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "pickupslip":
|
|
|
|
|
|
|
|
$labeltype = "pickupslip";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "machineid":
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
$labeltype = "machineid";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$machine = new Machine($machineid);
|
|
|
|
$machine = new Machine($machineid);
|
|
|
|
|
|
|
|
|
|
|
|
$mergedata = [
|
|
|
|
$mergedata = [
|
|
|
|
"id" => $machine->getID(),
|
|
|
|
"id" => $machine->getID(),
|
|
|
|
"link" => str_replace("{{id}}", $machine->getID(), $SETTINGS["branding"]["trackinglink"]),
|
|
|
|
|
|
|
|
"price" => number_format($machine->getPrice(), 2),
|
|
|
|
"price" => number_format($machine->getPrice(), 2),
|
|
|
|
"devicetype" => $machine->getTypeLabel(),
|
|
|
|
"devicetype" => $machine->getTypeLabel(),
|
|
|
|
"devicetype_lowercase" => strtolower($machine->getTypeLabel()),
|
|
|
|
"devicetype_lowercase" => strtolower($machine->getTypeLabel()),
|
|
|
@ -61,9 +51,13 @@ $mergedata = [
|
|
|
|
"clientbillingaddress" => "",
|
|
|
|
"clientbillingaddress" => "",
|
|
|
|
"clientshippingaddress" => "",
|
|
|
|
"clientshippingaddress" => "",
|
|
|
|
"clientpublicnotes" => "",
|
|
|
|
"clientpublicnotes" => "",
|
|
|
|
"clientprivatenotes" => "",
|
|
|
|
"clientprivatenotes" => ""
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($SETTINGS["labels"]["fields"] as $id => $val) {
|
|
|
|
|
|
|
|
$mergedata[$id] = str_replace("{{id}}", $machine->getID(), $val);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* https://stackoverflow.com/a/14167216
|
|
|
|
* https://stackoverflow.com/a/14167216
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|