Ignore:
Timestamp:
Aug 13, 2007, 9:05:34 PM (17 years ago)
Author:
george
Message:

Aktualizace MaNGOS Minimanageru na verzi 0.1.4a.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/char_list.php

    r5 r19  
    2121                $user_lvl,$user_name;
    2222
    23  $mysql = new MySQL;
    24  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    25 
    26  $start = (isset($_GET['start'])) ? $mysql->quote_smart($_GET['start']) : 0;
    27  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) :"guid";
    28  
    29  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     23 $sql = new SQL;
     24 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     25
     26 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
     27 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) :"guid";
     28 
     29 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    3030 $order_dir = ($dir) ? "ASC" : "DESC";
    3131 $dir = ($dir) ? 0 : 1;
    3232
    33  $query_1 = $mysql->query("SELECT count(*) FROM `character`");
    34  $all_record = $mysql->result($query_1,0);
    35 
    36  $query = $mysql->query("SELECT guid,name,account,race,class,position_x,position_y,map,
     33 $query_1 = $sql->query("SELECT count(*) FROM `character`");
     34 $all_record = $sql->result($query_1,0);
     35
     36 $query = $sql->query("SELECT guid,name,account,race,class,zone,map,
    3737                CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,
    3838                online,CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level
    3939                FROM `character` ORDER BY $order_by $order_dir LIMIT $start, $itemperpage");
    40  $this_page = $mysql->num_rows($query) or die(error($lang_global['err_no_result']));
     40 $this_page = $sql->num_rows($query) or die(error($lang_global['err_no_result']));
    4141
    4242//==========================top tage navigaion starts here========================
     
    5555           <input type=\"text\" size=\"14\" maxlength=\"50\" name=\"search_value\" />
    5656           <select name=\"search_by\">
     57            <option value=\"name\">{$lang_char_list['by_name']}</option>
    5758            <option value=\"guid\">{$lang_char_list['by_id']}</option>
    58                 <option value=\"name\">{$lang_char_list['by_name']}</option>
    5959                <option value=\"account\">{$lang_char_list['by_account']}</option>
    6060                <option value=\"level\">{$lang_char_list['by_level']}</option>
     
    8383  <table class=\"lined\">
    8484   <tr>
    85         <td width=\"5%\" class=\"head\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></td>
    86         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?order_by=guid&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['id']}</a></td>
    87         <td width=\"15%\" class=\"head\"><a href=\"char_list.php?order_by=name&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['char_name']}</a></td>
    88         <td width=\"15%\" class=\"head\"><a href=\"char_list.php?order_by=account&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['account']}</a></td>
    89     <td width=\"7%\" class=\"head\"><a href=\"char_list.php?order_by=race&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['race']}</a></td>
    90         <td width=\"6%\" class=\"head\"><a href=\"char_list.php?order_by=class&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['class']}</a></td>
    91         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?order_by=level&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['level']}</a></td>
    92         <td width=\"15%\" class=\"head\"><a href=\"char_list.php?order_by=map&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['map']}</a></td>
    93         <td width=\"17%\" class=\"head\">{$lang_char_list['zone']}</td>
    94         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?order_by=highest_rank&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['honor_kills']}</a></td>
    95         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?order_by=online&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['online']}</a></td>
     85        <th width=\"5%\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></th>
     86        <th width=\"5%\"><a href=\"char_list.php?order_by=guid&amp;start=$start&amp;dir=$dir\">".($order_by=='guid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['id']}</a></th>
     87        <th width=\"15%\"><a href=\"char_list.php?order_by=name&amp;start=$start&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['char_name']}</a></th>
     88        <th width=\"15%\"><a href=\"char_list.php?order_by=account&amp;start=$start&amp;dir=$dir\">".($order_by=='account' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['account']}</a></th>
     89    <th width=\"7%\"><a href=\"char_list.php?order_by=race&amp;start=$start&amp;dir=$dir\">".($order_by=='race' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['race']}</a></th>
     90        <th width=\"6%\"><a href=\"char_list.php?order_by=class&amp;start=$start&amp;dir=$dir\">".($order_by=='class' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['class']}</a></th>
     91        <th width=\"5%\"><a href=\"char_list.php?order_by=level&amp;start=$start&amp;dir=$dir\">".($order_by=='level' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['level']}</a></th>
     92        <th width=\"15%\"><a href=\"char_list.php?order_by=map&amp;start=$start&amp;dir=$dir\">".($order_by=='map' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['map']}</a></th>
     93        <th width=\"17%\">{$lang_char_list['zone']}</th>
     94        <th width=\"5%\"><a href=\"char_list.php?order_by=highest_rank&amp;start=$start&amp;dir=$dir\">".($order_by=='highest_rank' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['honor_kills']}</a></th>
     95        <th width=\"5%\"><a href=\"char_list.php?order_by=online&amp;start=$start&amp;dir=$dir\">".($order_by=='online' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['online']}</a></th>
    9696  </tr>";
    9797
    9898 $looping = ($this_page < $itemperpage) ? $this_page : $itemperpage;
    9999
    100  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     100 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    101101 
    102102 for ($i=1; $i<=$looping; $i++) {
    103     $char = $mysql->fetch_row($query) or die(error($lang_global['err_no_user']));
     103    $char = $sql->fetch_row($query) or die(error($lang_global['err_no_user']));
    104104 //to disalow lower lvl gm to  view accounts of other gms
    105         $result = $mysql->query("SELECT gmlevel,username FROM account WHERE id ='$char[2]'");
    106         $owner_gmlvl = $mysql->result($result, 0, 'gmlevel');
    107         $owner_acc_name = $mysql->result($result, 0, 'username');
     105        $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[2]'");
     106        $owner_gmlvl = $sql->result($result, 0, 'gmlevel');
     107        $owner_acc_name = $sql->result($result, 0, 'username');
    108108
    109109        if (($user_lvl >= $owner_gmlvl)||($owner_acc_name == $user_name)){
     
    112112                        $output .= "<td><input type=\"checkbox\" name=\"check[]\" value=\"$char[0]\" onclick=\"CheckCheckAll(document.form1);\" /></td>";
    113113                        else $output .= "<td></td>";
    114                         $output .= "
    115                     <td>$char[0]</td>
     114                        $output .= "<td>$char[0]</td>
    116115                        <td><a href=\"char.php?id=$char[0]\">$char[1]</a></td>
    117116                        <td><a href=\"user.php?action=edit_user&amp;error=11&amp;id=$char[2]\">$owner_acc_name</a></td>
    118                         <td>".get_player_race($char[3])."</td>
    119                         <td>".get_player_class($char[4])."</td>
    120                         <td>$char[10]</td>
    121                         <td>".get_map_name($char[7])."</td>
    122                         <td>".get_zone_name($char[7], $char[5], $char[6])."</td>
    123                         <td>$char[8]</td>
    124                         <td>".(($char[9]) ? "ON" : "-")."</td>
     117                        <td><img src='img/c_icons/{$char[3]}-0.gif' onmousemove='toolTip(\"".get_player_race($char[3])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     118                        <td><img src='img/c_icons/{$char[4]}.gif' onmousemove='toolTip(\"".get_player_class($char[4])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     119                        <td>$char[9]</td>
     120                        <td>".get_map_name($char[6])."</td>
     121                        <td>".get_zone_name($char[5])."</td>
     122                        <td>$char[7]</td>
     123                        <td>".(($char[8]) ? "<img src=\"img/up.gif\" alt=\"\" />" : "-")."</td>
    125124            </tr>";
    126125        }else{
     
    140139 </form><br /></center>";
    141140 
    142  $mysql->close();
     141 $sql->close();
    143142}
    144143
     
    153152 if(!isset($_GET['search_value'])) redirect("char_list.php?error=2");
    154153
    155  $mysql = new MySQL;
    156  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass']);
    157  
    158  $search_value = $mysql->quote_smart($_GET['search_value']);
    159  $search_by = (isset($_GET['search_by'])) ? $mysql->quote_smart($_GET['search_by']) : "name";
    160  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "guid";
    161  
    162  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     154 $sql = new SQL;
     155 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     156 
     157 $search_value = $sql->quote_smart($_GET['search_value']);
     158 $search_by = (isset($_GET['search_by'])) ? $sql->quote_smart($_GET['search_by']) : "name";
     159 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "guid";
     160 
     161 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    163162 $order_dir = ($dir) ? "ASC" : "DESC";
    164163 $dir = ($dir) ? 0 : 1;
     
    167166 //need to get the acc id from other table since input comes as name
    168167 case "account":
    169  {
    170         $mysql->db($realm_db['name']);
    171         $result = $mysql->query("SELECT id FROM account WHERE username LIKE '%$search_value%' LIMIT $sql_search_limit");
    172 
    173         //acc = 0 added just in case there will be NO result
    174         $where_out = "account = 0 ";
    175         while ($acc = $mysql->fetch_row($result)){
    176                  $where_out .= "OR account = $acc[0] ";
    177         }
    178 
    179         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     168        $sql->db($realm_db['name']);
     169        $result = $sql->query("SELECT id FROM account WHERE username LIKE '%$search_value%' LIMIT $sql_search_limit");
     170
     171        $where_out = "account IN (0 ";
     172        while ($char = $sql->fetch_row($result)) $where_out .= " ,$acc[0]";
     173        $where_out = ") ";
     174       
     175        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    180176        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    181177        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level
    182178        FROM `character` WHERE $where_out ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
    183  }
    184179 break;
    185180
    186181 case "level":
    187  {
    188182        if (!is_numeric($search_value)) $search_value = 1;
    189         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     183        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    190184        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    191185        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
    192186        WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) = $search_value ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
    193  }
    194187 break;
    195188
    196189case "greater_level":
    197190        if (!is_numeric($search_value)) $search_value = 1;
    198         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     191        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    199192        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    200193        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    203196
    204197 case "gold":
    205  {
    206         //used to avoid wrong input - cant use quotes on search value due to mysql bug.
    207198        if (!is_numeric($search_value)) $search_value = 1;
    208         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     199        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    209200        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    210201        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
    211202        WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_GOLD+1)."), ' ', -1) > $search_value ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
    212  }
    213203 break;
    214204 
    215205 case "guild":
    216         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    217         $result = $mysql->query("SELECT guildid FROM guild WHERE name LIKE '%$search_value%'");
    218         $guildid = $mysql->result($result, 0, 'guildid');
    219 
    220         $result = $mysql->query("SELECT guid FROM guild_member WHERE guildid = $guildid");
    221 
    222         //guid = 0 added just in case there will be NO result
    223         $where_out = "guid = 0 ";
    224         while ($char = $mysql->fetch_row($result)){
    225                 $where_out .= " OR guid = $char[0]";
    226         }
    227 
    228         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     206        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     207        $result = $sql->query("SELECT guildid FROM guild WHERE name LIKE '%$search_value%'");
     208        $guildid = $sql->result($result, 0, 'guildid');
     209
     210        $result = $sql->query("SELECT guid FROM guild_member WHERE guildid = $guildid");
     211
     212        $where_out = "guid IN (0 ";
     213        while ($char = $sql->fetch_row($result)) $where_out .= " ,$char[0]";
     214        $where_out = ") ";
     215
     216        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    229217        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    230218        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    233221
    234222  case "item":
    235         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    236         $result = $mysql->query("SELECT guid FROM character_inventory WHERE item_template = '$search_value'");
    237 
    238         //guid = 0 added just in case there will be NO result
    239         $where_out = " guid = 0";
    240         while ($char = $mysql->fetch_row($result)){
    241                 $where_out .= " OR guid = $char[0]";
    242         }
    243 
    244         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     223        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     224        $result = $sql->query("SELECT guid FROM character_inventory WHERE item_template = '$search_value'");
     225
     226        $where_out = "guid IN (0 ";
     227        while ($char = $sql->fetch_row($result)) $where_out .= " ,$char[0]";
     228        $where_out = ") ";
     229
     230        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    245231        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    246232        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    250236 case "greater_rank":
    251237        if (!is_numeric($search_value)) $search_value = 0;
    252         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     238        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    253239        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    254240        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    257243  case "highest_rank":
    258244        if (!is_numeric($search_value)) $search_value = 0;
    259         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     245        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    260246        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    261247        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    264250
    265251 default:
    266     $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     252    $sql_query = "SELECT guid,name,account,race,class,zone,map,
    267253        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    268254        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    270256 }
    271257
    272  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    273 
    274  $query = $mysql->query($sql);
    275  $total_found = $mysql->num_rows($query);
     258 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     259
     260 $query = $sql->query($sql_query);
     261 $total_found = $sql->num_rows($query);
    276262
    277263//==========================top tage navigaion starts here========================
     
    288274                <input type=\"text\" size=\"17\" maxlength=\"50\" name=\"search_value\" />
    289275                <select name=\"search_by\">
     276                        <option value=\"name\">{$lang_char_list['by_name']}</option>
    290277                        <option value=\"guid\">{$lang_char_list['by_id']}</option>
    291                         <option value=\"name\">{$lang_char_list['by_name']}</option>
    292278                        <option value=\"account\">{$lang_char_list['by_account']}</option>
    293279                        <option value=\"level\">{$lang_char_list['by_level']}</option>
     
    313299   <table class=\"lined\">
    314300   <tr>
    315         <td width=\"5%\" class=\"head\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></td>
    316         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=guid&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['id']}</a></td>
    317         <td width=\"15%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=name&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['char_name']}</a></td>
    318         <td width=\"15%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=account&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['account']}</a></td>
    319     <td width=\"7%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=race&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['race']}</a></td>
    320         <td width=\"6%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=class&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['class']}</a></td>
    321         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=level&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['level']}</a></td>
    322         <td width=\"17%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=map&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['map']}</a></td>
    323         <td width=\"15%\" class=\"head\">{$lang_char_list['zone']}</td>
    324         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=highest_rank&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['honor_kills']}</a></td>
    325         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=online&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['online']}</a></td>
     301        <th width=\"5%\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></td>
     302        <th width=\"5%\><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=guid&amp;dir=$dir\">".($order_by=='guid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['id']}</a></th>
     303        <th width=\"15%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=name&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['char_name']}</a></th>
     304        <th width=\"15%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=account&amp;dir=$dir\">".($order_by=='account' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['account']}</a></th>
     305    <th width=\"7%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=race&amp;dir=$dir\">".($order_by=='race' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['race']}</a></th>
     306        <th width=\"6%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=class&amp;dir=$dir\">".($order_by=='class' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['class']}</a></th>
     307        <th width=\"5%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=level&amp;dir=$dir\">".($order_by=='level' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['level']}</a></th>
     308        <th width=\"17%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=map&amp;dir=$dir\">".($order_by=='map' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['map']}</a></th>
     309        <th width=\"15%\">{$lang_char_list['zone']}</th>
     310        <th width=\"5%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=highest_rank&amp;dir=$dir\">".($order_by=='highest_rank' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['honor_kills']}</a></th>
     311        <th width=\"5%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=online&amp;dir=$dir\">".($order_by=='online' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['online']}</a></th>
    326312  </tr>";
    327313
    328  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     314 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    329315 
    330  for ($i=1; $i<=$total_found; $i++){
    331    $char = $mysql->fetch_row($query);
    332  //to disalow lower lvl gm to  view accounts of other gms
    333         $result = $mysql->query("SELECT gmlevel,username FROM account WHERE id ='$char[2]'");
    334         $owner_gmlvl = $mysql->result($result, 0, 'gmlevel');
    335         $owner_acc_name = $mysql->result($result, 0, 'username');
     316 while ($char = $sql->fetch_row($query)){
     317
     318        $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[2]'");
     319        $owner_gmlvl = $sql->result($result, 0, 'gmlevel');
     320        $owner_acc_name = $sql->result($result, 0, 'username');
    336321       
    337  if (($user_lvl >= $owner_gmlvl)||($owner_acc_name == $user_name)){
     322  if (($user_lvl >= $owner_gmlvl)||($owner_acc_name == $user_name)){
    338323                 $output .= "<tr>";
    339324                 if (($user_lvl > $owner_gmlvl)||($owner_acc_name == $user_name))$output .= "
     
    344329        <td><a href=\"char.php?id=$char[0]\">$char[1]</a></td>
    345330                <td><a href=\"user.php?action=edit_user&amp;error=11&amp;id=$char[2]\">$owner_acc_name</a></td>
    346                 <td>".get_player_race($char[3])."</td>
    347                 <td >".get_player_class($char[4])."</td>
    348                 <td>$char[10]</td>
    349                 <td>".get_map_name($char[7])."</td>
    350                 <td>".get_zone_name($char[7], $char[5], $char[6])."</td>
    351                 <td>$char[8]</td>
    352                 <td>".(($char[9]) ? "ON" : "-")."</td>
     331                <td><img src='img/c_icons/{$char[3]}-0.gif' onmousemove='toolTip(\"".get_player_race($char[3])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     332                <td><img src='img/c_icons/{$char[4]}.gif' onmousemove='toolTip(\"".get_player_class($char[4])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     333                <td>$char[9]</td>
     334                <td>".get_map_name($char[6])."</td>
     335                <td>".get_zone_name($char[5])."</td>
     336                <td>$char[7]</td>
     337                <td>".(($char[8]) ? "<img src=\"img/up.gif\" alt=\"\" />" : "-")."</td>
    353338       </tr>";
    354339        }else{
     
    368353 </form><br /></center>";
    369354
    370  $mysql->close();
     355 $sql->close();
    371356}
    372357
     
    376361//########################################################################################################################
    377362function del_char_form() {
    378 global  $lang_global, $lang_char_list, $output;
     363global  $lang_global, $lang_char_list, $output, $realm_id, $mangos_db;
    379364 if(isset($_GET['check'])) $check = $_GET['check'];
    380365        else redirect("char_list.php?error=1");
    381366
    382  $output .= "<center><h1><font class=\"error\">{$lang_global['are_you_sure']}</font></h1><br />";
    383  $output .= "<font class=\"bold\">{$lang_char_list['char_ids']}: ";
    384 
    385  //this array needed to pass multiple values from check boxes down to delete by post method
     367 $output .= "<center><img src=\"img/warn_red.gif\" width=\"48\" height=\"48\" alt=\"\" />
     368                        <h1><font class=\"error\">{$lang_global['are_you_sure']}</font></h1><br />
     369                        <font class=\"bold\">{$lang_char_list['char_ids']}: ";
     370
    386371 $pass_array = "";
    387372
     373 $sql = new SQL;
     374 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     375
    388376 for ($i=0; $i<count($check); $i++){
    389         $output .= "<a href=\"char.php?id=$check[$i]\" target=\"_blank\">$check[$i], </a>";
     377        $name = $sql->result($sql->query("SELECT name FROM `character` WHERE guid = {$check[$i]}"),0);
     378        $output .= "<a href=\"char.php?id=$check[$i]\" target=\"_blank\">$name, </a>";
    390379        $pass_array .= "&amp;check%5B%5D=$check[$i]";
    391380        }
    392381
    393  $output .= "<br />{$lang_global['will_be_erased']}</font><br /><br />";
    394 
    395  $output .= "<table class=\"hidden\">
     382 $sql->close();
     383 
     384 $output .= "<br />{$lang_global['will_be_erased']}</font><br /><br />
     385                <table class=\"hidden\">
    396386          <tr><td>";
    397387                        makebutton($lang_global['yes'], "char_list.php?action=dodel_char$pass_array",120);
     
    410400                $tab_del_user_mangos, $user_name;
    411401
    412  $mysql = new MySQL;
    413  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    414  
    415  if(isset($_GET['check'])) $check = $mysql->quote_smart($_GET['check']);
     402 $sql = new SQL;
     403 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     404 
     405 if(isset($_GET['check'])) $check = $sql->quote_smart($_GET['check']);
    416406        else redirect("char_list.php?error=1");
    417407
     
    425415}
    426416
    427  $mysql->close();
     417 $sql->close();
    428418 $output .= "<center>";
    429419 if (!$deleted_chars) $output .= "<h1><font class=\"error\">{$lang_char_list['no_chars_del']}</font></h1>";
Note: See TracChangeset for help on using the changeset viewer.