本文整理汇总了PHP中CoreLocal类的典型用法代码示例。如果您正苦于以下问题:PHP CoreLocal类的具体用法?PHP CoreLocal怎么用?PHP CoreLocal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CoreLocal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
function check($str)
{
// only check & warn once per transaction
if (CoreLocal::get('cashDropWarned') == True) {
return False;
}
// checking one time
CoreLocal::set('cashDropWarned', True);
// cannot check in standalone
if (CoreLocal::get('standalone') == 1) {
return False;
}
// lookup cashier total
$db = Database::mDataConnect();
$q = sprintf("SELECT sum(-total) FROM dtransactions WHERE\n trans_subtype='CA' AND trans_status <> 'X' AND emp_no=%d", CoreLocal::get('CashierNo'));
$r = $db->query($q);
$ttl = 0;
if ($db->num_rows($r) > 0) {
$row = $db->fetch_row($r);
$ttl = $row[0];
}
if ($ttl > CoreLocal::get('cashDropThreshold')) {
return True;
} else {
return False;
}
}
示例2: fetch
/**
Implementation function
@return SQL result object
*/
public function fetch($empNo = false, $laneNo = false, $transNo = false)
{
$op_db = CoreLocal::get('pDatabase');
$sql = Database::tDataConnect();
$join_table = $op_db . $sql->sep() . 'MasterSuperDepts';
$column = 's.super_name';
if (!$sql->table_exists($join_table)) {
$join_table = $op_db . $sql->sep() . 'subdepts';
$column = 's.subdept_name';
}
$query = 'SELECT l.upc,l.trans_type,l.description,
l.total,l.percentDiscount,l.trans_status,
l.charflag,l.scale,l.quantity,l.unitPrice,
l.ItemQtty,l.matched,l.numflag,l.tax,
l.foodstamp,l.trans_id,l.department,
l.trans_subtype,l.regPrice,
' . $column . ' AS category
FROM localtemptrans AS l
LEFT JOIN ' . $join_table . ' AS s ON l.department=s.dept_ID
WHERE trans_type <> \'L\'
ORDER BY trans_id DESC';
if ($empNo && $laneNo && $transNo) {
$query = sprintf("SELECT l.upc,l.trans_type,l.description,\n l.total,l.percentDiscount,l.trans_status,\n l.charflag,l.scale,l.quantity,l.unitPrice,\n l.ItemQtty,l.matched,l.numflag,l.tax,\n l.foodstamp,l.trans_id,l.department,\n l.trans_subtype,l.regPrice,\n " . $column . " AS category \n FROM localtranstoday as l \n LEFT JOIN " . $join_table . " AS s ON l.department=s.dept_ID\n WHERE trans_type <> 'L' AND\n emp_no=%d AND register_no=%d AND trans_no=%d\n AND datetime >= " . $sql->curdate() . "\n ORDER BY trans_id DESC", $empNo, $laneNo, $transNo);
}
$result = $sql->query($query);
return $result;
}
示例3: tender_out
function tender_out($asTender)
{
$ret = $this->default_json();
Database::getsubtotals();
if (CoreLocal::get("amtdue") <= 0.005) {
CoreLocal::set("change", -1 * CoreLocal::get("amtdue"));
$cash_return = CoreLocal::get("change");
if ($asTender != "FS") {
TransRecord::addchange($cash_return, 'CA');
}
CoreLocal::set("End", 1);
$ret['output'] = DisplayLib::printReceiptFooter();
$ret['redraw_footer'] = true;
$ret['receipt'] = 'full';
TransRecord::finalizeTransaction();
} else {
CoreLocal::set("change", 0);
CoreLocal::set("fntlflag", 0);
$ttl_result = PrehLib::ttl();
TransRecord::debugLog('Tender Out (PrehLib): ' . print_r($ttl_result, true));
TransRecord::debugLog('Tender Out (amtdue): ' . print_r(CoreLocal::get('amtdue'), true));
$ret['output'] = DisplayLib::lastpage();
}
return $ret;
}
示例4: preprocess
function preprocess()
{
if (isset($_REQUEST['doLookup'])) {
$ref = $_REQUEST['id'];
$local = $_REQUEST['local'];
$mode = $_REQUEST['mode'];
$obj = null;
$resp = array();
foreach (CoreLocal::get('RegisteredPaycardClasses') as $rpc) {
$obj = new $rpc();
if ($obj->myRefNum($ref)) {
break;
} else {
$obj = null;
}
}
if ($obj === null) {
$resp['output'] = DisplayLib::boxMsg('Invalid Transaction ID' . '<br />Local System Error', '', true);
$resp['confirm_dest'] = MiscLib::base_url() . 'gui-modules/pos2.php';
$resp['cancel_dest'] = MiscLib::base_url() . 'gui-modules/pos2.php';
} else {
if ($local == 0 && $mode == 'verify') {
$resp['output'] = DisplayLib::boxMsg('Cannot Verify - Already Complete' . '<br />Local System Error', '', true);
$resp['confirm_dest'] = MiscLib::base_url() . 'gui-modules/pos2.php';
$resp['cancel_dest'] = MiscLib::base_url() . 'gui-modules/pos2.php';
} else {
$resp = $obj->lookupTransaction($ref, $local, $mode);
}
}
echo JsonLib::array_to_json($resp);
return false;
}
return true;
}
示例5: basicAdminXml
private static function basicAdminXml()
{
$e2e = new MercuryE2E();
$termID = $e2e->getTermID();
$operatorID = CoreLocal::get("CashierNo");
$mcTerminalID = CoreLocal::get('PaycardsTerminalID');
$refNum = $e2e->refnum(CoreLocal::get('LastID'));
$dc_host = CoreLocal::get('PaycardsDatacapLanHost');
if (empty($dc_host)) {
$dc_host = '127.0.0.1';
}
$msgXml = '<?xml version="1.0"?' . '>
<TStream>
<Transaction>
<HostOrIP>' . $dc_host . '</HostOrIP>
<MerchantID>' . $termID . '</MerchantID>
<TerminalID>' . $mcTerminalID . '</TerminalID>
<OperatorID>' . $operatorID . '</OperatorID>
<MerchantLanguage>' . self::caLanguage() . '</MerchantLanguage>
<TranCode>{{TranCode}}</TranCode>
<SecureDevice>{{SecureDevice}}</SecureDevice>
<ComPort>{{ComPort}}</ComPort>
<SequenceNo>{{SequenceNo}}</SequenceNo>
<InvoiceNo>' . $refNum . '</InvoiceNo>
<RefNo>' . $refNum . '</RefNo>
</Transaction>
</TStream>';
return $msgXml;
}
示例6: kickOnSignOut
function kickOnSignOut()
{
if (CoreLocal::get('training') == 1) {
return False;
}
return True;
}
示例7: handle
public function handle($upc, $json)
{
$my_url = MiscLib::base_url();
switch (ltrim($upc, '0')) {
case '8006':
if (CoreLocal::get("memberID") == 0) {
$json['main_frame'] = $my_url . 'gui-modules/memlist.php';
} else {
if (CoreLocal::get("msgrepeat") == 0) {
CoreLocal::set("boxMsg", "<B>" . $total . " stock payment</B><BR>insert form<BR>press [enter] to endorse<P><FONT size='-1'>[clear] to cancel</FONT>");
$ret["main_frame"] = $my_url . "gui-modules/boxMsg2.php?endorse=stock&endorseAmt=" . $total;
}
}
break;
case '8005':
if (CoreLocal::get("memberID") == 0) {
$json['main_frame'] = $my_url . 'gui-modules/memlist.php';
} elseif (CoreLocal::get("isMember") == 0) {
$json['output'] = DisplayLib::boxMsg(_("member discount not applicable"), '', false, DisplayLib::standardClearButton());
} elseif (CoreLocal::get("percentDiscount") > 0) {
$json['output'] = DisplayLib::boxMsg(CoreLocal::get("percentDiscount") . "% discount already applied", '', false, DisplayLib::standardClearButton());
}
break;
}
// magic plu, but other conditions not matched
if ($json['main_frame'] === false && empty($json['output'])) {
$json['output'] = DisplayLib::boxMsg($upc . "<br />is not a valid item", '', false, DisplayLib::standardClearButton());
}
return $json;
}
示例8: draw
/**
Display the notification
@return [string] html
*/
public function draw()
{
if (CoreLocal::get('PaycardsCashierFacing') == '1') {
return '';
}
// style box to look like a little screen
$ret = '<div style="background:#ccc;border:solid 1px black;padding:7px;text-align:center;font-size:120%;">';
$rdy = '<div style="background:#0c0;border:solid 1px black;padding:7px;text-align:center;font-size:120%;">';
switch (CoreLocal::get('ccTermState')) {
case 'swipe':
return $ret . 'Slide<br />Card</div>';
break;
case 'ready':
return $rdy . 'Ready</div>';
break;
case 'pin':
return $ret . 'Enter<br />PIN</div>';
break;
case 'type':
return $ret . 'Card<br />Type</div>';
break;
case 'cashback':
return $ret . 'Cash<br />Back</div>';
break;
}
return '';
}
示例9: errorCheck
public function errorCheck()
{
if ($this->amount - CoreLocal::get('amtdue') > 0 && CoreLocal::get('amtdue') > 0) {
return DisplayLib::boxMsg(_('max tender is ') . CoreLocal::get('amtdue'), _('no change allowed'), false, DisplayLib::standardClearButton());
}
return true;
}
示例10: body_content
public function body_content()
{
echo $this->noinput_header();
?>
<div class="baseHeight">
<?php
if (CoreLocal::get("plainmsg") && strlen(CoreLocal::get("plainmsg")) > 0) {
echo DisplayLib::printheaderb();
echo "<div class=\"centerOffset\">";
echo DisplayLib::plainmsg(CoreLocal::get("plainmsg"));
echo "</div>";
} else {
// No input and no messages, so
// list the items
if (CoreLocal::get("End") == 1) {
echo DisplayLib::printReceiptfooter(true);
} else {
echo DisplayLib::lastpage(true);
}
}
echo "</div>";
// end base height
echo "<div id=\"footer\">";
echo DisplayLib::printfooter(true);
echo '</div>';
}
示例11: check
function check($str)
{
$as_upc = str_pad($str, 13, '0', STR_PAD_LEFT);
if (substr($str, -3) == "QK9") {
$this->remainder = str_replace("QK9", "QM9", $str);
return True;
} else {
if (substr($str, -4) == "QK10") {
$this->remainder = str_replace("QK10", "QM10", $str);
return True;
} else {
if (($as_upc == '0000000001112' || $as_upc == '0000000001113') && CoreLocal::get('msgrepeat') == 0) {
$this->remainder = 'QM708';
return true;
} elseif (preg_match('/(\\d+)\\*0*1112/', $str, $matches) && CoreLocal::get('msgrepeat') == 0) {
$this->remainder = $matches[1] . '*QM708';
return true;
} elseif (preg_match('/(\\d+)\\*0*1113/', $str, $matches) && CoreLocal::get('msgrepeat') == 0) {
$this->remainder = $matches[1] . '*QM708';
return true;
} elseif ($as_upc == '0049999900047') {
$this->remainder = '0049999900048';
return true;
}
}
}
return False;
}
示例12: ajax
protected function ajax()
{
CoreLocal::set("cabReference", $_REQUEST['input']);
$receipt = ReceiptLib::printReceipt('cab', CoreLocal::get('cabReference'));
ReceiptLib::writeLine($receipt);
return 'Done';
}
示例13: preprocess
public function preprocess()
{
$this->upc = FormLib::get('upc');
if (FormLib::get('reginput', false) !== false) {
$inp = FormLib::get('reginput');
if (strtoupper($inp) == 'CL') {
$this->change_page(MiscLib::baseURL() . 'gui-modules/pos2.php');
return false;
}
$dbc = Database::pDataConnect();
$empP = $dbc->prepare('
SELECT emp_no
FROM employees
WHERE EmpActive=1
AND frontendsecurity >= ?
AND (CashierPassword=? OR AdminPassword=?)');
if ($dbc->getValue($empP, array(30, $inp, $inp)) !== false) {
CoreLocal::set('strRemembered', $this->upc);
CoreLocal::set('msgrepeat', 1);
$arr = CoreLocal::get('WicOverride');
if (!is_array($arr)) {
$arr = array();
}
$arr[] = ltrim($this->upc, '0');
CoreLocal::set('WicOverride', $arr);
$this->change_page(MiscLib::baseURL() . 'gui-modules/pos2.php');
return false;
} else {
$this->box_color = 'errorColoredArea';
}
}
return true;
}
示例14: parse
function parse($str)
{
$curID = CoreLocal::get("currentid");
$dbc = Database::tDataConnect();
$query = "SELECT trans_type,tax,foodstamp FROM localtemptrans WHERE trans_id={$curID}";
$res = $dbc->query($query);
if ($dbc->num_rows($res) == 0) {
return True;
}
// shouldn't ever happen
$item = $dbc->fetch_row($res);
$query = "SELECT MAX(id) FROM taxrates";
$res = $dbc->query($query);
$tax_cap = 0;
if ($dbc->num_rows($res) > 0) {
$taxID = $dbc->fetch_row($res);
$max = $taxID[0];
if (!empty($max)) {
$tax_cap = $max;
}
}
$dbc->query($query);
$next_tax = $item['tax'] + 1;
$next_fs = 0;
if ($next_tax > $max) {
$next_tax = 0;
$next_fs = 1;
}
$query = "UPDATE localtemptrans \n set tax={$next_tax},foodstamp={$next_fs} \n WHERE trans_id={$curID}";
$dbc->query($query);
$ret = $this->default_json();
$ret['output'] = DisplayLib::listItems(CoreLocal::get("currenttopid"), $curID);
return $ret;
// maintain item cursor position
}
示例15: addItem
function addItem($row, $quantity, $priceObj)
{
if ($quantity == 0) {
return False;
}
// enforce limit on discounting sale items
$dsi = CoreLocal::get('DiscountableSaleItems');
if ($dsi == 0 && $dsi !== '' && $priceObj->isSale()) {
$row['discount'] = 0;
}
/*
Use "quantity" field in products record as a per-transaction
limit. This is analogous to a similar feature with sale items.
*/
if (!$priceObj->isSale() && $row['quantity'] > 0) {
$db = Database::tDataConnect();
$query = "SELECT SUM(quantity) as qty FROM localtemptrans\n WHERE upc='{$row['upc']}'";
$result = $db->query($query);
if ($db->num_rows($result) > 0) {
$chkRow = $db->fetch_row($result);
if ($chkRow['qty'] + $quantity > $row['quantity']) {
$this->error_msg = _("item only allows ") . $row['quantity'] . _(" per transaction");
return False;
}
}
}
$pricing = $priceObj->priceInfo($row, $quantity);
TransRecord::addRecord(array('upc' => $row['upc'], 'description' => $row['description'], 'trans_type' => 'I', 'trans_subtype' => isset($row['trans_subtype']) ? $row['trans_subtype'] : '', 'department' => $row['department'], 'quantity' => $quantity, 'unitPrice' => $pricing['unitPrice'], 'total' => MiscLib::truncate2($pricing['unitPrice'] * $quantity), 'regPrice' => $pricing['regPrice'], 'scale' => $row['scale'], 'tax' => $row['tax'], 'foodstamp' => $row['foodstamp'], 'discount' => $pricing['discount'], 'memDiscount' => $pricing['memDiscount'], 'discountable' => $row['discount'], 'discounttype' => $row['discounttype'], 'ItemQtty' => $quantity, 'volDiscType' => $row['pricemethod'], 'volume' => $row['quantity'], 'VolSpecial' => $row['groupprice'], 'mixMatch' => $row['mixmatchcode'], 'cost' => isset($row['cost']) ? $row['cost'] * $quantity : 0.0, 'numflag' => isset($row['numflag']) ? $row['numflag'] : 0, 'charflag' => isset($row['charflag']) ? $row['charflag'] : ''));
return true;
}