<?php
require_once 'modules/admin/models/Package.php';
require_once 'modules/admin/models/PackageTypeGateway.php';
require_once 'modules/admin/views/public/SignupView.php';

/**
* @package Admin
*/
class ViewSignup_3_Summary extends SignupView
{
    var $permission     = '';

    function dispatch()
    {

        $this->initialize();

        // Init some vars
        $this->templateInit();
        $this->currencys = new Currency($this->user);

        // Process the form post
        if($_POST) {
            $this->processFormPost($_REQUEST, @$_REQUEST['formId'], 'cartSummary');
        }

        // Allow Coupons?
        if(@$this->settings->get("Accept Coupons") == 1) {
            $this->tplView->acceptCoupons = true;
        }
        
        //$this->destroyCart();

        // Process the cart summary
        $cartSummary = $this->getCartSummary();
        $this->tplView->cartItems = $cartSummary['items'];
        $this->tplView->cartTotal = $cartSummary['total'];
        $this->tplView->cartCount = $cartSummary['totalCount'];
        
        // Process the progress bar
        $this->tplView->progress = $this->getProgressBar();
        $this->tplView->progressBar = $this->tplView->fetch('progressBar.tpl.php');

        // Store a session to stop us re-adding the last cart item if we hit reload
        $_SESSION['avoidaddpackage'] = true;

        // Output the template
        $this->tplView->display('signup_3_Summary.tpl.php');

        // Show the footer
        $this->tplView->display('signup_footer.tpl.php');


    }
}

?>
