<?php
session_start();
     if( (isset($_SESSION['IdAdmin'])) &&($_SESSION['IdAdmin']>0))
   {  
?>
<!DOCTYPE html>
<html>
<head>
<title>IESTP-Abancay-Docente</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="bower_components/animate/css/animate.css">
<link rel="stylesheet" href="assets/pages/notification/notification.css">

<link rel="stylesheet"  href="assets/css/style.css">

<?php
include("script_funciones.php");
include('db___cn.php');
$mysqli=conex_db_mysql();

$administrador="SELECT IdAdministrador,Apellidos,Nombres,UrlFoto,Email,Celular,Usuario,Clave
              FROM tb_administrador 
              WHERE IdAdministrador='".$_SESSION['IdAdmin']."'";
$rs=$mysqli->query($administrador);
$fila_administrador=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">
	
	<nav class="navbar header-navbar pcoded-header">
		<div class="navbar-wrapper">
			<div class="navbar-logo">
				<?php logo(); ?>	
			</div>
			<div class="navbar-container container-fluid">
			    <?php menuSuperior($fila_administrador['Nombres'],$fila_administrador['UrlFoto']); ?>
			</div>
		</div>
	</nav>

<div class="pcoded-main-container"><!-- inicio pcoded-main-container -->
  <div class="pcoded-wrapper"><!-- inicio pcoded-wrapper -->

	<nav class="pcoded-navbar">
	  <div class="nav-list">
	     <div class="pcoded-inner-navbar main-menu">
	        <div class="pcoded-navigation-label">Panel Navegaci&#243;n</div>
	          <?php  MenuPrincipal(); ?>
	     </div>
	  </div>
	</nav>

<div class="pcoded-content"><!-- inicio pcoded-content -->

	<div class="page-header card"> <!-- inicio page-header card - encabezado -->
		<div class="row align-items-end">
				<div class="col-lg-4">
					
				</div>
				<div class="col-lg-8">
					<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="#">Carpeta Personal</a>
								</li>
								<li class="breadcrumb-item">
								  <a href="#">Perfil Administrador</a>
								</li>
							</ul>
					</div>
				</div>
		</div>
	</div><!-- fin page-header card - encabezado -->

<div class="pcoded-inner-content"><!-- inicio pcoded-inner-content - contenido dinamico -->
	<div class="main-body">
	<div class="page-wrapper">
	<div class="page-body">
		<div class="row">
			<div class="col-lg-12">
				<div class="card">
					<div class="card-header bg-primary">
						<h5 class="card-header-text">Datos Personales</h5>
					</div>
					<div class="card-block">
			<form name="formDatosPersonales" method="post" action="" onsubmit="actualizarDatosPersonales(); return false">
					  <input type="hidden" name="Id1" id="Id1" value="<?php echo $fila_administrador['IdAdministrador'];  ?>">
					  
						<div class="form-group row">
						   <label class="col-sm-2 col-form-label text-right" >Apellidos :</label>
							<div class="col-sm-5">
							<input type="text" id="txt_apellidos" class="form-control"  value="<?php echo $fila_administrador['Apellidos']; ?>" >
							</div>
							<label class="col-sm-1 col-form-label text-right">Nombre:</label>
							<div class="col-sm-4">
							   <input type="text" id="txt_nombres" class="form-control" value="<?php echo $fila_administrador['Nombres']; ?>" >
							</div>
						</div>
						
						<div class="form-group row">
							<label class="col-sm-2 col-form-label text-right">Email:</label>
							<div class="col-sm-5">
							   <input type="email" id="txt_email" class="form-control" placeholder="Ingrese email personal" value="<?php echo $fila_administrador['Email']; ?>">
							</div>
							<label class="col-sm-1 col-form-label text-right">Celular :</label>
							<div class="col-sm-4">
							<input type="number" id="txt_celular" class="form-control" placeholder="Ingrese Celular" value="<?php echo $fila_administrador['Celular']; ?>">
							</div>
						</div>
					    <div class="form-group row">
						    <label class="col-sm-2"></label>
							<div class="col-sm-2">
                              <input type="submit" class="btn btn-primary m-b-0" name="bt_actualizar_personal" id="bt_actualizar_personal" value="Actualizar">
							</div>
							<label class="col-sm-8">
                               <div id="mensajes1"></div>
							</label>
						</div>
			</form>
					</div>
				</div>
			</div>
		</div>

		<div class="row">
			<div class="col-lg-12">
				<div class="card">
					<div class="card-header bg-primary">
						<h5 class="card-header-text">Acceso del Administrador</h5>
					</div>
					<div class="card-block">
						<form name="formAccesoeClass" method="post" action="" onsubmit="cambiarClave(); return false">
								  <input type="hidden" name="Id2" id="Id2" value="<?php echo $fila_administrador['IdAdministrador'];  ?>">
								  <div class="form-group row">
									   <label class="col-sm-2 col-form-label text-right">Usuario :</label>
										<div class="col-sm-3">
										  <input type="text" id="txt_usuario" class="form-control" maxlength="10" value="<?php echo $fila_administrador['Usuario']; ?>">
										</div>
										<label class="col-sm-2 col-form-label text-right">Contrase&#241;a Actual :</label>
										<div class="col-sm-2">
										  <input type="password" id="txt_clave" class="form-control" readonly value="<?php echo $fila_administrador['Clave']; ?>">
										</div>
										<div class="col-sm-3">
										  <input type="checkbox" onclick="myFunction()"> Mostrar Contrase&#241;a
										</div>
										
									</div>
									<div class="form-group row">
									   <label class="col-sm-2 col-form-label text-right" >Cambiar Contrase&#241;a :</label>
										<div class="col-sm-3">
										<input type="text" id="txt_cambiar_clave" required class="form-control" maxlength="15">
										</div>
										<label class="col-sm-7 col-form-label text-right"></label>
									</div>
								    <div class="form-group row">
									    <label class="col-sm-2"></label>
										<div class="col-sm-3">
                                          <input type="submit" class="btn btn-primary m-b-0" name="bt_cambiar_clave" id="bt_cambiar_clave" value="Cambiar Contrase&#241;a">
										</div>
										<label class="col-sm-7">
                                           <div id="mensajes2"></div>
										</label>
									</div>
								</form>
					</div>
				</div>
			</div>
		</div>

		<div class="row">
			<div class="col-lg-12">
				<div class="card">
					<div class="card-header bg-primary">
						<h5 class="card-header-text">Actualizar Fotograf&#237;a</h5>
					</div>
					<div class="card-block">
						<form name="formAdjuntarFotografia" action="uploadFotografia.php" method="post" id="formAdjuntarFotografia" enctype="multipart/form-data">
								  <input type="hidden" name="Id3" id="Id3" value="<?php echo $fila_administrador['IdAdministrador'];  ?>">
								  
								  <div class="form-group row">
								   <label class="col-sm-2 col-form-label"></label>
									<div class="col-sm-10">
										 <p>Las dimensiones de la fotograf&#237;a deben tener como m&#237;nimo la siguiente medida : Ancho de 800px y de Alto de 850px, y debe ser en formato jpeg. 
										 </p>
									</div>
								</div>
								  <div class="form-group row">
									   <label class="col-sm-2 col-form-label"></label>
										<div class="col-sm-10">
											<input type="file" id="file_fotografia" required class="form-control" name="file_fotografia">
										</div>
									</div>
									<div class="form-group row">
									    <label class="col-sm-2"></label>
										<div class="col-sm-10">
                                            <div class="progress">
				                                 <div class="bar bg-success"></div>
				                                 <div class="percent">0%</div>
				                            </div>
				                            <div id="status"></div>
										</div>
									</div>
								    <div class="form-group row">
									    <label class="col-sm-2"></label>
										<div class="col-sm-10">
                                          <input type="submit" class="btn btn-primary m-b-0" name="bt_actualizar_fotografia" id="bt_actualizar_fotografia" value="Actualizar">
										</div>
									</div>
								</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	</div>
	</div>
</div><!-- fin pcoded-inner-content - contenido dinamico -->
</div> <!-- fin pcoded-content -->


</div><!-- fin pcoded-wrapper -->

</div> <!-- fin pcoded-main-container -->

</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  src="assets/js/bootstrap-growl.min.js"></script>
<script src="assets/pages/accordion/accordion.js"></script>
<script src="js/jquery.form.js"></script>
<script src="js/progressBar.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.................";

}
?>
