// the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // **************************************************************************** // main eveAPI file. set_include_path(get_include_path() . PATH_SEPARATOR . "eveApi"); require_once "eve.config.php"; require_once "eve.funcs.php"; require_once "eveApi.base.php"; //Auto load the eveApi pages $files = scandir("./eveApi/"); $includes = array(); foreach ($files as $file) { if (pathinfo($file, PATHINFO_EXTENSION) == "php") { include_once "./eveApi/" . pathinfo($file, PATHINFO_BASENAME); } } if (!isset($sql_port)) { $sql_port = 3306; } $Db = new eveDb(); $Db->loadByParams($sql, $sql_u, $sql_p, $db, $sql_port, false);
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // **************************************************************************** // item viewer if (!isset($_GET['id'])) { include "itemsrch.php"; exit; } require_once "eve.php"; $id = (int) $_GET['id']; $Db = new eveDb($sql, $sql_u, $sql_p, $db); $name = $Db->getNameFromTypeId($id); ?> <html> <head> <title><?php echo $name; ?> </title> </head> <body> <?php $sql = "SELECT description FROM " . DB_PREFIX . "invTypes WHERE typeID = '" . mysql_real_escape_string($id) . "'"; $result = $Db->query($sql); if (!$result) { exit;
<head> <title>Item Search</title> </head> <body> <form action="itemsrch.php" method="get"> <input type="text" size=50 name="srch" value="<?php if (isset($_GET['srch'])) { echo $_GET['srch']; } ?> "> <input type="submit" value="Search"> </form> <?php require_once "eve.php"; $Db = new eveDb($sql, $sql_u, $sql_p, $db); if (isset($_GET['srch'])) { $srch = $_GET['srch']; if (strlen($srch) < 3) { die("Enter at least 3 letters!</body></html>"); } if (strpos($srch, "group:") !== false) { $sql = "SELECT typeName, typeID FROM " . DB_PREFIX . "invTypes WHERE groupId = " . mysql_real_escape_string(substr($srch, strpos($srch, "group:") + 6)) . " ORDER BY typeName"; } else { if (strpos($srch, "race:") !== false) { $sql = "SELECT typeName, typeID FROM " . DB_PREFIX . "invTypes WHERE raceId = " . mysql_real_escape_string(substr($srch, strpos($srch, "race:") + 5)) . " ORDER BY typeName"; } else { $sql = "SELECT typeName, typeID FROM " . DB_PREFIX . "invTypes WHERE typeName LIKE '%" . mysql_real_escape_string($srch) . "%' ORDER BY typeName"; } } $result = $Db->query($sql);