本文整理汇总了PHP中MiscLib::scaleObject方法的典型用法代码示例。如果您正苦于以下问题:PHP MiscLib::scaleObject方法的具体用法?PHP MiscLib::scaleObject怎么用?PHP MiscLib::scaleObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MiscLib
的用法示例。
在下文中一共展示了MiscLib::scaleObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preprocess
public function preprocess()
{
$this->box_css_class = 'coloredArea';
$this->msg = _('please enter your password');
$this->body_class = '';
if (isset($_REQUEST['reginput']) || isset($_REQUEST['userPassword'])) {
$passwd = '';
if (isset($_REQUEST['reginput']) && !empty($_REQUEST['reginput'])) {
$passwd = $_REQUEST['reginput'];
UdpComm::udpSend('goodBeep');
} elseif (isset($_REQUEST['userPassword']) && !empty($_REQUEST['userPassword'])) {
$passwd = $_REQUEST['userPassword'];
}
if (Authenticate::checkPassword($passwd)) {
Database::testremote();
$sd = MiscLib::scaleObject();
if (is_object($sd)) {
$sd->ReadReset();
}
/**
Find a drawer for the cashier
*/
$my_drawer = ReceiptLib::currentDrawer();
if ($my_drawer == 0) {
$available = ReceiptLib::availableDrawers();
if (count($available) > 0) {
ReceiptLib::assignDrawer(CoreLocal::get('CashierNo'), $available[0]);
$my_drawer = $available[0];
}
} else {
ReceiptLib::assignDrawer(CoreLocal::get('CashierNo'), $my_drawer);
}
TransRecord::addLogRecord(array('upc' => 'SIGNIN', 'description' => 'Sign In Emp#' . CoreLocal::get('CashierNo')));
/**
Use Kicker object to determine whether the drawer should open
The first line is just a failsafe in case the setting has not
been configured.
*/
if (session_id() != '') {
session_write_close();
}
$kicker_class = CoreLocal::get("kickerModule") == "" ? 'Kicker' : CoreLocal::get('kickerModule');
$kicker_object = new $kicker_class();
if ($kicker_object->kickOnSignIn()) {
ReceiptLib::drawerKick();
}
if ($my_drawer == 0) {
$this->change_page($this->page_url . "gui-modules/drawerPage.php");
} else {
$this->change_page($this->page_url . "gui-modules/pos2.php");
}
return false;
} else {
$this->box_css_class = 'errorColoredArea';
$this->msg = _('password invalid, please re-enter');
}
}
return true;
}
示例2: testMiscLib
public function testMiscLib()
{
chdir(dirname(__FILE__) . '/../../pos/is4c-nf/gui-modules/');
$rel = MiscLib::baseURL();
$this->assertEquals('../', $rel);
$this->assertEquals(1, MiscLib::nullwrap(1));
$this->assertEquals(1.5, MiscLib::nullwrap(1.5));
$this->assertEquals('test', MiscLib::nullwrap('test'));
$this->assertEquals(0, MiscLib::nullwrap(False));
$this->assertEquals(1, MiscLib::truncate2(1));
$this->assertEquals(1.99, MiscLib::truncate2(1.99));
$this->assertEquals(1.99, MiscLib::truncate2("1.99"));
$this->assertEquals(1.35, MiscLib::truncate2("1.345"));
$hostCheck = MiscLib::pingport(CoreLocal::get('localhost'), CoreLocal::get('DBMS'));
$this->assertInternalType('integer', $hostCheck);
$hostCheck = MiscLib::win32();
$this->assertInternalType('integer', $hostCheck);
$scale = MiscLib::scaleObject();
if ($scale !== 0) {
$this->assertInstanceOf('ScaleDriverWrapper', $scale);
}
}
示例3: elseif
$receiptContent[] = ReceiptLib::printReceipt($receiptType, $receiptNum, false, $doEmail);
}
if ($receiptType == "ccSlip" || $receiptType == 'gcSlip') {
// don't mess with reprints
} elseif (CoreLocal::get("autoReprint") == 1) {
CoreLocal::set("autoReprint", 0);
$receiptContent[] = ReceiptLib::printReceipt($receiptType, $receiptNum, true);
}
// use same email class for sending the receipt
// as was used to generate the receipt
$email_class = ReceiptLib::emailReceiptMod();
if ($transFinished) {
CoreLocal::set("End", 0);
$output = $yesSync;
UdpComm::udpSend("termReset");
$sd = MiscLib::scaleObject();
if (is_object($sd)) {
$sd->ReadReset();
}
CoreLocal::set('ccTermState', 'swipe');
uploadAndReset($receiptType);
}
// close session so if printer hangs
// this script won't lock the session file
if (session_id() != '') {
session_write_close();
}
if ($receiptType == "full" && $dokick) {
ReceiptLib::drawerKick();
}
/**
示例4: preprocess
function preprocess()
{
$this->display = "";
$sd = MiscLib::scaleObject();
$entered = "";
if (isset($_REQUEST["reginput"])) {
$entered = strtoupper(trim($_REQUEST["reginput"]));
}
if (substr($entered, -2) == "CL") {
$entered = "CL";
}
if ($entered == "RI") {
$entered = CoreLocal::get("strEntered");
}
if (CoreLocal::get("msgrepeat") == 1 && $entered != "CL") {
$entered = CoreLocal::get("strRemembered");
CoreLocal::set('strRemembered', '');
}
CoreLocal::set("strEntered", $entered);
$json = array();
if ($entered != "") {
if (in_array("Paycards", CoreLocal::get("PluginList"))) {
/* this breaks the model a bit, but I'm putting
* putting the CC parser first manually to minimize
* code that potentially handles the PAN */
if (CoreLocal::get("PaycardsCashierFacing") == "1" && substr($entered, 0, 9) == "PANCACHE:") {
/* cashier-facing device behavior; run card immediately */
$entered = substr($entered, 9);
CoreLocal::set("CachePanEncBlock", $entered);
}
$pe = new paycardEntered();
if ($pe->check($entered)) {
$valid = $pe->parse($entered);
$entered = "PAYCARD";
CoreLocal::set("strEntered", "");
$json = $valid;
}
CoreLocal::set("quantity", 0);
CoreLocal::set("multiple", 0);
}
/* FIRST PARSE CHAIN:
* Objects belong in the first parse chain if they
* modify the entered string, but do not process it
* This chain should be used for checking prefixes/suffixes
* to set up appropriate session variables.
*/
$parser_lib_path = $this->page_url . "parser-class-lib/";
if (!is_array(CoreLocal::get("preparse_chain"))) {
CoreLocal::set("preparse_chain", PreParser::get_preparse_chain());
}
foreach (CoreLocal::get("preparse_chain") as $cn) {
if (!class_exists($cn)) {
continue;
}
$p = new $cn();
if ($p->check($entered)) {
$entered = $p->parse($entered);
}
if (!$entered || $entered == "") {
break;
}
}
if ($entered != "" && $entered != "PAYCARD") {
/*
* SECOND PARSE CHAIN
* these parser objects should process any input
* completely. The return value of parse() determines
* whether to call lastpage() [list the items on screen]
*/
if (!is_array(CoreLocal::get("parse_chain"))) {
CoreLocal::set("parse_chain", Parser::get_parse_chain());
}
$result = False;
foreach (CoreLocal::get("parse_chain") as $cn) {
if (!class_exists($cn)) {
continue;
}
$p = new $cn();
if ($p->check($entered)) {
$result = $p->parse($entered);
break;
}
}
if ($result && is_array($result)) {
// postparse chain: modify result
if (!is_array(CoreLocal::get("postparse_chain"))) {
CoreLocal::set("postparse_chain", PostParser::getPostParseChain());
}
foreach (CoreLocal::get('postparse_chain') as $class) {
if (!class_exists($class)) {
continue;
}
$obj = new $class();
$result = $obj->parse($result);
}
$json = $result;
if (isset($result['udpmsg']) && $result['udpmsg'] !== False) {
if (is_object($sd)) {
$sd->WriteToScale($result['udpmsg']);
}
//.........这里部分代码省略.........