-
Notifications
You must be signed in to change notification settings - Fork 11
/
changecurrency.php
executable file
·197 lines (185 loc) · 6.14 KB
/
changecurrency.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?php
include 'header.php';
include 'pass.php';
function changecurrency(){
global $newCurrency ;
global $newLongCurrency ;
global $newSymbol ;
$currencylocation = "/home/stakebox/UI/currency.php" ;
if (is_readable($currencylocation) == FALSE)
die ("The currency file must be writable.") ;
// Open the file and erase the contents if any
$fp = fopen($currencylocation, "w");
// Write the data to the file
// CODE INJECTION WARNING!
fwrite($fp, "<?php\n\$currency='$newCurrency';\n\$longCurrency='$newLongCurrency';\n\$symbol='$newSymbol';\n?>");
// Close the file
fclose($fp);
echo '<h4><p><b>Your currency has been changed.</p></b></h4>' ;
}
?>
<b><a name="transactions" style="margin-bottom: 10px; display: inline-block;">Select New Currency</a></b>
<div class="row">
<div class="col-lg-3" offset="4">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">Choose Currency
<span class="caret"></span></button>
<ul class="dropdown-menu center">
<li><a href="/changecurrency?newCurrency=usd">US Dollars</a></li>
<li><a href="/changecurrency?newCurrency=yuan">Chinese Yuans</a></li>
<li><a href="/changecurrency?newCurrency=eur">Euros</a></li>
<li><a href="/changecurrency?newCurrency=cad">Canadian Dollars</a></li>
<li><a href="/changecurrency?newCurrency=rub">Russian Ruble</a></li>
<li><a href="/changecurrency?newCurrency=idr">Indonesian Rupiah</a></li>
<li><a href="/changecurrency?newCurrency=thb">Thai Baht</a></li>
<li><a href="/changecurrency?newCurrency=hkd">Hong Kong Dollar</a></li>
<li><a href="/changecurrency?newCurrency=zar">SouthAfrican Rand</a></li>
<li><a href="/changecurrency?newCurrency=gbp">British Pound</a></li>
<li><a href="/changecurrency?newCurrency=ils">Isaeli New Shekel</a></li>
<li><a href="/changecurrency?newCurrency=aud">Australian Dollar</a></li>
<li><a href="/changecurrency?newCurrency=chf">Swiss Franc</a></li>
<li><a href="/changecurrency?newCurrency=gbr">Pound Sterling</a></li>
<li><a href="/changecurrency?newCurrency=czk">Chech Republic Koruna</a></li>
<li><a href="/changecurrency?newCurrency=jpy">Japanese Yen</a></li>
<li><a href="/changecurrency?newCurrency=dkk">Danish Krone</a></li>
<li><a href="/changecurrency?newCurrency=sgd">Singapore Dollar</a></li>
<li><a href="/changecurrency?newCurrency=nzd">New Zealand Dollar</a></li>
<li><a href="/changecurrency?newCurrency=nok">Norwegian Krone</a></li>
<li><a href="/changecurrency?newCurrency=krw">South Korean Won</a></li>
</ul>
</div>
</div>
</div>
<?php
if($_GET['newCurrency'] == "usd"){
$newCurrency = "usd";
$newLongCurrency = "US Dollar";
$newSymbol = "$";
changecurrency();
}
else if($_GET['newCurrency'] == "yuan"){
$newCurrency = "cny";
$newLongCurrency = "Chinese Yuan";
$newSymbol = "¥";
changecurrency();
}
else if($_GET['newCurrency'] == "eur"){
$newCurrency = "eur";
$newLongCurrency = "Euro";
$newSymbol = "€";
changecurrency();
}
else if($_GET['newCurrency'] == "cad"){
$newCurrency = "cad";
$newLongCurrency = "Canadian Dollar";
$newSymbol = "$";
changecurrency();
}
else if($_GET['newCurrency'] == "rub"){
$newCurrency = "rub";
$newLongCurrency = "Russian Ruble";
$newSymbol = "₽";
changecurrency();
}
else if($_GET['newCurrency'] == "idr"){
$newCurrency = "idr";
$newLongCurrency = "Indonesian Rupiah";
$newSymbol = "Rp";
changecurrency();
}
else if($_GET['newCurrency'] == "thb"){
$newCurrency = "thb";
$newLongCurrency = "Thai Baht";
$newSymbol = "฿";
changecurrency();
}
else if($_GET['newCurrency'] == "hkd"){
$newCurrency = "hkd";
$newLongCurrency = "Hong Kong Dollar";
$newSymbol = "HK$";
changecurrency();
}
else if($_GET['newCurrency'] == "zar"){
$newCurrency = "zar";
$newLongCurrency = "South African Rand";
$newSymbol = "R";
changecurrency();
}
else if($_GET['newCurrency'] == "gbp"){
$newCurrency = "gbp";
$newLongCurrency = "British Pound";
$newSymbol = "£";
changecurrency();
}
else if($_GET['newCurrency'] == "ils"){
$newCurrency = "ils";
$newLongCurrency = "Israeli New Shekel";
$newSymbol = "₪";
changecurrency();
}
else if($_GET['newCurrency'] == "aud"){
$newCurrency = "aud";
$newLongCurrency = "Australian Dollar";
$newSymbol = "$";
changecurrency();
}
else if($_GET['newCurrency'] == "chf"){
$newCurrency = "chf";
$newLongCurrency = "Swiss franc";
$newSymbol = "CHF";
changecurrency();
}
else if($_GET['newCurrency'] == "gbr"){
$newCurrency = "gbr";
$newLongCurrency = "Pound Sterling";
$newSymbol = "£";
changecurrency();
}
else if($_GET['newCurrency'] == "czk"){
$newCurrency = "czk";
$newLongCurrency = "Chech Republic Koruna";
$newSymbol = "Kč";
changecurrency();
}
else if($_GET['newCurrency'] == "jpy"){
$newCurrency = "jpy";
$newLongCurrency = "Japanese Yen";
$newSymbol = "¥";
changecurrency();
}
else if($_GET['newCurrency'] == "dkk"){
$newCurrency = "dkk";
$newLongCurrency = "Danish Krone";
$newSymbol = "kr";
changecurrency();
}
else if($_GET['newCurrency'] == "sgd"){
$newCurrency = "sgd";
$newLongCurrency = "Singapore Dollar";
$newSymbol = "$";
changecurrency();
}
else if($_GET['newCurrency'] == "nzd"){
$newCurrency = "nzd";
$newLongCurrency = "New Zealand Dollar";
$newSymbol = "$";
changecurrency();
}
else if($_GET['newCurrency'] == "nok"){
$newCurrency = "nok";
$newLongCurrency = "Norwegian Krone";
$newSymbol = "kr";
changecurrency();
}
else if($_GET['newCurrency'] == "krw"){
$newCurrency = "krw";
$newLongCurrency = "South Korean Won";
$newSymbol = "₩";
changecurrency();
}
else if($_GET['newCurrency']){
print_r("Invalid currency");
}
?>
</div>
<?php include 'footer.php';?>