예제 #1
0
파일: boxMsg2.php 프로젝트: phpsmith/IS4C
    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();
        }
    }
예제 #2
0
    function body_content()
    {
        $this->add_onload_command("\$('#reginput').focus();\n");
        $info = _("price check");
        $inst = array(_("[scan] item"), _("[clear] to cancel"));
        if (!empty($this->upc)) {
            if (!$this->found) {
                $info = _("not a valid item");
                $inst = array(_("[scan] another item"), _("[clear] to cancel"));
                $this->upc = "";
                MiscLib::errorBeep();
            } else {
                $info = $this->pricing['description'] . '<br />' . $this->pricing['department'] . '<br />' . _("Current Price") . ": " . $this->pricing['actual_price'] . '<br />' . _("Regular Price") . ": " . $this->pricing['regular_price'];
                if (!empty($this->pricing['memPrice'])) {
                    $info .= "<br />(" . _("Member Price") . ": " . $this->pricing['memPrice'] . ")";
                }
                $inst = array(_("[scan] another item"), _("[enter] to ring this item"), _("[clear] to cancel"));
            }
        }
        ?>
        <div class="baseHeight">
        <div class="coloredArea centeredDisplay">
        <span class="larger">
        <?php 
        echo $info;
        ?>
        </span><br />
        <form name="form" id="formlocal" method="post" 
            autocomplete="off" action="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
">
        <input type="text" name="reginput" tabindex="0" 
            onblur="$('#reginput').focus();" id="reginput" />
        <input type="hidden" name="upc" value="<?php 
        echo $this->upc;
        ?>
" />
        </form>
        <p>
        <span id="localmsg"><?php 
        foreach ($inst as $i) {
            echo $i . "<br />";
        }
        ?>
</span>
        </p>
        </div>
        </div>
        <?php 
    }
예제 #3
0
 /**
   Get a centered message box
   @param $strmsg the message
   @param $icon graphic icon file
   @param $noBeep don't send a scale beep
   @param $buttons keyed array of touchable/clickable buttons
     - key is the text shown on the button
     - value is javascript executed onclick
   @return An HTML string
 
   This function will include the header
   printheaderb(). 
 */
 public static function msgbox($strmsg, $icon, $noBeep = false, $buttons = array())
 {
     $ret = self::printheaderb();
     $ret .= "<div id=\"boxMsg\" class=\"centeredDisplay\">";
     $ret .= "<div class=\"boxMsgAlert coloredArea\">";
     $ret .= CoreLocal::get("alertBar");
     if (CoreLocal::get('alertBar') == '') {
         $ret .= 'Alert';
     }
     $ret .= "</div>";
     $ret .= "\n        <div class=\"boxMsgBody\">\n            <div class=\"msgicon\"><img src=\"{$icon}\" /></div>\n            <div class=\"msgtext\">" . $strmsg . "\n            </div>\n            <div class=\"clear\"></div>\n        </div>";
     if (!empty($buttons) && is_array($buttons)) {
         $ret .= '<div class="boxMsgBody boxMsgButtons">';
         foreach ($buttons as $label => $action) {
             $label = preg_replace('/(\\[.+?\\])/', '<span class="smaller">\\1</span>', $label);
             $color = preg_match('/\\[clear\\]/i', $label) ? 'errorColoredArea' : 'coloredArea';
             $ret .= sprintf('<button type="button" class="pos-button %s" 
                     onclick="%s">%s</button>', $color, $action, $label);
         }
         $ret .= '</div>';
     }
     $ret .= "</div>";
     // close #boxMsg
     // input has probably already been marked up for display.
     // no need to re-wrap in various <div>s
     if (strstr($strmsg, 'id="boxMsg"') && strstr($strmsg, 'class="boxMsgBody"')) {
         $ret = $strmsg;
     }
     if (!$noBeep) {
         MiscLib::errorBeep();
     }
     CoreLocal::set("strRemembered", CoreLocal::get("strEntered"));
     CoreLocal::set("msgrepeat", 1);
     return $ret;
 }