<?php
/**
* @version		3.0.0
* @package		JomLand TicketCenter
* @copyright	Copyright (C) 2010 JomLand.com. All rights reserved.
* @link 		www.jomland.com
* @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
 
// no direct access
defined('_JEXEC') or die('Restricted access');

$cart = $this->cart;
$currency = $this->params->get('currency_symbol');
$tax =0;
?>

<div class="contentpane<?php echo $this->escape($this->menuparams->get('pageclass_sfx')); ?>">
<h3><?php echo JText::_('Cart');?></h3>

<div id="cart">
    <form name="josForm" id="josForm"  method="post" action="<?php //echo $this->formAction;?>" class="form-validate">
<?php
if($cart){
	if ($this->params->get('cart_countdown',10)>0){?>
		<div id="counter" class="counter row-fluid">
			<span><?php echo JText::_('CART_EXPIRED')?></span>
			<span class="countdown_num" id="countdown_min"></span>
			<span id="countdown_separate"> : </span>
			<span class="countdown_num" id="countdown_sec"></span>
		</div>

<?php }?>


	<?php echo $this->loadTemplate('cart_table');?>

        <div class="row-fluid span12">
            <div class="span6">
                <?php 	echo $this->loadTemplate('client');?>
            </div>

            <div class="span6">
                <?php
                if ($this->delivery_methods){
                    echo $this->loadTemplate('delivery');
                }
                if ($this->payment_methods){
                    echo $this->loadTemplate('payment');
                }
                ?>
            </div>
        </div>

        <hr class="row-fluid" />
        <div class="row-fluid span12 total_title">
            <span class="offset8 span3">
            <strong><?php echo JText::_('TICKETS_TOTAL');?></strong>
            </span>

            <span class="span1 total_sum">
                <strong>
                    <?php echo $currency;?><span id="TicketTotal"><?php echo number_format($this->ticktes_total,2);?></span>
                </strong>
            </span>
        </div>

		<?php if(!empty($this->commission)){
			$commission = $this->commission;  
		?>
        <div class="row-fluid span12 total_title">
            <span class="offset8 span3">
 			<strong><?php echo JText::_('JLTC_COMMISSION');?></strong>
            </span>

            <span class="span1 total_sum">
                <strong>
                    <?php echo $currency;?><span id="comission"><?php echo number_format($this->commission,2);?></span>
                </strong>
            </span>
            </div>
		<?php }else{
			$commission =0;
		}
		?>
		<?php if ($this->delivery_methods){ ?>
        <div class="row-fluid span12 total_title">
            <span class="offset8 span3">
            <strong><?php echo JText::_('Delivery');?></strong>
            </span>

            <span class="span1 total_sum">
                <strong>
                    <?php echo $currency;?><span id="Delivery_Price"><?php echo number_format($this->delivery_price,2);?></span>
                </strong>
            </span>
        </div>

	<?php }?>
	
	<?php  if ($this->params->get('tax_rate')>0){ ?>
            <div class="row-fluid span12 total_title">
                <span class="offset8 span3">
            		<strong><?php echo JText::_('Tax');?></strong>
                </span>

                <span class="span1 total_sum">
                    <strong>
                        <strong>
                            <?php
                            $tax = ($this->ticktes_total+$this->delivery_price+$commission)*$this->params->get('tax_rate')/100;
                            $total =$this->ticktes_total+$this->delivery_price+$tax+$commission;
                            echo $currency;?><span id="Tax"><?php echo number_format($tax ,2);?></span>
                        </strong>
                    </strong>
                </span>
            </div>
		<?php }else{
				$total =$this->ticktes_total+$this->delivery_price+$commission;
		}?>

        <div class="row-fluid span12 total_title">
            <span class="offset8 span3">
                <strong><?php echo JText::_('ORDER_TOTAL');?></strong>
            </span>

            <span class="span1 total_sum">
                <strong>
                    <?php echo $currency;?><span id="Total"><?php echo number_format($total ,2);?></span>
                </strong>
            </span>
        </div>

        <?php if (isset($this->tos)){
			echo $this->tos;
		}?>

        <div class="row-fluid span12 total_title">
            <span class="span2">
                <button id="cart_back_btn" class="button"><?php echo JText::_('JLTCETNER_MORE_TICKETS');?></button>
            </span>

            <span class="offset8  span2">
                <strong>
                    <button type="submit" id="order_btn" class="button validate"><?php echo JText::_('Order');?></button>
                </strong>
            </span>
        </div>


	
	<?php echo JHTML::_( 'form.token' ); ?>
	<input type="hidden" name="option" value="com_jlticketcenter" />
	<input type="hidden" name="controller" value="cart" />
	<input type="hidden" name="task" value="checkout_pross" />
	</form>
	</table> <!--  warper table -->
<?php 	}
	else{
		 echo JText::_('CART_IS_EMPTY');
	}
	?>
 </div>

</div>