当前位置: 首页>>代码示例>>PHP>>正文


PHP pDataConnect函数代码示例

本文整理汇总了PHP中pDataConnect函数的典型用法代码示例。如果您正苦于以下问题:PHP pDataConnect函数的具体用法?PHP pDataConnect怎么用?PHP pDataConnect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pDataConnect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: 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

示例3: nexttransno

function nexttransno()
{
    $next_trans_no = 1;
    $db = pDataConnect();
    sql_query("update globalvalues set transno = transno + 1", $db);
    $result = sql_query("select transno from globalvalues", $db);
    $num_rows = sql_num_rows($result);
    if ($num_rows != 0) {
        $row = sql_fetch_array($result);
        $next_trans_no = $row["transno"];
    }
    sql_close($db);
}
开发者ID:blynch-newpi,项目名称:IS4C,代码行数:13,代码来源:loadconfig.php

示例4: getChgName

function getChgName()
{
    $query = "select LastName, FirstName from custdata where CardNo = '" . $_SESSION["memberID"] . "'";
    $connection = pDataConnect();
    $result = sql_query($query, $connection);
    $row = sql_fetch_array($result);
    $num_rows = sql_num_rows($result);
    if ($num_rows > 0) {
        if (strlen($_SESSION["memberID"]) != 4) {
            $_SESSION["ChgName"] = $row["LastName"];
        } elseif (strlen($_SESSION["memberID"]) == 4) {
            $LastInit = substr($row["LastName"], 0, 1) . ".";
            $_SESSION["ChgName"] = trim($row["FirstName"]) . " " . $LastInit;
        } else {
            $_SESSION["ChgName"] = $_SESSION["memMsg"];
        }
    }
    sql_close($connection);
}
开发者ID:WedgeCoop,项目名称:IS4C,代码行数:19,代码来源:chgName.php

示例5: strtoupper

    include_once "connect.php";
}
// apbw 5/3/05 BlueSkyFix
if (!function_exists("addcoupon")) {
    include_once "additem.php";
}
// apbw 5/3/05 BlueSkyFix
$dept = strtoupper(trim($_POST["dept"]));
$dept = str_replace(".", "", $dept);
if ($dept == "CL") {
    gohome();
} elseif (is_numeric(substr($dept, 2))) {
    // apbw 5/3/05 BlueSkyFix
    $dept = substr($dept, 2);
    // apbw 5/3/05 BlueSkyFix
    $upc = $_SESSION["couponupc"];
    $val = $_SESSION["couponamt"];
    $query = "select * from departments where dept_no = '" . $dept . "'";
    $db = pDataConnect();
    $result = sql_query($query, $db);
    $num_rows = sql_num_rows($result);
    if ($num_rows != 0) {
        addcoupon($upc, $dept, $val);
        gohome();
    } else {
        header("Location:coupondeptinvalid.php");
    }
    sql_close($db);
} else {
    header("Location:coupondeptinvalid.php");
}
开发者ID:WedgeCoop,项目名称:IS4C,代码行数:31,代码来源:coupondec.php

示例6: upcscanned

function upcscanned($entered)
{
    $hitareflag = 0;
    $entered = str_replace(".", " ", $entered);
    if (strlen($entered) == 0 || !$entered) {
        lastpage();
    } else {
        if ($_SESSION["quantity"] == 0 && $_SESSION["multiple"] == 0) {
            $quantity = 1;
        } else {
            $quantity = $_SESSION["quantity"];
        }
    }
    $scaleprice = 0;
    if (substr($entered, 0, 1) == 0 && strlen($entered) == 7) {
        $p6 = substr($entered, -1);
        if ($p6 == 0) {
            $entered = substr($entered, 0, 3) . "00000" . substr($entered, 3, 3);
        } elseif ($p6 == 1) {
            $entered = substr($entered, 0, 3) . "10000" . substr($entered, 3, 3);
        } elseif ($p6 == 2) {
            $entered = substr($entered, 0, 3) . "20000" . substr($entered, 3, 3);
        } elseif ($p6 == 3) {
            $entered = substr($entered, 0, 4) . "00000" . substr($entered, 4, 2);
        } elseif ($p6 == 4) {
            $entered = substr($entered, 0, 5) . "00000" . substr($entered, 5, 1);
        } else {
            $entered = substr($entered, 0, 6) . "0000" . $p6;
        }
    }
    if (strlen($entered) == 13 && substr($entered, 0, 1) != 0) {
        $upc = "0" . substr($entered, 0, 12);
    } else {
        $upc = substr("0000000000000" . $entered, -13);
    }
    if (substr($upc, 0, 3) == "002") {
        $scaleprice = truncate2(substr($upc, -4) / 100);
        $upc = substr($upc, 0, 8) . "00000";
    }
    $query = "select * from products where upc = '" . $upc . "' AND inUse = 1";
    $db = pDataConnect();
    $result = sql_query($query, $db);
    $num_rows = sql_num_rows($result);
    $row = sql_fetch_array($result);
    $normal_price = $row["normal_price"];
    $special_price = $row["special_price"];
    $cost = 0;
    $deposit = $row["deposit"];
    $dept = $row["department"];
    if ($num_rows == 0 && substr($upc, 0, 3) != "005") {
        $fconn = tDataconnect();
        $datetimestamp = strftime("%Y-%m-%d %H:%M:%S %p", time());
        $inserterror = "insert into failedscans select " . $upc . " as upc, " . $_SESSION["laneno"] . " as lane_no, " . $_SESSION["CashierNo"] . " as emp_no, " . $_SESSION["transno"] . " as trans_no, " . "'" . $datetimestamp . "' as fdate";
        mysql_query($inserterror, $fconn);
        boxMsg($upc . "<br /><b>is not a valid item</b>");
    } elseif ($num_rows == 0 && substr($upc, 0, 3) == "005") {
        couponcode($upc);
    } elseif (($dept == 19 || $dept == 20) && $_SESSION["store"] == "rvm" && $_SESSION["msgrepeat"] == 0 && $_SESSION["carded"] == 0) {
        if ($_SESSION["bdaystatus"] == 99) {
            $boxMsg = "<b>Enter date of birth from valid ID</b><br />in the form mmddyyyy<p><font size=-1>[Clear] to cancel</font></p>";
        }
        if ($_SESSION["bdaystatus"] == -1) {
            $boxMsg = "<b>Invalid date of birth</b><br />re-enter in the form mmddyyyy<p><font size=-1>[Clear] to cancel</font></p>";
        }
        if ($_SESSION["bdaystatus"] == 0) {
            $boxMsg = "<b>Sales of item declined</b><p><font size=-1>[Clear] to cancel</font></p>";
        }
        $_SESSION["boxMsg"] = $boxMsg;
        bdBoxMsgScreen();
    } elseif ($row["scale"] != 0 && $_SESSION["weight"] == 0 && $_SESSION["quantity"] == 0) {
        if ($_SESSION["wgtRequested"] == 0) {
            $_SESSION["wgtRequested"] = 1;
            lastpage();
            echo "<script type=\"text/javascript\">\n" . "lockScreen = setTimeout('document.forms[0].elements[0].value = \"" . $_SESSION["strEntered"] . "\"; document.forms[0].submit();', 700)\n" . "</script>";
        } else {
            $_SESSION["SNR"] = 1;
            boxMsg("please put item on scale");
            $_SESSION["wgtRequested"] = 0;
        }
    } elseif ($row["scale"] != 0 && $_SESSION["scale"] == 0) {
        $_SESSION["waitforScale"] = 1;
        $_SESSION["SNR"] = 1;
        lastpage();
    } elseif ($row["scale"] == 0 && (int) $_SESSION["quantity"] != $_SESSION["quantity"] && $_SESSION["fractions"] != 1) {
        boxMsg("fractional quantity cannot be accepted for this item");
    } elseif ($_SESSION["itemDiscount"] < 0 || $_SESSION["itemDiscount"] > 65) {
        xboxMsg("item cannot be<br />discounted at " . $_SESSION["itemDiscount"] . "%");
        $_SESSION["itemDiscount"] = 0;
    } else {
        $mixMatch = 0;
        $qttyEnforced = $row["qttyEnforced"];
        if ($qttyEnforced == 1 && $_SESSION["multiple"] == 0 && $_SESSION["msgrepeat"] == 0) {
            qttyscreen();
        } else {
            $_SESSION["qttyvalid"] = 1;
        }
        if ($_SESSION["qttyvalid"] != 1) {
            sql_close($db);
        } else {
            $upc = $row["upc"];
//.........这里部分代码省略.........
开发者ID:WedgeCoop,项目名称:IS4C,代码行数:101,代码来源:upcscanned.php

示例7: 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

示例8: strtoupper

    $entered = $_SESSION["idSearch"];
    $_SESSION["idSearch"] = "";
} else {
    $entered = strtoupper(trim($_POST["search"]));
    $entered = str_replace("'", "''", $entered);
}
if (substr($entered, -2) == "ID") {
    $entered = substr($entered, 0, strlen($entered) - 2);
}
if (!$entered || strlen($entered) < 1) {
    $_SESSION["mirequested"] = 0;
    $away = 1;
    gohome();
} else {
    $memberID = $entered;
    $db_a = pDataConnect();
    if (!is_numeric($entered)) {
        $query = "select * from custdata where LastName like '" . $entered . "%' order by LastName, FirstName";
    } else {
        $query = "select * from custdata where CardNo = '" . $entered . "' order by personNum";
    }
    $result = sql_query($query, $db_a);
    $num_rows = sql_num_rows($result);
    if ($num_rows < 1) {
        echo "<body onLoad='document.searchform.search.focus();'>";
        printheaderb();
        membersearchbox("no match found<br />next search or member number");
    } elseif ($num_rows > 1 || !is_numeric($entered)) {
        ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
开发者ID:WedgeCoop,项目名称:IS4C,代码行数:31,代码来源:memlist.php

示例9: 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

示例10: strtotime

 $dateTimeStamp = $headerRow["dateTimeStamp"];
 $dateTimeStamp = strtotime($dateTimeStamp);
 $_SESSION["memberID"] = $headerRow["memberID"];
 $_SESSION["memCouponTLL"] = $headerRow["couponTotal"];
 $_SESSION["transDiscount"] = $headerRow["transDiscount"];
 $_SESSION["chargeTotal"] = -1 * $headerRow["chargeTotal"];
 if ($_SESSION["chargeTotal"] != 0) {
     $_SESSION["chargetender"] = 1;
 } 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);
开发者ID:WedgeCoop,项目名称:IS4C,代码行数:31,代码来源:reprint.php

示例11: ccout

             $errorInfo = "Ref: " . $Reference;
         } else {
             $errorInfo = "Auth: " . $Auth;
         }
         $_SESSION["boxMsg"] = "Error<br>" . $errorInfo . "<p>[clear]";
         //-------added 04/01/05 by CvR---need to save TroutD to void it
         ccout($User1, $Result, $TroutD, 0, $catTroutD);
         //-----
     }
     $_SESSION["ccTender"] = 0;
     boxMsgScreen();
     //-------added 04/02/05 by CvR---to void cc input...
 } elseif ($Result == "VOIDED") {
     $_SESSION["msgrepeat"] = 0;
     $_SESSION["ccTender"] = 1;
     $cn = pDataConnect();
     $selCCOutQ = "SELECT * FROM CC_OUT";
     $selCCOutR = sql_query($selCCOutQ);
     $selCCOutW = sql_fetch_row($selCCOutR);
     tender("CC", $selCCOutW[3] * 100);
     $ccamt = $_SESSION["ccTotal"];
     $trunCCOutQ = "TRUNCATE TABLE CC_OUT";
     $trunCCOutR = sql_query($trunCCOutQ, $cn);
     //-----
     gohome();
 } elseif ($Result == "NOT CAPTURED" && $Reference == "TRY AGAIN") {
     $_SESSION["ccTender"] = 0;
     $_SESSION["boxMsg"] = "Communication error, please try again.<p>[clear]";
     boxMsgScreen();
     //-------added 04/01/05 by CvR---need to save TroutD to void it
     ccout($User1, $Result, $TroutD, 0, $catTroutD);
开发者ID:blynch-newpi,项目名称:IS4C,代码行数:31,代码来源:ccauthorize.php

示例12: staffCharge

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);
    }
}
开发者ID:WedgeCoop,项目名称:IS4C,代码行数:28,代码来源:prehkeys.php

示例13: 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

示例14: save_configurations

function save_configurations($configurations)
{
    // Set all flag fields to 0.
    // Those that have been checked will be reset back to 1.
    $query = 'SELECT conf_id
                FROM `opdata`.`configuration`
                WHERE type = "flag";';
    $result = sql_query($query, pDataConnect());
    for ($i = 0; $i < sql_num_rows($result); $i++) {
        $row = sql_fetch_assoc_array($result);
        $query = 'UPDATE `opdata`.`configuration`
                    SET value = 0
                    WHERE conf_id = "' . $row["conf_id"] . '";';
        $execute = sql_query($query, pDataConnect());
    }
    // Save the configurations to the database.
    foreach ($configurations as $key => $value) {
        $query = 'UPDATE `opdata`.`configuration`
                    SET value = "' . $value . '"
                    WHERE `key` = "' . $key . '";';
        $result = sql_query($query, pDataConnect());
    }
}
开发者ID:WedgeCoop,项目名称:IS4C,代码行数:23,代码来源:query.php

示例15: gohome

    $password = 9999;
}
if ($password == "CL") {
    gohome();
} elseif (!is_numeric($password)) {
    header("Location:nsinvalid.php");
} elseif ($password > "9999" || $password < "1") {
    header("Location:nsinvalid.php");
} else {
    $query_global = "select * from globalvalues";
    $db = pDataConnect();
    $result = sql_query($query_global, $db);
    $row = sql_fetch_array($result);
    if ($password == $row["CashierNo"]) {
        drawerKick();
        gohome();
    } else {
        sql_close($db);
        $query2 = "select emp_no, FirstName, LastName from employees where empactive = 1 and " . "frontendsecurity >= 11 and (cashierpassword = " . $password . " or adminpassword = " . $password . ")";
        $db2 = pDataConnect();
        $result2 = sql_query($query2, $db2);
        $num_row2 = sql_num_rows($result2);
        if ($num_row2 > 0) {
            drawerKick();
            gohome();
        } else {
            header("Location:nsinvalid.php");
        }
    }
    sql_close($db);
}
开发者ID:WedgeCoop,项目名称:IS4C,代码行数:31,代码来源:nsauthenticate.php


注:本文中的pDataConnect函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。