1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
#
# xtablestart:
#
# we start by getting the articleNr of our search request
# which is given as argument when dbengine is called
local($nr) = xChop($query->param('articleNr'));
#
# then we remove any leading = which might
# be here if this is a sublist\
if (substr($nr,0,1) eq "=") {
$nr = substr($nr, 1, length($nr)-1);
}
#
# now we make sure that this articleNr is kept in mind\
# if our user chooses to create a new price record
$out->append(-name=>'articleNr',-value=>$nr) if $nr;
#
# and we print our "new" entry and a table start on top of our list
sprintf("<TABLE CELLSPACING=0><TR><TD><A HREF=\"dbengine.cgi?dbase=$dbase&mode=plain&table=$table&%s\"><FONT SIZE=2 FACE=Helvetica>New</FONT></A>\n",$out->query_string);
#
# xtableitem:
#
# ok this item listing starts with getting the ready build HREF to our record
local($href) = $_;
#
# we now start to build our return string beginning with a <TR> tag
$ret = "<TR>";
#
# we add the vendor name
$ret .= "<TD>".$values{'vendor'};
#
# and create an input field for the price whose fieldname has to start with the oid
$ret .= "<TD><INPUT NAME=".$oid."price TYPE=Text SIZE=10 MAXLENGTH=10 VALUE=\"".sprintf("%.2f",$values{'price'})."\">";
#
# finally we complete our record listing with a reference to the full price record around the article No
$ret .= "<TD>".$href.$values{'articleNr'}."</A>";
$ret;
#
# xtableend:
#
# make dure our output is terminated properly
"</TABLE>";
#
# xxquerystring:
#
# take the ready built query string and extend it to order our output by vendor
$_ . "ORDER BY vendor";
|