function cancelorder() { $_SESSION["msg"] = 2; $_SESSION["plainmsg"] = "transaction cancelled"; rePoll(); receipt("cancelled"); }
include "../connect.php"; } if (!function_exists("tDataConnect")) { include "../connect.php"; } if (!function_exists("addactivity")) { include "../additem.php"; } if (!function_exists("loginscreen")) { include "../clientscripts.php"; } if (!function_exists("memberID")) { include "../prehkeys.php"; } $_SESSION["away"] = 1; rePoll(); $_SESSION["training"] = 0; $password = str_replace(array("TRAINING", "'", ",", "+"), array('9999', ""), strtoupper(trim($_POST["reginput"]))); $global_values = get_global_values(); if (!$global_values["LoggedIn"]) { $employee_number = user_pass($password); $employee = get_user_info($employee_number); if ($employee) { testremote(); setglobalvalue("CashierNo", $employee["EmpNo"]); setglobalvalue("cashier", $employee["FirstName"] . " " . substr($employee["LastName"], 0, 1) . "."); loadglobalvalues(); $transno = gettransno($password); $_SESSION["transno"] = $transno; setglobalvalue("transno", $transno); setglobalvalue("LoggedIn", 1);
function printfooter() { // if ($_SESSION["msgrepeat"] != 1) { $_SESSION["runningTotal"] = $_SESSION["amtdue"]; // } if ($_SESSION["End"] == 1) { $_SESSION["runningTotal"] = -1 * $_SESSION["change"]; } if ($_SESSION["scale"] == 1) { $weight = number_format($_SESSION["weight"], 2) . "lb."; } else { $weight = "_ _ _ _"; } if (is_numeric($_SESSION["discounttotal"])) { $dbldiscounttotal = number_format($_SESSION["discounttotal"], 2); } else { $dbldiscounttotal = 0.0; $_SESSION["runningTotal"] = 0; } if (!$_SESSION["runningTotal"]) { $_SESSION["runningTotal"] = 0; } if ($_SESSION["isMember"] == 1 || $_SESSION["sc"] == 1) { $labelyousaved = "You Saved"; } else { $labelyousaved = "Could Have Saved"; } if ($_SESSION["percentDiscount"] == 0) { $strpercentdisclabel = "% Discount"; } else { $strpercentdisclabel = $_SESSION["percentDiscount"] . "% Discount"; } // ----------------------------------------------------------------------------------------------- echo "</table></td></tr></table>"; echo "<table border=0 cellspacing=0 cellpadding=0>"; echo "<tr><td width=119 bgcolor=white align=left><font face=arial color=black size=-1><b>" . $labelyousaved . "</b></font></td>"; echo "<td width=117 bgcolor=white align=center><font face=arial color=#004080 size=-1><b>" . $strpercentdisclabel . "</b></font></td>"; echo "<td width=117 bgcolor=white align=center><font face=arial color=#004080 size=-1><b>Mbr Special</b></font></td>"; // ----------------------------------------------------------------------------------------------- $strdiscountlabel = "Special"; // ----------------------First Row Labels --------------------------------------------------------- echo "<link rel=stylesheet type=text/css href=is4c.css>"; echo "<td width=117 bgcolor=white align=center><font face=arial color=#004080 size=-1><b>"; echo $strdiscountlabel . "</b></font></td>"; if ($_SESSION["ttlflag"] == 1 and $_SESSION["End"] != 1) { if ($_SESSION["fntlflag"] == 1) { echo "<td width=170 bgcolor=#800080 align=right><font face=arial color=white size=-1><b>fs Amount Due</b></font></td></tr>"; // $_SESSION["ttlflag"] = 0; } else { echo "<td width=170 bgcolor=#800000 align=right><font face=arial color=white size=-1><b>Amount Due</b></font></td></tr>"; } } elseif ($_SESSION["ttlflag"] == 1 and $_SESSION["End"] == 1) { echo "<td width=170 bgcolor=#004080 align=right><font face=arial color=white size=-1><b>Change</b></font></td></tr>"; } else { echo "<td width=170 bgcolor=black align=right><font face=arial color=white size=-1><b>Total</b></font></td></tr>"; } // ------------------ Second Row blank ----------------------------- echo "<tr><td height=1 colspan=5 bgcolor=black></td></tr>"; echo "<tr><td height=2 colspan=5></td></tr>"; // ----------------------------------------------------------------- $special = $_SESSION["memSpecial"] + $_SESSION["staffSpecial"]; if ($_SESSION["isMember"] == 1) { $dblyousaved = number_format($_SESSION["transDiscount"] + $dbldiscounttotal + $special + $_SESSION["memCouponTTL"], 2); $_SESSION["yousaved"] = $dblyousaved; $_SESSION["couldhavesaved"] = 0; $_SESSION["specials"] = number_format($dbldiscounttotal + $special, 2); } else { $dblyousaved = number_format($_SESSION["memSpecial"], 2); $_SESSION["yousaved"] = $dbldiscounttotal + $_SESSION["staffSpecial"]; $_SESSION["couldhavesaved"] = $dblyousaved; $_SESSION["specials"] = $dbldiscounttotal + $_SESSION["staffSpecial"]; } if ($_SESSION["sc"] == 1) { $_SESSION["yousaved"] = $_SESSION["yousaved"] + $_SESSION["scDiscount"]; $dblyousaved = $_SESSION["yousaved"]; } if ($_SESSION["percentDiscount"] != 0 || $_SESSION["memCouponTTL"] > 0) { $strperdiscount = number_format($_SESSION["transDiscount"] + $_SESSION["memCouponTTL"], 2); } else { $strperdiscount = "n/a"; } if ($_SESSION["isMember"] == 1) { $strmemSpecial = number_format($_SESSION["memSpecial"], 2); } else { $strmemSpecial = "n/a"; } if ($_SESSION["End"] == 1) { rePoll(); } if (strlen($_SESSION["endorseType"]) > 0 || $_SESSION["waitforScale"] == 1) { $_SESSION["waitforScale"] = 0; $_SESSION["beep"] = "noBeep"; } if ($_SESSION["scale"] == 0 && $_SESSION["SNR"] == 1) { rePoll(); } if ($_SESSION["cashOverAmt"] != 0) { // apbw/cvr 03/05/05 CashBackBeep twoPairs(); // apbw/cvr 03/05/05 CashBackBeep $_SESSION["cashOverAmt"] = 0; // apbw/cvr 03/05/05 CashBackBeep } echo "<TR><TD height='2' colspan='5'></TD></TR>"; echo "<TR><TD width='119' height='60' align='left' bgcolor='#EEEEEE'><FONT face='arial' size='+2' color='#004080'><CENTER><B>" . number_format($dblyousaved, 2) . "</B></CENTER></FONT></TD>"; echo "<TD width='117' align='center'><FONT face='arial' color='#808080' size='+1'>" . number_format($strperdiscount, 2) . "</FONT></TD>"; echo "<TD width='117' align='center'><FONT face='arial' color='#808080' size='+1'>" . number_format($strmemSpecial, 2) . "</FONT></TD>"; echo "<TD width='117' height='60' align='center'><FONT face='arial' color='#808080' size='+1'>" . number_format($dbldiscounttotal, 2) . "</FONT></TD>"; if ($_SESSION["ttlflag"] == 1 && $_SESSION["End"] != 1) { if ($_SESSION["fntlflag"] == 1) { echo "<TD width='170' height='60' align='center' bgcolor='white'><FONT face='arial' size='+3' color='#800080'><B>" . number_format($_SESSION["fsEligible"], 2) . "</B></FONT>"; // $_SESSION["fntlflag"] = 0; } else { echo "<TD width='170' height='60' align='center' bgcolor='white'><FONT face='arial' size='+3' color='#800000'><B>" . number_format($_SESSION["runningTotal"], 2) . "</B></FONT>"; } } elseif ($_SESSION["ttlflag"] == 1 && $_SESSION["End"] == 1) { echo "<TD width= '170' height='60' align='center' bgcolor='white'><FONT face='arial' size='+3' color='#004080'><B>" . number_format($_SESSION["runningTotal"], 2) . "</B></FONT>"; } else { echo "<TD width='170' height='60' align='center'><FONT face='arial' size='+3'><B>" . number_format($_SESSION["runningTotal"], 2) . "</B></FONT>"; } echo "</td></tr>\n"; echo "</TABLE>\n"; echo "<FORM name='hidden'>\n"; echo "<INPUT Type='hidden' name='alert' value='" . $_SESSION["beep"] . "'>\n"; echo "<INPUT Type='hidden' name='scan' value='" . $_SESSION["scan"] . "'>\n"; echo "<INPUT Type='hidden' name='screset' value='" . $_SESSION["screset"] . "'>\n"; echo "</FORM>"; $_SESSION["beep"] = "noBeep"; $_SESSION["scan"] = "scan"; $_SESSION["screset"] = "stayCool"; // echo $_SESSION["errorMsg"]; }
function printfooter() { $_SESSION["runningTotal"] = $_SESSION["amtdue"]; if ($_SESSION["End"] == 1) { $_SESSION["runningTotal"] = -1 * $_SESSION["change"]; } if ($_SESSION["scale"] == 1) { $weight = number_format($_SESSION["weight"], 2) . "lb."; } else { $weight = "_ _ _ _"; } if (is_numeric($_SESSION["discounttotal"])) { $dbldiscounttotal = number_format($_SESSION["discounttotal"], 2); } else { $dbldiscounttotal = 0.0; $_SESSION["runningTotal"] = 0; } if (!$_SESSION["runningTotal"]) { $_SESSION["runningTotal"] = 0; } if ($_SESSION["isMember"] == 1 || $_SESSION["sc"] == 1) { $labelyousaved = "You Saved"; } else { $labelyousaved = "Could Have Saved"; } if ($_SESSION["percentDiscount"] == 0) { $strpercentdisclabel = "% Discount"; } else { $strpercentdisclabel = $_SESSION["percentDiscount"] . "% Discount"; } echo "</table></td></tr></table>"; echo "<table border='0' cellspacing='0' cellpadding='0'>"; echo "<tr><td width='119' bgcolor='white' align='left'><font face='arial' color='black' size='-1'><b>" . $labelyousaved . "</b></font></td>"; echo "<td width='117' bgcolor='white' align='center'><font face='arial' color='#004080' size='-1'><b>" . $strpercentdisclabel . "</b></font></td>"; echo "<td width='117' bgcolor='white' align='center'><font face='arial' color='#004080' size='-1'><b>Mbr Special</b></font></td>"; $strdiscountlabel = "Special"; // ----------------------First Row Labels --------------------------------------------------------- echo "<td width='117' bgcolor='white' align='center'><font face='arial' color='#004080' size='-1'><b>"; echo $strdiscountlabel . "</b></font></td>"; if ($_SESSION["ttlflag"] == 1 and $_SESSION["End"] != 1) { if ($_SESSION["fntlflag"] == 1) { echo "<td width='170' bgcolor='#800080' align='right'><font face='arial' color='white' size='-1'><b>fs Amount Due</b></font></td></tr>"; } else { echo "<td width='170' bgcolor=#800000 align=right><font face=arial color=white size=-1><b>Amount Due</b></font></td></tr>"; } } elseif ($_SESSION["ttlflag"] == 1 and $_SESSION["End"] == 1) { echo "<td width='170' bgcolor='#004080' align='right'><font face='arial' color='white' size='-1'><b>Change</b></font></td></tr>"; } else { echo "<td width='170' bgcolor='black' align='right'><font face='arial' color='white' size='-1'><b>Total</b></font></td></tr>"; } // ------------------ Second Row blank ----------------------------- echo "<tr><td height='1' colspan='5' bgcolor='black'></td></tr>"; echo "<tr><td height='2' colspan='5'></td></tr>"; // ----------------------------------------------------------------- $special = $_SESSION["memSpecial"] + $_SESSION["staffSpecial"]; if ($_SESSION["isMember"] == 1) { $dblyousaved = number_format($_SESSION["transDiscount"] + $dbldiscounttotal + $special + $_SESSION["memCouponTTL"], 2); $_SESSION["yousaved"] = $dblyousaved; $_SESSION["couldhavesaved"] = 0; $_SESSION["specials"] = number_format($dbldiscounttotal + $special, 2); } else { $dblyousaved = number_format($_SESSION["memSpecial"], 2); $_SESSION["yousaved"] = $dbldiscounttotal + $_SESSION["staffSpecial"]; $_SESSION["couldhavesaved"] = $dblyousaved; $_SESSION["specials"] = $dbldiscounttotal + $_SESSION["staffSpecial"]; } if ($_SESSION["sc"] == 1) { $_SESSION["yousaved"] = $_SESSION["yousaved"] + $_SESSION["scDiscount"]; $dblyousaved = $_SESSION["yousaved"]; } if ($_SESSION["percentDiscount"] != 0 || $_SESSION["memCouponTTL"] > 0) { $strperdiscount = number_format($_SESSION["transDiscount"] + $_SESSION["memCouponTTL"], 2); } else { $strperdiscount = "n/a"; } if ($_SESSION["isMember"] == 1) { $strmemSpecial = number_format($_SESSION["memSpecial"], 2); } else { $strmemSpecial = "n/a"; } if ($_SESSION["End"] == 1) { rePoll(); } if (strlen($_SESSION["endorseType"]) > 0 || $_SESSION["waitforScale"] == 1) { $_SESSION["waitforScale"] = 0; $_SESSION["beep"] = "noBeep"; } if ($_SESSION["scale"] == 0 && $_SESSION["SNR"] == 1) { rePoll(); } if ($_SESSION["cashOverAmt"] != 0) { // apbw/cvr 03/05/05 CashBackBeep twoPairs(); // apbw/cvr 03/05/05 CashBackBeep $_SESSION["cashOverAmt"] = 0; // apbw/cvr 03/05/05 CashBackBeep } echo "<tr><td height='2' colspan='5'></td></tr>"; echo "<tr><td width='119' height='60' align='left' bgcolor='#EEEEEE'><font face='arial' size='+2' color='#004080'><center><b>" . number_format($dblyousaved, 2) . "</b></center></font></td>"; echo "<td width='117' align='center'><font face='arial' color='#808080' size='+1'>" . number_format($strperdiscount, 2) . "</font></td>"; echo "<td width='117' align='center'><font face='arial' color='#808080' size='+1'>" . number_format($strmemSpecial, 2) . "</font></td>"; echo "<td width='117' height='60' align='center'><font face='arial' color='#808080' size='+1'>" . number_format($dbldiscounttotal, 2) . "</font></td>"; if ($_SESSION["ttlflag"] == 1 && $_SESSION["End"] != 1) { if ($_SESSION["fntlflag"] == 1) { echo "<td width='170' height='60' align='center' bgcolor='white'><font face='arial' size='+3' color='#800080'><b>" . number_format($_SESSION["fsEligible"], 2) . "</b></font>"; } else { echo "<td width='170' height='60' align='center' bgcolor='white'><font face='arial' size='+3' color='#800000'><b>" . number_format($_SESSION["runningTotal"], 2) . "</b></font>"; } } elseif ($_SESSION["ttlflag"] == 1 && $_SESSION["End"] == 1) { echo "<td width= '170' height='60' align='center' bgcolor='white'><font face='arial' size='+3' color='#004080'><b>" . number_format($_SESSION["runningTotal"], 2) . "</b></font>"; } else { echo "<td width='170' height='60' align='center'><font face='arial' size='+3'><b>" . number_format($_SESSION["runningTotal"], 2) . "</b></font>"; } echo "</td></tr>\n"; echo "</table\n"; echo "<form name='hidden'>\n"; echo "<input type='hidden' name='alert' value='" . $_SESSION["beep"] . "'>\n"; echo "<input type='hidden' name='scan' value='" . $_SESSION["scan"] . "'>\n"; echo "<input type='hidden' name='screset' value='" . $_SESSION["screset"] . "'>\n"; echo "</form>"; $_SESSION["beep"] = "noBeep"; $_SESSION["scan"] = "scan"; $_SESSION["screset"] = "stayCool"; }