CORE POS - IS4C
The CORE POS front end
HW_Parser.php

check() looks for input the module can handle. In this case the module simply watches for the string "HW".

parse() demonstrates a couple options when the correct input is detected. If a transaction is in progress, it displays an error message. Otherwise, it sends the browser to a different display script.

N.B. the HelloWorld display module is just an example; that file does not exist in the gui-modules directory.

<?php
class HW_Parser extends Parser {
function check($str){
if (strtoupper($str) == "HW")
return True;
return False;
}
function parse($str){
global $CORE_LOCAL;
$return_value = $this->default_json();
if ($CORE_LOCAL->get("LastID") != "0"){
$return_value['output'] = DisplayLib::boxMsg("transaction in progress");
}
else {
$return_value['main_frame'] = MiscLib::base_url().'gui-modules/HelloWorld.php';
}
return $return_value;
}
}
?>