forked from PokemonAbsolute/Absolute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevolution_center.php
135 lines (124 loc) · 2.83 KB
/
evolution_center.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
<?php
require_once 'core/required/layout_top.php';
?>
<div class='panel content'>
<div class='head'>Evolution Center</div>
<div class='body padding-5px'>
<div class='description'>
Select one of the Pokémon in your roster, and you'll be given a list of Pokémon that it may evolve into.
</div>
<table class='border-gradient' style='margin-bottom: 5px;'>
<thead>
<th colspan='6'>Roster</th>
</thead>
<tbody>
<tr id='Evo_Roster'>
<?php
for ( $i = 0; $i <= 5; $i++ )
{
if ( isset($User_Data['Roster'][$i]['ID']) )
{
$Roster_Slot[$i] = GetPokemonData($User_Data['Roster'][$i]['ID']);
echo "
<td style='width: calc(100% / 6);' onclick='Display_Evos({$Roster_Slot[$i]['ID']});'>
<img class='spricon' src='{$Roster_Slot[$i]['Icon']}' ?><br />
<b>{$Roster_Slot[$i]['Display_Name']}</b><br />
</td>
";
}
else
{
$Roster_Slot[$i]['Icon'] = DOMAIN_SPRITES . '/Pokemon/Sprites/0_mini.png';
$Roster_Slot[$i]['Display_Name'] = 'Empty';
echo "
<td style='width: calc(100% / 6);'>
<img class='spricon' src='{$Roster_Slot[$i]['Icon']}' ?><br />
<b>{$Roster_Slot[$i]['Display_Name']}</b>
</td>
";
}
}
?>
</tr>
</tbody>
</table>
<table class='border-gradient' id='Evo_Data' style='width: 750px;'>
<thead>
<tr>
<th colspan='7'>
Evolutions
</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan='7' style='padding: 5px;'>
Please select the Pokémon that you wish to evolve.
</td>
</tr>
</tbody>
</table>
</div>
</div>
<script type='text/javascript'>
function Display_Evos(Pokemon_ID)
{
$.ajax({
type: 'POST',
url: '<?= DOMAIN_ROOT; ?>/core/ajax/evocenter/evolutions.php',
data: {
Request: 'Show_Evos',
Pokemon_ID: Pokemon_ID
},
success: function(data)
{
$('#Evo_Data').html(data);
},
error: function(data)
{
$('#Evo_Data').html(data);
}
});
}
function Evolve_Pokemon(Pokemon_ID, Evolution_ID, Evolution_Alt_ID)
{
$.ajax({
type: 'POST',
url: 'core/ajax/evocenter/evolutions.php',
data: {
Request: 'Evolve',
Pokemon_ID: Pokemon_ID,
Evolution_ID: Evolution_ID,
Evolution_Alt_ID: Evolution_Alt_ID,
},
success: function(data)
{
$('#Evo_Data').html(data);
Display_Roster();
},
error: function(data)
{
$('#Evo_Data').html(data);
Display_Roster();
}
});
}
function Display_Roster()
{
$.ajax({
type: 'GET',
url: 'core/ajax/evocenter/roster.php',
data: { },
success: function(data)
{
$('#Evo_Roster').html(data);
},
error: function(data)
{
$('#Evo_Roster').html(data);
}
});
}
</script>
<?php
require_once 'core/required/layout_bottom.php';