本文整理汇总了PHP中CoreLocal::get方法的典型用法代码示例。如果您正苦于以下问题:PHP CoreLocal::get方法的具体用法?PHP CoreLocal::get怎么用?PHP CoreLocal::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoreLocal
的用法示例。
在下文中一共展示了CoreLocal::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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 '';
}
示例3: 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;
}
示例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: 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>';
}
示例6: __construct
public function __construct($refNum)
{
$this->refNum = $refNum;
$this->today = date('Ymd');
// numeric date only, it goes in an 'int' field as part of the primary key
$this->now = date('Y-m-d H:i:s');
// full timestamp
$this->cashierNo = CoreLocal::get("CashierNo");
$this->laneNo = CoreLocal::get("laneno");
$this->transNo = CoreLocal::get("transno");
$this->transID = CoreLocal::get("paycard_id");
$this->setType(CoreLocal::get('CacheCardType'));
$this->amount = CoreLocal::get("paycard_amount");
if (($this->type == "Debit" || $this->type == "EBTCASH") && $this->amount > CoreLocal::get("amtdue")) {
$this->cashback = $this->amount - CoreLocal::get("amtdue");
$this->amount = CoreLocal::get("amtdue");
} else {
$this->cashback = 0;
}
$this->mode = $this->amount < 0 ? 'Return' : 'Sale';
$this->manual = CoreLocal::get("paycard_keyed") === True ? 1 : 0;
$this->live = 1;
if (CoreLocal::get("training") != 0 || CoreLocal::get("CashierNo") == 9999) {
$this->live = 0;
}
$this->cardholder = 'Cardholder';
}
示例7: ajax
protected function ajax()
{
CoreLocal::set("cabReference", $_REQUEST['input']);
$receipt = ReceiptLib::printReceipt('cab', CoreLocal::get('cabReference'));
ReceiptLib::writeLine($receipt);
return 'Done';
}
示例8: preprocess
function preprocess()
{
if (isset($_REQUEST["selectlist"])) {
$input = $_REQUEST["selectlist"];
if ($input == "CL") {
CoreLocal::set("msgrepeat", 0);
CoreLocal::set("strRemembered", "");
CoreLocal::set("refundComment", "");
} else {
if ($input == "Other") {
return True;
} else {
$input = str_replace("'", "", $input);
CoreLocal::set("strRemembered", CoreLocal::get("refundComment"));
// add comment calls additem(), which wipes
// out refundComment; save it
TransRecord::addcomment("PO: " . $input);
CoreLocal::set("refundComment", CoreLocal::get("strRemembered"));
CoreLocal::set("msgrepeat", 1);
//CoreLocal::set("refund",1);
}
}
$this->change_page($this->page_url . "gui-modules/pos2.php");
return False;
}
return True;
}
示例9: 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;
}
示例10: kickOnSignOut
function kickOnSignOut()
{
if (CoreLocal::get('training') == 1) {
return False;
}
return True;
}
示例11: 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
}
示例12: 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;
}
示例13: 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;
}
}
示例14: 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;
}
示例15: normalize
/**
localtranstoday used to be a view; recreate
it as a table if needed.
*/
public function normalize($db_name, $mode = BasicModel::NORMALIZE_MODE_CHECK, $doCreate = False)
{
if ($db_name == CoreLocal::get('pDatabase')) {
$this->connection = Database::pDataConnect();
} else {
if ($db_name == CoreLocal::get('tDatabase')) {
$this->connection = Database::tDataConnect();
} else {
echo "Error: Unknown database ({$db_name})";
return false;
}
}
if ($this->connection->isView($this->name)) {
if ($mode == BasicModel::NORMALIZE_MODE_CHECK) {
echo "View {$this->name} should be a table!\n";
echo "==========================================\n";
printf("%s table %s\n", "Check complete. Need to drop view & create replacement table.", $this->name);
echo "==========================================\n\n";
return 999;
} else {
$drop = $this->connection->query('DROP VIEW ' . $this->name);
echo "==========================================\n";
printf("Dropping view %s %s\n", $this->name, $drop ? "OK" : "failed");
if ($drop) {
$cResult = $this->create();
printf("Update complete. Creation of table %s %s\n", $this->name, $cResult ? "OK" : "failed");
}
echo "==========================================\n";
return true;
}
} else {
return parent::normalize($db_name, $mode, $doCreate);
}
}