<?php  $_order = $this->getOrder() ?>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<div class="order_title  clearfix">
	<div class="boeder">
		<h2>
		<?php if($this->helper('rss/order')->isStatusNotificationAllow()): ?>
<a href="<?php echo $this->helper('rss/order')->getStatusHistoryRssUrl($_order) ?>" class="link-rss"><?php echo $this->__('Subscribe to Order Status') ?></a> <span class="separator">|</span>
			<?php endif; ?>
			<span>
			<?php if($_order->getStatus()=='pending' && $this->canOnlinePayment($_order)): ?>

			<a class="btn_strong pay" href="<?php echo $_order->getPayment()->getMethodInstance()->getPaymentRedirectUrl().'order_id/'.$_order->getRealOrderId()?>" target="_blank"><?php echo $this->__('Go to pay') ?></a>
			<?php endif ?>
			<?php if ($this->helper('sales/reorder')->canReorder($_order)) : ?>
			<a href="<?php echo $this->getReorderUrl($_order) ?>" style="padding: 0 5px" class="btn_common  link-reorder"><?php echo $this->__('Reorder') ?></a>
			<?php endif ?>
			<a href="<?php echo $this->getPrintUrl($_order) ?>" class="btn_common link-print" style="padding: 0 5px" onclick="this.target='_blank';"><?php echo $this->__('Print Order') ?></a>
			</span>
			<?php echo $this->__('Order #: %s', $_order->getRealOrderId()) ?> &nbsp;&nbsp; <?php echo $this->__('Status');?>: <em><?php echo $this->__('%s', $_order->getStatusLabel()) ?></em>&nbsp;<em>(<?php echo $this->__($this->getOrderStatusDetail($_order));?>)</em></h2>
		<span class="order-date"><p class="back-link"><a href="<?php echo $this->getUrl('sales/order/history');?>"><small>&laquo; </small><?php echo $this->__('Back to My Orders') ?></a></p><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></span> </div>
</div>
<?php echo $this->getStatusHistoryRssUrl($_order) ?>
<div class="oreder_info">
		<h1><?php echo $this->__('Order Information');?></h1>
	<div class="order-items clearfix">
		<?php if (!$_order->getIsVirtual()): ?>
		<div class="order_row">
			<h6><?php echo $this->__('Shipping Address') ?></h6>
			<address>
			<?php echo $_order->getShippingAddress()->format('html') ?>
			</address>
		</div>
		<div class="order_row clearfix"><div class="clearfix">
			<h5><?php echo $this->__('配送方式：') ?></h5>
			<div class="payinfo">
			<?php if ($_order->getShippingDescription()): ?>
				<?php echo $_order->getShippingDescription() ?>
			<?php else: ?>
				<p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
			<?php endif; ?>
			<?php if ($this->canShowShippingBestTime()): ?>
				<br/>
				<?php echo $this->__('Shipping Date:') ?>
				<?php echo $this->__($this->getShippingBestTime());?>
			<?php endif; ?>
			</div></div><div class="clearfix">
			 <h5>支付方式：</h5>
			 <div class="payinfo"><?php echo $this->getPaymentInfoHtml() ?></div>

			 </div></div>

		<?php $billInfo= $this->getBillInfo();?>
		<div class="order_row">
			<h6><?php echo $this->__('Invoice Information');?></h6>
           <?php if($billInfo->getId()): ?>
			<ul>
				<li><?php echo $this->__('Invoice Type');?>：
					<?php $type=$billInfo->getType();?><?php if($type==0){echo $this->__('General Invoice');}else{echo $this->__('VAT Invoice');}?>
				</li>
				<li><?php echo $this->__('Invoices Payable');?>：
					<?php $title=$billInfo->getTitle();?><?php if($title==0){echo $this->__('Personal');}else{echo $this->__('Units');}?>
				</li>
				<?php $company=$billInfo->getCompany();?>
				<?php if($company): ?>
				<li><?php echo $this->__('Units Name');?>：
				<?php echo $company; ?>
				</li>
				<?php endif;?>
				<li><?php echo $this->__('Invoice Content');?>：
					<?php $content=$billInfo->getContent();?>
					<?php if($content==0): ?><?php echo $this->__('Detail');?>
					<?php elseif($content==1): ?><?php echo $this->__('Office Supplies');?>
					<?php elseif($content==2): ?><?php echo $this->__('Computer Accessories');?>
					<?php elseif($content==3): ?><?php echo $this->__('Consumable');?>
					<?php endif;?>
				</li>
			</ul>
		</div>
		<?php endif; ?>
		<?php endif; ?>
		<?php echo $this->getChildHtml('order_view') ?> </div>
</div>
<div id="loadblock" style="display:none;" class="pay_light">

    <div class="note"><?php echo $this->__('Please Pay In New Website And Choose Your Operation');?></div>
    <ul class="form-list">
        <li class="control"><strong><?php echo $this->__('Pay Successfully');?></strong> <a class="reg" href='<?php echo $this->getReturnUrl();?>'><?php echo $this->__('View Order');?></a>
        </li>
        <li class="control">
            <strong><?php echo $this->__('Pay Unsuccessfully');?></strong> <a class="reg"
                                                                              href='javascript:returnPay()'><?php echo $this->__('Return To Pay');?></a>
        </li>
    </ul>
</div>
    <script type="text/javascript">
    //<![CDATA[
    var showDialog = function() {
        $('#loadblock').dialog({width:430, height: 210, modal: true,title:"<?php echo $this->__('Login Payment Website To Pay');?>"});
    }
    $(function() {
        $('.pay').click(function() {
            showDialog();
        });
    });
    function returnPay() {
        $('.ui-dialog-titlebar-close').click();
    }

    //]]>
</script>
