Repository navigation
Expand file tree
/
Copy pathmounts.php
More file actions
92 lines (91 loc) · 4.03 KB
/
Copy pathmounts.php
File metadata and controls
92 lines (91 loc) · 4.03 KB
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
<?php
require "com/scorchedcode/mounts/mountfactory.php";
$mounts = new MountFactory();
?>
<?php if(!(isset($_GET["name"]) || isset($_GET["bonus"]))): ?>
<html>
<head><title>Mod16 Mount Helper</title>
<link href="mounts.css" rel="stylesheet">
<script src="jquery-3.3.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="tooltipster/dist/css/tooltipster.bundle.min.css" />
<script type="text/javascript" src="tooltipster/dist/js/tooltipster.bundle.min.js"></script>
<script src=mounts.js type="text/javascript"></script>
</head>
<?php include 'header.html'; ?>
<body style="background:url('img/firehorse.jpg') no-repeat; background-size:100%">
<form name="mount" action="mounts.php" method="post">
<b>Name:</b><select name="Names" id="Names">
<option value=""></option>
<?php foreach($mounts->listNames() as $name): ?>
<option value=<?= "\"".$name."\">".$name; ?></option>
<?php endforeach; ?>
</select><br />
<b>Insignia:</b><select name="Insignias" id="Insignias">
<option value=""></option>
<?php foreach((new InsigniaFactory())->listNames() as $name): ?>
<option value=<?= "\"".$name."\">".$name; ?></option>
<?php endforeach; ?>
</select><br />
<b>Stat Type:</b><select name="Types" id="Types">
<option value=""></option>
<option value="Buff">Buff</option>
<option value="Debuff">Debuff</option>
<option value="Damage">Damage</option>
<option value="Stat">Stat</option>
</select>
<input type="submit" value="Lookup"><br />
</form>
<?php if($_SERVER["REQUEST_METHOD"] == "POST"): ?>
<?php if(!isset($_POST["Names"]) || $_POST["Names"] == ""): ?>
<?php if(isset($_POST["Insignias"])): ?>
<?php foreach($mounts->getMountsFromFilter($_POST["Insignias"], null) as $bonus): ?>
<b><span class="mountpreview" title="Loading..." style="color:<?= $mounts->textsafecolors[($mounts->getMount(str_replace("\n", "", $bonus)))->getSpeed()] ?> !important;"><?= $bonus ?></span></b><br />
<?php endforeach; ?>
<?php else: ?>
<?php foreach($mounts->getMountsFromFilter(null, $_POST["Types"]) as $type): ?>
<b><span class="mountpreview" title="Loading..." style="color:<?= $mounts->textsafecolors[($mounts->getMount(str_replace("\n", "", $type)))->getSpeed()] ?> !important;"><?= $type ?></span></b><br />
<?php endforeach; ?>
<?php endif; ?>
<?php else: ?>
<?php $themount = $mounts->getMount($_POST["Names"]); ?>
<fieldset style="display:inline; background-color:<?= $mounts->colors[$themount->getSpeed()] ?>;">
<legend><h4><i><?= $themount->getName(); ?></i></h4></legend>
<img style="position:relative; object-fit:contain; height:100px; width:100px;" src=<?= "\"".$themount->getPicture(). "\">"; ?>
<?php if($themount->getSpeed() == "110" || $themount->getSpeed() == "140"): ?>
<h5><u>Equip Power:</u></h5>
<i><font size="3"><b><?= $themount->getEquip(); ?></b></font></i>
<?php endif; ?>
<?php if($themount->getSpeed() == "140"): ?>
<h5><u>Combat Power</u></h5>
<i><font size="3"><b><?= $themount->getCombat(); ?></b></i>
<?php endif; ?>
<?php if($themount->getInsignia() != ""): ?>
<h5><u>Insignias</u></h5>
<i><font size="3"><b><?= str_replace("\r\n", "<br />", $themount->getInsignia()); ?></b></i>
<h5><u><font color="red" size="20px">POSSIBLE</font> Insignia Bonuses</u></h5>
<?php foreach(explode("\n", $themount->getPossibleBonuses()) as $bonusline): ?>
<i><font size="3"><b><span title="Loading..." class="insigdesc"><?= $bonusline; ?></span></font></b></i><br />
<?php endforeach; ?>
<?php endif; ?>
</fieldset>
<?php endif; ?>
<?php endif; ?>
<!-- script src="artifacts.js"></script> -->
</body>
</html>
<?php else: ?>
<?php header('Content-Type: application/json');
if(isset($_GET["name"])) {
$lookupmount= $mounts->getMount($_GET["name"]);
if($lookupmount != null)
echo json_encode(["status" => 200, "message" => $lookupmount]);
else
echo json_encode(["status" => 400, "message" => "Bad Request"]);
}
elseif(isset($_GET["bonus"]))
echo json_encode(["status" => 200, "message" => (new InsigniaFactory())->getBonus($_GET["bonus"])]);
else
echo json_encode(["status" => 400, "message" => "Bad Request"]);
exit();
?>
<?php endif; ?>