/*************************************************************************/
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
$sql="SELECT sum(total_qty) as shipqty FROM sales_flat_shipment WHERE order_id=".$_order->getentity_id()." GROUP BY order_id ";
$results = $conn->fetchOne($sql);
$per=($results/$total)*100;
$orderAdminDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true);
$orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', true);
$preOrderId=0;
$nextOrderId=0;
$curOrderId=0;
$curOrderId=$_order->getId();
$resource = Mage::getSingleton('core/resource');
$tableName = $resource->getTableName('sales_flat_order');
$readConnection = $resource->getConnection('core_read');
$query = 'SELECT entity_id FROM ' . $tableName . ' WHERE entity_id < '.$curOrderId.' ORDER BY entity_id DESC LIMIT 0,1';
$preOrderId = $readConnection->fetchOne($query);
$query = 'SELECT entity_id FROM ' . $tableName . ' WHERE entity_id > '.$curOrderId.' ORDER BY entity_id ASC LIMIT 0,1';
$nextOrderId = $readConnection->fetchOne($query);
?>
<?php //* ?>
<div style="width:300px;">
<?php if($preOrderId>0) { ?>
<div style="float:left" ><a href="<?php echo $this->getViewUrl($preOrderId) ?>" style="font-weight:bold">« Previous Order </a></div>
<?php } else { ?>
<div style="float:left" >« Previous Order </div>
<?php } if($nextOrderId>0) { ?>
<div style="float:right" ><a href="<?php echo $this->getViewUrl($nextOrderId) ?>" style="font-weight:bold"> Next Order »</a></div>
<?php } else { ?>
<div style="float:right" > Next Order »</div>
<?php } ?>
</div>
<?php //*/ ?>
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
$sql="SELECT sum(total_qty) as shipqty FROM sales_flat_shipment WHERE order_id=".$_order->getentity_id()." GROUP BY order_id ";
$results = $conn->fetchOne($sql);
$per=($results/$total)*100;
$orderAdminDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true);
$orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', true);
$preOrderId=0;
$nextOrderId=0;
$curOrderId=0;
$curOrderId=$_order->getId();
$resource = Mage::getSingleton('core/resource');
$tableName = $resource->getTableName('sales_flat_order');
$readConnection = $resource->getConnection('core_read');
$query = 'SELECT entity_id FROM ' . $tableName . ' WHERE entity_id < '.$curOrderId.' ORDER BY entity_id DESC LIMIT 0,1';
$preOrderId = $readConnection->fetchOne($query);
$query = 'SELECT entity_id FROM ' . $tableName . ' WHERE entity_id > '.$curOrderId.' ORDER BY entity_id ASC LIMIT 0,1';
$nextOrderId = $readConnection->fetchOne($query);
?>
<?php //* ?>
<div style="width:300px;">
<?php if($preOrderId>0) { ?>
<div style="float:left" ><a href="<?php echo $this->getViewUrl($preOrderId) ?>" style="font-weight:bold">« Previous Order </a></div>
<?php } else { ?>
<div style="float:left" >« Previous Order </div>
<?php } if($nextOrderId>0) { ?>
<div style="float:right" ><a href="<?php echo $this->getViewUrl($nextOrderId) ?>" style="font-weight:bold"> Next Order »</a></div>
<?php } else { ?>
<div style="float:right" > Next Order »</div>
<?php } ?>
</div>
<?php //*/ ?>
No comments:
Post a Comment