forked from Amit86/minimanager
-
Notifications
You must be signed in to change notification settings - Fork 38
/
char_spell.php
148 lines (118 loc) · 6.12 KB
/
char_spell.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
<?php
require_once 'header.php';
require_once 'libs/char_lib.php';
require_once 'libs/spell_lib.php';
valid_login($action_permission['read']);
//########################################################################################################################
// SHOW CHARACTERS SPELL
//########################################################################################################################
function char_spell(&$sqlr, &$sqlc)
{
global $output, $lang_global, $lang_char,
$realm_id, $characters_db, $mmfpm_db,
$action_permission, $user_lvl, $user_name,
$spell_datasite, $itemperpage;
wowhead_tt();
require_once 'core/char/char_security.php';
$start = (isset($_GET['start'])) ? $sqlc->quote_smart($_GET['start']) : 0;
if (is_numeric($start)); else $start=0;
$result = $sqlc->query('SELECT account, BINARY name AS name, race, class, level, gender
FROM characters WHERE guid = '.$id.' LIMIT 1');
if ($sqlc->num_rows($result))
{
$char = $sqlc->fetch_assoc($result);
$owner_acc_id = $char['account'];
$result = $sqlr->query('SELECT `username`, `SecurityLevel` FROM `account` LEFT JOIN `account_access` ON `account`.`id`=`account_access`.`AccountID` WHERE `account`.`id` = '.$owner_acc_id.' ORDER BY `SecurityLevel` DESC LIMIT 1');
$owner_name = $sqlr->result($result, 0, 'username');
$owner_gmlvl = $sqlr->result($result, 0, 'SecurityLevel');
if (empty($owner_gmlvl))
$owner_gmlvl = 0;
if (($user_lvl > $owner_gmlvl)||($owner_name === $user_name))
{
$all_record = $sqlc->result($sqlc->query('SELECT count(spell) FROM character_spell WHERE guid = '.$id.' and active = 1'), 0);
$result = $sqlc->query('SELECT spell FROM character_spell WHERE guid = '.$id.' and active = 1 order by spell ASC LIMIT '.$start.', '.$itemperpage.'');
$output .= '
<center>
<div id="tab_content">
<h1>'.$lang_char['spells'].'</h1>
<br />';
require_once 'core/char/char_header.php';
$output .= '
<br /><br />';
if ($sqlc->num_rows($result))
{
$output .= '
<table class="lined" style="width: 550px;">
<tr align="right">
<td colspan="4">';
$output .= generate_pagination('char_spell.php?id='.$id.'&realm='.$realmid.'&start='.$start.'', $all_record, $itemperpage, $start);
$output .= '
</td>
</tr>
<tr>
<th>'.$lang_char['icon'].'</th>
<th>'.$lang_char['name'].'</th>
<th>'.$lang_char['icon'].'</th>
<th>'.$lang_char['name'].'</th>
</tr>';
$sqlm = new SQL;
$sqlm->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
while ($spell = $sqlc->fetch_assoc($result))
{
$output .= '
<tr>
<td><a href="'.$spell_datasite.$spell['spell'].'"><img src="'.spell_get_icon($spell['spell'], $sqlm).'" class="icon_border_0" /></a></td>
<td align="left"><a href="'.$spell_datasite.$spell['spell'].'">'.spell_get_name($spell['spell'], $sqlm).'</a></td>';
if($spell = $sqlc->fetch_assoc($result))
$output .='
<td><a href="'.$spell_datasite.$spell['spell'].'"><img src="'.spell_get_icon($spell['spell'], $sqlm).'" class="icon_border_0" /></a></td>
<td align="left"><a href="'.$spell_datasite.$spell['spell'].'">'.spell_get_name($spell['spell'], $sqlm).'</a></td>
</tr>';
else
$output .='
<td></td>
<td></td>
</tr>';
}
$output .= '
<tr align="right">
<td colspan="4">';
$output .= generate_pagination('char_spell.php?id='.$id.'&realm='.$realmid.'&start='.$start.'', $all_record, $itemperpage, $start);
$output .= '
</td>
</tr>
</table>';
}
//---------------Page Specific Data Ends here----------------------------
//---------------Character Tabs Footer-----------------------------------
$output .= '
</div>
</div>
<br />';
require_once 'core/char/char_footer.php';
$output .='
<br />
</center>
<!-- end of char_spell.php -->';
}
else
error($lang_char['no_permission']);
}
else
error($lang_char['no_char_found']);
}
//########################################################################################################################
// MAIN
//########################################################################################################################
//$action = (isset($_GET['action'])) ? $_GET['action'] : NULL;
$lang_char = lang_char();
$output .= '
<div class="top">
<h1>'.$lang_char['character'].'</h1>
</div>';
char_spell($sqlr, $sqlc);
//unset($action);
unset($action_permission);
unset($lang_char);
require_once 'footer.php';
?>