} else { $_SESSION["chargetender"] = 0; } $_SESSION["discounttotal"] = $headerRow["discountTTL"]; $_SESSION["memSpecial"] = $headerRow["memSpecial"]; sql_close($connect); $queryID = "select * from custdata where CardNo = '" . $_SESSION["memberID"] . "'"; $connID = pDataConnect(); $result = sql_query($queryID, $connID); $row = sql_fetch_array($result); if ($row["Type"] == "PC") { $_SESSION["isMember"] = 1; } else { $_SESSION["isMember"] = 0; } $_SESSION["memMsg"] = blueLine($row); sql_close($connID); if ($_SESSION["isMember"] == 1) { $_SESSION["yousaved"] = number_format($_SESSION["transDiscount"] + $_SESSION["discounttotal"] + $_SESSION["memSpecial"] + $_SESSION["memCouponTTL"], 2); $_SESSION["couldhavesaved"] = 0; $_SESSION["specials"] = number_format($_SESSION["discounttotal"] + $_SESSION["memSpecial"], 2); } else { $dblyousaved = number_format($_SESSION["memSpecial"], 2); $_SESSION["yousaved"] = $_SESSION["discounttotal"]; $_SESSION["couldhavesaved"] = number_format($_SESSION["memSpecial"], 2); $_SESSION["specials"] = $_SESSION["discounttotal"]; } // call to transLog, the body of the receipt comes from the view 'receipt' $query = "select * from rp_receipt where register_no = " . $laneno . " and emp_no = " . $cashierNo . " and trans_no = " . $transno . " order by trans_id"; $db = tDataConnect(); $result = sql_query($query, $db);
function staffCharge($arg) { $_SESSION["sc"] = 1; $staffID = substr($arg, 0, 4); $pQuery = "select * from chargecodeView where chargecode = '" . $arg . "'"; $pConn = pDataConnect(); $result = sql_query($pQuery, $pConn); $num_rows = sql_num_rows($result); $row = sql_fetch_array($result); if ($num_rows == 0) { xboxMsg("unable to authenticate staff " . $staffID); $_Session["isStaff"] = 0; // apbw 03/05/05 SCR } else { $_SESSION["isStaff"] = 1; // apbw 03/05/05 SCR $_SESSION["memMsg"] = blueLine($row); $tQuery = "update localtemptrans set card_no = '" . $staffID . "', percentDiscount = 15"; $tConn = tDataConnect(); addscDiscount(); discountnotify(15); sql_query($tQuery, $tConn); getsubtotals(); ttl(); $_SESSION["runningTotal"] = $_SESSION["amtdue"]; tender("MI", $_SESSION["runningTotal"] * 100); } }