本文整理汇总了PHP中tDataConnect函数 的典型用法代码示例。如果您正苦于以下问题:PHP tDataConnect函数的具体用法?PHP tDataConnect怎么用?PHP tDataConnect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tDataConnect函数 的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: checksuspended
function checksuspended()
{
testremote();
$db_a = tDataConnect();
$m_conn = mDataConnect();
$query_local = "select * from suspendedtoday";
$query_remote = "select * from " . trim($_SESSION["mServer"]) . "." . trim($_SESSION["mDatabase"]) . ".dbo.suspendedtoday";
$query = "select * from suspendedlist";
if ($_SESSION["standalone"] == 1) {
if ($_SESSION["remoteDBMS"] == "mssql") {
$result = mssql_query($query_local, $db_a);
} else {
$result = mysql_query($query, $db_a);
}
} else {
if ($_SESSION["remoteDBMS"] == "mssql") {
$result = sql_query($query_remote, $db_a);
} else {
$result = mysql_query($query, $m_conn);
}
}
$num_rows = sql_fetch_array($result);
if ($num_rows == 0) {
return 0;
} else {
return 1;
}
sql_close($db_a);
}
开发者ID:jdpurdyvi, 项目名称:IS4C, 代码行数:29, 代码来源:special.php
示例2: checksuspended
function checksuspended()
{
testremote();
$db_a = tDataConnect();
$m_conn = mDataConnect();
$query_local = "select * from suspendedtoday";
$query_remote = "select * from suspendedtoday";
$query = "select * from suspendedlist";
if ($_SESSION["standalone"] == 1) {
if ($_SESSION["remoteDBMS"] == "mssql") {
$result = mssql_query($query_local, $db_a);
} else {
$result = mysql_query($query, $db_a);
}
} else {
if ($_SESSION["remoteDBMS"] == "mssql") {
$result = sql_query($query_remote, $db_a);
} else {
$result = mysql_query($query_remote, $m_conn);
}
}
# That's just not right, fix it later?
# $num_rows = sql_fetch_array($result);
$num_rows = mysql_num_rows($result);
if ($num_rows == 0) {
return 0;
} else {
return 1;
}
sql_close($db_a);
}
开发者ID:WedgeCoop, 项目名称:IS4C, 代码行数:31, 代码来源:special.php
示例3: couponcode
function couponcode($upc)
{
$man_id = substr($upc, 3, 5);
$fam = substr($upc, 8, 3);
$val = substr($upc, -2);
$db = pDataConnect();
$query = "select * from couponcodes where code = '" . $val . "'";
$result = sql_query($query, $db);
$num_rows = sql_num_rows($result);
if ($num_rows == 0) {
boxMsg("coupon type unknown<br>please enter coupon<br>manually");
} else {
$row = sql_fetch_array($result);
$value = $row["Value"];
$qty = $row["Qty"];
if ($fam == "992") {
$value = truncate2($value);
$_SESSION["couponupc"] = $upc;
$_SESSION["couponamt"] = $value;
maindisplay("coupondeptsearch.php");
} else {
sql_close($db);
$fam = substr($fam, 0, 2);
$query = "select " . "max(unitPrice) as total, " . "max(department) as department, " . "sum(ItemQtty) as qty, " . "sum(case when trans_status = 'C' then -1 else quantity end) as couponqtty " . "from localtemptrans where substring(upc, 4, 5) = '" . $man_id . "' " . "group by substring(upc, 4, 5)";
$db = tDataConnect();
$result = sql_query($query, $db);
$num_rows = sql_num_rows($result);
if ($num_rows > 0) {
$row = sql_fetch_array($result);
if ($row["couponqtty"] < 1) {
boxMsg("Coupon already applied<BR>for this item");
} else {
$dept = $row["department"];
$act_qty = $row["qty"];
if ($qty <= $act_qty) {
if ($value == 0) {
$value = -1 * $row["total"];
}
$value = truncate2($value);
addcoupon($upc, $dept, $value);
lastpage();
} else {
boxMsg("coupon requires " . $qty . "items<BR>there are only " . $act_qty . " item(s)<BR>in this transaction");
}
}
} else {
boxMsg("product not found<BR>in transaction");
}
// sql_close($db);
}
}
}
开发者ID:blynch-newpi, 项目名称:IS4C, 代码行数:52, 代码来源:mcoupon.php
示例4: load
function load()
{
$query_member = "select * from custdata where CardNo = '205203'";
$query_product = "select * from products where upc = '0000000000090'";
$query_localtemptrans = "select * from localtemptrans";
$bdat = pDataConnect();
$result = sql_query($query_product, $bdat);
$result_2 = sql_query($query_member, $bdat);
sql_close($bdat);
$trans = tDataConnect();
$result_3 = sql_query($query_localtemptrans, $trans);
sql_close($trans);
}
开发者ID:blynch-newpi, 项目名称:IS4C, 代码行数:13, 代码来源:login3.php
示例5: moveTempData
function moveTempData()
{
$connection = tDataConnect();
// sql_query("call movetempdata()", $connection);
sql_query("update localtemptrans set trans_type = 'T' where trans_subtype = 'CP'", $connection);
// sql_query("update localtemptrans set trans_type = 'T', trans_subtype = 'IC' where upc in ('0000000008019', '0000000003031', '0000000001014')", $connection);
sql_query("update localtemptrans set upc = 'DISCOUNT', description = upc, department = 0 where trans_status = 'S'", $connection);
sql_query("insert into localtrans select * from localtemptrans", $connection);
sql_query("insert into dtransactions select * from localtemptrans", $connection);
sql_query("insert into activitylog select * from activitytemplog", $connection);
sql_query("insert into alog select * from activitytemplog", $connection);
sql_close($connection);
}
开发者ID:blynch-newpi, 项目名称:IS4C, 代码行数:13, 代码来源:end.php
示例6: clubCard
function clubCard($intItemNum)
{
$query = "select * from localtemptrans where trans_id = " . $intItemNum;
$connection = tDataConnect();
$result = sql_query($query, $connection);
$row = sql_fetch_array($result);
$num_rows = sql_num_rows($result);
if ($num_rows > 0) {
$strUPC = $row["upc"];
$strDescription = $row["description"];
$dblVolSpecial = $row["VolSpecial"];
$dblquantity = -0.5 * $row["quantity"];
$dblTotal = truncate2(-1 * 0.5 * $row["total"]);
// invoked truncate2 rounding function to fix half-penny errors apbw 3/7/05
$strCardNo = $_SESSION["memberID"];
$dblDiscount = $row["discount"];
$dblmemDiscount = $row["memDiscount"];
$intDiscountable = $row["discountable"];
$dblUnitPrice = $row["unitPrice"];
$intScale = nullwrap($row["scale"]);
if ($row["foodstamp"] != 0) {
$intFoodStamp = 1;
} else {
$intFoodStamp = 0;
}
$intdiscounttype = nullwrap($row["discounttype"]);
if ($row["voided"] == 20) {
boxMsg("Discount already taken");
} elseif ($row["trans_type"] == "T" or $row["trans_status"] == "D" or $row["trans_status"] == "V" or $row["trans_status"] == "C") {
boxMsg("Item cannot be discounted");
} elseif (strncasecmp($strDescription, "Club Card", 9) == 0) {
//----- edited by abpw 2/15/05 -----
boxMsg("Item cannot be discounted");
} elseif ($_SESSION["tenderTotal"] < 0 and $intFoodStamp == 1 and -1 * $dblTotal > $_SESSION["fsEligible"]) {
boxMsg("Item already paid for");
} elseif ($_SESSION["tenderTotal"] < 0 and -1 * $dblTotal > $_SESSION["runningTotal"] - $_SESSION["taxTotal"]) {
boxMsg("Item already paid for");
} else {
// --- added partial item desc to club card description - apbw 2/15/05 ---
addItem($strUPC, "Club Card: " . substr($strDescription, 0, 19), "I", "", "J", $row["department"], $dblquantity, $dblUnitPrice, $dblTotal, 0.5 * $row["regPrice"], $intScale, $row["tax"], $intFoodStamp, $dblDiscount, $dblmemDiscount, $intDiscountable, $intdiscounttype, $dblquantity, $row["volDiscType"], $row["volume"], $dblVolSpecial, 0, 0, 0);
$update = "update localtemptrans set voided = 20 where trans_id = " . $intItemNum;
$connection = tDataConnect();
sql_query($update, $connection);
$_SESSION["TTLflag"] = 0;
$_SESSION["TTLRequested"] = 0;
lastpage();
}
}
}
开发者ID:blynch-newpi, 项目名称:IS4C, 代码行数:49, 代码来源:clubCard.php
示例7: setDrawerKickLater
function setDrawerKickLater()
{
// this more complex version can be modified to kick the drawer under whatever circumstances the FE Mgr sees fit
// it currently kicks the drawer *only* for cash in & out
$db = tDataConnect();
$query = "select * from localtemptrans where trans_subtype = 'CA' and total <> 0";
$result = sql_query($query, $db);
$num_rows = sql_num_rows($result);
$row = sql_fetch_array($result);
if ($num_rows != 0) {
$_SESSION["kick"] = 1;
} else {
$_SESSION["kick"] = 0;
}
}
开发者ID:blynch-newpi, 项目名称:IS4C, 代码行数:15, 代码来源:setDrawerKick.php
示例8: loaddata
function loaddata()
{
$query_local = "select * from localtemptrans";
$query_product = "select * from products where upc='0000000000029'";
$db_product = pDataConnect();
$result_pro = sql_query($query_product, $db_product);
$db_local = tDataConnect();
$result_local = sql_query($query_local, $db_local);
$num_rows_local = sql_num_rows($result_local);
if ($num_rows_local > 0) {
$row_local = sql_fetch_array($result_local);
if ($row_local["card_no"] && strlen($row_local["card_no"]) > 0) {
$_SESSION["memberID"] = $row_local["card_no"];
}
}
if ($_SESSION["memberID"] == "0") {
$query_member = "select * from custdata where CardNo = '205203'";
$db_product = pDataConnect();
sql_query($query_member, $db_product);
$_SESSION["memType"] = 0;
$_SESSION["percentDiscount"] = 0;
} else {
$query_member = "select * from custdata where CardNo = '" . $_SESSION["memberID"] . "'";
$db_product = pDataConnect();
$result = sql_query($query_member, $db_product);
if (sql_num_rows($result) > 0) {
$row = sql_fetch_array($result);
$_SESSION["memMsg"] = $row["blueLine"];
$_SESSION["memType"] = $row["memType"];
$_SESSION["percentDiscount"] = $row["Discount"];
if ($row["Type"] == "PC") {
$_SESSION["isMember"] = 1;
} else {
$_SESSION["isMember"] = 0;
}
$_SESSION["isStaff"] = $row["staff"];
$_SESSION["SSI"] = $row["SSI"];
$_SESSION["discountcap"] = $row["MemDiscountLimit"];
if ($_SESSION["SSI"] == 1) {
$_SESSION["memMsg"] .= " #";
}
}
}
sql_close($db_local);
sql_close($db_product);
}
开发者ID:WedgeCoop, 项目名称:IS4C, 代码行数:46, 代码来源:session.php
示例9: if
var ieKey=e.keyCode;
if (ieKey==13) {
document.selectform.submit();
}
else if (ieKey != 0 && ieKey != 38 && ieKey != 40) {
window.top.location = 'pos.php';
};
}
</script>
</head>
<body onLoad='document.forms[0].elements[0].focus();'>
<?php
$query_local = "select register_no, emp_no, trans_no, sum(total) as total from suspendedtoday " . "group by register_no, emp_no, trans_no";
$query_remote = "select register_no, emp_no, trans_no, sum(total) as total from suspendedtoday " . "group by register_no, emp_no, trans_no";
$query = "select * from suspendedlist";
$db_a = tDataConnect();
$m_conn = mDataConnect();
if ($_SESSION["standalone"] == 1) {
if ($_SESSION["remoteDBMS"] == "mssql") {
$result = mssql_query($query_local, $db_a);
} else {
$result = mysql_query($query, $db_a);
}
} else {
if ($_SESSION["remoteDBMS"] == "mssql") {
$result = mssql_query($query_remote, $db_a);
} else {
$result = mysql_query($query_remote, $m_conn);
}
}
$num_rows = sql_num_rows($result);
开发者ID:WedgeCoop, 项目名称:IS4C, 代码行数:31, 代码来源:suspendedlist.php
示例10: blueLine
}
$_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);
$num_rows = sql_num_rows($result);
$receipt = $title . printReceiptHeader($dateTimeStamp, $ref);
// loop through the results to generate the items listing.
for ($i = 0; $i < $num_rows; $i++) {
$row = sql_fetch_array($result);
$receipt .= $row["linetoprint"] . "\n";
}
// The Nitty Gritty:
$member = "Member " . trim($_SESSION["memberID"]);
$your_discount = $_SESSION["transDiscount"] + $_SESSION["memCouponTTL"];
if ($_SESSION["transDiscount"] + $_SESSION["memCouponTTL"] + $_SESSION["specials"] > 0) {
$receipt .= "\n" . centerString("------------------ YOUR SAVINGS -------------------") . "\n";
if ($your_discount > 0) {
$receipt .= " DISCOUNTS: \$" . number_format($your_discount, 2) . "\n";
开发者ID:WedgeCoop, 项目名称:IS4C, 代码行数:31, 代码来源:reprint.php
示例11: printReceipt
function printReceipt($arg1)
{
$receipt = "";
setDrawerKick();
if ($arg1 == "full" and $_SESSION["kick"] != 0) {
// ---- apbw 03/29/05 Drawer Kick Patch
writeLine(chr(27) . chr(112) . chr(0) . chr(48) . "0");
}
/* --------------------------------------------------------------
turn off staff charge receipt printing if toggled - apbw 2/1/05
---------------------------------------------------------------- */
if ($_SESSION["TenderType"] == "MI" and ($_SESSION["receiptToggle"] == 0 or $_SESSION["SCReceipt"] == 0)) {
$_SESSION["noreceipt"] = 1;
}
// apbw 2/15/05 SCR
$dateTimeStamp = time();
// moved by apbw 2/15/05 SCR
// -- Our Reference number for the transaction.
$ref = trim($_SESSION["CashierNo"]) . "-" . trim($_SESSION["laneno"]) . "-" . trim($_SESSION["transno"]);
$_SESSION["noreceipt"] = ($_SESSION["receiptToggle"] + 1) % 2;
if ($_SESSION["noreceipt"] != 1) {
$receipt = printReceiptHeader($dateTimeStamp, $ref);
// call to transLog, the body of the receipt comes from the view 'receipt'
$query = "SELECT * from receipt";
$db = tDataConnect();
$result = sql_query($query, $db);
$num_rows = sql_num_rows($result);
// loop through the results to generate the items listing.
for ($i = 0; $i < $num_rows; $i++) {
$row = sql_fetch_array($result);
$receipt .= $row[0] . "\n";
}
// The Nitty Gritty:
if ($arg1 == "full") {
$member = "Member " . trim($_SESSION["memberID"]);
$your_discount = $_SESSION["transDiscount"] + $_SESSION["memCouponTTL"];
if ($_SESSION["transDiscount"] + $_SESSION["memCouponTTL"] + $_SESSION["specials"] > 0) {
$receipt .= "\n" . centerString("------------------ YOUR SAVINGS -------------------") . "\n";
if ($your_discount > 0) {
$receipt .= " DISCOUNTS: \$" . number_format($your_discount, 2) . "\n";
}
if ($_SESSION["specials"] > 0) {
$receipt .= " SPECIALS: \$" . number_format($_SESSION["specials"], 2) . "\n";
}
$receipt .= centerString("---------------------------------------------------") . "\n";
}
$receipt .= "\n";
// ccm-rle - will need to modify this to equal whatever we choose for non-member I changed the code because we aren't currently using memberships
if (trim($_SESSION["memberID"]) != 2) {
// mem# 99999 = NON-MEMBER
// $receipt .= centerString("Thank You - ".$member)."\n";
$receipt .= centerString("Thank You!") . "\n";
} else {
$receipt .= centerString("Thank You!") . "\n";
}
if ($_SESSION["yousaved"] > 0) {
$receipt .= centerString("You Saved \$" . number_format($_SESSION["yousaved"], 2)) . "\n";
}
if ($_SESSION["couldhavesaved"] > 0 && $_SESSION["yousaved"] > 0) {
$receipt .= centerString("You could have saved an additional \$" . number_format($_SESSION["couldhavesaved"], 2)) . "\n";
} elseif ($_SESSION["couldhavesaved"] > 0) {
$receipt .= centerString("You could have saved \$" . number_format($_SESSION["couldhavesaved"], 2)) . "\n";
}
$receipt .= centerString($_SESSION["receiptFooter1"]) . "\n" . centerString($_SESSION["receiptFooter2"]) . "\n" . centerString($_SESSION["receiptFooter3"]) . "\n" . centerString($_SESSION["receiptFooter4"]) . "\n";
// --- apbw 2/15/05 SCR ---
if ($_SESSION["chargetender"] == 1) {
$receipt = $receipt . printChargeFooterCust($dateTimeStamp, $ref);
}
if ($_SESSION["ccTender"] == 1) {
$receipt = $receipt . printCCFooter($dateTimeStamp, $ref);
}
if ($_SESSION["promoMsg"] == 1) {
promoMsg();
}
$_SESSION["headerprinted"] = 0;
} else {
$dashes = "\n" . centerString("----------------------------------------------") . "\n";
if ($arg1 == "partial") {
$receipt .= $dashes . centerString("* P A R T I A L T R A N S A C T I O N *") . $dashes;
} elseif ($arg1 == "cancelled") {
$receipt .= $dashes . centerString("* T R A N S A C T I O N C A N C E L L E D *") . $dashes;
} elseif ($arg1 == "resume") {
$receipt .= $dashes . centerString("* T R A N S A C T I O N R E S U M E D *") . $dashes . centerString("A complete receipt will be printed\n") . centerString("at the end of the transaction");
} elseif ($arg1 == "suspended") {
$receipt .= $dashes . centerString("* T R A N S A C T I O N S U S P E N D E D *") . $dashes . $option . centerString($ref);
}
}
}
/* --------------------------------------------------------------
print store copy of charge slip regardless of receipt print setting - apbw 2/14/05
---------------------------------------------------------------- */
if ($_SESSION["chargetender"] == 1) {
if ($_SESSION["noreceipt"] == 1) {
$receipt = printChargeFooterStore($dateTimeStamp, $ref);
} else {
$receipt = $receipt . printChargeFooterStore($dateTimeStamp, $ref);
}
}
//-------------------------------------------------------------------
$receipt = $receipt . "\n\n\n\n\n\n\n";
//.........这里部分代码省略.........
开发者ID:Robbt, 项目名称:CCM-IS4C, 代码行数:101, 代码来源:printReceipt.php
示例12: uploadtable
function uploadtable($table)
{
$output = "";
// openlog("is4c_connect", LOG_PID | LOG_PERROR, LOG_LOCAL0);
if ($_SESSION["localPass"] == "") {
$localpass = "";
} else {
$localpass = "-p" . $_SESSION["localPass"];
}
if ($_SESSION["mPass"] == "") {
$serverpass = "";
} else {
$serverpass = "-p" . $_SESSION["mPass"];
}
$upload = "mysqldump -u " . $_SESSION['localUser'] . " " . $localpass . " -t " . $_SESSION['tDatabase'] . " " . $table . " | mysql -h " . $_SESSION['mServer'] . " -u " . $_SESSION["mUser"] . " " . $serverpass . " " . $_SESSION['mDatabase'] . " 2>&1";
// echo $upload;
// ccm-rle 9-21-09 added below to create upload logfile
// $newfile="connectlog.txt";
// $file = fopen ($newfile, "a");
// fwrite($file,$upload);
// fclose($file);
exec($upload, $aResult);
$error = 0;
$output = 0;
foreach ($aResult as $errormsg) {
if ($errormsg && strlen($errormsg) > 0) {
$output = $output . "\n" . $errormsg;
$error = 1;
}
}
if ($error == 1) {
syslog(LOG_WARNING, "uploadtable({$table}) failed; rc: errormsg: '{$output}'");
return 0;
} else {
$t_conn = tDataConnect();
mysql_query("TRUNCATE TABLE " . $table, $t_conn);
return 1;
}
}
开发者ID:Robbt, 项目名称:CCM-IS4C, 代码行数:39, 代码来源:connect.php
示例13: voidupc
function voidupc($upc)
{
$lastpageflag = 1;
$deliflag = 0;
if (strpos($upc, "*") && (strpos($upc, "**") || strpos($upc, "*") == 0 || strpos($upc, "*") == strlen($upc) - 1)) {
$upc = "stop";
} elseif (strpos($upc, "*")) {
$voidupc = explode("*", $upc);
if (!is_numeric($voidupc[0])) {
$upc = "stop";
} else {
$quantity = $voidupc[0];
$upc = $voidupc[1];
$weight = 0;
}
} elseif (!is_numeric($upc) && !strpos($upc, "DP")) {
$upc = "stop";
} else {
$quantity = 1;
$weight = $_SESSION["weight"];
}
if (is_numeric($upc)) {
$upc = substr("0000000000000" . $upc, -13);
if (substr($upc, 0, 3) == "002" && substr($upc, -5) != "00000") {
$scaleprice = substr($upc, 10, 4) / 100;
$upc = substr($upc, 0, 8) . "0000";
$deliflag = 1;
} elseif (substr($upc, 0, 3) == "002" && substr($upc, -5) == "00000") {
$scaleprice = $_SESSION["scaleprice"];
$deliflag = 1;
}
}
if ($upc == "stop") {
inputUnknown();
} else {
$db = tDataConnect();
if ($_SESSION["discounttype"] == 3) {
$query = "select sum(quantity) as voidable, max(scale), as scale, max(volDiscType) as volDiscType " . "from localtemptrans where upc = '" . $upc . "' and discounttype = 3 and unitPrice = " . $_SESSION["caseprice"] . " group by upc";
} elseif ($deliflag == 0) {
$query = "select sum(ItemQtty) as voidable, sum(quantity) as vquantity, max(scale) as scale, " . "max(volDiscType) as volDiscType from localtemptrans where upc = '" . $upc . "' and discounttype <> 3 group by upc, discounttype";
} else {
$query = "select sum(ItemQtty) as voidable, sum(quantity) as vquantity, max(scale) as scale, " . "max(volDiscType) as volDiscType from localtemptrans where upc = '" . $upc . "' and unitPrice = " . $scaleprice . " and discounttype <> 3 group by upc";
}
if ($_SESSION["ddNotify"] == 1) {
$query = "select sum(ItemQtty) as voidable, sum(quantity) as vquantity, max(scale) as scale, " . "max(volDiscType) as volDiscType from localtemptrans where upc = '" . $upc . "' and discounttype <> 3 and discountable = " . $_SESSION["discountable"] . " group by upc, discounttype, discountable";
}
$result = sql_query($query, $db);
$num_rows = sql_num_rows($result);
if ($num_rows == 0) {
boxMsg("Item not found");
} else {
$row = sql_fetch_array($result);
if ($row["scale"] == 1 && $weight > 0) {
$quantity = $weight - $_SESSION["tare"];
$_SESSION["tare"] = 0;
}
$volDiscType = $row["volDiscType"];
$voidable = nullwrap($row["voidable"]);
$VolSpecial = 0;
$volume = 0;
$scale = nullwrap($row["scale"]);
if ($voidable == 0 && $quantity == 1) {
boxMsg("Items already voided");
} elseif ($voidable == 0 && $quantity > 1) {
boxMsg("Items already voided");
} elseif ($scale == 1 && $quantity < 0) {
boxMsg("tare weight cannot be greater than item weight");
} elseif ($voidable < $quantity && $row["scale"] == 1) {
$message = "Void request exceeds<br />weight of item rung in<p><b>You can void up to " . $row["voidable"] . " lb</b></p>";
boxMsg($message);
} elseif ($voidable < $quantity) {
$message = "Void request exceeds<br />number of items rung in<p><b>You can void up to " . $row["voidable"] . "</b></p>";
boxMsg($message);
} else {
unset($result);
//--------------------------------Void Item----------------------------
if ($_SESSION["discounttype"] == 3) {
$query_upc = "select * from localtemptrans where upc = '" . $upc . "' and discounttype = 3 and unitPrice = " . $_SESSION["caseprice"];
} elseif ($deliflag == 0) {
$query_upc = "select * from localtemptrans where upc = '" . $upc . "' and discounttype <> 3";
} else {
$query_upc = "select * from localtemptrans where upc = '" . $upc . "' and unitPrice = " . $scaleprice;
}
$_SESSION["discounttype"] = 9;
$result = sql_query($query_upc, $db);
$row = sql_fetch_array($result);
$ItemQtty = $row["ItemQtty"];
$foodstamp = nullwrap($row["foodstamp"]);
$discounttype = nullwrap($row["discounttype"]);
$mixMatch = nullwrap($row["mixMatch"]);
if ($_SESSION["isMember"] != 1 && $row["discounttype"] == 2 || $_SESSION["isStaff"] == 0 && $row["discounttype"] == 4) {
$unitPrice = $row["regPrice"];
} elseif (($_SESSION["isMember"] == 1 && $row["discounttype"] == 2 || $_SESSION["isStaff"] != 0 && $row["discounttype"] == 4) && $row["unitPrice"] == $row["regPrice"]) {
$db_p = pDataConnect();
$query_p = "select * from products where upc = '" . $upc . "'";
$result_p = sql_query($query_p, $db_p);
$row_p = sql_fetch_array($result_p);
$unitPrice = $row_p["special_price"];
sql_close($db_p);
} else {
//.........这里部分代码省略.........
开发者ID:WedgeCoop, 项目名称:IS4C, 代码行数:101, 代码来源:void.php
示例14: datareload
function datareload()
{
$query_mem = "select * from custdata where CardNo='205203'";
$query_prod = "select * from products where upc='0000000000090'";
$query_temp = "select * from localtemptrans";
$db_bdat = pDataConnect();
sql_query($query_prod, $db_bdat);
sql_query($query_mem, $db_bdat);
sql_close($db_bdat);
$db_trans = tDataConnect();
sql_query($query_temp, $db_trans);
sql_close($db_trans);
$_SESSION["datetimestamp"] = strftime("%Y-%m-%m/%d/%y %T", time());
}
开发者ID:WedgeCoop, 项目名称:IS4C, 代码行数:14, 代码来源:authenticate3.php
示例15: drawitems
function drawitems($top_item, $rows, $highlight)
{
printheaderb();
$query = "select count(*) as count from localtemptrans";
$db = tDataConnect();
$result = sql_query($query, $db);
$row = sql_fetch_array($result);
$rowCount = $row["count"];
sql_close($db);
if ($rowCount == 0) {
if ($_SESSION["training"] != 1) {
plainmsg($_SESSION["welcomeMsg1"] . "<br />" . $_SESSION["welcomeMsg2"] . "<br />" . $_SESSION["welcomeMsg3"]);
} else {
plainmsg($_SESSION["trainingMsg1"] . "<br />" . $_SESSION["trainingMsg2"]);
}
} else {
$query_range = "select * from screendisplay where trans_id >= " . $top_item . " and trans_id <= " . ($top_item + $rows) . " order by trans_id";
$db_range = tDataConnect();
$result_range = sql_query($query_range, $db_range);
$num_rows = sql_num_rows($result_range);
echo "<tr><td width='600' colspan='3'> </td></tr>\n";
for ($i = 0; $i < $num_rows; $i++) {
$row = sql_fetch_array($result_range);
$trans_id = $row["trans_id"];
$description = $row["description"];
$total = $row["total"];
$comment = $row["comment"];
$tf = $row["status"];
$color = $row["lineColor"];
if ($trans_id == $highlight) {
if ($color == "") {
printitemhilite($description, $comment, $total, $tf);
} else {
printitemcolorhilite($color, $description, $comment, $total, $tf);
}
} else {
if ($color == "") {
printitem($description, $comment, $total, $tf);
} else {
printitemcolor($color, $description, $comment, $total, $tf);
}
}
}
sql_close($db_range);
}
}
开发者ID:WedgeCoop, 项目名称:IS4C, 代码行数:46, 代码来源:listitems.php
示例16: addactivity
/**
* Return a thingie based on $paramie
* @param boolean $activity
* @return integer|babyclass
*/
function addactivity($activity)
{
$timeNow = time();
if ($_SESSION["CashierNo"] > 0 && $_SESSION["CashierNo"] < 256) {
$intcashier = $_SESSION["CashierNo"];
} else {
$intcashier = 0;
}
if ($_SESSION["DBMS"] == "mssql") {
$strqtime = "select max(datetime) as maxDateTime, getdate() as rightNow from activitytemplog";
} else {
$strqtime = "select max(datetime) as maxDateTime, now() as rightNow from activitytemplog";
}
$db = tDataConnect();
$result = sql_query($strqtime, $db);
$row = sql_fetch_array($result);
if (!$row || !$row[0]) {
$interval = 0;
} else {
$interval = strtotime($row["rightNow"]) - strtotime($row["maxDateTime"]);
}
$_SESSION["datetimestamp"] = strftime("%Y-%m-%d %H:%M:%S", $timeNow);
$strq = "insert into activitytemplog values (" . "'" . nullwrap($_SESSION["datetimestamp"]) . "', " . nullwrap($_SESSION["laneno"]) . ", " . nullwrap($intcashier) . ", " . nullwrap($_SESSION["transno"]) . ", " . nullwrap($activity) . ", " . nullwrap($interval) . ")";
// echo $strq;
$result = sql_query($strq, $db);
// $_SESSION["datetimestamp"] = time();
sql_close($db);
}
开发者ID:blynch-newpi, 项目名称:IS4C, 代码行数:33, 代码来源:additem.php
示例17: insertltt
function insertltt($register_no, $emp_no, $trans_no)
{
$inserted = 0;
$conn = tDataConnect();
mysql_query("truncate table localtemptrans", $conn);
$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, memType, staff) " . "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, memType, staff " . "from is4c_log.suspended where register_no = " . $register_no . " and emp_no = " . $emp_no . " and trans_no = " . $trans_no;
// ccm-rle 10-1-2009 This is trying to capture the code from above to see if it is being ran
// echo $query;
// $myFile = "querytestlog.txt";
// $fh = fopen($myFile, 'w');
// fwrite($fh, $query);
// fclose($fh);
if (mysql_query($query, $conn)) {
if (mysql_query("truncate table is4c_log.suspended", $conn)) {
$inserted = 1;
}
}
return $inserted;
}
开发者ID:Robbt, 项目名称:CCM-IS4C, 代码行数:19, 代码来源:resume.php
示例18: wmdiscount
function wmdiscount()
{
$sconn = mDataConnect();
$conn2 = tDataConnect();
$volQ = "SELECT * FROM is4c_op.volunteerDiscounts WHERE CardNo = " . $_SESSION["memberID"];
$volR = sql_query($volQ, $sconn);
$row = sql_fetch_array($volR);
$total = $row["total"];
if ($row["staff"] == 3) {
if ($_SESSION["discountableTotal"] > $total) {
$a = $total * 0.15;
// apply 15% disocunt
$b = ($_SESSION["discountableTotal"] - $total) * 0.02;
// apply 2% discount
$c = $a + $b;
$aggdisc = number_format($c / $_SESSION["discountableTotal"] * 100, 2);
// aggregate discount
$_SESSION["transDiscount"] = $c;
$_SESSION["percentDiscount"] = $aggdisc;
} elseif ($_SESSION["discountableTotal"] <= $total) {
$_SESSION["percentDiscount"] = 15;
$_SESSION["transDiscount"] = $_SESSION["discountableTotal"] * 0.15;
}
} elseif ($row["staff"] == 6) {
if ($_SESSION["discountableTotal"] > $total) {
$a = $total * 0.05;
// apply 15% disocunt
$aggdisc = number_format($a / $_SESSION["discountableTotal"] * 100, 2);
// aggregate discount
$_SESSION["transDiscount"] = $a;
$_SESSION["percentDiscount"] = $aggdisc;
} elseif ($_SESSION["discountableTotal"] <= $total) {
$_SESSION["percentDiscount"] = 5;
$_SESSION["transDiscount"] = $_SESSION["discountableTotal"] * 0.05;
}
}
sql_query("update localtemptrans set percentDiscount = " . $_SESSION["percentDiscount"], $conn2);
if ($_SESSION["discountableTotal"] < $total) {
$a = number_format($_SESSION["discountableTotal"] / 20, 2);
$arr = explode(".", $a);
if ($arr[1] >= 75 && $arr[1] != 00) {
$dec = 75;
} elseif ($arr[1] >= 50 && $arr[1] < 75) {
$dec = 50;
} elseif ($arr[1] >= 25 && $arr[1] < 50) {
$dec = 25;
} elseif ($arr[1] >= 00 && $arr[1] < 25) {
$dec = 00;
}
$_SESSION["volunteerDiscount"] = $arr[0] . "." . $dec;
} else {
$_SESSION["volunteerDiscount"] = $total / 20;
}
}
开发者ID:WedgeCoop, 项目名称:IS4C, 代码行数:54, 代码来源:prehkeys.php
krishnaik06/Machine-Learning-in-90-days
阅读:1057| 2022-08-18
1. m文件与m函数的区别所谓 MATLAB 程序,大致分为两类:M 脚本文件 (M-Script) 和 M
阅读:459| 2022-07-18
armancodv/building-energy-model-matlab: It is a small software which is develope
阅读:1110| 2022-08-17
在美元的英文“dollar”里面明明没有字母“s”,为什么美元的符号($)是一条竖线穿过字
阅读:1059| 2022-11-06
OpenZeppelin Contracts is a library for smart contract development. Versions 4.1
阅读:592| 2022-07-29
FGRibreau/import-tweets-to-mastodon: How to import tweets to mastodon (e.g. http
阅读:920| 2022-08-17
mcmtroffaes/latexcodec: Lexer and codec to work with LaTeX code in Python. Inste
阅读:857| 2022-08-12
tboronczyk/localization-middleware: PSR-15 middleware to assist primarily with l
阅读:496| 2022-08-16
长沙城南,有一所以“环保”为名的学校,从1979年创立以来,四易归属、五更其名。 这
阅读:750| 2022-11-06
The package github.com/containrrr/shoutrrr/pkg/util before 0.6.0 are vulnerable
阅读:811| 2022-07-29
请发表评论