<?
	#---------------------------------------------------------------------#
	# This source code is (c)2000 White Pajamas, Inc                      #
	# see http://www.stonekeep.com/license.html for licensing information #
	#---------------------------------------------------------------------#

	#--------------------------------------------------------------------
	# $Id: showext.php3,v 1.8 2000/12/14 19:14:00 shevett Exp $
	#----------------------------------------------------------------
	#
	# Showext - show extra data...
	#
	
	$dquery	= "select ".
			"eschema.elabel,eschema.eflags,ebulk.bvalue,eschema.esequence,eschema.element ".
			"from ".
			"eschema,ebulk ".
			"where ".
			"eschema.etable=ebulk.btable and ".
			"eschema.element=ebulk.belement and ".
			"eschema.etable='$exttable' and ".
			"ebulk.browref=$extrow ".
			"order by ".
			"eschema.esequence";
						

	$extquery=db_query("$dquery");
	while ($extrow = db_fetch_array($extquery)) {
		echo "<tr>\n";
		if (strchr($extrow[eflags],"O") > 0) {
			echo "<td align=right>$extrow[elabel]</td>\n";
			$element = $extrow[element];
			if ($extrow[bvalue] == 0) {
				echo "<td align=left><b>None</td>\n";
			} else {
				$findval = db_query("select elabel from eschema where etable='$exttable' and element='$element' and esequence=$extrow[bvalue]");
				$value = db_fetch_array($findval);
				echo "<td align=left><b>$value[elabel]</td>\n";
			}
			echo "</tr>\n";
			# Throw away the rest
			while (($extrow = db_fetch_array($extquery)) && ($extrow[element] == $element));
		}
		if (!$extrow) {
			break;
		}
		echo "<td align=right>$extrow[elabel]</td>\n";
		echo "<td align=left><b>$extrow[bvalue]</td>\n";
		echo "</tr>\n";
	}
						
?>
