0){ output("Creature deleted`n`n"); }else{ output("Creature not deleted: %s", db_error(LINK)); } $op=""; httpset('op', ""); } if ($op=="" || $op=="search"){ $level = httpget("level"); if (!$level) $level = 1; $q = httppost("q"); if ($q) { $where = "creaturename LIKE '%$q%' OR creatureweapon LIKE '%$q%' OR creaturelose LIKE '%$q%' OR createdby LIKE '%$q%'"; } else { $where = "creaturelevel='$level'"; } $sql = "SELECT * FROM " . db_prefix("creatures") . " WHERE $where ORDER BY creaturelevel,creaturename"; $result = db_query($sql); // Search form $search = translate_inline("Search"); rawoutput("
"); rawoutput("",true); addnav("","creatures.php?op=search"); addnav("Levels"); $sql1 = "SELECT count(creatureid) AS n,creaturelevel FROM " . db_prefix("creatures") . " group by creaturelevel order by creaturelevel"; $result1 = db_query($sql1); while ($row = db_fetch_assoc($result1)) { addnav(array("Level %s: (%s creatures)", $row['creaturelevel'], $row['n']), "creatures.php?level={$row['creaturelevel']}"); } // There is no reason to allow players to add creatures to level 17 and 18. // Players aren't supposed to stay at level 15 at all. if ($level <= 16) { addnav("Edit"); addnav("Add a creature","creatures.php?op=add&level=$level"); } $opshead = translate_inline("Ops"); $idhead = translate_inline("ID"); $name = translate_inline("Name"); $lev = translate_inline("Level"); $weapon = translate_inline("Weapon"); $winmsg = translate_inline("Win"); $diemsg = translate_inline("Die"); $author = translate_inline("Author"); $edit = translate_inline("Edit"); $confirm = translate_inline("Are you sure you wish to delete this creature?"); $del = translate_inline("Del"); rawoutput("$opshead | $idhead | $name | $lev | $weapon | $winmsg | $diemsg | $author |
[ "); output_notl("%s", $edit); rawoutput(" | "); output_notl("%s", $del); rawoutput(" ] | "); addnav("","creatures.php?op=edit&creatureid={$row['creatureid']}"); addnav("","creatures.php?op=del&creatureid={$row['creatureid']}&level={$row['creaturelevel']}"); output_notl("%s", $row['creatureid']); rawoutput(" | "); output_notl("%s", $row['creaturename']); rawoutput(" | "); output_notl("%s", $row['creaturelevel']); rawoutput(" | "); output_notl("%s", $row['creatureweapon']); rawoutput(" | "); output_notl("%s", $row['creaturewin']); rawoutput(" | "); output_notl("%s", $row['creaturelose']); rawoutput(" | "); output_notl("%s", $row['createdby']); rawoutput(" |