Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $race = array(
- 0 => "Any",
- 1 => "Human",
- 2 => "Elf",
- 3 => "Oroc",
- 4 => "Goblin",
- 5 => "Gnome",
- 6 => "Half-elf",
- 7 => "Felpuur",
- 8 => "Undead",
- 9 => "Construct",
- 10 => "Dwarf",
- 11 => "Angel",
- 12 => "Orc",
- 13 => "Merfolk",
- 14 => "Magical Being"
- );
- $role = array(
- 0 => "Any",
- 1 => "Tank",
- 2 => "Melee",
- 3 => "Ranged",
- 4 => "Healer",
- 5 => "Special"
- );
- $source = array(
- 0 => "Any",
- 1 => "Strength",
- 2 => "Agility",
- 3 => "Intellect",
- 4 => "Wisdom",
- 5 => "Special"
- );
- $t = $_POST['t'];
- try {
- $db = new PDO('sqlite:dotd.db3');
- if ($t == "helmet") { $q = "SELECT * FROM equipment WHERE equipType = 3 ORDER BY ID DESC"; }
- else if ($t == "chest") { $q = "SELECT * FROM equipment WHERE equipType = 4 ORDER BY ID DESC"; }
- else if ($t == "pant") { $q = "SELECT * FROM equipment WHERE equipType = 6 ORDER BY ID DESC"; }
- else if ($t == "boot") { $q = "SELECT * FROM equipment WHERE equipType = 7 ORDER BY ID DESC"; }
- else if ($t == "glove") { $q = "SELECT * FROM equipment WHERE equipType = 5 ORDER BY ID DESC"; }
- else if ($t == "mh") { $q = "SELECT * FROM equipment WHERE equipType = 1 ORDER BY ID DESC"; }
- else if ($t == "oh") { $q = "SELECT * FROM equipment WHERE equipType = 2 OR equipType = 9 ORDER BY ID DESC"; }
- else if ($t == "ring") { $q = "SELECT * FROM equipment WHERE equipType = 8 ORDER BY ID DESC"; }
- else if ($t == "neck") { $q = "SELECT * FROM equipment WHERE equipType = 10 ORDER BY ID DESC"; }
- else { $q = "SELECT * FROM ".$t." ORDER BY ID DESC"; }
- $r = $db->query($q);
- $x = 0;
- while($row = $r->fetch(PDO::FETCH_NAMED)) {
- $x++;
- $c = ($x % 2 == 0 ? "even" : "odd");
- if ($t == "general" || $t == "troop") {
- echo "<tr class=\"".$c."\"><td class=\"nowrap\"><a href=\"http://dotd.wikia.com/wiki/".$row['name']."\">".$row['name']."</a></td>";
- echo "<td class=\"nowrap\">Attack: ".$row['attack']."<br />Defense: ".$row['defense']."</td>";
- echo "<td class=\"nowrap\">".$race[$row['race']]."/".$role[$row['role']]."/".$source[$row['source']]."</td>";
- echo "<td>".$row['proc_desc']."</td><td>".($row['lore'] ? '<a href="#" onclick="toggle('.$row['id'].');return false">[Lore]</a>' : '')."</td></tr>";
- echo "<tr class=\"".$c." lore\" id=\"".$row['id']."\"><td colspan=\"100%\">".$row['lore']."</td></tr>";
- }
- else if ($t == "magic" || $t == "consumable") {
- echo "<tr class=\"".$c."\"><td class=\"nowrap\"><a href=\"http://dotd.wikia.com/wiki/".$row['name']."\">".$row['name']."</a></td>";
- echo "<td>".$row['proc_desc']."</td><td>".($row['lore'] ? '<a href="#" onclick="toggle('.$row['id'].');return false">[Lore]</a>' : '')."</td></tr>";
- echo "<tr class=\"".$c." lore\" id=\"".$row['id']."\"><td colspan=\"100%\">".$row['lore']."</td></tr>";
- }
- else if ($t == "legion") {
- echo "<tr class=\"".$c."\"><td class=\"nowrap\"><a href=\"http://dotd.wikia.com/wiki/".$row['name']."\">".$row['name']."</a></td>";
- echo "<td class=\"nowrap\">Generals: ".$row['num_gen']."<br />Troops: ".$row['num_trp']."</td>";
- echo "<td class=\"nowrap\">Bonus: ".$row['bonus']."%".($row['bonusSpecial'] == 0 ? '' : '<br />'.$row['bonusText'].'')."</td>";
- echo "<td>".$row['proc_desc']."</td><td>".($row['lore'] ? '<a href="#" onclick="toggle('.$row['id'].');return false">[Lore]</a>' : '')."</td></tr>";
- echo "<tr class=\"".$c." lore\" id=\"".$row['id']."\"><td colspan=\"100%\">".$row['lore']."</td></tr>";
- }
- else {
- echo "<tr class=\"".$c."\"><td class=\"nowrap\"><a href=\"http://dotd.wikia.com/wiki/".$row['name']."\">".$row['name']."</a></td>";
- echo "<td class=\"nowrap\">Attack: ".$row['attack']."<br />Defense: ".$row['defense']."".($row['perception'] == 0 ? '' : '<br />Perception: '.$row['perception'].'')."</td>";
- echo "<td class=\"nowrap\">".($row['unq'] == 0 ? '' : '[Unique]<br />').($row['eng'] == 0 ? '' : 'Energy: '.$row['eng'].'<br />').($row['sta'] == 0 ? '' : 'Stamina: '.$row['sta'].'<br />').($row['hnr'] == 0 ? '' : 'Honor: '.$row['hnr'].'<br />').($row['hlt'] == 0 ? '' : 'Health: '.$row['hlt'].'<br />').($row['atk'] == 0 ? '' : 'Attack: '.$row['atk'].'<br />').($row['def'] == 0 ? '' : 'Defense: '.$row['def'].'<br />').($row['power'] == 0 ? '' : 'Power: '.$row['power'])."</td>";
- echo "<td>".$row['proc_desc']."</td><td>".($row['lore'] ? '<a href="#" onclick="toggle('.$row['id'].');return false">[Lore]</a>' : '')."</td></tr>";
- echo "<tr class=\"".$c." lore\" id=\"".$row['id']."\"><td colspan=\"100%\">".$row['lore']."</td></tr>";
- }
- }
- $db = null;
- } catch (PDOException $e) {
- echo "Error: ".$e->getMessage()."<br/>";
- die();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement