<?php
session_start();

include("config.inc.php");
include("Functions_Sales.php");

$connection = mysql_connect($config['dbServer'],$config['dbUser'],$config['dbPass']) or die("Could not connect to DB");
mysql_select_db($_SESSION['dbName'],$connection) or die("Could not find DB");

$FromCurr = $_GET["FromCurr"];
$ToCurr   = $_GET["ToCurr"];
$FromDate = $_GET["FromDate"];
$Amount   = $_GET["Amount"];


$query = "SELECT Round(ifNull(convertcurfunc('".$FromCurr."', '".$ToCurr."', '".insertMySQLDate($FromDate)."', 0, 0, '', '', ifNull($Amount,0)),0),2) From Dual ";
$result = selectData($connection, $query);
//echo $query; exit;
echo $result[0];
	

?>
