Changeset 109 for db/post_read.php


Ignore:
Timestamp:
Oct 14, 2007, 1:35:47 PM (17 years ago)
Author:
hosiplan
Message:

+ možnost přihlásit se jako v minimanageru tzn. na herní ACC
+ jednoduchá administrace
+ správa bugů z bugreporter
+ export characteru
+ hledání creepů + jejich drop
+ úprava databáze

File:
1 edited

Legend:

Unmodified
Added
Removed
  • db/post_read.php

    r103 r109  
    11<?php
    22if($vlozeni_souboru == "OK"){
    3 ?>
    4 
    5 <?php
    63
    74if( !empty($q) AND !empty($id) ){
    8   if( !empty($lvl_d) AND !empty($lvl_h) ){ $where = "(`MinLevel`>='$lvl_d' AND `MinLevel`<='$lvl_h') AND "; };
    9   $sql_select = SQLselect_Strankovani("SELECT * FROM quest_template WHERE ( $where`Title` LIKE '%$q%' )", $limit, 20, "?id=questy&amp;q=".$q."&amp;lvl_d=".$lvl_d."&amp;lvl_h=".$lvl_h, $SID);
    10   if( @mysql_num_rows($sql_select[1]) > 0 ){ $i = 0;
    11     $sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
    12     $sql_select['result'] .= "<thead><tr><td>Název úkolu</td><td>Min level</td><td>Úkol zadává</td><td>Úkol</td></tr></thead>\n<col width=\"180px\"><col width=\"70px\">";
    13 
    14     while( $result = MySQL_Fetch_Array($sql_select[1]) ){
    15       $sql_select['result'] .= "  <tr valign='top'>";
    16       $sql_select['result'] .= "<td><a href=\"index.php?quest=".$result['entry']."\">".$result['Title']."</a></td>";
    17       $sql_select['result'] .= "<td>".$result['MinLevel']."</td>";
    18       $sql_select['result'] .= "<td>";
    19 
    20         $startovni_creature_dotaz = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$result['entry']." ");
    21         while( $start_creature = @MySQL_Fetch_Array($startovni_creature_dotaz) ){
    22           $sql_select['result'] .= "<a href=\"index.php?creature=".$start_creature['entry']."\">".$start_creature['name']."</a><br>";
     5  if( $id == "questy" ){
     6    if( !empty($lvl_d) AND !empty($lvl_h) ){ $where = "(`MinLevel`>='$lvl_d' AND `MinLevel`<='$lvl_h') AND "; };
     7    $sql_select = SQLselect_Strankovani("SELECT * FROM `quest_template` WHERE ( $where`Title` LIKE '%$q%' ) ORDER BY `entry` ASC", $limit, 20, "?id=questy&amp;q=".$q."&amp;lvl_d=".$lvl_d."&amp;lvl_h=".$lvl_h, $SID);
     8    if( @mysql_num_rows($sql_select[1]) > 0 ){ $i = 0;
     9      $sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
     10      $sql_select['result'] .= "<thead><tr><td>Název úkolu</td><td>Min level</td><td>Úkol zadává</td><td>Úkol</td></tr></thead>\n<col width=\"180px\"><col width=\"70px\">";
     11 
     12      while( $result = MySQL_Fetch_Array($sql_select[1]) ){
     13        $sql_select['result'] .= "  <tr valign='top'>";
     14        $sql_select['result'] .= "<td><a href=\"index.php?quest=".$result['entry']."\">".$result['Title']."</a></td>";
     15        $sql_select['result'] .= "<td>".$result['MinLevel']."</td>";
     16        $sql_select['result'] .= "<td>";
     17 
     18          $startovni_creature_dotaz = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$result['entry']." ");
     19          while( $start_creature = @MySQL_Fetch_Array($startovni_creature_dotaz) ){
     20            $sql_select['result'] .= "<a href=\"index.php?creature=".$start_creature['entry']."\">".$start_creature['name']."</a><br>";
     21            };
     22          $startovni_gameobject_dotaz = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$result['entry']." ");
     23          while( $start_gameobject = @MySQL_Fetch_Array($startovni_gameobject_dotaz) ){
     24            $sql_select['result'] .= "<a href=\"index.php?gameobject=".$start_gameobject['entry']."\">".$start_gameobject['name']."</a><br>";
     25            };
     26 
     27        $sql_select['result'] .= "</td>";
     28        $sql_select['result'] .= "<td>".$result['Objectives']."</td>";
     29        $sql_select['result'] .= "</tr>\n";
     30        };
     31     
     32      $sql_select['result'] .= "</table>\n";
     33      }  else{ $sql_select['error'] = "<p>Nebyly nalezeny žádné questy.</p>"; };
     34   
     35    }
     36  elseif( $id == "creeps" ){
     37    $sql_select = SQLselect_Strankovani("SELECT * FROM `creature_template` WHERE ( `name` LIKE '%$q%' OR `subname` LIKE '%$q%' ) ORDER BY `entry` ASC", $limit, 20, "?id=creeps&amp;q=".$q, $SID);
     38    if( @mysql_num_rows($sql_select[1]) > 0 ){ $i = 0;
     39      $sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
     40      $sql_select['result'] .= "<thead><tr><td>Název creepa</td><td>Level</td></tr></thead>\n<col><col width=\"70px\">";
     41 
     42      while( $result = MySQL_Fetch_Array($sql_select[1]) ){
     43        $sql_select['result'] .= "  <tr valign='top'>";
     44        $sql_select['result'] .= "<td><a href=\"index.php?creature=".$result['entry']."\">".$result['name']."</a></td>";
     45        if( $result['rank'] != 3 ){
     46          $sql_select['result'] .= "<td align='center'>".$result['minlevel']." - ".$result['maxlevel']."</td>";
     47          }
     48        else{
     49          $sql_select['result'] .= "<td align='center'>Boss</td>";
    2350          };
    24         $startovni_gameobject_dotaz = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$result['entry']." ");
    25         while( $start_gameobject = @MySQL_Fetch_Array($startovni_gameobject_dotaz) ){
    26           $sql_select['result'] .= "<a href=\"index.php?gameobject=".$start_gameobject['entry']."\">".$start_gameobject['name']."</a><br>";
    27           };
    28 
    29       $sql_select['result'] .= "</td>";
    30       $sql_select['result'] .= "<td>".$result['Objectives']."</td>";
    31       $sql_select['result'] .= "</tr>\n";
    32       };
    33    
    34     $sql_select['result'] .= "</table>\n";
    35     }  else{ $sql_select['error'] = "<p>Nebyly nalezeny žádné questy.</p>"; };
    36  
     51        $sql_select['result'] .= "</tr>\n";
     52        };
     53     
     54      $sql_select['result'] .= "</table>\n";
     55      }  else{ $sql_select['error'] = "<p>Nebyly nalezeny žádní creepové.</p>"; };
     56
     57    };
    3758  }
    3859elseif( !empty($quest) AND empty($id) ){
     
    111132    $result = MySQL_Fetch_Array($sql_select['sql']);
    112133    $sql_select['creature'] = $result;
     134   
     135    switch($sql_select['creature']['rank']){
     136      case 0: $sql_select['other']['creature_type'] = "Normal"; break;
     137      case 1: $sql_select['other']['creature_type'] = "Elite"; break;
     138      case 2: $sql_select['other']['creature_type'] = "Rare Elite"; break;
     139      case 3: $sql_select['other']['creature_type'] = "World Boss"; break;
     140      case 4: $sql_select['other']['creature_type'] = "Rare"; break;
     141      };
    113142
    114143    $questy_dotaz_creature = mysql_query("SELECT * FROM `creature_questrelation` LEFT JOIN `quest_template` ON `creature_questrelation`.`quest` = `quest_template`.`entry` WHERE (`creature_questrelation`.`id` =".$sql_select['creature']['entry']." AND `quest_template`.`PrevQuestId`=0 ) ");
     
    117146          $sql_select['other']['creature_quests'] .= "<a href=\"index.php?quest=".$quest_NPC['entry']."\">".$quest_NPC['Title']."</a><br>\n";
    118147        }; };
     148
     149    $drop_creature = mysql_query("SELECT * FROM `creature_loot_template` LEFT JOIN `item_template` ON `creature_loot_template`.`item` = `item_template`.`entry` WHERE `creature_loot_template`.`entry`='".$sql_select['creature']['lootid']."' ORDER BY `Quality` DESC, `ChanceOrRef` DESC ");
     150      if( @mysql_num_rows($drop_creature) > 0 ){
     151        while($drop_NPC = @MySQL_Fetch_Array($drop_creature)){
     152          switch($drop_NPC['Quality']){
     153            case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break;
     154            case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break;
     155            case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break;
     156            case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break;
     157            case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break;
     158            case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break;
     159            case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break;
     160            };
     161          $sql_select['other']['creature_drop'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>";
     162          $sql_select['other']['creature_drop'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n";
     163        }; } else{ $sql_select['other']['creature_drop'] = "<tr><td colspan='2'>Tento creep nemá žádný drop !</td></tr>"; };
     164
     165    $pickpocket_creature = mysql_query("SELECT * FROM `pickpocketing_loot_template` LEFT JOIN `item_template` ON `pickpocketing_loot_template`.`item` = `item_template`.`entry` WHERE `pickpocketing_loot_template`.`entry`='".$sql_select['creature']['pickpocketloot']."' ORDER BY `Quality` DESC, `ChanceOrRef` DESC ");
     166      if( @mysql_num_rows($pickpocket_creature) > 0 ){
     167        while($drop_NPC = @MySQL_Fetch_Array($pickpocket_creature)){
     168          switch($drop_NPC['Quality']){
     169            case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break;
     170            case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break;
     171            case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break;
     172            case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break;
     173            case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break;
     174            case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break;
     175            case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break;
     176            };
     177          $sql_select['other']['creature_pickpocket'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>";
     178          $sql_select['other']['creature_pickpocket'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n";
     179        }; } else{ $sql_select['other']['creature_pickpocket'] = "<tr><td colspan='2'>Tento creep nemá žádný Pickpocket !</td></tr>"; };
     180
     181    $skin_creature = mysql_query("SELECT * FROM `skinning_loot_template` LEFT JOIN `item_template` ON `skinning_loot_template`.`item` = `item_template`.`entry` WHERE `skinning_loot_template`.`entry`='".$sql_select['creature']['skinloot']."' ORDER BY `Quality` DESC, `ChanceOrRef` DESC ");
     182      if( @mysql_num_rows($skin_creature) > 0 ){
     183        while($drop_NPC = @MySQL_Fetch_Array($skin_creature)){
     184          switch($drop_NPC['Quality']){
     185            case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break;
     186            case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break;
     187            case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break;
     188            case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break;
     189            case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break;
     190            case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break;
     191            case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break;
     192            };
     193          $sql_select['other']['creature_skin'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>";
     194          $sql_select['other']['creature_skin'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n";
     195        }; } else{ $sql_select['other']['creature_skin'] = "<tr><td colspan='2'>Tento creep nemá žádný Skin !</td></tr>"; };
    119196
    120197    } else{ $sql_select['error'] = "<p>Creep nebyl nalezen.</p>"; };
     
    167244
    168245  }
    169 elseif( $id == "sendbug" ANd isset($_POST['send']) ){
     246elseif( $id == "sendbug" AND isset($_POST['send']) ){
    170247  mysql_select_db($Config['DB_read']['DB_read']['Database_web'])
    171248    OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_web']."!</p>");
     
    178255  else{ $sql_insert['result'] = "<p>Bug se nepodařilo uložit do databáze.<br>Zkuste to později znovu prosím.</p>"; };
    179256 
     257  }
     258elseif( $id == "myacc" ){
     259  mysql_select_db($Config['DB_read']['DB_read']['Database_realmd'])
     260    OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_realmd']."!</p>");
     261    @mysql_query("SET CHARACTER SET utf8"); 
     262
     263  $sql_select['sql'] = mysql_query("SELECT * FROM `account` WHERE `username`='".$user['nick']."' LIMIT 1");
     264  $sql_select['result']['acc'] = @mysql_fetch_array($sql_select['sql']);
     265
     266  mysql_select_db($Config['DB_read']['DB_read']['Database_mangos'])
     267    OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_mangos']."!</p>");
     268    @mysql_query("SET CHARACTER SET utf8"); 
     269
     270  $sql_select['sql'] = mysql_query("SELECT * FROM `character` WHERE `account`='".$sql_select['result']['acc']['id']."' ");
     271  $sql_select['result']['char_count'] = @mysql_num_rows($sql_select['sql']);
     272  for($i=0;$sql_select['result']['char'][$i] = @mysql_fetch_array($sql_select['sql']) ;$i++){
     273    $sql_select['result']['char'][$i]['data'] = explode(" ", $sql_select['result']['char'][$i]['data']);
     274    };
     275
     276  switch($sql_select['result']['acc']['gmlevel']){
     277    case 0: $sql_select['result']['other']['opravneni'] = "Player"; break;
     278    case 1: $sql_select['result']['other']['opravneni'] = "Moderator"; break;
     279    case 2: $sql_select['result']['other']['opravneni'] = "GameMaster"; break;
     280    case 3: $sql_select['result']['other']['opravneni'] = "Administrator"; break;
     281    default: $sql_select['result']['other']['opravneni'] = "unknown";
     282    };
     283
     284  switch($sql_select['result']['acc']['tbc']){
     285    case 0: $sql_select['result']['other']['version'] = "Normal"; break;
     286    case 1: $sql_select['result']['other']['version'] = "Burning Crusade"; break;
     287    };
     288
     289  $sql_select['result']['other']['chars'] .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n";
     290  for($i=0; $i < $sql_select['result']['char_count'] ;$i++){
     291    $sql_select['result']['other']['chars'] .= "<tr><td>".$sql_select['result']['char'][$i]['name']."</td>";
     292    $sql_select['result']['other']['chars'] .= "<td title=\"Level\">".$sql_select['result']['char'][$i]['data'][34]."</td>";
     293    $sql_select['result']['other']['chars'] .= "<td title=\"Rasa\">".$Database['race'][$sql_select['result']['char'][$i]['race']]."</td>";
     294    $sql_select['result']['other']['chars'] .= "<td title=\"Povolání\">".$Database['class'][$sql_select['result']['char'][$i]['class']]."</td>\n";
     295    $sql_select['result']['other']['chars'] .= "<td> - <a href=\"./character.php?char=".$sql_select['result']['char'][$i]['guid']."\">Exportovat</a></td></tr>\n";
     296    }; $sql_select['result']['other']['chars'] .= "</table>";
     297
     298
    180299  };
    181300
    182301
     302
     303
     304  }; // vložení souboru
    183305?>
    184 
    185 
    186 <?php
    187   };
    188 ?>
    189 
Note: See TracChangeset for help on using the changeset viewer.