get order information in magento

In this article get order information,
Order id, customer id, order amount,


Here is code....

<?php
$customerId = Mage::getSingleton('customer/session')->getId();
 echo $customerId . "<br>";

$orderId = $this->getOrderId();
 echo $orderId . "<br>";

$orderReference = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getSingleton('sales/order');
$order->load($lastOrderId);
$_totalData =$order->getData();
$_grand = $_totalData['grand_total'];
$_grand = number_format($_grand, 2, '.', '');
 echo $_grand . "<br>";

?>

Labels: