forked from udsaxman/Sapphirev2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TDSInTransfer.php
367 lines (311 loc) · 9.79 KB
/
TDSInTransfer.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<?php
session_start();
include 'header.html';
include 'connection.php';
include 'functions.php'
?>
<!-- InstanceBeginEditable name="content" -->
<div id="content_area" align="left">
<br/>
<br/>
<br/>
<br/>
<form action="TDSInTransfer.php"
method="post">
<fieldset>
<legend>Transfer Type</legend>
<?php
$powerRequired = 100;
$powerRequired = CheckAccess('transfer');
if (isset($_SESSION["power"])) {
if ($_SESSION["power"] >= $powerRequired) {
AccessGranted();
} elseif ($_SESSION["power"] < $powerRequired) {
AccessDenied(1);
}
} else {
AccessDenied(0);
}
function AccessGranted()
{
include 'connection.php';
$typeCount = 1;
$typeName[0] = "";
$selectedType = 0;
global $conn;
$sql = "SELECT * FROM Transaction_Types";
$result = mysql_query($sql, $conn) or die(mysql_error());
while ($row = mysql_fetch_assoc($result)) {
foreach ($row as $name => $value) {
if ($name == "description") //This should be changed to Name, fix this when you stored proceedure all the things
{ //Nope, fix it later
$typeName[$typeCount] = $value;
$typeCount++;
}
}
}
if (isset($_REQUEST["selType"])) {
$selectedType = $_REQUEST["selType"];
}
echo "<select name = 'selType'>";
for ($i = 0; $i < $typeCount; $i++) //Base 1
{
if (($typeName[$i] == "corp")) {
echo "<option value = " . $i;
if ($i == $selectedType) {
echo " selected = 'selected'";
}
echo ">";
echo $typeName[$i] . "</option>";
}
if (($typeName[$i] == "paycheck")) {
echo "<option value = " . $i;
if ($i == $selectedType) {
echo " selected = 'selected'";
}
echo ">";
echo $typeName[$i] . "</option>";
}
}
echo "</select>";
echo "<input type = 'submit' value = 'Select Type' />";
if (isset($_REQUEST["selType"])) {
$i = $_REQUEST["selType"];
if ($typeName[$i] == "paycheck") {
Paycheck();
} elseif ($typeName[$i] == "corp") {
Corp();
}
}
}
function Paycheck()
{
include 'connection.php';
global $conn;
$theName = "";
$today = date("Y.m.d");
$userArray[0] = "";
$userIdArray[0] = 0;
$iskArray[0] = 0;
$userCount = 0;
$sql = "Select
rank_power, user_id, user_name, user_isk
From
Users
left join
Ranks on Users.rank_id = Ranks.rank_id
Where
rank_power > 0
Order By
user_name";
$result = mysql_query($sql, $conn) or die(mysql_error());
while ($row = mysql_fetch_assoc($result)) {
foreach ($row as $name => $value) {
if ($name == "rank_power") {
}
if ($name == "user_id") {
$userIdArray[$userCount] = $value;
}
if ($name == "user_name") {
$userArray[$userCount] = $value;
}
if ($name == "user_isk") {
$iskArray[$userCount] = $value;
$userCount++;
}
}
}
if (isset($_SESSION["userName"])) {
$theName = $_SESSION["userName"];
} else {
$theName = "Error_No_Name_Found";
}
echo "</fieldset>";
echo "</form>";
echo "<br />";
echo "<form action = 'processTransfer.php' method = 'post'>";
echo "<fieldset>";
echo "<legend>Paycheck</legend>";
echo "<input type = 'hidden' name = 'type' value = 'paycheck' />";
echo "<br />";
echo "<label>Transfer Conductor:</label>";
echo "<input type = 'text' readonly='readonly' name = 'name' value ='" . $theName . "' />";
echo "<br />";
echo "<label>Transfer Date:</label>";
echo "<input type = 'text' readonly='readonly' name = 'date' value ='" . $today . "' />";
echo "<br />";
echo "<select id='select_user' name = 'selUser'>";
echo "<option value =0>-=Select Pilot=-</option>";
for ($i = 1; $i < $userCount + 1; $i++) {
echo "<option value =" . $userIdArray[$i - 1] . ">" . $userArray[$i - 1] . "</option>";
}
echo "</select>";
echo "<br />";
echo "<label>Current Wallet:</label>";
echo "<input type = 'text' readonly='readonly' id = 'user_wallet' name = 'wallet' value ='~~!~~' />";
echo "<br />";
echo "<label>Amount to Removed:</label>";
echo "<input type = 'text' name = 'amount' value = '0' />";
echo "<br />";
echo "<input type = 'submit' value = 'Transfer Isk' />";
echo "</fieldset>";
echo "</form>";
echo "\n\n";
echo "<script type='text/javascript'>";
echo "\n";
echo "window.onload = function()";
echo "\n";
echo "{";
echo "\n\t";
echo "var isk = new Array();";
echo "\n\t";
echo "isk[0] = \"~~!~~\";";
echo "\n\t";
for ($x = 1; $x < $userCount + 1; $x++) {
echo "isk[" . ($x) . "] = \"" . number_format($iskArray[$x - 1], 2, '.', ',') . "\";";
echo "\n\t";
}
echo "var eSelect = document.getElementById('select_user');";
echo "\n\t";
echo "eSelect.onchange = function ()";
echo "\n\t";
echo "{";
echo "\n\t\t";
echo "document.getElementById(\"user_wallet\").value = isk[eSelect.selectedIndex];";
echo "\n\t";
echo "}";
echo "\n";
echo "}";
echo "\n";
echo "</script>";
echo "\n";
}
function Corp()
{
global $conn;
include 'connection.php';
$theName = "";
$today = date("Y.m.d");
$userArray[0] = "";
$userIdArray[0] = 0;
$iskArray[0] = 0;
$userCount = 0;
$sql = "Select
rank_power, user_id, user_name, user_isk
From
Users
left join
Ranks on Users.rank_id = Ranks.rank_id
Where
rank_power > 0
Order By
user_name";
$result = mysql_query($sql, $conn) or die(mysql_error());
while ($row = mysql_fetch_assoc($result)) {
foreach ($row as $name => $value) {
if ($name == "rank_power") {
}
if ($name == "user_id") {
$userIdArray[$userCount] = $value;
}
if ($name == "user_name") {
$userArray[$userCount] = $value;
}
if ($name == "user_isk") {
$iskArray[$userCount] = $value;
$userCount++;
}
}
}
if (isset($_SESSION["userName"])) {
$theName = $_SESSION["userName"];
} else {
$theName = "Error_No_Name_Found";
}
echo "</fieldset>";
echo "</form>";
echo "<br />";
echo "<form action = 'processTransfer.php' method = 'post'>";
echo "<fieldset>";
echo "<legend>Corp Transaction</legend>";
echo "<input type = 'hidden' name = 'type' value = 'corp' />";
echo "<br />";
echo "<label>Transfer Conductor:</label>";
echo "<input type = 'text' readonly='readonly' name = 'name' value ='" . $theName . "' />";
echo "<br />";
echo "<label>Transfer Date:</label>";
echo "<input type = 'text' readonly='readonly' name = 'date' value ='" . $today . "' />";
echo "<br />";
echo "<select id='select_user' name = 'selUser'>";
echo "<option value =0>-=Select Pilot=-</option>";
for ($i = 1; $i < $userCount + 1; $i++) {
echo "<option value =" . $userIdArray[$i - 1] . ">" . $userArray[$i - 1] . "</option>";
}
echo "</select>";
echo "<br />";
echo "<label>Current Wallet:</label>";
echo "<input type = 'text' readonly='readonly' id = 'user_wallet' name = 'wallet' value ='~~!~~' />";
echo "<br />";
echo "<label>Amount to Add:</label>";
echo "<input type = 'text' name = 'amount' value = '0' />";
echo "<br />";
echo "<label>Addition Text:</label>";
echo "<input type = 'text' name = 'addText' value = '' />";
echo "<br />";
echo "<input type = 'submit' value = 'Transfer Isk' />";
echo "</fieldset>";
echo "</form>";
echo "\n\n";
echo "<script type='text/javascript'>";
echo "\n";
echo "window.onload = function()";
echo "\n";
echo "{";
echo "\n\t";
echo "var isk = new Array();";
echo "\n\t";
echo "isk[0] = \"~~!~~\";";
echo "\n\t";
for ($x = 1; $x < $userCount + 1; $x++) {
echo "isk[" . $x . "] = \"" . number_format($iskArray[$x - 1], 2, '.', ',') . "\";";
echo "\n\t";
}
echo "var eSelect = document.getElementById('select_user');";
echo "\n\t";
echo "eSelect.onchange = function ()";
echo "\n\t";
echo "{";
echo "\n\t\t";
echo "document.getElementById(\"user_wallet\").value = isk[eSelect.selectedIndex];";
echo "\n\t";
echo "}";
echo "\n";
echo "}";
echo "\n";
echo "</script>";
echo "\n";
}
?>
</div>
<!-- InstanceEndEditable -->
<footer align="center">
EVE Online, the EVE logo, EVE and all associated logos and designs are the intellectual property of CCP hf.
<br/>
All artwork, screenshots, characters, vehicles, storylines, world facts or other recognizable features of the
intellectual property relating to these trademarks are likewise the intellectual property of CCP hf.
<br/>
EVE Online and the EVE logo are the registered trademarks of CCP hf. All rights are reserved worldwide. All other
trademarks are the property of their respective owners.
<br/>
CCP hf. has granted permission to tdsin.net to use EVE Online and all associated logos and designs for promotional
and information purposes on its website but does not endorse, and is not in any way affiliated with, tdsin.net.
<br/>
CCP is in no way responsible for the content on or functioning of this website, nor can it be liable for any damage
arising from the use of this website.
</footer>
</DIV>
</td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>