<?php

session_start();
require('../../Operaciones/Admin_operacion.php');
if(isset($_SESSION['Login'])){
	$Id	=$_SESSION['Login'];
	$Id_Reg=$_POST['idReg'];
}else {
	session_start();
	session_destroy();
	header('location: ../index.php?error=acceso');
}
$dato = new Admin_P();
$datoB = new Admin_P();
$datoA = $dato->UsrTipo($Id_Reg);
echo 'Cuenta'.$Id_Reg;
?>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
	#Pantalla {
		margin: 0px auto;
		padding: 15px;
	}
</style>
</head>

<body>
<div id="Pantalla">
<form id="Edit_Cuenta">
<table class="customers">
   <tbody>
    <tr>
      <th colspan="2">.: Actualización de Usuarios :.</th>
    </tr>
    <tr align="center">
      <td colspan="2"></td>
      </tr>
    <tr>
      <td width="130">Municipio :</td>
      <td width="62"><div id="Mun_Gan"><?php $datoB->MuniSelect($datoA['id']) ?></div> </td>
    </tr>
    <tr>
      <td>Login :</td>
      <td><div id="Log_IN"><input type="text" name="Log_in" id="Log_in" max="30" maxlength="30" autocomplete="off" placeholder="-- Minimo 5 caracteres - -" required value="<?= $datoA['Login'] ?>"></div></td>
    </tr>
    <tr>
      <td>Descripción : </td>
      <td><input type="text" name="Descrip" id="Descrip" max="100" placeholder="-- Máximo 100 caracteres --" maxlength="100" autocomplete="off" value="<?= $datoA['Nombre'] ?>"></td>
    </tr>
    <tr>
      <td>Contraseña :* 
        <button type="button" onClick="Gen_Contra()">Genera</button></td>
      <td><div id="Contrasena"><input type="text" name="Contrase" id="Contrase" max="50"  maxlength="50" readonly></div></td>
    </tr>
    <tr>
      <td colspan="2" align="center"><button type="button" onClick="ActUsr(<?= $Id_Reg ?>)">Actualizar</button></td>
      </tr>
   </tbody>
</table>
 
  <div id="P_Auto" style="display:none;">
   <table class="customers">
   <tbody>
   <tr>
      <td colspan="2" align="center">.: Datos del Personal Autorizado :.</td>
    </tr>
    <tr>
      <td align="center">Apellido Parterno :</td>
      <td align="center"><input type="text" name="A_Paterno" id="A_Paterno" max="50" maxlength="50"> </td>
    </tr>
    <tr>
      <td align="center">Apellido Materno :</td>
      <td align="center"><input type="text" name="A_Materno" id="A_Materno" max="50" maxlength="50"></td>
    </tr>
    <tr>
      <td align="center">Nombre :</td>
      <td align="center"><input type="text" name="Nombre" id="Nombre" max="50" maxlength="50"></td>
    </tr>
    <tr>
      <td align="center">Teléfono :</td>
      <td align="center"><input type="text" name="Tel" id="Tel" max="10" maxlength="10"></td>
    </tr>
    <tr>
      <td align="center">Correo E :</td>
      <td align="center"><input type="text" name="Correo_E" id="Correo_E" max="70" maxlength="70"></td>
    </tr>
       </tbody>
</table>
    </div>
    <table class="customers">
   <tbody>
    <tr>
      <td colspan="2" align="center"><button type="button" onClick="Alta_Reg()" name="Btn_Alta" id="Btn_Alta" class="Boton" style="display: none">Alta</button></td>
    </tr>
    <tr>
      <td colspan="2" align="center"><div id="Msg_E"></div></td>
    </tr>
   </tbody>
</table>
    
</form>
</div>
<script>
	
//	Origen(1);
	function Ver_Log() {
		let Campo = document.getElementById("Log_in");
  		Campo.value = Campo.value.toLowerCase();
		Campo.value = Campo.value.replace(/\s+/g, '')
		$('#Log_IN').load('Cuentas/Procesos.php',{Opc:3,Campo:Campo.value})
}
</script>
</body>
</html>