forked from timschofield/KwaMoja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExchangeRateTrend.php
71 lines (62 loc) · 2.16 KB
/
ExchangeRateTrend.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
<?php
include ('includes/session.php');
$Title = _('View Currency Trends');
include ('includes/header.php');
$FunctionalCurrency = $_SESSION['CompanyRecord']['currencydefault'];
if (isset($_GET['CurrencyToShow'])) {
$CurrencyToShow = $_GET['CurrencyToShow'];
} elseif (isset($_POST['CurrencyToShow'])) {
$CurrencyToShow = $_POST['CurrencyToShow'];
}
// ************************
// SHOW OUR MAIN INPUT FORM
// ************************
echo '<form method="post" id="update" action="' . htmlspecialchars(basename(__FILE__), ENT_QUOTES, 'UTF-8') . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<p class="page_title_text" >
<img src="' . $RootPath . '/css/' . $_SESSION['Theme'] . '/images/money_add.png" title="' . _('View Currency Trend') . '" alt="" />' . ' ' . _('View Currency Trend') . '
</p>';
echo '<table>'; // First column
$SQL = "SELECT currabrev,
currency
FROM currencies";
$Result = DB_query($SQL);
// CurrencyToShow Currency Picker
echo '<tr>
<td>
<select name="CurrencyToShow" onchange="ReloadForm(update.submit)">';
while ($MyRow = DB_fetch_array($Result)) {
if ($MyRow['currabrev'] != $_SESSION['CompanyRecord']['currencydefault']) {
if ($CurrencyToShow == $MyRow['currabrev']) {
echo '<option selected="selected" value="' . $MyRow['currabrev'] . '">' . _($MyRow['currency']) . ' (' . $MyRow['currabrev'] . ')' . '</option>';
} else {
echo '<option value="' . $MyRow['currabrev'] . '">' . _($MyRow['currency']) . ' (' . $MyRow['currabrev'] . ')' . '</option>';
}
}
}
echo '</select>
</td>
</tr>
</table>
<div class="centre">
<input type="submit" name="submit" value="' . _('Accept') . '" />
</div>
</form>';
// **************
// SHOW OUR GRAPH
// **************
$image = 'http://www.google.com/finance/getchart?q=' . $FunctionalCurrency . $CurrencyToShow . '&x=CURRENCY&p=3M&i=86400';
echo '<table>
<tr>
<th>
<div class="centre">
<b>' . $FunctionalCurrency . ' / ' . $CurrencyToShow . '</b>
</div>
</th>
</tr>
<tr>
<td><img src="' . $image . '" alt="' . _('Trend Currently Unavailable') . '" /></td>
</tr>
</table>';
include ('includes/footer.php');
?>