forked from Znote/ZnoteAAC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spells.php
134 lines (126 loc) · 4.88 KB
/
spells.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
<?php
require_once 'engine/init.php'; include 'layout/overall/header.php'; echo '<h1>Spells</h1>';
if(file_exists('spell.php')) { require_once 'spell.php'; ?>
<table>
<tr class="yellow">
<td><b>Name</b></td>
<?php if($show_spells_groups) echo '<td><b>Group</b></td>'; ?>
<td><b>Type</b></td>
<td><b>Exp Lvl</b></td>
<td><b>Mana</b></td>
<td><b>Premium</b></td>
</span>
</tr>
<?php
@$sort = $_REQUEST['sort'];
if(!isset($sort)) $sort = 'name';
@$vocation = $_REQUEST['vocation'];
if(!isset($vocation)) $vocation = 'vall';
if($show_spells_groups)
{
@$group = $_REQUEST['_group'];
if(!isset($group)) $group = 'gall';
}
@$type = $_REQUEST['_type'];
if(!isset($type)) $type = 'tall';
@$premium = $_REQUEST['_premium'];
if(!isset($premium)) $premium = 'pall';
$order = array();
foreach($spells as $key => $row)
{
$order[$key] = $row[$sort];
}
array_multisort($order, SORT_ASC, $spells);
foreach($spells as $spell) {
if($vocation != 'vall')
{
if(!in_array($vocation, $spell['vocation'])) continue;
}
if($show_spells_groups && $group != 'gall')
{
if($spell['group'] != $group) continue;
}
if($type != 'tall')
{
if($spell['type'] != $type) continue;
}
if($premium != 'pall')
{
if($spell['premium'] != $premium) continue;
}
?>
<tr>
<td><?php echo '<b>'.$spell['name'].'</b> ('.$spell['words'].')'; ?></td>
<?php if($show_spells_groups) echo '<td>'.$spell['group'].'</td>'; ?>
<td><?php echo $spell['type']; ?></td>
<td><?php echo $spell['level']; ?></td>
<td><?php echo $spell['mana']; ?></td>
<td><?php echo $spell['premium']; ?></td>
</tr>
<?php } echo '</table>'; ?>
<form action='spells.php' method='post'>
<table>
<tr class="yellow">
<td colspan=4><b>Spell Search</b></td></tr>
<tr class="yellow">
<?php if($show_spells_groups) {
echo'<td width=25%><b>vocation</b></td>
<td width=25%><b>group</b></td>
<td width=25%><b>type</b></td>
<td width=25%><b>premium</b></td>';}
else {
echo'<td width=40%><b>vocation</b></td>
<td width=30%><b>type</b></td>
<td width=30%><b>premium</b></td>';}?>
</tr>
<tr>
<td valign='top'>
<input type='radio' name='vocation' value='vall' checked> all<br>
<?php
foreach(config('vocations') as $id => $vocation)
{
if($id > 0)
{
echo "<input type='radio' name='vocation' value='".$vocation."'> ".$vocation."<br>";
}
}
?>
</td>
<?php
if($show_spells_groups) echo"
<td valign='top'>
<input type='radio' name='_group' value='gall' checked> all<br>
<input type='radio' name='_group' value='Attack'> attack<br>
<input type='radio' name='_group' value='Healing'> healing<br>
<input type='radio' name='_group' value='Support'> support</td>"; ?>
<td valign='top'>
<input type='radio' name='_type' value='tall' checked> all<br>
<input type='radio' name='_type' value='Instant'> instant<br>
<input type='radio' name='_type' value='Rune'> rune
</td>
<td valign='top'>
<input type='radio' name='_premium' value='pall' checked> all<br>
<input type='radio' name='_premium' value='no'> no<br>
<input type='radio' name='_premium' value='yes'> yes
</td>
</tr>
<tr>
<td>sort by:
<select name='sort'>
<option value='name' selected>name
<option value='words'>words
<?php if($show_spells_groups) echo "<option value='group' >group"; ?>
<option value='type' >type
<option value='level' >exp lvl
<option value='mana' >mana
<option value='premium' >premium
</select>
</td>
<td colspan='3'>
<input type='submit' name='submit'>
</td>
</tr>
</table>
</form>
<?php } else { echo 'This page has not been configured yet.'; };
include 'layout/overall/footer.php'; ?>