Esempio n. 1
0
 function parse($str)
 {
     if ($str == "0ID") {
         // Member zero clears member info from the transaction
         PrehLib::clearMember();
         $ret = array("main_frame" => false, "output" => DisplayLib::lastpage(), "target" => ".baseHeight", "redraw_footer" => true);
         return $ret;
     } else {
         if (CoreLocal::get('RestrictDefaultNonMem') == 1 && $str == CoreLocal::get('defaultNonMem') . 'ID') {
             // PrehLib::ttl will automatically prompt for member if it
             // has not been entered; otherwise just total
             $ret = $this->default_json();
             $try = PrehLib::ttl();
             if ($try !== true) {
                 $ret['main_frame'] = $try . '?idSearch=' . CoreLocal::get('defaultNonMem');
             } else {
                 $ret['output'] = DisplayLib::lastpage();
             }
             return $ret;
         } else {
             // always re-apply other member numbers
             $ret = PrehLib::memberID(substr($str, 0, strlen($str) - 2));
             return $ret;
         }
     }
 }
Esempio n. 2
0
 public function handle($upc, $json)
 {
     $db = Database::pDataConnect();
     $query = "select card_no from memberCards where upc='{$upc}'";
     $result = $db->query($query);
     if ($db->num_rows($result) < 1) {
         $json['output'] = DisplayLib::boxMsg(_("Card not assigned"), '', false, DisplayLib::standardClearButton());
         return $json;
     }
     $row = $db->fetch_array($result);
     CoreLocal::set("memberCardUsed", 1);
     $json = PrehLib::memberID($row[0]);
     return $json;
 }