[0]; $ret .= "[<< View Current Order]\n"; $ret .= "[<< Back to store]"; if ($item =~ /^clothes-(.+)$/) { my $type = $1; my $colors = $it->[1]; my %inv; my $dbr = LJ::get_db_reader(); my $sth = $dbr->prepare("SELECT subitem, avail, price FROM inventory ". "WHERE item='clothes' AND subitem LIKE '$type%'"); $sth->execute; while (my ($si, $avail, $price) = $sth->fetchrow_array) { my ($style, $color, $size) = split(/-/, $si); $inv{$color}->{$size} = [ $avail, $price ]; } $ret .= "Size Chart for details about the sizes. p?>"; $ret .= "
"; foreach my $col (@$colors) { $ret .= "
$LJ::Pay::color{$col}"; foreach my $size (sort { $LJ::Pay::size{$a}->[0] <=> $LJ::Pay::size{$b}->[0] } keys %{$inv{$col}}) { my $inv = $inv{$col}->{$size}; my $price = sprintf("\$%.02f", $inv->[1]); my $avail = $inv->[0]; $ret .= "\n"; } $ret .= "
$LJ::Pay::size{$size}->[1]$price  \n"; if ($avail) { $ret .= "
"; $ret .= LJ::html_hidden("product", "clothes-$type-$col-$size"); $ret .= "
"; } else { $ret .= " [Out of Stock]"; } $ret .= "
"; $ret .= "
\n"; } $ret .= "
"; $ret .= ""; $ret .= ""; } return $ret; } _code?> <=body title=> page?>