forked from Akkadius/EQEmuEOC
/
global.php
91 lines (87 loc) · 3.15 KB
/
global.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
<?php
/* Handles global $db, Common Requests */
require_once('includes/config.php');
require_once('includes/functions.php');
/*
Displays Modal Spell View
*/
/* Handles Request for toggling UI Style */
if(isset($_GET['ToggleUIStyle'])){
if($_GET['ToggleUIStyle'] == 1){ $_SESSION['UIStyle'] = 1; }
if($_GET['ToggleUIStyle'] == 2){ $_SESSION['UIStyle'] = 2; }
exit;
}
/*
Handles Request for viewing spell data in a Modal
*/
if(isset($_GET['spellview'])){
require_once('includes/spell.inc.php');
require_once('includes/alla_functions.php');
if($_GET['spellview'] > 0){
$QueryResult = mysqli_query($db, "SELECT * FROM spells_new WHERE `id` = ". $_GET['spellview'] . ";");
while($row = mysqli_fetch_array($QueryResult)){
$Content .= BuildSpellInfo($row, 1);
}
}
else{
$Content .= 'There is currently no spell data...<br>';
}
echo Modal('View Spell Data', '<div class="alert alert-info">' . $Content . '</div>', '');
}
/*
Displays Item View tooltip
*/
if(isset($_GET['item_view'])){
require_once('includes/constants.php');
require_once('includes/alla_functions.php');
require_once('modules/ItemEditor/constants_ie.php');
// echo '<style></style>';
$QueryResult = mysqli_query($db, "SELECT * FROM items WHERE `id` = ". $_GET['item_view'] . ";");
while($row = mysqli_fetch_array($QueryResult)){
// $Content .= BuildSpellInfo($row, 1);
echo BuildItemStats($row, 1, 'item_view');
}
}
/*
Displays Spell View tooltip
*/
if(isset($_GET['spell_view'])){
require_once('includes/spell.inc.php');
require_once('includes/constants.php');
require_once('includes/alla_functions.php');
require_once('modules/ItemEditor/constants_ie.php');
$QueryResult = mysqli_query($db, "SELECT * FROM spells_new WHERE `id` = ". $_GET['spell_view'] . ";");
while($row = mysqli_fetch_array($QueryResult)){
$Content .= BuildSpellInfo($row, 1, 'item_view');
echo $Content;
}
if(!$Content){ echo 'There is no data available...'; }
}
/*
Displays Inline Spell View Data for inline editing as well...
Requested via tooltip...
*/
if(isset($_GET['spell_view_data_quick'])){
require_once('includes/spell.inc.php');
require_once('includes/constants.php');
require_once('includes/alla_functions.php');
require_once('modules/ItemEditor/constants_ie.php');
require_once('modules/SpellEditor/functions.php');
$result = mysqli_query($db, "SELECT * FROM spells_new WHERE `id` = ". $_GET['spell_view_data_quick'] . ";");
$columns = mysqli_num_fields($result);
echo '<div style="width:600px;height:700px;overflow-y;scroll">';
echo '<h4 class="page-title"><i class="fa fa-database"></i> Spell Inline Editor</h4><hR>';
echo '<table class="table table-hover">';
echo '<tr>
<th style="width:200px">Field</th>
<th>Data</th>
</tr>';
for ($i = 0; $i < $columns; $i++){
$FieldName = mysqli_field_name($result, $i);
$FieldData = mysqli_result($result, 0, $i);
echo '<tr><td><b>' . $FieldName . '</b><br><small>' . $spells_new_fields[$FieldName][0] . '</small></td><td> ' . SpellFieldInput($_GET['spell_view_data_quick'], $FieldName, $FieldData) . '</td></tr>';
}
echo '</table>';
echo '</div>';
}
?>