<?php

$char = mysql_real_escape_string($_GET['char']);



$sql = mysql_query("SELECT * FROM player WHERE name LIKE '$char'") or die(mysql_error());
 $ergebnis = mysql_query($sql);
if(mysql_num_rows($sql) !=NULL)
{



include("inc/drepturi.php");
if(isset($_SESSION['user']) && isset($_SESSION['pass']) && $_SESSION['admin'] >=$drepturi['lista_itm'])
  {


$row = mysql_fetch_object($sql);
$lvl = $row->level;
$skillgroup = $row->skill_group;
$class = $row->job;
$onlinemin = $row->playtime;
$exp = $row->exp;
$levelstep = $row->level_step;
$name = $row->name;		echo "<div class=\"postui post-title\">				<h2><span>Prezentare caracterului  $name </span></h2></div>	<div class=\"postui post-con\">			<div class=\"con-wrap\">";





echo "<br/>
<center><img src=\"resurse/renders/$class.png\"></center><br/>
   <div class=\"trenner_news\">&nbsp;</div>
		<div align=\"left\"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nume </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $name</div></td>

		<div align=\"left\"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ras&#259; / Abilit&#259;&#355;i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td> ";

	
if($class == "0" or $class == "4")
{
	if($skillgroup == "1" and $skillgroup !="0")
	{
	echo "R&#259;zboinic Corp ";
	}
	elseif($skillgroup == "2" and $skillgroup !="0")
	{
	echo "R&#259;zboinic Mental ";
	}
	elseif($skillgroup == "0")
	{
	echo "R&#259;zboinic <small>(Nici o abilitate &#238;nv&#259;&#355;at&#259;)</small>";
	}	
}
elseif($class == "1" or $class == "5")
{
	if($skillgroup == "1" and $skillgroup !="0")
	{
	echo "Ninja Lam&#259; ";
	}
	elseif($skillgroup == "2" and $skillgroup !="0")
	{
	echo "Ninja Arc ";
	}
	elseif($skillgroup == "0")
	{
	echo "Ninja <small>(Nici o abilitate &#238;nv&#259;&#355;at&#259;)</small>";
	}
}
elseif($class == "2" or $class == "6")
{
	if($skillgroup == "1" and $skillgroup !="0")
	{
	echo "Sura Arme ";
	}
	elseif($skillgroup == "2" and $skillgroup !="0")
	{
	echo "Sura Magie Neagr&#259; ";
	}
	elseif($skillgroup == "0")
	{
	echo "Sura <small>(Nici o abilitate &#238;nv&#259;&#355;at&#259;)</small>";
	}
}
elseif($class == "3" or $class == "7")
{
	if($skillgroup == "1" and $skillgroup !="0")
	{
	echo "&#350;aman Dragon ";
	}
	elseif($skillgroup == "2" and $skillgroup !="0")
	{
	echo "&#350;aman Vindec&#259;tor ";
	}
	elseif($skillgroup == "0")
	{
	echo "&#350;aman <small>(Nici o abilitate &#238;nv&#259;&#355;at&#259;)</small>";
	}
}
else
{

echo "garnix";
}
echo "";




?>	


					<script type="text/javascript">
                        function show_download()
                        {
    						$(document).ready(function() {						  
					           $('#required').slideToggle();                                    							
    						});
                        }
					</script>

<center>
				<a class="btn-big2" href="javascript:void(0)" onclick="show_download();" id="requirements">Iteme Echipate</a>


</center>
</div></div><div class="postui post-end"></div>






	
	
				<?PHP



		include('inc/daten.inc.php');
		$char2 = $_GET['char'];
	  	$query= mysql_query("Select * from player.player WHERE name LIKE '$char2'");
		$char = mysql_fetch_object($query);
		$cid= $char->account_id;
		$numea = mysql_fetch_object(mysql_query("Select * from account.account where id='$cid'"));
		$nume_cont = $numea->login;
		$q1 = mysql_query("Select * from player.item where owner_id='".$char->id."' and window='EQUIPMENT'");
	
	  ?>	
	
	<div id="required">
					<div class="postui post-title">
	<h2><span>Iteme echipate </span></h2>
</div>
<div class="postui post-con">
	<div class="con-wrap">

      <center><h2>Iteme : <?=$char->name?></h2></center>
	  
	  
	    
      <table width="100%" style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;">
	  
	  
	  			<tr>
				<td style="text-align:center; border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Imagine</b></a></td>
				<td style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Nume Item</b></a></td>
				<td style="text-align:center; border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Pietre</b></a></td>
				<td style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Bonusuri</b></a></td>
			</tr> 
	  
        <?php
	  while($item = mysql_fetch_object($q1))
	  {
?>

  <tr>
    <td style='text-align:center; border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><?=img_item($item->vnum);?></td>
	<td style='text-align:center; border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><?=nume_item($item->vnum)?></td>
    <td style='border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><?php
	for($i=0;$i<3;$i++) {
            if($i==0) { $akSocket = $item->socket0; }
            if($i==1) { $akSocket = $item->socket1; }
            if($i==2) { $akSocket = $item->socket2; }
            if($i==3) { $akSocket = $item->socket3; }
            if($i==4) { $akSocket = $item->socket4; }
            if($i==5) { $akSocket = $item->socket5; }
            echo'#'.($i+1).'&nbsp;';
            if(isset($itemSteine[$akSocket])) {
              echo $itemSteine[$akSocket];
            }
            else {
              echo $akSocket;
            }
            echo "<br>";
          
          }
	?></td>
    <td style='border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><b><?php 
	 for($i=0;$i<5;$i++) {
            if($i==0) { $akBoni = $item->attrtype0; $akWert = $item->attrvalue0; }
            if($i==1) { $akBoni = $item->attrtype1; $akWert = $item->attrvalue1; }
            if($i==2) { $akBoni = $item->attrtype2; $akWert = $item->attrvalue2; }
            if($i==3) { $akBoni = $item->attrtype3; $akWert = $item->attrvalue3; }
            if($i==4) { $akBoni = $item->attrtype4; $akWert = $item->attrvalue4; }
            if($i==5) { $akBoni = $item->attrtype5; $akWert = $item->attrvalue5; }
            if($i==6) { $akBoni = $item->attrtype6; $akWert = $item->attrvalue6; }
            echo'#'.($i+1).'&nbsp;';
            if(isset($itemBoni[$akBoni])) {
              echo $itemBoni[$akBoni];
            }
            else {
              echo $akBoni;
            }
            echo':&nbsp;'.$akWert;
            echo "<br/>";
          
          }
	?></b></td>
    
   
  </tr>

<?php } ?></table>

   
   </div>
   		</div>												
<div class="postui post-end"></div>

</div> 	

<br>
   <?php } else { echo error("
   
      					<div class=\"postui post-title\">
	<h2><span>Prezentarea caracterului </span></h2>
</div>
<div class=\"postui post-con\">
	<div class=\"con-wrap\">
   
   
   <center>Pentru a avea acces la această zonă trebuie să vă autentificaţi.</center>
   
   
   
         </div>
   		</div>												
<div class=\"postui post-end\"></div>
   
   
   
   ");}}
   
   
   
   else { echo error("
   
   
   
   
   					<div class=\"postui post-title\">
	<h2><span>Prezentarea caracterului </span></h2>
</div>
<div class=\"postui post-con\">
	<div class=\"con-wrap\">
   
   
   
   Caracterul selectat nu există.
   
   
   
      </div>
   		</div>												
<div class=\"postui post-end\"></div>
   
   
   "); }
   
   
   
   ?>