<?php 
session_start();
if(!isset($_SESSION['idUsuario'])){
	header("location:../");
}
include_once '../conexao/index.php';

$_SESSION['idUsuario'] = $_SESSION['idUsuario'];
$_SESSION['nomeUsuario'] = $_SESSION['nomeUsuario'];
$_SESSION['categoriaUsuario'] = $_SESSION['categoriaUsuario']; 

?>
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
	<meta name="viewport" content="width-device-width, initial-scale=1">
	<link rel="shorcut icon"  href="../../../img/config/ios7-cart.png">
	<link rel="stylesheet" type="text/css" href="../../../css/administracao.css">
	<link rel="stylesheet" type="text/css" href="../../../css/jquery-ui.min.css">
	<link rel="stylesheet" type="text/css" href="../../../css/jquery-ui.css">
	<script type="text/javascript" src="../../../js/jquery-3.3.1.min.js"></script>
	<script type="text/javascript" src="../../../js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="../../../js/jquery-ui.js"></script>
	<script type="text/javascript" src="../../../js/funcoesAdministracao.js"></script>
	<script type="text/javascript" src="../../../js/configuracoesAdministracao.js"></script>
</head>
<body>
<div class="geralHeader">
	<div class="box grupo-head">
		<p class="p">Cadastro de Usuarios</p>
		<p><img src="../img/config/ios7-personadd-outline.png"></p>
	</div>
	<div class="box grupo-inputs">
		<p><span>Cod</span><span><input type="text" id="cod" placeholder="MN"></span></p>
		<p><span>Nome</span><span><input type="text" id="nome" placeholder="Milagre Nicodemos"></span></p>
		<p>
			<span>Categoria</span>
			<span>
				<select id="categoria">
					<option value="Admin">Admin</option>
					<option value="User">User</option>
				</select>
			</span>
		</p>
		<p><span>Usuario</span><span><input type="text" id="nuit" placeholder="admin"></span></p>
		<p><span>Senha</span><span><input type="password" id="endereco" placeholder="*************"></span></p>
		<p><span>Contacto</span><span><input type="phone" id="contacto" placeholder="878884862"></span></p>
		<p><span>Email</span><span><input type="email" id="email" placeholder="milagrelazaro1@gmail.com"></span></p>
	</div>
	<div class="box">
		<div class="btns">
			<button type="reset">
				Limpar
			</button>
			<button id="addEmpresa">
				Enviar
			</button>
		</div>
	</div>
	<div class="box table">
		<div class="look">
			<p>
				<span>Numero de registros</span>
				<span>
					<select id="numeroRegistros">
						<option value="5">5</option>
						<option value="10">10</option>
						<option value="20">20</option>
						<option value="50">50</option>
					</select>
				</span>
			</p>
			<p><input type="text" id="look" placeholder="Procurar"></p>
		</div>
		<div class="tabela">
			<table>
				<thead>
					<th>#</th>
					<th>Cod</th>
					<th>Nome</th>
					<th>Categoria</th>
					<th>Usuario</th>
					<th>Senha</th>
					<th>Contacto</th>
					<th>Email</th>
					<th>Data</th>
				</thead>
				<tbody>
					<tr>
						<td>1</td>
						<td>MN</td>
						<td>Milagre Nicodemos</td>
						<td>Admin</td>
						<td>admin</td>
						<td>1234</td>
						<td>878884862</td>
						<td>milagrelazaro1@gmail.com</td>
						<td>2021-06-02</td>
					</tr>
					<tr>
						<td>2</td>
						<td>IW</td>
						<td>Ivone Waite</td>
						<td>user</td>
						<td>ivone</td>
						<td>1234</td>
						<td>852134342</td>
						<td>ivone@gmail.com</td>
						<td>2020-07-25</td>
					</tr>
					<tr>
						<td>1</td>
						<td>MN</td>
						<td>Milagre Nicodemos</td>
						<td>Admin</td>
						<td>admin</td>
						<td>1234</td>
						<td>878884862</td>
						<td>milagrelazaro1@gmail.com</td>
						<td>2021-06-02</td>
					</tr>
					<tr>
						<td>2</td>
						<td>IW</td>
						<td>Ivone Waite</td>
						<td>user</td>
						<td>ivone</td>
						<td>1234</td>
						<td>852134342</td>
						<td>ivone@gmail.com</td>
						<td>2020-07-25</td>
					</tr>
					
				</tbody>
			</table>
		</div>
	</div>
	<script type="text/javascript">
		$(function() {
			$("table tbody tr td").on('dblclick', function() {
				if ($('td > input').length > 0) {
					return;
				}
				var conteudoOriginal = $(this).text();
				var novoElemento = $('<input/>', {type: 'text', value:conteudoOriginal});
				$(this).html(novoElemento.bind('blur keydown', function(e) {
					var keyCode = e.which;
					if (keyCode == 13) {
						var conteudoNovo = $(this).val();
						if (conteudoNovo != "") {
							$(this).parent().html(conteudoNovo);
						}
					}
					if (e.type == "blur") {
						$(this).parent().html(conteudoOriginal);
					}
				}));
				$(this).children().select();
			});
		});
	</script>
</div>
</body>
</html>