diff options
Diffstat (limited to 'ng_selfservice/quotation.php')
-rw-r--r-- | ng_selfservice/quotation.php | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/ng_selfservice/quotation.php b/ng_selfservice/quotation.php index cf455431b..acccf9cb1 100644 --- a/ng_selfservice/quotation.php +++ b/ng_selfservice/quotation.php @@ -58,34 +58,46 @@ if ( isset($quotation['sections']) and count($quotation['sections']) > 0 ) { ); $row = 0; foreach ( $section['detail_items'] as $detail ) { - print( - '<TR CLASS="row' . $row . '">'. - '<TD>' - ); - if ( $detail['pkgnum'] ) { + if (isset($detail['description'])) { + print( + '<TR CLASS="row' . $row . '">'. + '<TD>' + ); + if ( $detail['pkgnum'] ) { + print( + '<A HREF="quotation_remove_pkg.php?pkgnum=' . + $detail['pkgnum'] . '">'. + '<IMG SRC="images/cross.png" /></A>' + ); + } + print( + '</TD>'. + '<TD>'. htmlspecialchars($detail['description']). '</TD>'. + '<TD CLASS="amount">'. $detail['amount']. '</TD>'. + '</TR>'. "\n" + ); + $row = 1 - $row; + } else { + # total rows; a 3.x-ism print( - '<A HREF="quotation_remove_pkg.php?pkgnum=' . - $detail['pkgnum'] . '">'. - '<IMG SRC="images/cross.png" /></A>' + '<TR CLASS="total">'. + '<TD></TD>'. + '<TD>'. htmlspecialchars($detail['total_item']). '</TD>'. + '<TD CLASS="amount">'. $detail['total_amount']. '</TD>'. + '</TR>'."\n" ); } + } + if (isset($section['subtotal'])) { print( - '</TD>'. - '<TD>'. htmlspecialchars($detail['description']). '</TD>'. - '<TD CLASS="amount">'. $detail['amount']. '</TD>'. - '</TR>'. "\n" + '<TR CLASS="total">'. + '<TD></TD>'. + '<TD>Total</TD>'. + '<TD CLASS="amount">'. $section['subtotal']. '</TD>'. + '</TR>' ); - $row = 1 - $row; } - print( - '<TR CLASS="total">'. - '<TD></TD>'. - '<TD>Total</TD>'. - '<TD CLASS="amount">'. $section['subtotal']. '</TD>'. - '</TR>'. - '</TABLE>'. - "\n" - ); + print "</TABLE>\n"; } # foreach $section } |