-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate2.php
40 lines (33 loc) · 889 Bytes
/
update2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
include_once("allFunctions.php");
//$referer2 = $_SERVER['HTTP_REFERER'];
//echo $referer2;
?>
<?php
session_start();
$sourceValue =(double)$_GET['v'];
$indexCurrency = (int)$_GET['c'];
$from = $_SESSION['currencyRates'][$indexCurrency];
$amtExp= array();
$txt = "<select id='to' style='font-size: 14pt; color: blue' onchange='validateSourceValue()'>";
echo "<table id='expTb'>";
for($x = 0; $x<9;$x++)
{
echo "<tr>";
if($indexCurrency==$x)
continue;
echo "<td>to ";
$var = $_SESSION['currencies1'][$x];
echo "".$var.":"."</td>";
$txt.="<option value = '".$var."' >".$var."</option>";
$to = $_SESSION['currencyRates'][$x];
$expectedAmount = (double)($to/$from)*$sourceValue;
$amtExp[$var] = $expectedAmount;
echo "<td>".$amtExp[$var]."</td>";
echo "</tr>";
}
$_SESSION['amountsExpected'] = $amtExp;
$txt.="</select>";
echo "</table>";
echo $txt;
?>