<!--
=========================================================
Painel P2P Plus - v1.0
=========================================================
Created by Albeci Nogueira (PLAYLIVE.TOP)
=========================================================
-->
<?php 
include_once "sistema/functions.php";
$id_user = $_GET['update'];
$buscarUser = buscarUsuarioID($id_user);
$nome_user = $buscarUser["nome"];
$usuario_user = $buscarUser["usuario"];
$senha_user = $buscarUser["senha"];
$nivel_user = $buscarUser["nivel"];
?>
<!DOCTYPE html>
<html lang="en">
<?php 
include_once "head.php";
?>
  <body>
    <div class="container-scroller">
      <!-- partial:partials/_sidebar.html -->
<?php 
include_once "header.php";
?>
        <!-- partial -->
        <div class="main-panel">
          <div class="content-wrapper">
            <div class="row">
              <div class="col-12 grid-margin stretch-card">
                <div class="card corona-gradient-card">
                  <div class="card-body py-0 px-0 px-sm-3">
                    <div class="row align-items-center">
                      <div class="col-4 col-sm-3 col-xl-2">
                        <img src="assets/images/dashboard/Group126@2x.png" class="gradient-corona-img img-fluid" alt="">
                      </div>
                      <div class="col-5 col-sm-7 col-xl-8 p-0">
                        <h4 class="mb-1 mb-sm-0">Precisa de ajuda?</h4>
                        <p class="mb-0 font-weight-normal d-none d-sm-block">Temos suporte especializado, é só chamar!!!</p>
                      </div>
                      <div class="col-3 col-sm-2 col-xl-2 pl-0 text-center">
                        <span>
                          <a href="https://wa.me/<?=$whatsapp;?>" target="_blank" class="btn btn-outline-light btn-rounded get-started-btn">Clique para Suporte</a>
                        </span>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>

<div class="col-14 grid-margin stretch-card">
                <div class="card">
                  <div class="card-body">
                    <h4 class="card-title">Editar Usuário</h4>
                    <form class="forms-sample" method="post" action="actions/usuarios/editar.php">
                      <input type="hidden" class="form-control" name="id" value="<?=$id_user;?>">
                      <div class="form-group">
                        <label for="title">Nome</label>
                        <input type="text" class="form-control" name="nome" id="nome" value="<?=$nome_user;?>">
                      </div>
                      <div class="form-group">
                        <label for="url">Usuário</label>
                        <input type="text" class="form-control" name="usuario" id="usuario" value="<?=$usuario_user;?>">
                      </div>
                      <div class="form-group">
                        <label for="url">Senha</label>
                        <input type="text" class="form-control" name="senha" id="senha" value="<?=$senha_user;?>">
                      </div>
                      <div class="form-group">
                        <label for="url">Nível Atual: <b style="color: green;"><?php echo $nivel_user == 1 ? "Admin" : "Usuário";?></b></label>
                        <select name="nivel" class="form-control">
                          <option value="<?php echo $nivel_user; ?>">Selecione ou deixe branco</option>
                          <option value="1">Admin</option>
                          <option value="0">Usuário</option>
                        </select>
                      </div>
                      <button type="submit" name="submit" class="btn btn-primary mr-2">Editar</button>
                    </form>
                  </div>
                </div>
              </div>
          <!-- content-wrapper ends -->
<?php
include_once "footer.php";
?>
  </body>
</html>