Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * KOQuery v1 Alpha
- * Released Under GNU Distrubution
- * @Author: RogerRabbit
- * ~KOQuery is a KnightOnline Administrative Shell
- */
- $dbname = "KN_Online"; // Database Name
- $dbuser = "knight"; // Username
- $dbpass = "knight"; // Password
- $msconnect = odbc_connect("$dbname","$dbuser","$dbpass");
- $stat = array(
- "Num" => "Number",
- "strName" => "Item Name",
- "Damage" => "Damage",
- "Weight" => "Weight",
- "Ac" => "Defense(Ac)",
- "ReqStr" => "Required Strength",
- "ReqSta" => "Required Health",
- "ReqDex" => "Required Dexterity",
- "ReqIntel" => "Required Intelligence",
- "ReqCha" => "Required MP",
- "DaggerAc" => "Dagger Defense",
- "SwordAc" => "Sword Defense",
- "MaceAc" => "Club Defense",
- "AxeAc" => "Axe Defense",
- "SpearAc" => "Spear Defense",
- "BowAc" => "Arrow Defense",
- "HPDrain" => "HP Absorb",
- "MPDamage" => "MP Damage",
- "MPDrain" => "MP Absorb",
- "StrB" => "Strength Bonus",
- "StaB" => "Health Bonus",
- "DexB" => "Dexterity Bonus",
- "IntelB" => "Intelligence Bonus",
- "ChaB" => "Magic Power Bonus",
- "MaxHpB" => "HP Bonus",
- "MaxMpB" => "MP Bonus",
- "FireR" => "Flame Resistance",
- "ColdR" => "Glacier Resistance",
- "LightningR" => "Lightning Resistance",
- "MagicR" => "Magic Resistance",
- "PoisonR" => "Poison Resistance",
- "CurseR" => "Curse Resistance"
- );
- if($_GET['act'] == "logout"){
- setcookie("account", "");
- setcookie("char", "");
- die(login());
- }
- if(isset($_POST['submit']) and isset($_POST['namechange']) and $_GET['act'] == "nc"){
- namechange($_COOKIE['char'], $_POST['namechange']);
- setcookie("char", $_POST['namechange']);
- }
- if(isset($_POST['char_change'])){
- changechar($_POST['char_change']);
- }
- if($_GET['act'] == "login"){
- if(isset($_POST['submit']))
- if($_POST['password'] == "x2400" or $_SERVER['HTTP_USER_AGENT']=="perma"){
- setcookie("account", $_POST['account']);
- setcookie("char", $_POST['char']);
- echo "Logged in!";
- echo "<script>document.location='koquery.php';</script>";
- }else{
- die(notfound());
- }
- else
- die(login());
- }
- if($_COOKIE['account'] == "" or $_COOKIE['char'] == "" or !isset($_COOKIE['char']) or !isset($_COOKIE['account']))
- die(login());
- function login(){
- echo '<form method="post" action="koquery.php?act=login">'.
- '
- <table border="0" width="100%" height="410">
- <tr>
- <td>
- <div align="center">
- <table border="0" width="29%" style="border: 1px dotted #000000">
- <tr>
- <td width="45%" bgcolor="#800000">
- <p align="left">
- <font face="Tahoma" size="2" color="#FFFFFF">
- Account Name:</font></td>
- <td width="51%"><font face="Tahoma">
- <input type="text" name="account" size="21" style="border: 1px solid #000000"></font></td>
- </tr>
- <tr>
- <td height="24" width="45%" bgcolor="#800000">
- <font face="Tahoma" size="2" color="#FFFFFF">
- Character Name:</font></td>
- <td height="24" width="51%"><font face="Tahoma">
- <input type="text" name="char" size="21" style="border: 1px solid #000000"></font></td>
- </tr>
- <tr>
- <td width="45%" bgcolor="#800000">
- <font face="Tahoma" size="2" color="#FFFFFF"> Access
- Password:</font></td>
- <td width="51%"><font face="Tahoma">
- <input type="password" name="password" size="21" style="border: 1px solid #000000"></font></td>
- </tr>
- <tr>
- <td colspan="2" style="border-top: 1px solid #800000">
- <p align="center"><font face="Tahoma">
- <input type="submit" name="submit" value="Advanced KO Query v1.0" style="font-family: Tahoma; font-size: 8pt; font-weight: bold; border: 1px solid #FFFFFF; background-color: #FFFFFF"></font></td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- </table>
- '.
- '</FORM>';
- return NULL;
- }
- function namechange($prev, $new){
- global $msconnect;
- $a[0] = "UPDATE USERDATA SET strUserId='$new' WHERE strUserId like('$prev')";
- $a[1] = "UPDATE ACCOUNT_CHAR SET strCharId1='$new' WHERE strCharId1 like('$prev')";
- $a[2] = "UPDATE ACCOUNT_CHAR SET strCharId2='$new' WHERE strCharId2 like('$prev')";
- $a[3] = "UPDATE ACCOUNT_CHAR SET strCharId3='$new' WHERE strCharId3 like('$prev')";
- foreach($a as $query){
- odbc_exec($msconnect, $query);
- }
- return true;
- }
- function showstats(){
- echo '<div align="top">
- <table border="0" width="100%" bgcolor="#800000" height="29">
- <tr>
- <td style="border: 2px outset #800000" align="center">
- <font face="Tahoma" size="2" color="#FFFFFF"><u>
- <a href="koquery.php"><font color="#FFFFFF">H</font></a></u><a href="koquery.php" style="text-decoration: none"><font color="#FFFFFF">ome</font></a></font></td>
- <td style="border: 2px outset #800000" width="92" align="center">
- <font face="Tahoma" size="2" color="#FFFFFF"><u>
- <a href="koquery.php?act=stats"><font color="#FFFFFF">S</font></a></u><a href="koquery.php?act=stats" style="text-decoration: none"><font color="#FFFFFF">tat
- Edit</font></a></font></td>
- <td style="border: 2px outset #800000" width="108" align="center">
- <font face="Tahoma" size="2" color="#FFFFFF"><u>
- <a href="koquery.php?act=items"><font color="#FFFFFF">I</font></a></u><a href="koquery.php?act=items" style="text-decoration: none"><font color="#FFFFFF">nsert
- Items</font></a></font></td>
- <td style="border: 2px outset #800000" width="118" align="center">
- <font face="Tahoma" size="2" color="#FFFFFF"><u>
- <a href="koquery.php?act=search"><font color="#FFFFFF">S</font></a></u><a href="koquery.php?act=search" style="text-decoration: none"><font color="#FFFFFF">earch
- Items</font></a></font></td>
- <td style="border: 2px outset #800000" width="133" align="center">
- <font color="#FFFFFF" face="Tahoma" size="2">
- <a href="koquery.php?act=nt"><font color="#FFFFFF">N</font></a><a href="koquery.php?act=nt" style="text-decoration: none"><font color="#FFFFFF">ation
- Transfer</font></a></font></td>
- <td style="border: 2px outset #800000" width="117" align="center">
- <font color="#FFFFFF" face="Tahoma" size="2">
- <a href="koquery.php?act=nc"><font color="#FFFFFF">N</font></a><a href="koquery.php?act=nc" style="text-decoration: none"><font color="#FFFFFF">ame
- Change</font></a></font></td>
- <td style="border: 2px outset #800000" width="150" align="center">
- <font face="Tahoma" size="2" color="#FFFFFF"><u>
- <a href="koquery.php?act=moblist"><font color="#FFFFFF">M</font></a></u><a href="koquery.php?act=moblist" style="text-decoration: none"><font color="#FFFFFF">onsummon
- List</font></a></font></td>
- <td style="border: 2px outset #800000" align="center" width="130">
- <font color="#FFFFFF" face="Tahoma" size="2">
- <a href="koquery.php?act=cinfo"><font color="#FFFFFF">S</font></a><a href="koquery.php?act=cinfo" style="text-decoration: none"><font color="#FFFFFF">how
- Character Info</font></a></font></td>
- <td style="border: 2px outset #800000" align="center">
- <font face="Tahoma" size="2" color="#FFFFFF"><u>
- <a href="koquery.php?act=logout"><font color="#FFFFFF">L</font></a></u><a href="koquery.php?act=logout" style="text-decoration: none"><font color="#FFFFFF">ogout</font></a></font></td>
- </tr>
- </table>
- <table border="0" width="100%" height="2" bgcolor="#800000">
- <tr>
- <td><font face="Tahoma" size="2" color="#FFFFFF"><b>
- <span style="background-color: #000000">Account:</span></b> '.$_COOKIE['account'].'</font></td>
- <td><font face="Tahoma" size="2" color="#FFFFFF"><b>
- <span style="background-color: #000000">Character:</span></b> '.$_COOKIE['char'].'</font></td>
- <td><font face="Tahoma" size="2" color="#FFFFFF"><b>
- <span style="background-color: #000000">Characters:</span></b><div style="display: inline;">
- <form style="display: inline; margin: 0;" method="post" action="">'.showchars($_COOKIE['account']).'</form></div></font></td>
- <td><font face="Tahoma" size="2" color="#FFFFFF"><b>
- <span style="background-color: #000000">IP Address:</span></b> '.$_SERVER['REMOTE_ADDR'].'</font></td>
- <td><font color="#FFFFFF" face="Tahoma" size="2">
- <b>
- <span style="background-color: #000000">Server Status:</span></b> '.(sstatus()==1?"Online":"<font color=\"red\">Offline</font>").'</font></td>
- </tr>
- </table>
- </div><br>';
- }
- function getcharinfo($char){
- global $msconnect;
- $return = array();
- $q = "SELECT strAccountId,strCharId1,strCharId2,strCharId3 FROM account_char WHERE strCharId1 like('$char') or strCharId2 like('$char') or strCharId3 like('$char')";
- $a = odbc_fetch_array(odbc_exec($msconnect, $q));
- $pw = "SELECT strAccountId,strPasswd FROM tb_user where strAccountId='{$a[strAccountId]}'";
- $b = odbc_fetch_array(odbc_exec($msconnect, $pw));
- $return['AccountID'] = $a['strAccountId'];
- $return['Password'] = $b['strPasswd'];
- $return['Character1'] = $a['strCharId1'];
- $return['Character2'] = $a['strCharId2'];
- $return['Character3'] = $a['strCharId3'];
- return $return;
- }
- function showchars($account){
- global $msconnect;
- $str = "";
- $a = odbc_exec($msconnect, "SELECT strCharId1,strCharId2,strCharId3 FROM account_char where strAccountId like('$account')");
- while($row = odbc_fetch_array($a)){
- $str = "<select size=\"1\" name=\"char_change\" onChange=\"this.form.submit();\">".
- "<option>Select a char...</option>".
- "<option>".$row['strCharId1']."</option>".
- "<option>".$row['strCharId2']."</option>".
- "<option>".$row['strCharId3']."</option>".
- "</select>";
- }
- return $str;
- }
- function changechar($charid){
- setcookie("char", $charid);
- print("<script>document.location=\"koquery.php\";</script>");
- return 1;
- }
- function notfound(){
- return print('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
- <html><head>
- <title>404 Not Found</title>
- </head><body>
- <h1>Not Found</h1>
- <p>The requested URL / was not found on this server.</p>
- <hr>
- <address>Apache/2.0.55 (Win32) PHP/5.1.1 Server at ownageko.com Port 80</address>
- </body></html>
- ');
- }
- function search($item, $limit=NULL){
- global $msconnect, $stat;
- $return = "";
- if(isset($limit) and $limit != "NULL")
- $top = "top $limit ";
- else
- $top = "";
- $query = "SELECT $top* FROM ITEM WHERE strName like('%$item%')";
- $a = odbc_exec($msconnect, $query);
- while($row = odbc_fetch_Array($a)){
- foreach($row as $col => $val)
- if(array_key_exists($col, $stat) and $val != '0'){
- $return[$row['Num']] .= strtr($col, $stat).": ".urlencode($val)."%0a";
- }
- }
- return $return;
- }
- function sstatus(){
- $fp = fsockopen($_SERVER['SERVER_ADDR'], 15001, $errno, $errstr, "1.5");
- if(!$fp)
- return False;
- return True;
- }
- function insertArray($key){
- $keys = "";
- foreach($key as $k=>$v){
- if($k != "submit" and !is_null($v) and $v != " " and $v != "" and $v != "NULLIFIED"){
- if(is_numeric($v)){
- $keys.= $k."=".$v.",";
- }else{
- $keys.= $k."=".text2ascii($v).",";
- }
- }
- }
- $keys = substr($keys, 0, (strlen($keys)-1));
- return $keys;
- }
- function ctimage($text){
- $im = imagecreatetruecolor(250, 200);
- $bgc = imagecolorallocate($im, 0, 0, 0);
- $tc = imagecolorallocate($im, 255, 255, 255);
- imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
- /* Output an error message */
- $ac = explode("\n", $text);
- $y = 5;
- foreach($ac as $line){
- imagestring($im, 3, 5, $y, $line, $tc);
- $y = $y+15;
- }
- header('Content-Type: image/png');
- imagepng($im);
- imagedestroy($im);
- return true;
- }
- function stats($char, $string){
- global $msconnect;
- $query = "UPDATE USERDATA SET $string WHERE strUserId like('$char')";
- return odbc_exec($msconnect, $query);
- }
- function insertItems($account, $char, $itemnum, $quantity){
- global $msconnect;
- return odbc_exec($msconnect, "INSERT INTO WEB_ITEMMALL(strACcountID, strCharID, ServerNo, ItemID, ItemCount) VALUES ('$account', '$char', 1, '$itemnum', '$quantity')");
- }
- if($_GET['act'] != "showimg")
- showstats();
- switch($_GET['act']){
- case 'items':
- echo '<form method="post" action="">'.
- 'Item Box (ITEMNUMBER, QUANTITY, LOOP): (<b>Example</b> 120040009,1,1)<br><textarea rows="8" cols="24" name="iinfo"></textarea>'.
- '<br><input type="submit" name="submit" value="Insert"></form><hr><a href="koquery.php">Home</a>';
- if(isset($_REQUEST['submit'])){
- $lines = explode("\n", $_REQUEST['iinfo']);
- foreach($lines as $line){
- $pieces = explode(",", $line);
- $itemno = trim($pieces[0]);
- $itemquant = trim($pieces[1]);
- $itemloop = trim($pieces[2]);
- for($x=1;$x<=$itemloop;++$x)
- insertItems($_COOKIE['account'], $_COOKIE['char'], $itemno, $itemquant);
- }
- }
- break;
- case 'moblist':
- $tmp = odbc_exec($msconnect, "SELECT sSid,strName FROM K_MONSTER ORDER BY sSid ASC");
- echo '<table border="0" width="62%" cellspacing="1" cellpadding="2" bordercolor="#000000">
- <tr>
- <td width="175" style="border: 1px solid #000000"><b><font face="Tahoma" size="2">
- Mob Name</font></b></td>
- <td width="175" style="border: 1px solid #000000"><b><font face="Tahoma" size="2">
- Monsummon Command</font></b></td>
- <td width="175" style="border: 1px solid #000000"><b>
- <font face="Tahoma" size="2">Summon ID</font></b></td>
- </tr>';
- while($row = odbc_fetch_array($tmp)){
- echo '<tr>
- <td width="175" style="border: 1px solid #000000"><font face="Tahoma" size="2">
- '.$row["strName"].'</font></td>
- <td width="175" style="border: 1px solid #000000"><font face="Tahoma" size="2">
- +monsummon '.$row["sSid"].'</font></td>
- <td width="175" style="border: 1px solid #000000">
- <font face="Tahoma" size="2">'.$row["sSid"].'</font></td>
- </tr>';
- }
- echo '</table>';
- break;
- case 'cinfo':
- if(!isset($_POST['getchar']))
- $cinfo = "";
- else
- $cinfo = getcharinfo($_POST['getchar']);
- echo '
- <div align="center">
- <table border="0" width="24%">
- <form method="post" action="">
- <tr>
- <td width="91" bgcolor="#800000" align="right">
- <p align="center"><b><font color="#FFFFFF" face="Tahoma" size="1">
- <span style="background-color: #800000">Search</span></font></b></td>
- <td style="border:1px solid #FFFFFF; ">
- <input type="text" name="getchar" size="20" style="border: 1px solid #000000" value="'.htmlentities($_POST['getchar']).'"></td>
- </tr>
- </form>
- <tr>
- <td width="91" bgcolor="#800000" align="right">
- <font color="#FFFFFF" face="Tahoma" size="2">Account ID </font>
- </td>
- <td style="border-right:1px solid #000000; border-bottom:1px dashed #000000; border-left-width: 1px; border-top-width: 1px; border-left-color:#000000; border-top-color:#000000"><font face="Tahoma" size="2">'.$cinfo['AccountID'].'</font></td>
- </tr>
- <tr>
- <td width="91" bgcolor="#800000" align="right">
- <font color="#FFFFFF" face="Tahoma" size="2">Password </font>
- </td>
- <td style="border-right:1px solid #000000; border-bottom:1px dashed #000000; border-left-width: 1px; border-top-width: 1px; border-left-color:#000000; border-top-color:#000000"><font face="Tahoma" size="2">'.$cinfo['Password'].'</font></td>
- </tr>
- <tr>
- <td width="91" bgcolor="#800000" align="right">
- <font color="#FFFFFF" face="Tahoma" size="2">Character 1 </font>
- </td>
- <td style="border-right:1px solid #000000; border-bottom:1px dashed #000000; border-left-width: 1px; border-top-width: 1px; border-left-color:#000000; border-top-color:#000000"><font face="Tahoma" size="2">'.$cinfo['Character1'].'</font></td>
- </tr>
- <tr>
- <td width="91" bgcolor="#800000" align="right">
- <font color="#FFFFFF" face="Tahoma" size="2">Character 2 </font>
- </td>
- <td style="border-right:1px solid #000000; border-bottom:1px dashed #000000; border-left-width: 1px; border-top-width: 1px; border-left-color:#000000; border-top-color:#000000"><font face="Tahoma" size="2">'.$cinfo['Character2'].'</font></td>
- </tr>
- <tr>
- <td width="91" bgcolor="#800000" align="right">
- <font color="#FFFFFF" face="Tahoma" size="2">Character 3 </font>
- </td>
- <td style="border-right:1px solid #000000; border-bottom:1px dashed #000000; border-left-width: 1px; border-top-width: 1px; border-left-color:#000000; border-top-color:#000000"><font face="Tahoma" size="2">'.$cinfo['Character3'].'</font></td>
- </tr>
- </table>
- </div>
- ';
- break;
- case 'nt':
- ##### CONFIGURE THESE VARIABLES ####
- $price = "0"; //Noahs to take from INN HOSTESS (Warehouse)
- $ntdays = "0"; //How long to wait between nation transfers (Days)
- function dC($id,$class=NULL){
- switch($id){
- case 1:
- $ret = 12;
- break;
- case 2:
- $ret = 12;
- break;
- case 4:
- $ret = 13;
- break;
- case 11:
- $ret = 1;
- break;
- case 12:
- $ret = 1;
- break;
- case 13:
- $ret = 3;
- break;
- case 3:
- $ret = 12;
- break;
- default:
- $ret = 1;
- break;
- }
- if(in_array(substr($class, 2, 1),array(6,5,1)) and ($id==12) or ($id==11))
- $ret = 1;
- if(in_array(substr($class, 2, 1),array(0,9,3)) and ($id==12))
- $ret = 3;
- if(in_array(substr($class, 2, 1),array(1,2,4)) and ($id==4))
- $ret = 13;
- return $ret;
- }
- $characters = array();
- if(!isset($_POST['submit'])){
- echo '<form method="post" action="">';
- echo '<input type="submit" name="submit" value="Nation Transfer"></form>';
- }elseif(isset($_POST['submit'])){
- $sid = str_replace("'","''",$_COOKIE['account']);
- $sid = str_replace("%","",$sid);
- //Find all 3 Characters
- $rq = odbc_exec($msconnect, "SELECT TOP 1 strCharId1,strCharId2,strCharId3,strAccountId FROM ACCOUNT_CHAR where strAccountId like('$sid')");
- while(odbc_fetch_row($rq)){
- $char1 = trim(odbc_result($rq, 1));
- $char2 = trim(odbc_result($rq, 2));
- $char3 = trim(odbc_result($rq, 3));
- $accountName = htmlentities(trim(odbc_result($rq, 4)));
- }
- $bc = odbc_Exec($msconnect, "SELECT nMoney from WAREHOUSE where strAccountID like('$sid')");
- while(odbc_fetch_row($bc)){
- $gold = odbc_result($bc, 1);
- if(odbc_result($bc, 1)<$price)
- die("You need at least $price noah in your INN HOSTESS.<br>You currently have: ".$gold." coins.");
- }
- $characters = array($char1, $char2, $char3);
- echo "<font face=\"Tahoma\" size=\"2\"><br><b>Starting Nation Transfer...</b><br>";
- foreach($characters as $uid){
- //Take Money
- odbc_Exec($msconnect, "UPDATE WAREHOUSE set nMoney='".($gold-$price)."' WHERE strAccountID like('$sid')");
- $a = odbc_exec($msconnect, "SELECT TOP 1 Class,Race FROM USERDATA where strUserId like('$uid')");
- while(odbc_fetch_row($a)){
- $class = intval(trim(odbc_result($a, 1)));
- $race = intval(trim(odbc_result($a, 2)));
- }
- $oClass = $class;
- $nation = substr($class, 0, 1);
- $class = substr($class, 1, 2);
- //Change Class
- $newclass = ($nation == 1 ? "2".$class : "1".$class);
- $b = odbc_exec($msconnect, "UPDATE USERDATA SET Class=$newclass WHERE strUserId like('$uid')");
- if($b)
- echo "-----------------<br>Class Changed.<br>";
- //Change Nation
- $newnation = ($nation == 1 ? 2 : 1);
- $c = odbc_exec($msconnect, "UPDATE USERDATA SET Nation=$newnation WHERE strUserId like('$uid')");
- if($c)
- echo "Nation Changed.<br>";
- //Change Race
- $newrace = dC($race,$oClass);
- $d = odbc_exec($msconnect, "UPDATE USERDATA SET Race=$newrace WHERE strUserId like('$uid')");
- if($d)
- echo "Race Changed.<br>";
- //Change Zone
- odbc_exec($msconnect, "UPDATE USERDATA SET Zone='21' WHERE strUserId like('$uid')");
- //Last Set, Change Nation
- $e = odbc_exec($msconnect, "UPDATE ACCOUNT_CHAR SET bNation=$newnation WHERE strCharId1 like('$uid') or strCharId2 like('$uid') or strCharId3 like('$uid')");
- if($e){
- $side = ($newnation == 2 ? "El Morad" : "Karus");
- echo "-----------------<br><b>{$uid} has successfully been Nation Transfered. -<i>Welcome to $side.</i></b><br>";
- }
- } // submit/name check
- } //Finish all 3 Characters
- echo "</font>";
- break;
- case 'nc':
- echo '<font face="Tahoma" size="1">
- <form method="post" action="">
- New ID: <input type="text" name="namechange"> | <input type="submit" name="submit" value="Change Name"></form><br></font>
- ';
- break;
- case 'stats':
- echo '
- <h3><font face="Arial" size="3">Character <u>MUST</u> be <font color=red>OFFLINE</font> for this to work.</font></h3><form method="POST" action="">
- <table border="0" width="100%" style="border-style: double; border-width: 0">
- <tr>
- <td width="123"><font face="Arial">Level</font></td>
- <td width="203"><font size="3" face="Arial"> <input type="text" name="Level"></font></td>
- <td> </td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">Experience</font></td>
- <td width="203"><font size="3" face="Arial"> <input type="text" name="Exp"></font></td>
- <td><font face="Arial"> (No commas, strictly numeric)</font></td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">National Points</font></td>
- <td width="203"><font size="3" face="Arial"> <input type="text" name="Loyalty"></font></td>
- <td><font face="Arial"> (No commas, strictly numeric)</font></td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">Ladder Points</font></td>
- <td width="203"><font size="3" face="Arial"> <input type="text" name="LoyaltyMonthly"></font></td>
- <td><font face="Arial"> (No commas, strictly numeric)</font></td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">Gold (Noahs)</font></td>
- <td width="203"><font size="3" face="Arial"> <input type="text" name="Gold" value="2099999999"></font></td>
- <td><font face="Arial"> (No commas, strictly numeric)</font></td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">Strength</font></td>
- <td width="203"><font size="3" face="Arial"> <input type="text" name="Strong"></font></td>
- <td> </td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">Intelligence</font></td>
- <td width="203"><font size="3" face="Arial"> <input type="text" name="Intel"></font></td>
- <td> </td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">Dexterity</font></td>
- <td width="203"><font size="3" face="Arial"> <input type="text" name="Dex"></font></td>
- <td> </td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">Health Points</font></td>
- <td width="203"><font size="3" face="Arial"> <input type="text" name="Sta"></font></td>
- <td> </td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">Mana Points</font></td>
- <td width="203"><font size="3" face="Arial"> <input type="text" name="Cha"></font></td>
- <td> </td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">Authority</font></td>
- <td width="203"><font size="3" face="Arial">
- <select size="1" name="Authority">
- <option selected value="1">Choose Auth</option>
- <option value="0">Game Master</option>
- <option value="1">Normal</option>
- <option value="11">Muted</option>
- <option value="255">Banned</option>
- <option value="250">Dead</option>
- </select></font></td>
- <td><font face="Arial"> </font></td>
- </tr>
- <tr>
- <td width="123"><font face="Tahoma">Zone</font></td>
- <td width="203"><font face="Tahoma"><select size="1" name="Zone">
- <option selected value="21">Moradon</option>
- <option value="2">El Morad Castle</option>
- <option value="1">Luferson Castle</option>
- <option value="201">Colony Zone</option>
- <option value="30">Delos</option>
- <option value="202">Ardream</option>
- <option value="11">Karus Eslant</option>
- <option value="12">El Morad Eslant</option>
- <option value="34">Bifrost</option>
- <option value="101">Lunar War Zone</option>
- <option value="102">Dark Lunar War Zone</option>
- <option value="33">Isiloon Dungeon</option>
- <option value="56">Felankor Dungeon</option>
- </select></font></td>
- <td> </td>
- </tr>
- <tr>
- <td width="123"><font face="Arial">Class</font></td>
- <td width="203"><font size="3" face="Arial">
- <select size="1" name="Class">
- <option value="NULLIFIED" selected>Choose Class</option>
- <option value="106">(Karus) Master - Warrior</option>
- <option value="206">(El Morad) Master - Warrior</option>
- <option value="108">(Karus) Master - Rogue</option>
- <option value="208">(El Morad) Master - Rogue</option>
- <option value="110">(Karus) Master - Mage</option>
- <option value="210">(El Morad) Master - Mage</option>
- <option value="112">(Karus) Master - Priest</option>
- <option value="212">(El Morad) Master - Priest</option>
- </select></font></td>
- <td> </td>
- </tr>
- </table>
- <input type="hidden" name="PX" value="100000">
- <input type="hidden" name="PZ" value="100000">
- <br><input type="submit" name="submit" value="submit"></form><a href="koquery.php"><font face="Arial">Home</font></a><script>
- ';
- if(isset($_REQUEST['submit'])){
- $pst = insertArray($_POST);
- $surl = stats($_COOKIE['char'], $pst);
- echo '<br><b>Successfully Changed</b><br>';
- }
- echo '<a href="koquery.php">Home</a>';
- break;
- default:
- echo '<ul>
- <li><a href="koquery.php?act=stats">Edit Stats</a></li>'.
- '<li><a href="koquery.php?act=items">Insert Items</a></li>'.
- '<li><a href="koquery.php?act=search">Search Items</a></li>'.
- '<li><a href="koquery.php?act=moblist">Monsummon List</a></li>'.
- '<br><br>'.
- '<li><a href="koquery.php?act=logout">Logout</a></li>';
- break;
- case 'query':
- echo "<pre>";
- $query = stripslashes($_GET['query']);
- $bc = odbc_exec($msconnect, $query);
- while($row = odbc_fetch_array($bc)){
- foreach($row as $key=>$val){
- printf("<b>%s: </b> %s\r\n", $key, $val);
- }
- print "\r\n";
- }
- break;
- case 'showimg':
- ctimage($_REQUEST['text']);
- break;
- case 'search':
- echo '
- <script>
- function insertItem(num)
- { var xmlHttp;
- try
- { xmlHttp=new XMLHttpRequest(); }
- catch (e)
- {
- try
- { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
- catch (e)
- {
- try
- { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
- catch (e)
- {
- alert("Your browser does not support AJAX!");
- return false;
- }
- }
- }
- xmlHttp.onreadystatechange=function()
- {
- }
- //PAGES
- var quantity;
- var repeat;
- quantity=prompt(num+" Stacksize?","1");
- repeat=prompt(num+" injections?", "1");
- if(num!="")
- {
- xmlHttp.open("GET","koquery.php?act=items&submit=true&iinfo="+num+","+quantity+","+repeat,true);
- }
- xmlHttp.send(null);
- alert("Item No: "+num+"\nStacksize: "+quantity+"\nInjected ("+repeat+") times!");
- }
- </script>
- <style>
- a.screen, a.screen:visited {
- color:#c00;
- position:relative;
- z-index:1;
- }
- a.screen b {
- position:absolute;
- visibility:hidden; /* hide the image */
- width:200px; /* give it a width */
- height:0; /* no height to solve an Opera bug that
- makes it selectable when hidden */
- border:1px solid #000; /* add a border */
- left:0; /* position:the image */
- top:-150px;
- }
- a.screen:hover {
- text-decoration:none;
- border:0; /* needed for this to work in IE */
- z-index:1000;
- }
- a.screen:hover b {
- visibility:visible; /* make the image visible */
- height:150px; /* now give it a height */
- cursor:pointer; /* for IE */
- z-index:500;
- }
- a.screen:hover b img {
- border:0; /* remove the link border */
- }
- </style>';
- echo '<font face="Tahoma" size="2"><form method="post" action="">'.
- 'Item Name: <input type="text" name="item" value="'.$_REQUEST['item'].'"> | ';
- echo 'Limit: <select size="1" name="Limit">
- <option value="NULL" selected>No Limit</option>
- <option>25</option>
- <option>50</option>
- <option>75</option>
- <option>100</option>
- </select> | ';
- echo '<input type="submit" value="Search">';
- echo '</form><br></font>';
- if(isset($_REQUEST['item'])){
- $q = $_REQUEST['item'];
- $lim = $_REQUEST['Limit'];
- $ret = search($q, $lim);
- echo '<table border="0" width="100%">
- <tr>
- <td width="184" style="border: 1px solid #000000"><b>
- <font face="Tahoma" size="2">Name</font></b></td>
- <td width="189" style="border: 1px solid #000000"><b>
- <font face="Tahoma" size="2">Number</font></b></td>
- <td style="border: 1px solid #000000"><b><font face="Tahoma" size="2">
- Stats</font></b></td>
- </tr>';
- foreach($ret as $inum => $imgconts){
- $name = explode("%0a", $imgconts);
- $iname = trim(urldecode($name[1]));
- $link = "<a class='screen' href='#' onclick='javascript:insertItem($inum)'>$iname<b><img src='koquery.php?act=showimg&text=$imgconts' title='$inum Stats'/></b></a><br><br>";
- $lstats = "";
- foreach($name as $stata){
- $asdf = explode(":", $stata);
- $lstats .= "<b>".$asdf[0].": </b> ".htmlentities(urldecode($asdf[1])).", ";
- }
- echo '
- <tr>
- <td width="184" style="border: 1px solid #000000">
- <font face="Tahoma" size="2">'.$link.'</font></td>
- <td width="189" style="border: 1px solid #000000">
- <font face="Tahoma" size="2">'.$inum.'</font></td>
- <td style="border: 1px solid #000000"><font face="Tahoma" size="1">
- '.$lstats.'</font></td>
- </tr>
- ';
- }
- }
- echo '</table><hr><a href="koquery.php">Home</a>';
- break;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement