<?php



/* SSL Management */

$useSSL = true;



include(dirname(__FILE__).'/config/config.inc.php');

include(dirname(__FILE__).'/init.php');



if (!$cookie->isLogged())

	Tools::redirect('authentication.php?back=history.php');



//CSS ans JS file calls

$js_files = array(

	__PS_BASE_URI__.'js/jquery/jquery.scrollto.js',

	_THEME_JS_DIR_.'history.js'

);



if ($orders = Order::getCustomerOrders(intval($cookie->id_customer)))

{

	foreach ($orders AS $key => $order)

	{

		$myOrder = new Order($order['id_order']);

		$orders[$key]['virtual'] = $myOrder->isVirtual(false);

		$orders[$key]['total_paid'] = Tools::displayPrice(floatval($order['total_paid']), new Currency(intval($order['id_currency'])), false, false);

	}

}



include(dirname(__FILE__).'/header.php');

$smarty->assign('orders', $orders);

$smarty->display(_PS_THEME_DIR_.'history.tpl');

include(dirname(__FILE__).'/footer.php');



?>