本文整理汇总了PHP中MiscLib::goodBeep方法的典型用法代码示例。如果您正苦于以下问题:PHP MiscLib::goodBeep方法的具体用法?PHP MiscLib::goodBeep怎么用?PHP MiscLib::goodBeep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MiscLib
的用法示例。
在下文中一共展示了MiscLib::goodBeep方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preprocess
function preprocess()
{
$this->upc = "";
$this->found = false;
$this->pricing = array('sale' => false, 'actual_price' => '', 'memPrice' => '', 'description', 'department', 'regular_price');
if (isset($_REQUEST['reginput']) && strtoupper($_REQUEST['reginput']) == "CL") {
// cancel
$this->change_page($this->page_url . "gui-modules/pos2.php");
return false;
} else {
if (isset($_REQUEST['reginput']) || isset($_REQUEST['upc'])) {
// use reginput as UPC unless it's empty
$this->upc = isset($_REQUEST['reginput']) ? $_REQUEST['reginput'] : '';
if ($this->upc == '' && isset($_REQUEST['upc'])) {
$this->upc = $_REQUEST['upc'];
}
$this->upc = str_pad($this->upc, 13, '0', STR_PAD_LEFT);
$db = Database::pDataConnect();
$query = "select inUse,upc,description,normal_price,scale,deposit,\n qttyEnforced,department,local,cost,tax,foodstamp,discount,\n discounttype,specialpricemethod,special_price,groupprice,\n pricemethod,quantity,specialgroupprice,specialquantity,\n mixmatchcode,idEnforced,tareweight,d.dept_name\n from products, departments d where department = d.dept_no\n AND upc = ?";
$prep = $db->prepare($query);
$result = $db->execute($prep, array($this->upc));
$num_rows = $db->num_rows($result);
// lookup item info
if ($num_rows > 0) {
$this->found = true;
$row = $db->fetch_row($result);
$discounttype = MiscLib::nullwrap($row["discounttype"]);
$DiscountObject = null;
// see UPC parser for explanation
$DTClasses = CoreLocal::get("DiscountTypeClasses");
if ($row['discounttype'] < 64 && isset(DiscountType::$MAP[$row['discounttype']])) {
$class = DiscountType::$MAP[$row['discounttype']];
$DiscountObject = new $class();
} else {
if ($row['discounttype'] > 64 && isset($DTClasses[$row['discounttype'] - 64])) {
$class = $DTClasses[$row['discounttype'] - 64];
$DiscountObject = new $class();
} else {
// If the requested discounttype isn't available,
// fallback to normal pricing. Debatable whether
// this should be a hard error.
$DiscountObject = new NormalPricing();
}
}
if ($DiscountObject->isSale()) {
$this->pricing['sale'] = true;
}
$info = $DiscountObject->priceInfo($row, 1);
$this->pricing['actual_price'] = sprintf('$%.2f%s', $info['unitPrice'], $row['scale'] > 0 ? ' /lb' : '');
$this->pricing['regular_price'] = sprintf('$%.2f%s', $info['regPrice'], $row['scale'] > 0 ? ' /lb' : '');
if ($info['memDiscount'] > 0) {
$this->pricing['memPrice'] = sprintf('$%.2f%s', $info['unitPrice'] - $info['memDiscount'], $row['scale'] > 0 ? ' /lb' : '');
}
$this->pricing['description'] = $row['description'];
$this->pricing['department'] = $row['dept_name'];
MiscLib::goodBeep();
}
// user hit enter and there is a valid UPC present
if (isset($_REQUEST['reginput']) && $_REQUEST['reginput'] == '' && $this->found) {
CoreLocal::set("msgrepeat", 1);
CoreLocal::set("strRemembered", $this->upc);
$this->change_page($this->page_url . "gui-modules/pos2.php");
return false;
}
}
}
return true;
}