function cleartemptrans() { $db = tDataConnect(); if ($_SESSION["msg"] == 2) { $_SESSION["msg"] = 99; sql_query("update localtemptrans set trans_status = 'X'", $db); } if ($_SESSION["DBMS"] == "mssql") { sql_query("exec clearTempTables", $db); } else { moveTempData(); truncateTempTables(); } sql_close($db); testremote(); loadglobalvalues(); $_SESSION["transno"] = $_SESSION["transno"] + 1; setglobalvalue("TransNo", $_SESSION["transno"]); if ($_SESSION["TaxExempt"] != 0) { $_SESSION["TaxExempt"] = 0; setglobalvalue("TaxExempt", 0); } memberReset(); transReset(); printReset(); getsubtotals(); delete_file(remote_oux()); delete_file(local_inx()); return 1; }
function lockscreen() { if ($_SESSION["timedlogout"] > 0) { if ($_SESSION["LastID"] == 0) { $timeout = $_SESSION["timedlogout"]; setglobalvalue("LoggedIn", 0); echo "<script type=\"text/javascript\">"; echo "logout = setTimeout(\"window.top.location = '/login.php'\", " . $timeout . ");\n"; echo "</script>"; $intAway = 1; $_SESSION["training"] = 0; } } else { if ($_SESSION["lockScreen"] != 0) { echo "<script type=\"text/javascript\">\n"; echo "lockScreen = setTimeout(\"window.location = '/login3.php'\", 180000);\n"; echo "</script>\n"; } else { echo "<script type=\"text/javascript\">\n"; echo "lockScreen = setTimeout(\"window.location = '/reload.php'\", 180000);\n"; echo "</script>\n"; } } }
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); if ($transno == 1) { addactivity(1); } loginscreen(); } elseif ($password == 9999) { setglobalvalue("CashierNo", 9999); setglobalvalue("cashier", "Training Mode"); setglobalvalue("LoggedIn", 1); loadglobalvalues(); $_SESSION["training"] = 1; loginscreen(); } else { $_SESSION["auth_fail"] = 1; header("Location:/login.php"); } } else { if (get_user_info(user_pass($password)) == $global_values["CashierNo"]) { loadglobalvalues(); testremote(); loginscreen(); } else { if (user_pass_priv($password)) { loadglobalvalues();
function needBasedDisc($strl) { if ($_SESSION["needBasedDisc"] != 0) { if (!is_numeric($strl) || $strl > 100 || $strl < 0) { boxMsg("discount invalid"); } else { $query = "select sum(total) as total from localtemptrans where upc = '0000000008005' group by upc"; $db = tDataConnect(); $result = sql_query($query, $db); $num_rows = sql_num_rows($result); if ($num_rows == 0) { $couponTotal = 0; } else { $row = sql_fetch_array($result); $couponTotal = nullwrap($row["total"]); } if ($couponTotal == 0 || $strl == 0) { sql_query("update localtemptrans set percentDiscount = " . $strl, $db); // ------------ NBD gets its own ttl() function. cuz it's special. -------------- $_SESSION["ttlrequested"] = 1; if ($_SESSION["memberID"] == "0") { maindisplay("memsearch.php"); } else { if ($_SESSION["isMember"] == 1) { $query = "INSERT into localtemptrans (datetime, register_no, emp_no, trans_no, upc, description, trans_type, trans_subtype, trans_status, department, quantity, scale, unitPrice, total, regPrice, tax, foodstamp, discount, memDiscount, discountable, discounttype, voided, percentDiscount, ItemQtty, volDiscType, volume, VolSpecial, mixMatch, matched, card_no) select datetime, register_no, emp_no, trans_no, upc, description, trans_type, trans_subtype, trans_status, department, quantity, scale, unitPrice, total, regPrice, tax, foodstamp, discount, memDiscount, discountable, discounttype, voided, percentDiscount, ItemQtty, volDiscType, volume, VolSpecial, mixMatch, matched, card_no from memdiscountadd"; } else { $query = "INSERT into localtemptrans (datetime, register_no, emp_no, trans_no, upc, description, trans_type, trans_subtype, trans_status, department, quantity, scale, unitPrice, total, regPrice, tax, foodstamp, discount, memDiscount, discountable, discounttype, voided, percentDiscount, ItemQtty, volDiscType, volume, VolSpecial, mixMatch, matched, card_no) select datetime, register_no, emp_no, trans_no, upc, description, trans_type, trans_subtype, trans_status, department, quantity, scale, unitPrice, total, regPrice, tax, foodstamp, discount, memDiscount, discountable, discounttype, voided, percentDiscount, ItemQtty, volDiscType, volume, VolSpecial, mixMatch, matched, card_no from memdiscountremove"; } if ($_SESSION["isStaff"] != 0) { $query2 = "INSERT into localtemptrans (datetime, register_no, emp_no, trans_no, upc, description, trans_type, trans_subtype, trans_status, department, quantity, scale, unitPrice, total, regPrice, tax, foodstamp, discount, memDiscount, discountable, discounttype, voided, percentDiscount, ItemQtty, volDiscType, volume, VolSpecial, mixMatch, matched, card_no) select datetime, register_no, emp_no, trans_no, upc, description, trans_type, trans_subtype, trans_status, department, quantity, scale, unitPrice, total, regPrice, tax, foodstamp, discount, memDiscount, discountable, discounttype, voided, percentDiscount, ItemQtty, volDiscType, volume, VolSpecial, mixMatch, matched, card_no from staffdiscountadd"; } else { $query2 = "INSERT into localtemptrans (datetime, register_no, emp_no, trans_no, upc, description, trans_type, trans_subtype, trans_status, department, quantity, scale, unitPrice, total, regPrice, tax, foodstamp, discount, memDiscount, discountable, discounttype, voided, percentDiscount, ItemQtty, volDiscType, volume, VolSpecial, mixMatch, matched, card_no) select datetime, register_no, emp_no, trans_no, upc, description, trans_type, trans_subtype, trans_status, department, quantity, scale, unitPrice, total, regPrice, tax, foodstamp, discount, memDiscount, discountable, discounttype, voided, percentDiscount, ItemQtty, volDiscType, volume, VolSpecial, mixMatch, matched, card_no from staffdiscountremove"; } $mconn = tDataConnect(); $result = sql_query($query, $mconn); $result2 = sql_query($query2, $mconn); $_SESSION["ttlflag"] = 1; setglobalvalue("ttlflag", 1); getsubtotals(); if ($strl > 0) { $discountAmt = truncate2(-1 * ($_SESSION["discountableTotal"] * ($_SESSION["needBasedDisc"] / 100))); addItem($_SESSION["needBasedDisc"] . "FF", $_SESSION["needBasedDisc"] . "% Food For All Discount", "I", "", "C", 0, 0, 1, $discountAmt, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 10, 0, ''); } $amtDue = str_replace(",", "", $_SESSION["amtdue"]); addItem("", "Discount Amt: " . $discountAmt . ", Tax " . truncate2($_SESSION["taxTotal"]), "C", "", "D", 0, 0, 0, $amtDue, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, ''); if ($_SESSION["fntlflag"] == 1) { addItem("", "Foodstamps Eligible", "", "", "D", 0, 0, 0, truncate2($_SESSION["fsEligible"]), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, ''); } } // ------------ end NBDs special ttl() function ------------------ $_SESSION["repeat"] = 0; } lastpage(); } } else { inputUnknown(); } }
function reverseTaxExempt() { addItem("", "** Tax Exemption Reversed **", "", "", "D", 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10); $_SESSION["TaxExempt"] = 0; setglobalvalue("TaxExempt", 0); }