-
Notifications
You must be signed in to change notification settings - Fork 3
/
ExchangeRateTrend.php
74 lines (52 loc) · 2.36 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
72
73
74
<?php
/* $Revision: 1.3 $ */
/* $Id$*/
include('includes/session.inc');
$title = _('View Currency Trends');
include('includes/header.inc');
$graph = '/graph120.png';
$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" name=update action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('View Currency Trend') . '" alt="" />' . ' ' . _('View Currency Trend') . '</p>';
echo '<table class="selection">'; // First column
$SQL = "SELECT currabrev,
country,
currency
FROM currencies";
$result=DB_query($SQL,$db);
// CurrencyToShow Currency Picker
echo '<tr><td><select name="CurrencyToShow" onChange="ReloadForm(update.submit)">';
DB_data_seek($result,0);
while ($myrow=DB_fetch_array($result)) {
if ($myrow['currabrev']!=$_SESSION['CompanyRecord']['currencydefault']){
if ( $CurrencyToShow==$myrow['currabrev'] ) {
echo '<option selected="True" value="' . $myrow['currabrev'] . '">' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>';
} else {
echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>';
}
}
}
echo '</select></td></tr>';
echo '</table>'; /*close off the table in the third column */
echo '<br /><div class="centre"><button type="submit" name="submit">' . _('Accept') . '</button></div>';
echo '</form>';
// **************
// SHOW OUR GRAPH
// **************
$graph = $CurrencyToShow. '/' . $FunctionalCurrency . $graph;
$image = 'http://www.x-rates.com/d/' . $graph;
echo '<br /></div><table class="selection">';
echo '<tr><th class="header">' . $FunctionalCurrency . ' / ' . $CurrencyToShow . '</th></tr>';
echo '<tr><td><img src=' . $image . ' alt="Trend Currently Unavailable" /></td></tr>';
echo '</table>';
include('includes/footer.inc');
?>