function body_content() { $this->input_header(); echo DisplayLib::printheaderb(); ?> <div class="baseHeight"> <div class="<?php echo $this->color; ?> centeredDisplay"> <img alt="key" src='<?php echo $this->img; ?> ' /> <p> <?php echo $this->msg; ?> </p> </div> </div> <?php Database::getsubtotals(); echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; }
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>'; }
function body_content() { $this->input_header('onsubmit="lookupFormCallback();return false;"'); echo '<div class="baseHeight">'; $id = $_REQUEST['id']; $local = false; if (substr($id, 0, 2) == '_l') { $local = true; $id = substr($id, 2); } $mode = $_REQUEST['mode']; $msg = 'Looking up transaction'; if ($mode == 'verify') { $msg = 'Verifying transaction'; } echo DisplayLib::boxMsg($msg . '<br />Please wait', '', true); echo '</div>'; // baseHeight printf('<input type="hidden" id="refNum" value="%s" />', $id); printf('<input type="hidden" id="local" value="%d" />', $local ? 1 : 0); printf('<input type="hidden" id="lookupMode" value="%s" />', $mode); echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>\n"; $this->add_onload_command('performLookup();'); }
public function getFooter() { $ret = "<div id=\"footer\">" . DisplayLib::printfooter() . "</div>\n" . "</div>\n"; ob_start(); $this->scale_box(); $ret .= ob_get_clean(); return $ret; }
function print_page() { $my_url = $this->page_url; ?> <!DOCTYPE html> <html> <?php echo "<head>"; // 18Aug12 EL Add content/charset. echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n"; echo "<link rel=\"stylesheet\" type=\"text/css\"\n href=\"{$my_url}css/pos.css\">"; // include store css file if it exists if (file_exists(dirname(__FILE__) . '/../store.css')) { echo "<link rel=\"stylesheet\" type=\"text/css\"\n href=\"{$my_url}/store.css\">"; } if (MiscLib::win32()) { echo "<script type=\"text/javascript\"\n src=\"{$my_url}/js/jquery-1.8.3.min.js\"></script>"; } else { echo "<script type=\"text/javascript\"\n src=\"{$my_url}/js/jquery.js\"></script>"; } $this->head_content(); echo "</head>"; echo '<body class="' . $this->body_class . '">'; echo "<div id=\"boundingBox\">"; $this->noinput_header(); echo DisplayLib::printheaderb(); $this->body_content(); echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; echo "</div>"; $this->scale_box(); $this->scanner_scale_polling(false); if (!empty($this->onload_commands)) { echo "\n<script type=\"text/javascript\">\n"; echo "\$(document).ready(function(){\n"; echo $this->onload_commands; echo "});\n"; echo "</script>\n"; } // 18Aug12 EL Moved after ready-script. echo "</body>\n"; print "</html>"; }
function body_content() { $amt = CoreLocal::get("old_ar_balance"); $this->input_header(); ?> <div class="baseHeight"> <?php if ($amt == CoreLocal::get("balance")) { echo DisplayLib::boxMsg(sprintf("Old A/R Balance: \$%.2f<br />\n [Enter] to pay balance now<br />\n [Clear] to leave balance", $amt)); } else { echo DisplayLib::boxMsg(sprintf("Old A/R Balance: \$%.2f<br />\n Total A/R Balance: \$%.2f<br />\n [Enter] to pay old balance<br />\n [Balance] to pay the entire balance<br />\n [Clear] to leave the balance", $amt, CoreLocal::get("balance"))); } echo "</div>"; echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; CoreLocal::set("msgrepeat", 2); }
function body_content() { echo $this->input_header(); ?> <div class="baseHeight"> <?php if (empty($this->msg)) { echo DisplayLib::lastpage(); } else { echo $this->msg; } ?> </div> <?php echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; $this->add_onload_command("\$('#reginput').keyup(function(ev){\n switch(ev.keyCode){\n case 33:\n \$('#reginput').val('U11');\n \$('#formlocal').submit();\n break;\n case 38:\n \$('#reginput').val('U');\n \$('#formlocal').submit();\n break;\n case 34:\n \$('#reginput').val('D11');\n \$('#formlocal').submit();\n break;\n case 40:\n \$('#reginput').val('D');\n \$('#formlocal').submit();\n break;\n }\n });\n"); $this->add_onload_command("undoInstructions();"); }
public function body_content() { $this->input_header(); echo DisplayLib::printheaderb(); echo '<div class="baseHeight">'; echo '<div class=" ' . $this->box_color . ' centeredDisplay">'; echo '<span class="larger">'; echo $this->upc . ' - ' . $this->getItem() . '<br />'; echo 'Item is not eligible'; echo '</span><br />'; echo '<p>'; echo 'Type manager password to override.<br />'; echo '[clear] to go back'; echo '</p>'; echo '</div>'; echo '</div>'; Database::getsubtotals(); echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; $this->add_onload_command("\$('<input type=\"hidden\" name=\"upc\">').val(" . $this->upc . ").appendTo('#formlocal');\n"); }
/** Print the standard footer @return None */ public function footer() { echo '<div id="footer">'; DisplayLib::printfooter(); echo '</div>'; }
function body_content() { $this->input_header(); echo DisplayLib::printheaderb(); ?> <div class="baseHeight"> <?php echo "<div id=\"boxMsg\" class=\"centeredDisplay\">"; echo "<div class=\"boxMsgAlert coloredArea\">"; echo "Waiting for signature"; echo "</div>"; echo "<div class=\"\">"; echo "<div id=\"imgArea\"></div>"; echo '<div class="textArea">'; if (!isset($_REQUEST['amt'])) { $_REQUEST['amt'] = 0.0; } if (!isset($_REQUEST['type'])) { $_REQUEST['type'] = 'Unknown'; } if (!isset($_REQUEST['code'])) { $_REQUEST['code'] = '??'; } echo '$' . sprintf('%.2f', $_REQUEST['amt']) . ' as ' . $_REQUEST['type']; echo '<br />'; echo '<span id="sigInstructions" style="font-size:90%;">'; echo '[enter] to get re-request signature, [clear] to cancel'; echo '</span>'; echo "</div>"; echo "</div>"; // empty class echo "</div>"; // #boxMsg echo "</div>"; // .baseHeight echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; $this->add_onload_command("addToForm('amt', '{$_REQUEST['amt']}');\n"); $this->add_onload_command("addToForm('type', '{$_REQUEST['type']}');\n"); $this->add_onload_command("addToForm('code', '{$_REQUEST['code']}');\n"); CoreLocal::set("boxMsg", ''); CoreLocal::set("msgrepeat", 2); }
public function body_content() { $this->input_header(); echo DisplayLib::printheaderb(); echo '<div class="baseHeight">'; echo '<div class=" ' . $this->box_color . ' centeredDisplay">'; echo $this->stepContent(); echo '</div>'; echo '</div>'; Database::getsubtotals(); echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; $this->add_onload_command("\$('<input type=\"hidden\" name=\"step\">').val(" . $this->step . ").appendTo('#formlocal');\n"); }
function body_content() { $lines = CoreLocal::get('screenLines'); if (!$lines === '' || !is_numeric($lines)) { $lines = 11; } $this->input_header('action="pos2.php" onsubmit="return submitWrapper();"'); if (CoreLocal::get("timeout") != "") { $this->add_onload_command("enableScreenLock();\n"); } $this->add_onload_command("\$('#reginput').keydown(function(ev){\n switch(ev.which){\n case 33:\n parseWrapper('U{$lines}');\n break;\n case 38:\n parseWrapper('U');\n break;\n case 34:\n parseWrapper('D{$lines}');\n break;\n case 40:\n parseWrapper('D');\n break;\n case 9:\n parseWrapper('TFS');\n return false;\n case 69:\n case 101:\n return getScaleWeight();\n }\n });\n"); /* if (CoreLocal::get("msgrepeat") == 1) $this->add_onload_command("submitWrapper();"); */ ?> <div class="baseHeight"> <?php CoreLocal::set("quantity", 0); CoreLocal::set("multiple", 0); CoreLocal::set("casediscount", 0); // set memberID if not set already if (!CoreLocal::get("memberID")) { CoreLocal::set("memberID", "0"); } if (CoreLocal::get("plainmsg") && strlen(CoreLocal::get("plainmsg")) > 0) { echo DisplayLib::printheaderb(); echo "<div class=\"centerOffset\">"; echo DisplayLib::plainmsg(CoreLocal::get("plainmsg")); CoreLocal::set("plainmsg", 0); echo "</div>"; } elseif (!empty($this->display)) { echo $this->display; } else { echo DisplayLib::lastpage(); } echo "</div>"; // end base height echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; if (CoreLocal::get("touchscreen")) { echo '<div style="text-align: center;"> <button type="submit" class="quick_button pos-button coloredBorder" style="margin: 0 10px 0 0;" onclick="parseWrapper(\'QO1001\');"> Items </button> <button type="submit" class="quick_button pos-button coloredBorder" style="margin: 0 10px 0 0;" onclick="parseWrapper(\'QO1002\');"> Total </button> <button type="submit" class="quick_button pos-button coloredBorder" style="margin: 0 10px 0 0;" onclick="parseWrapper(\'QO1003\');"> Member </button> <button type="submit" class="quick_button pos-button coloredBorder" style="margin: 0 10px 0 0;" onclick="parseWrapper(\'QO1004\');"> Tender </button> <button type="submit" class="quick_button pos-button coloredBorder" style="margin: 0 10px 0 0;" onclick="parseWrapper(\'QO1005\');"> Misc </button> </div>'; } }
function body_content() { $this->input_header(); ?> <div class="baseHeight"> <?php $due = CoreLocal::get("amtdue"); if ($this->amt == 0) { $this->amt = $due; } $amt = $this->amt; if (!is_numeric($amt) || abs($amt) < 0.005) { echo DisplayLib::boxMsg("Invalid Amount: {$amt}", "Enter a different amount"); } elseif ($amt > 0 && $due < 0) { echo DisplayLib::boxMsg("Invalid Amount", "Enter a negative amount"); } elseif ($amt < 0 && $due > 0) { echo DisplayLib::boxMsg("Invalid Amount", "Enter a positive amount"); } elseif ($amt > 0) { $msg = "Tender " . sprintf('$%.2f', $amt) . ' using Bitcoin'; echo DisplayLib::boxMsg("[enter] to continue if correct<br>Enter a different amount if incorrect<br>[clear] to cancel", $msg, true); } elseif ($amt < 0) { $msg = "Refund " . sprintf('$%.2f', $amt) . ' using Bitcoin'; echo DisplayLib::boxMsg("[enter] to continue if correct<br>Enter a different amount if incorrect<br>[clear] to cancel", $msg, true); } else { echo DisplayLib::boxMsg("Enter a different amount", "[clear] to cancel", "Invalid Amount"); } CoreLocal::set("msgrepeat", 2); ?> </div> <?php echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; }
function body_content() { $this->input_header("onsubmit=\"return submitWrapper();\" action=\"" . $_SERVER['PHP_SELF'] . "\""); ?> <div class="baseHeight"> <?php // Signature Capture support // If: // a) enabled // b) a Credit transaction // c) Over limit threshold OR a return $isCredit = CoreLocal::get('CacheCardType') == 'CREDIT' || CoreLocal::get('CacheCardType') == '' ? true : false; // gift doesn't set CacheCardType so customer swipes and // cashier types don't overwrite each other's type if (CoreLocal::get('paycard_type') == PaycardLib::PAYCARD_TYPE_GIFT) { $isCredit = false; } $needSig = CoreLocal::get('paycard_amount') > CoreLocal::get('CCSigLimit') || CoreLocal::get('paycard_amount') < 0 ? true : false; $isVoid = CoreLocal::get('paycard_mode') == PaycardLib::PAYCARD_MODE_VOID ? true : false; if (CoreLocal::get("PaycardsSigCapture") == 1 && $isCredit && $needSig && !$isVoid) { echo "<div id=\"boxMsg\" class=\"centeredDisplay\">"; echo "<div class=\"boxMsgAlert coloredArea\">"; echo "Waiting for signature"; echo "</div>"; echo "<div class=\"\">"; echo "<div id=\"imgArea\"></div>"; echo '<div class="textArea">'; echo '$' . sprintf('%.2f', CoreLocal::get('paycard_amount')) . ' as CREDIT'; echo '<br />'; echo '<span id="sigInstructions" style="font-size:90%;">'; echo '[enter] to get re-request signature, [void] ' . _('to reverse the charge'); echo '<br />'; if (isset($_REQUEST['reginput']) && ($_REQUEST['reginput'] == '' || $_REQUEST['reginput'] == 'CL')) { echo '<b>'; } echo '[reprint] to quit & use paper slip'; if (isset($_REQUEST['reginput']) && ($_REQUEST['reginput'] == '' || $_REQUEST['reginput'] == 'CL')) { echo '</b>'; } echo '</span>'; echo "</div>"; echo "</div>"; // empty class echo "</div>"; // #boxMsg UdpComm::udpSend('termSig'); $this->add_onload_command("addToForm('doCapture', '1');\n"); } else { echo DisplayLib::boxMsg(CoreLocal::get("boxMsg"), "", true); UdpComm::udpSend('termApproved'); } CoreLocal::set("CachePanEncBlock", ""); CoreLocal::set("CachePinEncBlock", ""); ?> </div> <?php echo "<div id=\"footer\">"; Database::getsubtotals(); // in case of partial approval shows remainder due echo DisplayLib::printfooter(); echo "</div>"; $rp_type = ''; if (isset($_REQUEST['receipt']) && strlen($_REQUEST['receipt']) > 0) { $rp_type = $_REQUEST['receipt']; $this->add_onload_command("\$('#reginput').val('RP');\n"); $this->add_onload_command("submitWrapper();\n"); } elseif (CoreLocal::get("paycard_type") == PaycardLib::PAYCARD_TYPE_GIFT) { if (CoreLocal::get("paycard_mode") == PaycardLib::PAYCARD_MODE_BALANCE) { $rp_type = "gcBalSlip"; } else { $rp_type = "gcSlip"; } } elseif (CoreLocal::get("paycard_type") == PaycardLib::PAYCARD_TYPE_CREDIT) { $rp_type = "ccSlip"; } elseif (CoreLocal::get("paycard_type") == PaycardLib::PAYCARD_TYPE_ENCRYPTED) { $rp_type = "ccSlip"; } printf("<input type=\"hidden\" id=\"rp_type\" value=\"%s\" />", $rp_type); }
} } else { $arr = array('main_frame' => false, 'target' => '.baseHeight', 'output' => DisplayLib::inputUnknown()); $json = $arr; if (is_object($sd)) { $sd->WriteToScale('errorBeep'); } } } } CoreLocal::set("msgrepeat", 0); if (empty($json)) { echo "{}"; } else { if (isset($json['redraw_footer']) && $json['redraw_footer'] !== False) { $json['redraw_footer'] = DisplayLib::printfooter(); } if (isset($json['scale']) && $json['scale'] !== False) { $display = DisplayLib::scaledisplaymsg($json['scale']); if (is_array($display)) { $json['scale'] = $display['display']; } else { $json['scale'] = $display; } $term_display = DisplayLib::drawNotifications(); if (!empty($term_display)) { $json['term'] = $term_display; } } echo JsonLib::array_to_json($json); }
function body_content() { $this->input_header(); echo DisplayLib::printheaderb(); $mode = FormLib::get('qty-mode', 0); $this->add_onload_command("formAdd('#formlocal','qty-mode','{$mode}');\n"); $item = FormLib::get('entered-item', CoreLocal::get('strEntered')); $this->add_onload_command("formAdd('#formlocal','entered-item','{$item}');\n"); ?> <div class="baseHeight"> <div class="<?php echo $this->box_color; ?> centeredDisplay"> <span class="larger"> <?php echo $this->msg; ?> </span><br /> <p> <?php echo _("enter quantity or clear to cancel"); ?> </p> </div> </div> <?php CoreLocal::set("msgrepeat", 2); CoreLocal::set("item", CoreLocal::get("strEntered")); UdpComm::udpSend('errorBeep'); echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; }
public function testDisplayLib() { $footer = DisplayLib::printfooter(); $this->assertInternalType('string', $footer); $this->assertNotEmpty($footer); $pmsg = DisplayLib::plainmsg('test message'); $this->assertInternalType('string', $pmsg); $this->assertNotEmpty($pmsg); $this->assertContains('test message', $pmsg); $mbox = DisplayLib::msgbox('test msgbox', '', True); $this->assertInternalType('string', $mbox); $this->assertNotEmpty($mbox); $this->assertContains('test msgbox', $mbox); $xbox = DisplayLib::xboxMsg('test xboxMsg'); $this->assertInternalType('string', $xbox); $this->assertNotEmpty($xbox); $this->assertContains('test xboxMsg', $xbox); $bmsg = DisplayLib::boxMsg('test boxMsg', '', True); $this->assertInternalType('string', $bmsg); $this->assertNotEmpty($bmsg); $this->assertContains('test boxMsg', $bmsg); $unk = DisplayLib::inputUnknown(); $this->assertInternalType('string', $unk); $this->assertNotEmpty($unk); $headerb = DisplayLib::printheaderb(); $this->assertInternalType('string', $headerb); $this->assertNotEmpty($headerb); $item = DisplayLib::printItem('name', 'weight', '1.99', 'T', 1); $this->assertInternalType('string', $item); $this->assertNotEmpty($item); $itemC = DisplayLib::printItemColor('004080', 'name', 'weight', '1.99', 'T', 2); $this->assertInternalType('string', $itemC); $this->assertNotEmpty($itemC); $itemH = DisplayLib::printItemColorHilite('004080', 'name', 'weight', '1.99', 'T'); $this->assertInternalType('string', $itemH); $this->assertNotEmpty($itemH); CoreLocal::set('weight', 0); CoreLocal::set('scale', 0); CoreLocal::set('SNR', 0); $basic = DisplayLib::scaledisplaymsg(); $this->assertInternalType('string', $basic); $this->assertEquals('0.00 lb', $basic); $scale_in_out = array('S11000' => '0.00 lb', 'S11001' => '0.01 lb', 'S11' => '_ _ _ _', 'S141' => '_ _ _ _', 'S143' => '0.00 lb', 'S145' => 'err -0', 'S142' => 'error', 'ASDF' => '? ? ? ?', 'S144000' => '0.00 lb', 'S144002' => '0.02 lb'); foreach ($scale_in_out as $input => $output) { $test = DisplayLib::scaledisplaymsg($input); $this->assertInternalType('array', $test); $this->assertArrayHasKey('display', $test); $this->assertEquals($output, $test['display']); } $this->assertEquals(1, CoreLocal::get('scale')); $this->assertEquals(0.02, CoreLocal::get('weight')); CoreLocal::set('SNR', '4011'); $both = DisplayLib::scaledisplaymsg('S11050'); $this->assertInternalType('array', $both); $this->assertArrayHasKey('display', $both); $this->assertArrayHasKey('upc', $both); $this->assertEquals('0.50 lb', $both['display']); $this->assertEquals('4011', $both['upc']); $list = DisplayLib::listItems(0, 0); $this->assertInternalType('string', $list); $rf = DisplayLib::printReceiptFooter(); $this->assertInternalType('string', $rf); $draw = DisplayLib::drawItems(0, 11, 0); $this->assertInternalType('string', $draw); $lp = DisplayLib::lastpage(); $this->assertInternalType('string', $lp); $this->assertEquals($lp, $list); }
function body_content() { $this->input_header("onsubmit=\"return submitWrapper();\""); ?> <div class="baseHeight"> <?php $buttons = is_array(CoreLocal::get('boxMsgButtons')) ? CoreLocal::get('boxMsgButtons') : array(); echo DisplayLib::boxMsg(CoreLocal::get("boxMsg"), "", true, $buttons); echo "</div>"; echo "<div id=\"footer\">"; echo DisplayLib::printfooter(); echo "</div>"; echo '<input type="hidden" id="endorseType" value="' . (isset($_REQUEST['endorse']) ? $_REQUEST['endorse'] : '') . '" />'; echo '<input type="hidden" id="endorseAmt" value="' . (isset($_REQUEST['endorseAmt']) ? $_REQUEST['endorseAmt'] : '') . '" />'; /** Encode the last command entered in the page. With payment terminals facing the customer, input processing may happen in the background and alter the value of strEntered */ echo '<input type="hidden" id="repeat-cmd" value="' . CoreLocal::get('strEntered') . '" />'; CoreLocal::set("boxMsg", ''); CoreLocal::set("boxMsgButtons", array()); CoreLocal::set("msgrepeat", 2); if (!isset($_REQUEST['quiet'])) { MiscLib::errorBeep(); } }
<?php /******************************************************************************* Copyright 2010 Whole Foods Co-op. This file is part of IT CORE. IT CORE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. IT CORE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License in the file license.txt along with IT CORE; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************************/ ini_set('display_errors', 'Off'); include_once dirname(__FILE__) . '/../lib/AutoLoader.php'; echo DisplayLib::printfooter();