<?php
	include("../session.php");
	include("../connect.php");
	$user=$_SESSION['company'];
	$pQuery=mysql_query("select * from price order by id desc");
	$displayP=mysql_fetch_array($pQuery);
	$price=$displayP['price'];
	
$checkurl = 'www.finance.yahoo.com';

if(@fsockopen($checkurl,80)){	
$from = 'MYR';
$to = 'SGD';
$url = 'http://finance.yahoo.com/d/quotes.csv?f=l1d1t1&s='.$from.$to.'=X';

$handle = fopen($url, 'r');

 
if ($handle) {
    $result = fgetcsv($handle);
    fclose($handle);
}



	
	$priceA = $price * 1 *$result[0];
		$priceB = $price * 2 *$result[0];
			$priceC = $price * 3*$result[0];
	$priceA1 = round($priceA, 2);
	$priceB1 = round($priceB, 2);
	$priceC1 = round($priceC, 2);	
	
?>

<html>
<head>
<title>User Page(Company profile)</title>
<link href="header.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" href="facebox/facebox.css" />
<script language="javascript" src="jquery.js"></script>
<script language="javascript" src="facebox/facebox.js"></script>


</head>
<body>
<!-----------------Outer table--------------->
<table align=left width=1200 border=0 cellspacing=10 cellpadding=3 class=outer >
<tr>
	<td colspan=2 class="head">
	<?php include("companyHead.php");?>
	</td>
	</tr>
<tr>
	<td colspan=2>
	<div class=main>&nbsp;&nbsp;>>
			<a href="<?php echo"company.php";?>">&nbsp;Home&nbsp;</a>>>
			<a href="<?php echo"paypal.php";?>">&nbsp;Update License&nbsp;</a>
			</div></td>
	</tr>
<tr>
	<td valign=top colspan=2>
	<!--------------------Inner table 2----------------------->
<font color="red">
<?php echo '1 '.$from.' is worth '.$result[0].' '.$to.' Based on data on '.$result[1].' '.$result[2]. ' EDT';?>
</font>

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<table>
<tr><td><input type="hidden" name="on0" value="License">License</td></tr><tr><td><select name="os0">
	<option value="Update License(1 YRS)">Update License(1 YRS) : $<?php echo $priceA1?>SGD - daily</option>
	<option value="Update License(2 YRS)">Update License(2 YRS) : $<?php echo $priceB1?>SGD - daily</option>
	<option value="Update License(3 YRS)">Update License(3 YRS) : $<?php echo $priceC1?>SGD - daily</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="SGD">

<input type='hidden' name='custom' value='<?php echo"$user"?>'>
<input type="hidden" name="business" value="wai_1330158011_biz@gmail.com">
<input type="hidden" name="return" value="http://www.wauhaha.com/smart/login.php">
<input type="hidden" name="cancel_return" value="http://www.wauhaha.com/smart/login.php">
<input name='notify_url' value='http://www.wauhaha.com/smart/company/updatepaypal.php' type='hidden'>

<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIIuwYJKoZIhvcNAQcEoIIIrDCCCKgCAQExggE6MIIBNgIBADCBnjCBmDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCFNhbiBKb3NlMRUwEwYDVQQKEwxQYXlQYWwsIEluYy4xFjAUBgNVBAsUDXNhbmRib3hfY2VydHMxFDASBgNVBAMUC3NhbmRib3hfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMA0GCSqGSIb3DQEBAQUABIGAJfRRfIQmUGB2okPdG6dgvHZvX926l2Vxp2K/Sv1rQuxXBZuD1uMXrGMf/8L8tTaVy/lD5o18v54OeYzcrdy1hRKjnmJ3SRbmfk9zWqJD0DIZVPNl6ASSDTFcnH9hO1vlBI/c3/XR7LfOy05i2WWmApK4BxLuhwAiThHhzpDX2xsxCzAJBgUrDgMCGgUAMIICBQYJKoZIhvcNAQcBMBQGCCqGSIb3DQMHBAhcTGTyMn01PoCCAeDq6ovb9N6IWosS+gkNxFXlGc+D/LBJDYZuTBVmP28g6PhUvZxTSPHx/E9joyGP6Ii+Of3OV5nnBrDjU2+LE6hif9tXLjp7rya4zkDfeF6CGlKNEAcmi2nJaF/xap/see2798sMSr1V8F4izZ5V1uo4lF/Z/yJ8z01lbmdtUKceF6HJTjzsah7XeLZqhn34uwNOLzPmSrhIYZR73Y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Fm2VJSUiQftx0DIhM46GqdOeiR0csb0niq1z/13tJOcPcPWqXKuKcUTNU04vr+YzTG/Bae50UTPWMcfyiSU4u7EbKmDBazriCH6iWJoW+EUfZhYfniXzLcNQ==-----END PKCS7-----
">
<input type="image" src="image/subscribe.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

</td>
	</tr>
</table>
<!-----------------------End outer table-------------------------->


<?php 
}
else{
echo "<script language=javascript>alert('Internet Connection Error, Please Try Again');window.location='company.php';</script>";
die();
}
?>
<?php 
include("../closeconnection.php");
?>

</body>
</html>
