本文整理汇总了PHP中CoreLocal::set方法的典型用法代码示例。如果您正苦于以下问题:PHP CoreLocal::set方法的具体用法?PHP CoreLocal::set怎么用?PHP CoreLocal::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoreLocal
的用法示例。
在下文中一共展示了CoreLocal::set方法的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: ajax
protected function ajax()
{
$decision = strtoupper(FormLib::get('input', 'CL'));
$ret = array('dest_page' => MiscLib::base_url() . 'gui-modules/pos2.php', 'endorse' => false, 'cleared' => false);
$repeat_cmd = CoreLocal::get('strEntered');
$requested_cmd = FormLib::get('cmd');
if (!empty($requested_cmd)) {
$repeat_cmd = $requested_cmd;
}
if ($decision == "CL") {
CoreLocal::set("msgrepeat", 0);
CoreLocal::set("lastRepeat", '');
CoreLocal::set("toggletax", 0);
CoreLocal::set("togglefoodstamp", 0);
CoreLocal::set("RepeatAgain", false);
$ret['cleared'] = true;
} elseif (strlen($decision) > 0) {
CoreLocal::set("msgrepeat", 1);
CoreLocal::set("strRemembered", $repeat_cmd);
} else {
CoreLocal::set("msgrepeat", 1);
CoreLocal::set("strRemembered", $repeat_cmd);
}
return $ret;
}
示例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()
{
$plugin_info = new QuickMenus();
$this->plugin_url = $plugin_info->pluginUrl() . '/';
$this->offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0;
if (count($_POST) > 0) {
$output = "";
if ($_REQUEST["clear"] == 0) {
$value = $_REQUEST['ddQKselect'];
if ($value === '') {
CoreLocal::set("msgrepeat", 0);
CoreLocal::set("strRemembered", '');
} else {
$output = CoreLocal::get("qmInput") . $value;
CoreLocal::set("msgrepeat", 1);
CoreLocal::set("strRemembered", $output);
CoreLocal::set("currentid", CoreLocal::get("qmCurrentId"));
}
if (!FormLib::validateToken() && is_numeric($value)) {
CoreLocal::set("msgrepeat", 0);
}
}
if (substr(strtoupper($output), 0, 2) == "QM") {
CoreLocal::set("qmNumber", substr($output, 2));
return True;
} else {
$this->change_page($this->page_url . "gui-modules/pos2.php");
}
return False;
}
return True;
}
示例5: preprocess
/**
Input processing function
*/
function preprocess()
{
// a selection was made
if (isset($_REQUEST['search'])) {
$entered = strtoupper($_REQUEST['search']);
if ($entered == "" || $entered == "CL") {
// should be empty string
// javascript causes this input if the
// user presses CL{enter}
// Redirect to main screen
CoreLocal::set("tenderTotal", "0");
$this->change_page($this->page_url . "gui-modules/pos2.php");
return False;
}
if (!empty($entered)) {
// built department input string and set it
// to be the next POS entry
// Redirect to main screen
$input = CoreLocal::get("tenderTotal") . "CQ" . $entered;
CoreLocal::set("msgrepeat", 1);
CoreLocal::set("strRemembered", $input);
$this->change_page($this->page_url . "gui-modules/pos2.php");
return False;
}
}
return True;
}
示例6: suspendorder
/**
Suspends the current transaction
If the remote server is available, it will be suspended
there. Otherwise it is suspended locally.
@return [string] transaction identifier
*/
public static function suspendorder()
{
$query_a = "select emp_no, trans_no from localtemptrans";
$db_a = Database::tDataConnect();
$result_a = $db_a->query($query_a);
$row_a = $db_a->fetch_array($result_a);
$cashier_no = substr("000" . $row_a["emp_no"], -2);
$trans_no = substr("0000" . $row_a["trans_no"], -4);
$trans_num = ReceiptLib::receiptNumber();
if (CoreLocal::get("standalone") == 0) {
$db_a->add_connection(CoreLocal::get("mServer"), CoreLocal::get("mDBMS"), CoreLocal::get("mDatabase"), CoreLocal::get("mUser"), CoreLocal::get("mPass"), false, true);
$cols = Database::getMatchingColumns($db_a, "localtemptrans", "suspended");
$db_a->transfer(CoreLocal::get("tDatabase"), "select {$cols} from localtemptrans", CoreLocal::get("mDatabase"), "insert into suspended ({$cols})");
$db_a->close(CoreLocal::get("mDatabase"), True);
} else {
$query = "insert into suspended select * from localtemptrans";
$result = $db_a->query($query);
}
/* ensure the cancel happens */
$cancelR = $db_a->query("UPDATE localtemptrans SET trans_status='X',charflag='S'");
TransRecord::finalizeTransaction(true);
CoreLocal::set("plainmsg", _("transaction suspended"));
$recall_line = CoreLocal::get("standalone") . " " . CoreLocal::get("laneno") . " " . $cashier_no . " " . $trans_no;
/**
If the transaction is marked as complete but somehow did not
actually finish, this will prevent the suspended receipt from
adding tax/discount lines to the transaction
*/
CoreLocal::set('End', 0);
return $trans_num;
}
示例7: preprocess
function preprocess()
{
if (isset($_REQUEST["selectlist"])) {
/** generate XML based on menu choice **/
switch ($_REQUEST['selectlist']) {
case 'KC':
$this->xml = DatacapCaAdmin::keyChange();
$this->output = 'display';
break;
case 'PD':
$this->xml = DatacapCaAdmin::paramDownload();
$this->output = 'display';
break;
case 'KR':
$this->xml = DatacapCaAdmin::keyReport();
break;
case 'SR':
$this->xml = DatacapCaAdmin::statsReport();
break;
case 'DR':
$this->xml = DatacapCaAdmin::declineReport();
break;
case 'PR':
$this->xml = DatacapCaAdmin::paramReport();
break;
case 'CL':
default:
$this->change_page('PaycardEmvMenu.php');
return false;
}
} elseif (isset($_REQUEST['xml-resp'])) {
/** parse response XML and display a dialog box
or print a receipt **/
$xml = $_REQUEST['xml-resp'];
$output = $_REQUEST['output-method'];
$resp = DatacapCaAdmin::parseResponse($xml);
if ($output == 'display' || $resp['receipt'] === false) {
CoreLocal::set('boxMsg', '<strong>' . $resp['status'] . '</strong><br />' . $resp['msg-text']);
CoreLocal::set('strRemembered', '');
$this->change_page(MiscLib::baseURL() . 'gui-modules/boxMsg2.php');
return false;
} else {
$print_class = CoreLocal::get('ReceiptDriver');
if ($print_class === '' || !class_exists($print_class)) {
$print_class = 'ESCPOSPrintHandler';
}
$PRINT_OBJ = new $print_class();
$receipt_body = implode("\n", $resp['receipt']);
$receipt_body .= "\n\n\n\n\n\n\n";
$receipt_body .= chr(27) . chr(105);
if (session_id() != '') {
session_write_close();
}
$PRINT_OBJ->writeLine($receipt_body);
$this->change_page($this->page_url . "gui-modules/pos2.php");
return false;
}
}
return true;
}
示例8: preReqCheck
/**
Set up state and redirect if needed
@return True or a URL to redirect
*/
public function preReqCheck()
{
if ($this->tender_code == 'CC' && CoreLocal::get('store') == 'wfc') {
CoreLocal::set('kickOverride', true);
}
return true;
}
示例9: preprocess
/**
Input processing function
*/
function preprocess()
{
// a selection was made
if (isset($_REQUEST['search'])) {
$entered = strtoupper($_REQUEST['search']);
if ($entered == "" || $entered == "CL") {
// should be empty string
// javascript causes this input if the
// user presses CL{enter}
// Redirect to main screen
CoreLocal::set("departmentAmount", "0");
$this->change_page($this->page_url . "gui-modules/pos2.php");
return False;
}
if (is_numeric($entered)) {
// built department input string and set it
// to be the next POS entry
// Redirect to main screen
$input = CoreLocal::get("departmentAmount") . "DP" . $entered . "0";
$qty = CoreLocal::get("quantity");
if ($qty != "" & $qty != 1 & $qty != 0) {
$input = $qty . "*" . $input;
}
CoreLocal::set("msgrepeat", 1);
CoreLocal::set("strRemembered", $input);
$this->change_page($this->page_url . "gui-modules/pos2.php");
return False;
}
}
return True;
}
示例10: parse
function parse($str)
{
$ret = $this->default_json();
if ($str == "FNTL") {
$ret['main_frame'] = MiscLib::base_url() . 'gui-modules/fsTotalConfirm.php';
} elseif ($str == "TETL") {
$ret['main_frame'] = MiscLib::base_url() . 'gui-modules/requestInfo.php?class=Totals';
} elseif ($str == "FTTL") {
PrehLib::finalttl();
} elseif ($str == "TL") {
CoreLocal::set('End', 0);
$chk = PrehLib::ttl();
if ($chk !== True) {
$ret['main_frame'] = $chk;
}
} elseif ($str == "MTL") {
$chk = PrehLib::omtr_ttl();
if ($chk !== True) {
$ret['main_frame'] = $chk;
}
} elseif ($str == "WICTL") {
$ttl = PrehLib::wicableTotal();
$ret['output'] = DisplayLib::boxMsg(_('WIC Total') . sprintf(': $%.2f', $ttl), '', true, DisplayLib::standardClearButton());
// return early since output has been set
return $ret;
}
if (!$ret['main_frame']) {
$ret['output'] = DisplayLib::lastpage();
$ret['redraw_footer'] = True;
}
return $ret;
}
示例11: 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;
}
示例12: preprocess
function preprocess()
{
if (isset($_REQUEST["selectlist"])) {
$parser = new PaycardDatacapParser();
switch ($_REQUEST['selectlist']) {
case 'WICON':
CoreLocal::set('WicMode', true);
$this->change_page(MiscLib::baseURL() . 'gui-modules/pos2.php');
return false;
case 'WICOFF':
CoreLocal::set('WicMode', false);
$this->change_page(MiscLib::baseURL() . 'gui-modules/pos2.php');
return false;
case 'WICT':
$plugin = new WicPlugin();
$this->change_page($plugin->pluginURL() . '/WicTenderPage.php');
return false;
break;
case 'CL':
default:
break;
}
$this->change_page(MiscLib::baseURL() . 'gui-modules/pos2.php');
return false;
}
return true;
}
示例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: ajax
protected function ajax()
{
CoreLocal::set("cabReference", $_REQUEST['input']);
$receipt = ReceiptLib::printReceipt('cab', CoreLocal::get('cabReference'));
ReceiptLib::writeLine($receipt);
return 'Done';
}
示例15: preprocess
function preprocess()
{
$me = CoreLocal::get('CashierNo');
$this->security = Authenticate::getPermission($me);
if (isset($_REQUEST['selectlist'])) {
if (!FormLib::validateToken()) {
return false;
}
if (empty($_REQUEST['selectlist'])) {
$this->change_page($this->page_url . "gui-modules/pos2.php");
return False;
} elseif ($_REQUEST['selectlist'] == 'SUSPEND') {
Database::getsubtotals();
if (CoreLocal::get("LastID") == 0) {
CoreLocal::set("boxMsg", _("no transaction in progress"));
CoreLocal::set('boxMsgButtons', array('Dismiss [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();'));
$this->change_page($this->page_url . "gui-modules/boxMsg2.php");
return False;
} else {
// ajax call to end transaction
// and print receipt
$ref = SuspendLib::suspendorder();
$this->add_onload_command("\$.ajax({\n type:'post',\n url:'{$this->page_url}ajax-callbacks/ajax-end.php',\n cache: false,\n data: 'receiptType=suspended&ref={$ref}',\n dataType: 'json',\n success: function(data){\n \$.ajax({\n type:'post',\n url:'{$this->page_url}ajax-callbacks/ajax-transaction-sync.php',\n cache: false,\n success: function(data){\n location='{$this->page_url}gui-modules/pos2.php';\n },\n error: function(e1){\n location='{$this->page_url}gui-modules/pos2.php';\n }\n });\n },\n error: function(e1){\n location='{$this->page_url}gui-modules/pos2.php';\n }\n });");
return True;
}
} else {
if ($_REQUEST['selectlist'] == 'RESUME') {
Database::getsubtotals();
if (CoreLocal::get("LastID") != 0) {
CoreLocal::set("boxMsg", _("transaction in progress"));
CoreLocal::set('boxMsgButtons', array('Dismiss [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();'));
$this->change_page($this->page_url . "gui-modules/boxMsg2.php");
} elseif (SuspendLib::checksuspended() == 0) {
CoreLocal::set("boxMsg", _("no suspended transaction"));
CoreLocal::set('boxMsgButtons', array('Dismiss [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();'));
CoreLocal::set("strRemembered", "");
$this->change_page($this->page_url . "gui-modules/boxMsg2.php");
} else {
$this->change_page($this->page_url . "gui-modules/suspendedlist.php");
}
return False;
} else {
if ($_REQUEST['selectlist'] == 'TR') {
TenderReport::printReport();
$this->change_page($this->page_url . "gui-modules/pos2.php");
return False;
} else {
if ($_REQUEST['selectlist'] == 'OTR' && $this->security >= 30) {
$this->change_page($this->page_url . 'gui-modules/requestInfo.php?class=AnyTenderReportRequest');
return False;
} elseif ($_REQUEST['selectlist'] == 'UNDO' && $this->security >= 30) {
$this->change_page($this->page_url . 'gui-modules/undo.php');
return false;
}
}
}
}
}
return True;
}