示例#1
0
 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;
 }
示例#2
0
 function parse($str)
 {
     $tmp = explode("QM", $str);
     if (count($tmp) == 2) {
         CoreLocal::set("qmInput", $tmp[0]);
     } else {
         CoreLocal::set("qmInput", "");
     }
     CoreLocal::set("qmNumber", $tmp[count($tmp) - 1]);
     CoreLocal::set("qmCurrentId", CoreLocal::get("currentid"));
     $ret = $this->default_json();
     $plugin_info = new QuickMenus();
     $ret['main_frame'] = $plugin_info->pluginUrl() . '/QMDisplay.php';
     return $ret;
 }
示例#3
0
 function parse($str)
 {
     $ret = $this->default_json();
     if (strlen($str) == 4) {
         CoreLocal::set('qmInput', $str);
         $desc = $this->descriptions[$str];
         $opts = array($desc . ' (Steak)' => 'M', $desc . ' (Risotto)' => 'V', $desc . ' (Squash V)' => 'S');
         if ($str == 1041) {
             $opts[$desc . ' (Kids)'] = 'K';
         }
         CoreLocal::set('qmNumber', $opts);
         $plugin_info = new QuickMenus();
         $ret['main_frame'] = $plugin_info->pluginUrl() . '/QMDisplay.php';
         return $ret;
     } else {
         $flag = strtoupper($str[4]);
         $plu = substr($str, 0, 4);
         $price = $flag == 'K' ? 5.0 : 20.0;
         TransRecord::addRecord(array('upc' => str_pad($plu, 13, '0', STR_PAD_LEFT), 'description' => $this->descriptions[$plu] . ' (' . $flag . ')', 'trans_type' => 'I', 'department' => 235, 'quantity' => 1.0, 'ItemQtty' => 1.0, 'unitPrice' => $price, 'total' => $price, 'regPrice' => $price, 'charflag' => $flag));
         $ret['output'] = DisplayLib::lastpage();
         $ret['redraw_footer'] = True;
         return $ret;
     }
 }