<?php
session_start();
require('../Operaciones/Cliente_operacion.php');
if(isset($_SESSION['Login'])){
$Id_Reg=$_SESSION['Acceso'];
}else {
	session_start();
	session_destroy();
	header('location: ../Salir.php');
}
$dato = new Cliente_P();
$dato=$dato->Acceso($Id_Reg);

?>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Perfil</title>
<style type="text/css">
<!--
#Panel_perfil {
	margin: auto;
	top: 35px;
	width: 400px;
	height: 500px;
	padding: 25px;
	background: #FFF;
	border-radius: 25px;
	-webkit-box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);
	-moz-box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);
	box-shadow:  10px 10px 5px 0px rgba(0,0,0,0.75);
	font-family: Gotham, Helvetica Neue, Helvetica, Arial," sans-serif";
	
	}
	#Datos_T {
		padding: 20px;
	}
body {
	background-color: #eee;
}
	#Msg {
		background-color: red;
		color:white;
		
	}	
</style>
</head>

<body>
<br><br><br>
<div id="Panel_perfil">
  <div align="center">
	  <p align="left"><div id="Msg"></div>  
    <table id="Datos_T" width="380" border="0">
      <tr>
        <td width="166">AGL :</td>
        <td width="166">&nbsp;</td>
      </tr>
      <tr align="center">
        <td colspan="2"><?= $dato['nombre'] ?></td>
      </tr>
      <tr>
        <td>Login :</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="27" colspan="2" align="center"><?= $dato['Login'] ?></td>
      </tr>
		<form name="Perfil_Temp" method="post" action="#">
		  <tr>
		    <td height="37" colspan="2"><div align="center">Cambio de Contraseña</div></td>
	      </tr>
		  <tr>
		    <td height="46" bgcolor="#EDB62B"><div align="center">Anterior</div></td>
		    <td bgcolor="#EDB62B"><label>
		      <div align="center">
		        <input name="Pass_ante" type="password" id="Pass_ante" size="15" autocomplete="off" placeholder="Contraseña Anterior">
	          </div>
	        </label></td>
	      </tr>
		  <tr>
		    <td height="49" bgcolor="#EDB62B"><div align="center">Nuevo</div></td>
		    <td bgcolor="#EDB62B"><label>
		      <div align="center">
		        <input name="Nuevo_pass" type="password" id="Nuevo_pass" size="15" autocomplete="off" placeholder="Nueva Contraseña">
	          </div>
	        </label></td>
	      </tr>
		  <tr>
		    <td height="43" bgcolor="#EDB62B"><div align="center">Confirmación</div></td>
		    <td bgcolor="#EDB62B"><label>
		      <div align="center">
		        <input name="Conf_pass" type="password" id="Conf_pass" autocomplete="off" size="15" placeholder="Confirmación">
	          </div>
	        </label></td>
	      </tr>
		  <tr>
		    <td colspan="2"><div align="center">
				<button onclick="Pregunta()" class="Boton">Enviar</button>
		      </div>
          </tr> </form>
    </table>
   
    <p><img src="../Diseno/Contra_Log.jpg" width="217" height="96" alt=""/></p>
      </div>
</div>
<script>
	var Id_reg_ =<?php echo $Id_Reg ?>;
	const Pregunta = ()=>{
		let Pass_Ante_ = document.getElementById("Pass_ante").value;
		let New_Pass_ = document.getElementById("Nuevo_pass").value;
		let Conf_Pass_ = document.getElementById("Conf_pass").value;
		$("#Msg").load('Cambios.php',{Pass_Ante:Pass_Ante_,New_Pass:New_Pass_,Conf_Pass:Conf_Pass_,Id_reg:Id_reg_});	
	}
</script>
</body>
</html>