<link href="../css/reset.css" rel="stylesheet" type="text/css" media="all"/>

<link href="../css/all.css" rel="stylesheet" type="text/css" media="all"/>

<link  href="../css/plugins.css" rel="stylesheet" type="text/css" media="screen" />

<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="http://www.metin2.ro/css/ie6.css" media="screen"/><![endif]-->

<!--[if gte IE 6]><link rel="stylesheet" type="text/css" href="http://www.metin2.ro/css/ie7.css" media="screen"/><![endif]-->

<script type="text/javascript" src="../js/jquery-latest.pack.js"></script>

<script type="text/javascript" src="../js/jquery.validationEngine.modified.js"></script>

<script type="text/javascript" src="../js/jquery.validationEngine.rules.html"></script>

<script type="text/javascript" src="../js/iepngfix_tilebg.js"></script>

<script type="text/javascript" src="../js/jquery.tools.min.js"></script>

<script type="text/javascript" src="../js/jquery.fancybox-1.3.1.pack.js"></script>

<script type="text/javascript" src="../js/jquery.bgiframe.js"></script>

<script type="text/javascript" src="../js/main.js"></script>
<!-- center column -->
<div id="register" class="col-2">

	<div class="content content-last">

		<div class="content-bg">

			<div class="content-bg-bottom">

				<h2><?PHP echo $serverSettings['titel']; ?> - Contul t&#259;u</h2>

				<div class="inner-form-border">

					<div class="inner-form-box">

	<h3><a id="toLogin" href="index.php?s=profil" title="Datele utilizatorului">Datele utilizatorului</a>Deblocare caractere</h3>

 <div class="trenner"></div><br/>
<?PHP

  if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
    
    
    if(isset($_GET['char']) && checkInt($_GET['char'])) {
      $sqlCmd = "SELECT player.name, player_index.empire, UNIX_TIMESTAMP(player.last_play) AS timeStamp 
        FROM player.player
        INNER JOIN player.player_index ON player.account_id = player_index.id
        WHERE player.id = '".$_GET['char']."'
        AND player.account_id = '".$_SESSION['user_id']."'
        LIMIT 1";
      $sqlQry = mysql_query($sqlCmd,$sqlServ);
    
      if(mysql_num_rows($sqlQry)>0) {
        $getChar = mysql_fetch_object($sqlQry);
        $difSpielzeit = time()-$getChar->timeStamp;
        $toGoTime = (5*60)-($difSpielzeit);
        $toGoMin = floor(($toGoTime)/60);
        $toGoSek = ($toGoTime)%60;
        if(($difSpielzeit/60)>=5) {
        
          $sqlUpdate = "UPDATE player.player SET map_index='".$resetPos[$getChar->empire]['map_index']."', x='".$resetPos[$getChar->empire]['x']."', y='".$resetPos[$getChar->empire]['y']."', 	exit_x='".$resetPos[$getChar->empire]['x']."', exit_y='".$resetPos[$getChar->empire]['y']."', exit_map_index='".$resetPos[$getChar->empire]['map_index']."', horse_riding='0' WHERE id='".$_GET['char']."' LIMIT 1";
          $updatePos = mysql_query($sqlUpdate,$sqlServ);
          if($updatePos) {
            echo '<p>Caracterul &laquo;'.$getChar->name.'&raquo; a fost teleportat cu succes &#238;n Map1.<br/> Dac&#259; deblocarea nu a func&#355;ionat, v&#259; rug&#259;m s&#259; v&#259;<br/> deconecta&#355;i &#351;i s&#259; a&#351;tepta&#355;i un moment.<br/> Apoi încerca&#355;i din nou aceast&#259; procedur&#259;.</p>';
          }
          else { echo'<p class="meldung">A ap&#259;rut o eroare, v&#259; rug&#259;m s&#259; contacta&#355;i un administrator</p>'; }
          
        }
        else {
          echo'<p class="meldung">Trebuie s&#259; fi&#355;i delogat de cel putin 5 minute. <br/>V&#259; rug&#259;m s&#259; a&#351;tepta&#355;i '.$toGoMin.' minute &#351;i '.$toGoSek.' secunde.</p>';
        }
        
      }
      else {
        echo'<p class="meldung">Caracterul specificat nu exist&#259;.</p>';
      }
    
    }
    echo'<p><a href="javascript:history.back()">Inapoi</a></p>';
  }
  else {
    echo'<p class="meldung">Trebuie s&#259; fii logat pentru a pentru aceast&#259; sec&#355;iune.</p>';
  }
?> <p id="regLegend">Trebuie s&#259; fi&#355;i delogat de cel putin 5 minute, pentru ca func&#355;ia deblocare s&#259; mearg&#259;!</p>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>