-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathframe_list.php
458 lines (405 loc) · 24.4 KB
/
frame_list.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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
<!DOCTYPE html>
<html>
<?php
include "augment_functions.php";
include "material_functions.php";
include "general_functions.php";
include "crafting_functions.php";
// Load database settings from config file
$settings = array();
$settings = load_config();
$mysql_user = $settings[0];
$mysql_host = $settings[1];
$mysql_pass = $settings[2];
$mysql_database = $settings[3];
// Establish connection to the database
$con = mysqli_connect($mysql_host, $mysql_user, $mysql_pass, $mysql_database);
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
$log_message = "CRITICAL: Failed to connect to database while attempting to update the database tables! Please check your database and database settings!";
log_to_file($log_message);
}
mysqli_query($con, "SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'");
$skell_frame_raw_data = get_skell_frame_data($con);
// $skell_frame_raw_data[0] contains all augment names
$search_result = binary_search($skell_frame_raw_data[0], $_GET["frame"]);
?>
<head>
<meta charset="ISO-8859-1">
<title>
<?php
// Print out the current augment as the page title.
if ($_SERVER["REQUEST_METHOD"] == "GET")
{
if(empty($_GET["frame"]))
{
print "Skell Frame List";
}
else if(strcasecmp($skell_frame_raw_data[0][$search_result], $_GET["frame"]) != 0)
{
print "Skell Frame List ";
}
else
{
print $skell_frame_raw_data[0][$search_result];
}
}
?>
</title>
<link rel="stylesheet" type="text/css" href="styles.css" title="Default Styles" media="screen"/>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans" title="Font Styles"/>
</head>
<body link="#E2E2E2" vlink="#ADABAB">
<center><div class="container">
<header>
<?php print_header(); ?>
</header>
<article style="color:#FFFFFF;">
<p>
<!-- <center><img src="logo_big.png"></center> Insert Main Logo here -->
<hr/>
<center><h1>Xenoblade Chronicles X Craftable Skell Frames</h1></center>
<hr/>
<p>
<div class="box">
<p>
<center><h3>Craftable Skell Frames</h3></center>
Click on the skell frame you would like to find more details for.
<br/><br/>
Notes: <br/>
<ul>
<li><a href ="https://docs.google.com/spreadsheets/d/1g0YR4M8RAHiRhCbAvV4tjXXHLEhRMrARzZMYAUGmyZ4/pub#" target="_blank">Full spreadsheet that was used</a>, created by Gessenkou, and modified by myself and others.</li>
<li>This webpage was created by birdonwheels5.</li>
<li><a href="https://github.com/birdonwheels5/xenoblade-x-site/" target="_blank">Source code</a></li>
</ul>
</p>
</div>
<?php
if ($_SERVER["REQUEST_METHOD"] == "GET")
{
if(empty($_GET["frame"]))
{
print "<div class=\"box\">\n";
print "
<center><h3>Skell Frame Index</h3>
<br/>
<br/>
<table class=\"resultsTable\">
<tr>
<td>
<b>Frame Name</b>
<td/>
<td>
<b>Frame Type</b>
<td/>
</tr>";
print print_skell_frame($skell_frame_raw_data);
print "</center></div>\n";
die();
}
if(strcasecmp($skell_frame_raw_data[0][$search_result], $_GET["frame"]) != 0)
{
print "<div class=\"box\">";
print "The requested frame could not be found in the database. <br/><br/>";
// Explode the search term by spaces
$exploded_frame = explode(" ", $_GET["frame"]);
// Run a linear search with the first word of the search term
$linear_results = linear_augment_search($skell_frame_raw_data, $exploded_frame[0]);
$linear_results_count = count($linear_results);
if($linear_results_count != 0)
{
print "<br/><br/>";
print "Did you mean...<br/><br/>";
print "<ul>";
for($i = 0; $i < $linear_results_count; $i++)
{
// Replace spaces with +'s for url link
print "<li><a href =\"skell_frame_list.php?frame=" . preg_replace('/\s+/', '+', $linear_results[$i]) . "\">" . $linear_results[$i] . "</a></li>";
}
print "</ul></div>";
}
die();
}
// Put all the frame's data in its own array
$skell_frame_data = array();
for($i = 0; $i < 24; $i++) // We have 24 rows
{
$skell_frame_data[$i] = $skell_frame_raw_data[$i][$search_result];
}
// Search succeeded, time to get the rest of the data about the augment
$bestiary_data = get_skell_frame_bestiary_data($con, $skell_frame_raw_data[17][$search_result], $skell_frame_raw_data[18][$search_result],
$skell_frame_raw_data[19][$search_result], $skell_frame_raw_data[20][$search_result],
$skell_frame_raw_data[21][$search_result], $skell_frame_raw_data[22][$search_result]);
$frontiernav_data = get_frontiernav_data($con, $skell_frame_data[23]);
print
"<div class=\"box\">
<p>
<center><h3>Results for " . $skell_frame_data[0] . "</h3></center>
<br/>
<br/>
<table class=\"resultsTable\">
<tr>
<td>
<b>Frame Name</b>
<td/>
<td>
<b>Frame Type</b>
<td/>
<td>
<b>Required Miranium</b>
<td/>
<td>
<b>Armor Battle Traits</b>
<td/>
<td>
<b>Material 1</b>
<td/>
<td>
<b>Material 2</b>
<td/>
<td>
<b>Material 3</b>
<td/>
<td>
<b>Material 4</b>
<td/>
<td>
<b>Material 5</b>
<td/>
<td>
<b>Material 6</b>
<td/>
<td>
<b>Rare Resource</b>
<td/>
</tr>";
print print_skell_frame_result($skell_frame_data);
print "
</table>
<hr/>";
print "<h3>Stats</h3>";
print print_skell_frame_stats($skell_frame_data);
print "<hr/>
<table class=\"resultsTable\">
<tr>
<td>
<h2><a href=\"material_search.php?search_term=" . preg_replace('/\s+/', '+', trim(preg_replace('/[0-9]+/', '', $skell_frame_data[17]))) . "\" target=\"_blank\">" . trim(preg_replace('/[0-9]+/', '', $skell_frame_data[17])) . "</a></h2>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
</tr>";
print print_bestiary_table_head();
print print_bestiary_table($bestiary_data, 0);
print
"</p>
<p>
<table class=\"resultsTable\">
<tr>
<td>
<h2><a href=\"material_search.php?search_term=" . preg_replace('/\s+/', '+', trim(preg_replace('/[0-9]+/', '', $skell_frame_data[18]))) . "\" target=\"_blank\">" . trim(preg_replace('/[0-9]+/', '', $skell_frame_data[18])) . "</a></h2>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
</tr>";
print print_bestiary_table_head();
print print_bestiary_table($bestiary_data, 1);
print
"</p>
<p>
<table class=\"resultsTable\">
<tr>
<td>
<h2><a href=\"material_search.php?search_term=" . preg_replace('/\s+/', '+', trim(preg_replace('/[0-9]+/', '', $skell_frame_data[19]))) . "\" target=\"_blank\">" . trim(preg_replace('/[0-9]+/', '', $skell_frame_data[19])) . "</a></h2>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
</tr>";
print print_bestiary_table_head();
print print_bestiary_table($bestiary_data, 2);
print
"</p>
<p>
<table class=\"resultsTable\">
<tr>
<td>
<h2><a href=\"material_search.php?search_term=" . preg_replace('/\s+/', '+', trim(preg_replace('/[0-9]+/', '', $skell_frame_data[20]))) . "\" target=\"_blank\">" . trim(preg_replace('/[0-9]+/', '', $skell_frame_data[20])) . "</a></h2>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
</tr>";
print print_bestiary_table_head();
print print_bestiary_table($bestiary_data, 3);
print
"</p>
<p>
<table class=\"resultsTable\">
<tr>
<td>
<h2><a href=\"material_search.php?search_term=" . preg_replace('/\s+/', '+', trim(preg_replace('/[0-9]+/', '', $skell_frame_data[21]))) . "\" target=\"_blank\">" . trim(preg_replace('/[0-9]+/', '', $skell_frame_data[21])) . "</a></h2>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
</tr>";
print print_bestiary_table_head();
print print_bestiary_table($bestiary_data, 4);
print
"</p>
<p>
<table class=\"resultsTable\">
<tr>
<td>
<h2><a href=\"material_search.php?search_term=" . preg_replace('/\s+/', '+', trim(preg_replace('/[0-9]+/', '', $skell_frame_data[22]))) . "\" target=\"_blank\">" . trim(preg_replace('/[0-9]+/', '', $skell_frame_data[22])) . "</a></h2>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
</tr>";
print print_bestiary_table_head();
print print_bestiary_table($bestiary_data, 5);
print
"</p>
<p>
<table class=\"resultsTable\">
<tr>
<td>
<h2>" . trim(preg_replace('/[0-9]+/', '', $skell_frame_data[23])) . "</h2>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
<td>
<p></p>
<td/>
</tr>
<tr>
<td>
<b>FN Site: </b>
<td/>
<td>
<b>Mining: </b>
<td/>
<td>
<b>Research: </b>
<td/>
<td>
<b>Battle: </b>
<td/>
<td>
<b>Tourist Spots: </b>
<td/>
<td>
<b>Rare Resources: </b>
<td/>
<td>
<b>Connections: </b>
<td/>
</tr>";
print print_frontiernav_table($frontiernav_data);
}
?>
</p>
</div>
</p>
</p>
</article>
<div class="paddingBottom">
</div>
<div id="counter">
<img src="http://simplehitcounter.com/hit.php?uid=1998481&f=16777215&b=0" border="0" height="0" width="0" alt="web counter"></a>
</div>
<!-- <footer>
2016 birdonwheels5.
</footer> -->
</div>
</body>
</html>