<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']; ?> - Contraceña perdida?</h2>
				<div class="inner-form-border">
					<div class="inner-form-box">
	<h3><a id="toLogin" href="index.php?s=login" title="&#206;napoi la autentificare"> Identificarce</a>Cambio contraceña!</h3>
 <div class="trenner"></div><br/>
 <?PHP

  if(isset($_POST['sfform']) && $_POST['sfform']=="Trimite") {
  
    if(!empty($_POST['account']) && !empty($_POST['email'])) {
  
      $acc = mysql_real_escape_string($_POST['account']);
      $email = mysql_real_escape_string(($_POST['email']));
      
      $sqlCmd = "SELECT id FROM account.account WHERE login='".$acc."' AND email='".$email."' LIMIT 1";
      $sqlQry = mysql_query($sqlCmd,$sqlServ);
      
      if(mysql_num_rows($sqlQry)>0) {
        
        $newPass = substr(md5(rand(999,99999)),0,8);
        $setPass = "UPDATE account.account SET password=PASSWORD('".$newPass."') WHERE login='".$acc."' LIMIT 1";
        $qryPass = mysql_query($setPass);
        
        if($qryPass) {
          echo'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parola ta a fost resetat&#259; cu succes.<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parola nouã a contului  <b>'.$acc.'</b> este : <b>'.$newPass.'</b> <br/><br/><div class="trenner"></div>';
        }
        else {
          echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nu poate fi setata nici o parol&#259; nou&#259;. V&#259; rugam contacta&#355;i un Administrator.<br/><br/></h1><div class="trenner"></div>';
        }
        
      }
      	 else {
      echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Informa&#355;iile introduse sunt gre&#351;ite.<br/><br/></h1><div class="trenner"></div>';
    }
    }
    else {
      echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nu a&#355;i introdus informa&#355;iile.<br/><br/></h1><div class="trenner"></div>';
    }

    
  }
?>
<form name="registerForm" id="registerForm" action="index.php?s=passwordlost" method="POST">
<div>
<label for="username">Nombre de la Cuenta:*</label>
<input
								type="text"
								class="validate[required,custom[noSpecialCharacters],length[8,16]]"
								id="username"
								name="account"
								title=""
								value=""
								maxlength="16"
								AUTOCOMPLETE="off"
								/>


										<div>
								<label for="password">Correo Electronico:*
								</label>
								<input
								type="username"
								class="validate[required,custom[email]]"
								id="password"
								name="email"
								maxlength="50"
								value=""
								AUTOCOMPLETE="off"
								/>
							</div>	
<br/><br/><br/>
              <th class="topLine" style="text-align:center;" colspan="2"><input id="submitBtn" type="submit" name="sfform" value="Enviar" class="btn-bg"/></th>

          </div>
        </form>
						<p id="regLegend">* Todos los datos son necesarios.</p>
						<p id="regLegend">* Debes introducir los datos correctos!</p>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>	