--- /dev/null
+<?php
+// +----------------------------------------------------------------------
+// | PHP Source
+// +----------------------------------------------------------------------
+// | Copyright (C) 2007 by Peter Keller <peter@silmor.de>
+// +----------------------------------------------------------------------
+// |
+// | 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"));
+}
+
+
+?>