<?php
session_start();
if(strpos(strtolower($_SERVER['REQUEST_URI']), 'phpsessid') !== false)
{
  session_destroy();
  session_regenerate_id();
  session_start();
                              
}
include "../phpconfig/config.php";
include "../phpconfig/valida_login.php";
include "../includes/topo.php"; 

$id = $_GET['id'];


$sql = mysql_query("SELECT * FROM usuarios WHERE id='$id'");

$lin = mysql_fetch_assoc($sql);

?>


        <ul class="breadcrumb">
          <li><a href="<?php echo sti('adm');  ?>">Home</a></li>
          <li>Editar usuário</li>
          <li class="active"><?php echo $lin['nome']; ?> <?php echo $lin['sobrenome']; ?></li>
        </ul>

 <form class="form-horizontal" method="post" action="edita.php"  enctype="multipart/form-data">
        <fieldset>


          <div class="control-group">
            <label class="control-label" for="input01">Nome</label>
            <div class="controls">
              <input type="hidden" name='id'  value='<?php echo $lin['id']; ?>'>
              <input type="text" class="input-xlarge" name='nome' value='<?php echo $lin['nome']; ?>'>
            </div>
          </div>

             <div class="control-group">
            <label class="control-label" for="input01">Sobrenome</label>
            <div class="controls">
              <input type="text" class="input-xlarge" name='sobrenome' value='<?php echo $lin['sobrenome']; ?>'>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label" for="input01">login</label>
            <div class="controls">
              <input type="text" class="input-xlarge" readonly name='login' value='<?php echo $lin['username']; ?>'>
            </div>
          </div>             
          <div class="control-group">
            <label class="control-label" for="input01">Senha</label>
            <div class="controls">
              <input type="text" class="input-xlarge" name='senha1' value=''>
            </div>
          </div>

          <div class="control-group">
            <label class="control-label" for="input01">Confirmar senha</label>
            <div class="controls">
              <input type="text" class="input-xlarge" name='senha2' value=''>
            </div>
          </div>

          <div class="control-group">
            <label class="control-label" for="input01">Email</label>
            <div class="controls">
              <input type="text" class="input-xlarge" name='email' value='<?php echo $lin['email']; ?>'>
            </div>
          </div>
 

          <div class="form-actions">
            <button type="submit" class="btn btn-primary">Salvar</button>
            <a class="btn btn-warning pull-right" href="index.php">Voltar</a>
          </div>
        </fieldset>
      </form>




<?php include "../includes/rodape.php"; ?>
