<?php
session_start();
     if( (isset($_SESSION['IdStudent'])) &&($_SESSION['IdStudent']>0))
   {  
?>
<!DOCTYPE html>
<html>
<head>
<title>IESTP-Abancay</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<link rel="icon" href="assets/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="bower_components/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/pages/waves/css/waves.min.css" media="all">
<link rel="stylesheet"  href="assets/icon/feather/css/feather.css">
<link rel="stylesheet"  href="assets/icon/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/icon/icofont/css/icofont.css">
<link rel="stylesheet"  href="assets/css/style.css">
<?php
include("script_funciones.php");
include('db___cn.php');
$mysqli=conex_db_mysql();

$estudiante="SELECT IdEstudiante,Apellidos,Nombres,UrlFoto,Dni,Email,NumCelular
              FROM tb_estudiantes 
              WHERE IdEstudiante='".$_SESSION['IdStudent']."'";
$rs=$mysqli->query($estudiante);
$fila_estudiante=mysqli_fetch_array($rs);

mysqli_close($mysqli);
?>
</head>
<body>

<div class="loader-bg">
<div class="loader-bar"></div>
</div>

<div id="pcoded" class="pcoded">
   <div class="pcoded-overlay-box"></div>
      <div class="pcoded-container navbar-wrapper">
        <?php
            MenuSuperior($fila_estudiante['Nombres'],$fila_estudiante['UrlFoto'],$_SESSION['Carrera']);
         ?>
<div class="pcoded-main-container">
  <div class="pcoded-wrapper">
    <?php
       MenuPrincipal();
     ?>
<div class="pcoded-content">
  <div class="page-header card">
      <div class="row align-items-end">
		<div class="col-lg-8">
			<div class="page-header-title">
				<div class="d-inline">
				</div>
			</div>
		</div>
		<div class="col-lg-4">
			<div class="page-header-breadcrumb">
				<ul class=" breadcrumb breadcrumb-title">
				<li class="breadcrumb-item">
				<a href="principal.php"><i class="feather icon-home"></i></a>
				</li>
				<li class="breadcrumb-item">
				<a href="#">Cambiar Contrase&#241;a</a>
				</li>
				</ul>
			</div>
		</div>
      </div>
  </div>
<div class="pcoded-inner-content">
<div class="main-body">
<div class="page-wrapper">
<div class="page-body">
  <div class="card">
	<div class="card-header bg-primary">
	    <h5>Cambiar Contrase&#241;a</h5>
		<div class="card-header-right">
		</div>
	</div>
	  <div class="card-block">
         <form name="formCambiarClave" method="post" action="" onsubmit="cambiarClave(); return false">
            <input type="hidden" name="Id" id="Id" value="<?php echo $fila_estudiante['IdEstudiante'];  ?>">  		    
					<div class="form-group row">
						<label class="col-sm-2 col-form-label text-right">Nueva Contrase&#241;a :</label>
						<div class="col-sm-4">
						  <input type="password" id="txt_clave" class="form-control" maxlength="10" required>
						</div>
						<label class="col-sm-6 col-form-label"></label>
					 </div>
					 <div class="form-group row">
					  <label class="col-sm-2 col-form-label"></label>
						<div class="col-sm-3">
						  <input type="checkbox" onclick="myFunction()"> Mostrar Contrase&#241;a
						</div>
                         <label class="col-sm-7 col-form-label"></label>
					 </div>											    
					 <div class="form-group row">
				       <label class="col-sm-2 col-form-label"></label>
						<div class="col-sm-3">
						<input type="submit" class="btn waves-effect waves-light btn-primary" id="bt_cambiar" name="bt_cambiar" value="Cambiar Contrase&#241;a"> 
					  </div>
					  <label class="col-sm-7 col-form-label">
					  	  <div id="mensajes"></div>
					  </label>
			       </div>
           </form>
                               
	  </div>
  </div>
</div>
</div>
</div>
</div>
</div>

</div>
</div>
</div>
</div>

<script src="bower_components/jquery/js/jquery.min.js"></script>
<script src="bower_components/jquery-ui/js/jquery-ui.min.js"></script>
<script src="bower_components/popper/js/popper.min.js"></script>
<script src="bower_components/bootstrap/js/bootstrap.min.js"></script>

<script src="assets/pages/waves/js/waves.min.js"></script>

<script  src="bower_components/jquery-slimscroll/js/jquery.slimscroll.js"></script>

<script src="assets/js/pcoded.min.js"></script>
<script src="assets/js/vertical/vertical-layout.min.js"></script>
<script src="assets/js/script.min.js"></script>
<script src="js/ajax.js"></script>
<script type="text/javascript">
	function myFunction() {
	  var x = document.getElementById("txt_clave");
	  if (x.type === "password") {
	    x.type = "text";
	  } else {
	    x.type = "password";
	  }
}
</script>
</body>
</html>
<?php
}
else
{ 

echo "Error Ud. Debe Iniciar Sesion.................";

}
?>
