From df1722d8ae8c952446adf8400fae33d1dde143ac Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 3 Nov 2007 16:32:00 +0000 Subject: [PATCH] - forgot file for cart ;-) git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@66 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- www/inc/cart_listing.php | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+), 0 deletions(-) create mode 100644 www/inc/cart_listing.php diff --git a/www/inc/cart_listing.php b/www/inc/cart_listing.php new file mode 100644 index 0000000..c598e23 --- /dev/null +++ b/www/inc/cart_listing.php @@ -0,0 +1,63 @@ + +// +---------------------------------------------------------------------- +// | +// | Copyright: See COPYING file that comes with this distribution +// +---------------------------------------------------------------------- +// + +function createCartOverview() +{ + global $parser; + global $error; + global $lang; + + $COOKIE_NAME = "ms_cartid"; + + $cart = new Cart($_COOKIE[$COOKIE_NAME]); + + $p = new Parser("cart.html"); + + $details = ""; + $totalsum = 0; + + // get tickets from cart + foreach ($cart->getTickets() as $ticket) + { + $cartRowTmpl = $p->getVar("ROW"); + $event = $ticket->eventObject(); + + // set event details + $p->setVars($event->getParserData()); + $p->setVar("AMOUNT", $ticket->getAmount()); + + $rowsum = $ticket->getAmount()*$event->getDefaultPrice(); + $p->setVar("ROWSUM", $lang->getPrice($rowsum)); + + $totalsum += $rowsum; + + $details .= $p->parse($cartRowTmpl); + } + + $p->setVar("TABLEROWS", $details); + $p->setVar("TOTALSUM", $lang->getPrice($totalsum)); + + $p->setVar("fieldAMOUNT", "ms_amount[]"); + $p->setVar("buttonSAVE", "ms_save"); + $p->setVar("buttonORDER", "ms_order"); + + // set error message + if ($error->exists()) { + $p->setVar("ERROR", "true"); + $p->setVar("ERRORAREA", $error->getAllFormatted()); + } + + // create page + $parser->setVAR("PAGE", $p->parseFile("cart.html")); +} + + +?> -- 1.7.2.5