<?php
/**
 * @version     $Id$
 * @package     JSN_Mobilize
 * @subpackage  SystemPlugin
 * @author      JoomlaShine Team <support@joomlashine.com>
 * @copyright   Copyright (C) 2012 JoomlaShine.com. All Rights Reserved.
 * @license     GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.joomlashine.com
 * Technical Support:  Feedback - http://www.joomlashine.com/contact-us/get-support.html
 */
//index.php?option=com_virtuemart&view=invoice&layout=invoice&format=pdf&tmpl=component&order_number=xx&order_pass=p_yy
//
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
JHTML::stylesheet('vmpanels.css', JURI::root() . 'components/com_virtuemart/assets/css/');
if ($this->_layout == "invoice") {
    $document = JFactory::getDocument();
    $document->setTitle(JText::_('COM_VIRTUEMART_ORDER_PRINT_PO_NUMBER') . ' ' . $this->orderDetails['details']['BT']->order_number . ' ' . $this->vendor->vendor_store_name);
//$document->setName( JText::_('COM_VIRTUEMART_ACC_ORDER_INFO').' '.$this->orderDetails['details']['BT']->order_number);
//$document->setDescription( JText::_('COM_VIRTUEMART_ORDER_PRINT_PO_NUMBER').' '.$this->orderDetails['details']['BT']->order_number);
}

if ($this->headFooter) {
    ?>
<div class="vendor-details-view">
    <h1><?php echo $this->vendor->vendor_store_name;
        if (!empty($this->vendor->images[0])) {
            ?>
            <div class="vendor-image">
                <?php echo $this->vendor->images[0]->displayMediaThumb('', false); ?>
            </div>
            <?php
        }
        ?>    </h1>
	<div class="vendor-details-address">
	<?php //Attention this is removed, please use directly
		//echo $this->vendorAddress;
		echo shopFunctions::renderVendorAddress($this->vendor->virtuemart_vendor_id, '<br />');
		?>
		</div>
</div>

<div class="vendor-description">
<?php //echo $this->vendor->vendor_store_desc.'<br>';


    /*	foreach($this->vendorAddress as $userfields){

         foreach($userfields['fields'] as $item){
             if(!empty($item['value'])){
                 if($item['name']==='agreed'){
                     $item['value'] =  ($item['value']===0) ? JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_NO'):JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_YES');
                 }
             ?><!-- span class="titles"><?php echo $item['title'] ?></span -->
                         <span class="values vm2<?php echo '-'.$item['name'] ?>" ><?php echo $this->escape($item['value']) ?></span>
                     <?php if ($item['name'] != 'title' and $item['name'] != 'first_name' and $item['name'] != 'middle_name' and $item['name'] != 'zip') { ?>
                         <br class="clear" />
                     <?php
                 }
             }
         }
     }*/
}
?></div> <?php


if ($this->print) {
    ?>

<body onload="javascript:print();">

<div class='spaceStyle'>
    <?php
// 			echo require(__DIR__.'/mail_html_shopper.php');
    ?>
</div>
<div class='spaceStyle'>
    <?php
    echo $this->loadTemplate('order');
    ?>
</div>

<div class='spaceStyle'>
    <?php
    echo $this->loadTemplate('items');
    ?>
</div>
    <?php    //echo $this->vendor->vendor_legal_info; ?>
</body>
<?php
} else {

    ?>

<?php

    echo $this->loadTemplate('order');

    ?>


	<div class='spaceStyle'>
	<?php

    $tabarray = array();

    $tabarray['items'] = 'COM_VIRTUEMART_ORDER_ITEM';
    $tabarray['history'] = 'COM_VIRTUEMART_ORDER_HISTORY';

    shopFunctionsF::buildTabs( $this, $tabarray);
    echo '</div>
	    <br clear="all"/><br/>';
}

if ($this->headFooter) {
    echo $this->vendor->vendor_legal_info;
}

?>






