<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<script type="text/javascript">
<!--
function Active(what)
{
what.style.backgroundColor='#CCCCCC';
}
function NotActive(what)
{
what.style.backgroundColor='';
}
function storeCaret(textEl) {
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}
//-->
</script>
<title>DeadTouch Account Maker - Search Player</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {color: #FFCC00}
-->
</style>
</head>
<body>
<div align="center"> 
  <p><font color="#FFCC00">DeadTouch Account Creator</font> </p>
  <table width="14%" border="0" cellspacing="2" cellpadding="2">
    <tr>
      <td bgcolor="#CCCCCC"><div class="odn"><font color="#000000" size="1"><a href="index.php">&nbsp;<font color="#1C3359"> Home</font></a></font></div>
          <font color="#000000" size="1">
          <div align="center">Home Page</div>
          </font></td>
    </tr>
    <tr>
      <td bgcolor="#CCCCCC"><font color="#000000" size="1">
        <div class="odn"><a href="zaloz.php">&nbsp;<font color="#1C3359"> Account 
          Creator</font></a></div>
        </font>
          <div align="center"><font size="1"> Create Character</font></div></td>
    </tr>
    <tr>
      <td bgcolor="#CCCCCC"><font color="#000000" size="1">
        <div class="odn"><a href="players.php">&nbsp;<font color="#1C3359"> Search Player</font></a></div>
        </font>
          <div align="center"><font size="1"> Find Character</font></div></td>
    </tr>
    <tr>
      <td bgcolor="#CCCCCC"><font color="#000000" size="1">
        <div class="odn"><a href="kontakt.php">&nbsp;<font color="#1C3359"> Contact</font></a></div>
        </font>
          <div align="center"><font size="1"> Contact with GM</font></div></td>
    </tr>
  </table>
  <table width="14%" border="0" cellpadding="2" cellspacing="2">
    <tr>
      <td bgcolor="#CCCCCC"><font color="#000000" size="1"></font>
          <div class="odn"><font color="#000000" size="1"><a href="http://www.otscenter.pl">&nbsp; <font color="#1C3359">OtsCenter.pl</font></a></font></div>
        <div align="center">Polish World of OTS </div>
        <div align="center"><font size="1"> </font></div></td>
    </tr>
  </table>
  <table width="14%" border="0" cellpadding="2" cellspacing="2">
    <tr>
      <td align="center" bgcolor="#CCCCCC"><div class="odn"><font color="#000000" size="1"><a href="http://www.graviriarpg.fora.pl">&nbsp;<font color="#1C3359"> </font></a>Statistics</font></div>
          <div align="center"><font color="#000000" size="1"><a target="Graviria Level Ranking" href="rank/lvl.php" onclick="window.open('rank/lvl.php', 'Graviria Level Ranking').focus(); return false">LVL</a> / <a target="Graviria Level Ranking" href="rank/mlvl.php" onclick="window.open('rank/mlvl.php', 'Graviria Level Ranking').focus(); return false">MLVL</a> </font> <font size="1"><br />
            Statistics</font></div></td>
    </tr>
  </table>
  <p> </p><hr width="560">
  <form method="get" action="<?=$PHP_SELF?>">
    <div align="center"><font color="#FFFFFF" size="2">Write a nick of player:</font><br />
      <input type="hidden" name="where" value="search" />
      <input type="text" name="char" onFocus="Active(this);" onBlur="NotActive(this)" />
      <input name="submit" type="submit" value="Search" />
    </div>
  </form>
  <div align="center"> 
    <table width="40%" border="0" cellpadding="2" cellspacing="2">
      <tr> 
        <td> 
          <?php
$char = $_REQUEST['char'];
$monster_folder = "C:\\DeadTouch\\data\\monsters\\";
$folderplayer = "C:\\DeadTouch\\data\\players\\";
$file= "$folderplayer$char.xml";
$f = @fopen($file, "r");
if(!$char) {    
} else if(!$f) {
print("<font color=\"red\">Cannot find char with nick <font color=\"orange\">$char!</font><br><br>\n\n");
} else {
$contents = fread($f, filesize($file));
$tags = explode("<", $contents);
$name = "";
$level = 0;
$magic_level = 0;
$voc = 0;
$lastlogin = 0;
$skills = array(0, 0, 0, 0, 0, 0, 0);
foreach($tags as $tag) {
if(substr($tag, 0, 6) == "player") {
if($temppos = stristr($tag, "name=\"")) {
$temp = explode("\"", $temppos);
$name = $temp[1];
}
if($temppos = stristr($tag, "level=\"")) {
$temp = explode("\"", $temppos);
$level = $temp[1];
}
if($temppos = stristr($tag, "maglevel=\"")) {
$temp = explode("\"", $temppos);
$magic_level = $temp[1];
}
if($temppos = stristr($tag, "voc=\"")) {
$temp = explode("\"", $temppos);
$voc = $temp[1];
}
if($temppos = stristr($tag, "lastlogin=\"")) {
$temp = explode("\"", $temppos);
$lastlogin = $temp[1];
}
}
if(substr($tag, 0, 6) == "skill ") {
if($temppos = stristr($tag, "skillid=\"")) {
$temp = explode("\"", $temppos);
$tempid = $temp[1];
}
if($temppos = stristr($tag, "level=\"")) {
$temp = explode("\"", $temppos);
$templvl = $temp[1];
}
if($tempid && $templvl) {
$skills[$tempid] = $templvl;
}
}
if(substr($tag, 0, 6) == "death ") {
if($temppos = stristr($tag, "name=\"")) {
$temp = explode("\"", $temppos);
$tempname = $temp[1];
}
if($temppos = stristr($tag, "level=\"")) {
$temp = explode("\"", $temppos);
$templvl = $temp[1];
}
if($tempname && $templvl) {
if(file_exists("<font color='#3333CC'>$monster_folder$tempname.xml<font>")) {
$deathtext[] = " $templvl by a <font color='#66CCFF'>$tempname</font>";
} else if(file_exists("$folderplayer$tempname.xml")) {
$deathtext[] = " $templvl by <font color='#66CCFF'><a href=\"players.php?where=search&char=$tempname\">$tempname</a></font>";
} else {
$deathtext[] = "$templvl by $tempname";       
}
}
}
}
print("<center><br><br><b>Stats:</b><br></center>");
print("<b><font color='#FFCC00'>Name:</font></b> $name<br>\n");
print("<b><font color='#FFCC00'> Level:</font></b> $level<br>\n");
print("<b><font color='#FFCC00'>Magic Level:</font></b> $magic_level<br>\n");
$vocations = array("None", "Mage", "Acolyte", "Hunter", "Warrior", "Master Sorcerer", "Elder Druid", "Roayl Paladin", "Elite Knight",);
print("<b><font color='#FFCC00'>Vocation:</font></b> $vocations[$voc]<br>\n");
print("<center><br><br><b>Skills:</b><br></center>");
$skillnames = array( "", "Club Fighting", "Sword Fighting", "Axe Fighting", "Distance Shielding", "Shielding ", "Fishing");
foreach($skills as $k => $skill) {
if(!$skill) continue;
print("<b>$skillnames[$k]:</b> $skill<br>\n");
}
if($deathtext) {
print("<center><br><br><b>Deaths:</b><br></center>");
foreach($deathtext as $temp) {
print("Killed at level $temp.<br>\n");
}
}
}
?>
          <div align="center"></div>
          <div align="center"></div>
          <div align="center"></div></td>
      </tr>
    </table>
    <table width="40%" border="0" cellpadding="2" cellspacing="2">
      <tr>
        <td><div align="center">Account Maker created by Guts!<br />
                <a href="http://www.otscenter.pl/">www.otscenter.pl</a> - <span class="style1">Polish World of OTS </span></div>
            <div align="center"></div>
          <div align="center"></div></td>
      </tr>
    </table>
    <p><br />
      <br />
      </p>
  </div>
</div>
</body>
</html>
