<?php 
    @$msg = $_GET['msg'];
	require_once("vendor/autoload.php");
	$user = new \App\Models\User();


	$getUser = $user->getUser($_SESSION['id_user']);

?>
<!-- MOVE O CURSO DO MENU 
<script> window.onload = function(e){ $('.nav-item').removeClass('active'); $('#user').addClass('active'); } </script>
 MOVE O CURSO DO MENU -->
<div class="page-inner">
	<div class="page-header">
		<h4 class="page-title">Meu Perfil</h4>
		<ul class="breadcrumbs">
			<li class="nav-home">
				<a href="#">
					<i class="flaticon-home"></i>
				</a>
			</li>
			<li class="separator">
				<i class="flaticon-right-arrow"></i>
			</li>
			<li class="nav-item">
				<a href="#">Meu Perfil</a>
			</li>
		</ul>
	</div>
	<div class="row">
		<div class="col-md-12">
			<?php include './inc/alerts.php';?>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			
			<div class="card">
				<div class="card-body">
				
					<form method="post" id="form_modalEdt" enctype="multipart/form-data" onSubmit="ChamadaPadrao(
								this.id,
								'btn_modalEdt',
								'span_modalEdt',
								'main?view=usuarios'
								);return false;">
					  <div class="modal-header">
						<h5 class="modal-title" id="modalEdtdms">Editar Dados</h5>
					  </div>
					  <div class="modal-body">
						<div class="caixa_form">
							<input type="hidden" name="user_type_edt" id="user_type_edt" value="<?= $getUser[0]["id_user_type"]; ?>">
							<input type="hidden" name="id_esc" id="id_esc" value="<?= $getUser[0]["id"]; ?>">
							<input type="hidden" name="cod" value="3">
							<input type="hidden" name="ext_edt" id="ext_edt" value="<?= $getUser[0]["ext"]; ?>">
							<label for="user_nome_edt">Nome Completo</label>
							<input class="form-control" required id="user_nome_edt" name="user_nome_edt" value="<?= $getUser[0]["user_name"]; ?>">
							<label for="user_email_edt">Email</label>
							<input type="email" class="form-control" required id="user_email_edt" name="user_email_edt" value="<?= $getUser[0]["user_email"]; ?>">
							<!--<label for="user_type_edt">Tipo do Usuário</label>
							<select required class="form-control tipo_user" name="user_type_edt" id="user_type_edt">
							</select>-->
							<p style="font-weight: bold;color: #666;font-size: 10px;text-transform: uppercase;margin: 0;margin-top: 10px;">A senha não pode ser mostrada aqui pois foi encriptografada. Caso deseje alterar a senha apenas digite uma nova senha no campo a baixo.</p>
							<label for="user_senha_edt">Senha</label>
							<input type="password" class="form-control" id="user_senha_edt" name="user_senha_edt" autocomplete="off" readonly onfocus="this.removeAttribute('readonly');" onBlur="this.setAttribute('readonly', true);">
							<div class="row" style="padding-top: 20px;padding-bottom: 100px" >
								<div class="col-md-12">
									<label for="papel_type_edt">Perfil</label>
									<style>
										.image-preview-input {
											position: relative;
											overflow: hidden;
											margin: 0px;    
											color: #333;
											background-color: #fff;
											border-color: #ccc;    
										}
										.image-preview-input input[type=file] {
											position: absolute;
											top: 0;
											right: 0;
											margin: 0;
											padding: 0;
											font-size: 20px;
											cursor: pointer;
											opacity: 0;
											filter: alpha(opacity=0);
										}
										.image-preview-input-title {
											margin-left:2px;
										}
										.popover {
											max-width: fit-content !important;
										}
									</style>
								
									<!-- image-preview-filename input [CUT FROM HERE]-->
									<div class="input-group image-preview">
										<input type="text" class="form-control image-preview-filename" disabled="disabled"> <!-- don't give a name === doesn't send on POST/GET -->
										<span class="input-group-btn">
											<!-- image-preview-clear button -->
											<button type="button" class="btn btn-default image-preview-clear" style="display:none;">
												<span class="glyphicon glyphicon-remove"></span> Limpar
											</button>
											<!-- image-preview-input -->
											<div class="btn btn-default image-preview-input">
												<span class="glyphicon glyphicon-folder-open"></span>
												<span class="image-preview-input-title">Procurar</span>
												<input type="file" accept="image/png, image/jpeg, image/gif" name="input-file-preview-2" /> <!-- rename it -->
											</div>
										</span>
									</div><!-- /input-group image-preview [TO HERE]--> 
								</div>
							</div>
					   
					   
					   </div>
					  </div>
					  <div class="modal-footer">
						<button class="btn btn-success" name="BTN_EDT" id="btn_modalEdt">&#10003; Salvar Alterações <span id="span_modalEdt"></span></button>
					  </div>
					</form>
				</div>
			</div>
			
		</div>
	</div>	
	
</div>

<!-- inclusao do footer -->
<?php
		$ff = "<script src='utils/js/users.js'></script>";
		$ff .= "
				<script>
				if (document.addEventListener) {
					document.addEventListener('keydown', bloquearSource);
				} else { //Versões antigas do IE
					document.attachEvent('onkeydown', bloquearSource);
				}

				function bloquearSource(e) {
					e = e || window.event;

					var code = e.which || e.keyCode;

					if (
						e.ctrlKey &&
						(code == 83 || code == 85) //83 = S, 85 = U
					) {
						if (e.preventDefault) {
							e.preventDefault();
						} else {
							e.returnValue = false;
						}

						return false;
					}
				}
if (document.addEventListener) {
    document.addEventListener('contextmenu', function(e) {
        e.preventDefault();
        return false;
    });
} else { //Versões antigas do IE
    document.attachEvent('oncontextmenu', function(e) {
        e = e || window.event;
        e.returnValue = false;
        return false;
    });
}
</script>
		"
		
		
?>

