This is the main HTML/PHP code to accept the data. Following this is the classSubway.PHP code which I am attempting to call to obtain some data.
<?
include_once($_SERVER['APPL_PHYSICAL_PATH'] . "functions.php");
include_once("..\classes\classOracleConnection.php");
include_once("..\classes\classSubway.php");
$location = $_SESSION['locationObject'];
$oc = new OracleConnection();
$oc->connect();
extract($_GET);
if( ! isset( $order ) )
$order = "";
if( ! isset( $quantity ) )
$quantity = "";
if( ! isset($jobname) )
$jobname = "";
$o = new Order($order);
if( $o->SubwaySKU != "" ) // if there was any data
$pageOnLoad = "document.forms[0].VAR_Duke_Part_Nbr.focus(); document.forms[0].VAR_Duke_Part_Nbr.select()";
else
$pageOnLoad = "document.forms[0].VAR_Duke_Part_Nbr.focus(); document.forms[0].VAR_Duke_Part_Nbr.select()";
// exit;
?>
<HTML>
<SCRIPT language="javascript">
function getPrinter()
{
return top.document.frames.ODHeader.Printer.value;
}
function getUserID()
{
return top.document.frames.ODHeader.UserID.value;
}
function refreshPage(ord, qty, xml)
{
var URL;
URL = document.location.href;
if( URL.indexOf( "?" ) > -1 )
URL = URL.substring(0, URL.indexOf( "?" ));
URL = URL + "?order=" + ord + "&quantity=" + qty + "&xml=" + xml + "&description=<?=$description?>";
<?
if( isset($specialprocessing) ) {
?>
URL = URL + "&specialprocessing=" + "<?=$specialprocessing?>";
<?
}
?>
document.forms[0].submitbutton.style.visibility = "hidden";
document.forms[0].resetbutton.style.visibility = "hidden";
MessageDiv.innerText = "SEARCHING...";
document.location.href = URL ;
}
function processForm(f)
{
f.printer.value = getPrinter();
f.userID.value = getUserID();
return true;
}
</SCRIPT>
<BODY topmargin=0 bgcolor="#99FFFF" style="font-family: Helvetica" onLoad="<?=$pageOnLoad?>">
<H2>Duke / Subway Label</H2>
<form name="myForm" action="ProcessLabel.php" method="POST" target="ODStatus" onSubmit="return processForm(this);">
<input type=hidden name="xmlfile" value="<?=$_GET['xml']?>">
<? if( ! isset( $specialprocessing ) ) { ?>
<input type=hidden name="format" value="Duke-Subway.lwl">
<? } else { ?>
<input type=hidden name="format" value="">
<input type=hidden name="specialprocessing" value="<?=$specialprocessing?>">
<? } ?>
<input type=hidden name="printer" value="">
<input type=hidden name="userID" value="">
<input type=hidden name="jobname" value="<?=$jobname?>">
Select either Subway or Duke <br>
<input type="radio" name="customer" value="20204"> Subway (20204) <br>
<input type="radio" name="customer" value="21002"> Duke (21002) <br>
<input type=hidden name="VAR_Duke_Part_N" value="<?=$o->SubwaySKU?>">
<input type=hidden name="VAR_Duke_Desc" value="<?=$o->Descrip?>">
<table>
<tr><th align=left>Duke Part Nbr</th><td width=6></td><td><input type="text" name="VAR_Duke_Part_Nbr" size="6" maxlength="6" value="<?=$o->SubwaySKU?>" onChange="refreshPage(this.value, quantity.value, xmlfile.value);"> <div id="MessageDiv"></div></td></tr>
<tr><th align=left>Duke Description </th><td width=25></td><td><?=$o->Descrip?></td></tr>
</table>
Duke Quantity: <input type="text" name="VAR_Duke_Quantity" size="3" maxlength="3" value="1"><br>
Store# : <input type="text" name="VAR_Store_Nbr" size="6" maxlength="6" value="3333"><br>
PO Nbr: <input type="text" name="VAR_PO_Nbr" size="8" maxlength="8" value="PO123"><br>
Metro Order: <input type="text" name="VAR_Metro_Order" size="7" maxlength="7" value="AA1234"><br>
Metro Line#: <input type="text" name="VAR_Metro_Line" size="4" maxlength="4" value="0030"> 
<input type="checkbox" id="truck"> Truck Line<br>
Metro Part#: <input type="text" name="VAR_Metro_Part" size="15" maxlength="15" value="W86P"><br>
Total Metro Ordered Count : <input type="text" name="VAR_Metro_Cnt" size="4" maxlength="4" value="2"><br>
Nbr of Boxes: <input type="text" name="VAR_Quantity" size="7" maxlength="7" value="4"><br><br>
<input name="submitbutton" type="submit" value="Print Labels"><input name="resetbutton" type="reset" value="Clear Fields">
</form>
</BODY>
</HTML>
Here is the classSubway.PHP script.
<?
class Order
{
var $SubwaySKU, $Descrip;
public function __construct($on)
{
if ( $on == "" )
return;
echo "class call";
$f1 = fopen("..\\textfile\SUBWAY.TXT", "rt");
$rcdfound = 0;
while (!feof($f1)) {
$holdf = "";
$holdf = fgets($f1);
$holdf = htmlentities($holdf);
if (substr($holdf, 0, 4) != "TENN") {
list ($this->SubwaySKU,
$this->Descrip) = explode(",",$holdf);
if (rtrim($this->SubwaySku) == rtrim($on)) {
$rcdfound = 1;
break;
};
};
};
fclose ($f1);
if ($rcdfound != 0) {
echo $this->SubwaySKU . " " . $this->Descrip;
}
if ($rcdfound != 1) {
echo "Subway/Duke Number Not Found: " . $on;
$this->SubwaySKU = $on;
$this->Descrip = "";
}
}
}
?>