<link  href="../css/plugins.css" rel="stylesheet" type="text/css" media="screen" />
<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>
<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>Schimb&#259; parola depozitului</h3>
 <div class="trenner"></div><br/>
 <?PHP
  if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
 if(isset($_POST['submit']) && $_POST['submit']=="Schimba") {
      if(checkAnum($_POST['lnpass']) && strlen($_POST['lnpass'])>=1 && strlen($_POST['lnpass'])<=6 && $_POST['lnpass']==$_POST['lnpass2']) {
        $oldPass = mysql_real_escape_string($_POST['lopass']);
        $newPass = mysql_real_escape_string($_POST['lnpass']);
        $sqlCmd = "SELECT password FROM player.safebox WHERE password='".$oldPass."' AND account_id='".$_SESSION['user_id']."' LIMIT 1";
        $sqlQry = mysql_query($sqlCmd,$sqlServ);
        if(mysql_num_rows($sqlQry)==1) {
          $passCmd = "UPDATE player.safebox SET password='".$newPass."' WHERE account_id='".$_SESSION['user_id']."' LIMIT 1;";
          $passUpdate = mysql_query($passCmd,$sqlServ);
          if($passUpdate) {
            echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A&#355;i schimbat cu succes parola depozitului.<br/><br/></h1><div class="trenner"></div>';
          }
          else {
            echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Schimbarea parolei depozitului a e&#351;uat.<br/><br/></h1><div class="trenner"></div>';
          }
        }
        else {
          echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parola depozitului introdus&#259; este incorect&#259;.<br/><br/></h1><div class="trenner"></div>';
        }
        
      }
      else {
        echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nu a&#355;i introdus toate datele corect.<br/><br/></h1><div class="trenner"></div>';
      }
    }
  ?>
  <?PHP
  }
  else {
    echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Trebuie s&#259; fi &#238;nregistrat pentru a avea acces la aceast&#259; pagin&#259;!<br/><br/></h1><div class="trenner"></div>';
  }
?>


          <form name="registerForm" id="registerForm" action="index.php?s=camp_p" method="POST">
          <div>  
		  					<div>
							<label for="password">Parola veche:*
								</label>
								<input
								type="password"
								class="validate[required,custom[noSpecialCharacters],length[1,6]]"
								id="password"
								name="lopass"
								maxlength="6"
								value=""
								AUTOCOMPLETE="off"
								/>
							</div>
									  										<div>
							<label for="password">Parola nou&#259;:*
								</label>
								<input
								type="password"
								class="validate[required,custom[noSpecialCharacters],length[1,6]]"
								id="password"
								name="lnpass"
								maxlength="6"
								value=""
								AUTOCOMPLETE="off"
								/>
							</div>
							<div>
								<label for="password">Repet&#259; parola nou&#259;:*
								</label>
								<input
								type="password"
								class="validate[required,custom[noSpecialCharacters],length[1,6]]"
								id="password"
								name="lnpass2"
								maxlength="6"
								value=""
								AUTOCOMPLETE="off"
								/>
							</div></div>
              <br/><input id="submitBtn" type="submit" name="submit" value="Schimba" class="btn-bg"/>
        </form>
						<p id="regLegend">* este necesar</p>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>	