forked from AlexJezior/TheFallenImmortals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
itemdescription.php
46 lines (36 loc) · 2.13 KB
/
itemdescription.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
<?php
session_name("icsession");
session_start();
include('db.php');
if($_POST['itemid'] != "Nothing"){
$data = "";
$querty = mysqli_query($conn, "SELECT * FROM inventory WHERE id='".$_POST['itemid']."' AND username='".$char['username']."'");
$inventory = mysqli_fetch_assoc($querty);
if($inventory['type'] == "Item"){
$data .= "<center> <a href=\'javascript: useItem(\"".$inventory['id']."\");\'><b>Use</b></a><table>";
}
elseif($inventory['equipped'] == "No" && $inventory['type'] != "Item"){
$current = mysqli_query($conn, "SELECT * FROM inventory WHERE type='".$inventory['type']."' AND equipped='Yes' AND username='".$char['username']."'");
$equipped = mysqli_fetch_assoc($current);
$information = "Name: ".$equipped['itemname']." 
 |Type: ".$equipped['type']." 
 |Lvl Req: ".$equipped['levelreq']." 
 |Str: ".$equipped['strength']." 
 |Dex: ".$equipped['dexterity']." 
 |End: ".$equipped['endurance']." 
 |Int: ".$equipped['intelligence']." 
 |Con: ".$equipped['concentration']." 
 |Price: ".$equipped['value']."";
$data .= "<center>[<a title=\'".$information."\'>?</a>] <a href=\'javascript: equip(\"".$inventory['id']."\");\'><b>Equip</b></a><table>";
}elseif($inventory['equipped'] == "Yes" && $inventory['type'] != "Item"){
$data .= "<center><a href=\'javascript: unequip(\"".$inventory['id']."\");\'><b>Unequip</b></a><table>";
}
if($inventory['type'] != "Item"){
$data .= "<tr><td>Type:</td><td>".$inventory['type']."</td></tr>";
$data .= "<tr><td>Level Req:</td><td>".$inventory['levelreq']."</td></tr>";
$data .= "<tr><td>Str:</td><td>".$inventory['strength']."</td></tr>";
$data .= "<tr><td>Dex:</td><td>".$inventory['dexterity']."</td></tr>";
$data .= "<tr><td>End:</td><td>".$inventory['endurance']."</td></tr>";
$data .= "<tr><td>Int:</td><td>".$inventory['intelligence']."</td></tr>";
$data .= "<tr><td>Con:</td><td>".$inventory['concentration']."</td></tr>";
$data .= "<tr><td>Price:</td><td>".$inventory['value']."</td></tr>";
}
$data .= "</table></center>";
}else{
$data = "Nothing!";
}
print("fillDiv('itemDesc','".$data."');");
include('updatestats.php');
?>