<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php $_order = $this->getOrder() ?>
<?php
$orderAdminDate = $this->formatDate($_order->getCreatedAt(), 'medium', true);
$orderStoreDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true);
?>
<div class="box-left">
    <!--Order Information-->
    <div class="entry-edit">
        <?php if ($_order->getEmailSent()):
            $_email=$this->__('Order confirmation email sent');
        else:
            $_email=$this->__('Order confirmation email not sent');
        endif; ?>
        <div class="entry-edit-head">
        <?php if ($this->getNoUseOrderLink()): ?>
            <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?> (<?php echo $_email ?>)</h4>
        <?php else: ?>
            <a href="<?php echo $this->getViewUrl($_order->getId()) ?>"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?></a>
            <strong>(<?php echo $_email ?>)</strong>
        <?php endif; ?>
        </div>
        <div class="fieldset">
            <table cellspacing="0" class="form-list">
            <tr>
                <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date') ?></label></td>
                <td><strong><?php echo $orderAdminDate ?></strong></td>
            </tr>
            <?php if ($orderAdminDate != $orderStoreDate):?>
            <tr>
                <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date (%s)', $_order->getCreatedAtDate()->getTimezone()) ?></label></td>
                <td><strong><?php echo $orderStoreDate ?></strong></td>
            </tr>
            <?php endif;?>
            <tr>
                <td class="label"><label><?php echo Mage::helper('sales')->__('Order Status') ?></label></td>
                <td><strong><span id="order_status"><?php echo $_order->getStatusLabel() ?></span></strong></td>
            </tr>
            <tr>
                <td class="label"><label><?php echo Mage::helper('sales')->__('Purchased From') ?></label></td>
                <td><strong><?php echo $this->getOrderStoreName() ?></strong></td>
            </tr>
            <?php if($_order->getRelationChildId()): ?>
            <tr>
                <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the new order') ?></label></td>
                <td><a href="<?php echo $this->getViewUrl($_order->getRelationChildId()) ?>">
                    <?php echo $_order->getRelationChildRealId() ?>
                </a></td>
            </tr>
            <?php endif; ?>
            <?php if($_order->getRelationParentId()): ?>
            <tr>
                <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the previous order') ?></label></td>
                <td><a href="<?php echo $this->getViewUrl($_order->getRelationParentId()) ?>">
                    <?php echo $_order->getRelationParentRealId() ?>
                </a></td>
            </tr>
            <?php endif; ?>
            <?php if($_order->getRemoteIp()): ?>
            <tr>
                <td class="label"><label><?php echo Mage::helper('sales')->__('Placed from IP') ?></label></td>
                <td><strong><?php echo $_order->getRemoteIp() ?></strong></td>
            </tr>
            <?php endif; ?>
            </table>
        </div>
    </div>
</div>
<div class="box-right">
    <!--Account Information-->
    <div class="entry-edit">
        <div class="entry-edit-head">
            <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Account Information') ?></h4>
        </div>
        <div class="fieldset">
            <div class="hor-scroll">
                <table cellspacing="0" class="form-list">
                <tr>
                    <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Name') ?></label></td>
                    <td><strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong></td>
                </tr>
                <tr>
                    <td class="label"><label><?php echo Mage::helper('sales')->__('Email') ?></label></td>
                    <td><a href="mailto:<?php echo $_order->getCustomerEmail() ?>"><strong><?php echo $_order->getCustomerEmail() ?></strong></a></td>
                </tr>
                <?php if ($_groupName=$this->getCustomerGroupName()) : ?>
                <tr>
                    <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Group') ?></label></td>
                    <td><strong><?php echo $_groupName ?></strong></td>
                </tr>
                <?php endif; ?>
                <?php if ($_dob=$this->getOrder()->getCustomerDob()) : ?>
                <tr>
                    <td class="label"><label><?php echo Mage::helper('sales')->__('Date of Birth') ?></label></td>
                    <td><strong><?php echo Mage::helper('core')->formatDate($_dob, 'medium') ?></strong></td>
                </tr>
                <?php endif; ?>
                <?php if ($_taxvat = $_order->getCustomerTaxvat()):?>
                <tr>
                    <td class="label"><label><?php echo Mage::helper('sales')->__('TAX/VAT Number') ?></label></label></td>
                    <td><strong><?php echo $this->htmlEscape($_taxvat)?></strong></td>
                </tr>
                <?php endif;?>
                </table>
            </div>
        </div>
    </div>
</div>
<div class="clear"></div>

<div class="box-left">
    <!--Billing Address-->
    <div class="entry-edit">
        <div class="entry-edit-head">
            <h4 class="icon-head head-billing-address"><?php echo Mage::helper('sales')->__('Billing Address') ?></h4>
        </div>
        <fieldset>
            <address><?php echo $_order->getBillingAddress()->getFormated(true) ?></address>
        </fieldset>
    </div>
</div>
<?php if (!$this->getOrder()->getIsVirtual()): ?>
<div class="box-right">
    <!--Shipping Address-->
    <div class="entry-edit">
        <div class="entry-edit-head">
            <h4 class="icon-head head-shipping-address"><?php echo Mage::helper('sales')->__('Shipping Address') ?></h4>
        </div>
        <fieldset>
            <address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address>
        </fieldset>
    </div>
</div>
<div class="clear"></div>
<?php endif; ?>