-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate.php
81 lines (60 loc) · 1.47 KB
/
update.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
include_once("allFunctions.php");
//$referer2 = $_SERVER['HTTP_REFERER'];
//echo $referer2;
?>
<?php
session_start();
showCurrentAmountsTable();
getFromField();
function showCurrentAmountsTable()
{
$newAmounts = explode('^', $_GET['na']);
$flag = false;
$count =0;
echo "<table id = 'amountsTable' cellspacing='0' cellpadding='2' border='1' width='30% style=background-color: white;'>
<tbody>";
if($_GET['t'] == 1)
{
foreach($_SESSION['currentAmounts'] as $currencyName => &$currencyAmount)
{
$currencyAmount = $newAmounts[$count];
echo "<tr>
<td>".$currencyName."</td>
<td id='".$currencyName."'>".$currencyAmount."</td>
</tr>";
$count++;
}
}
else {
$iniAmt = $_SESSION['currentAmounts'][0];
}
if($_GET['t'] != 1)
{
foreach($_SESSION['currentAmounts'] as $currencyName => $currencyAmount)
{
echo "<tr>
<td align='center'>".$currencyName."</td>
<td width='300' align='right'id='".$currencyName."'>".$currencyAmount."</td>
</tr>";
}
echo "</tbody>
</table>";
}
}
function getFromField()
{
echo "<select id = 'from' style='font-size: 14pt; color: blue' >";
echo "<option >Select From Which Currency</option>";
$count = 0;
foreach($_SESSION['currentAmounts'] as $currencyName => $currencyAmount)
{
if($currencyAmount !=0)
{
echo "<option value = '" .$count. "' >".$currencyName."</option>";
}
$count++;
}
echo "</select>";
}
?>