Mini Shell

Direktori : /home/sicomercio/public_html/adm/
Upload File :
Current File : /home/sicomercio/public_html/adm/editarusuarios.php

<?php 
include"menu.php";
?>

<? 


 

 

 if($_POST){

$novonome = $_POST["novonome"];
$novologin = $_POST["novologin"];
$novoemail = $_POST["novoemail"];
$novocelular = $_POST["novocelular"];
$cidade = $_POST["cidade"];
 
 $idd = $_POST["idd"];
 
$novonome = utf8_decode($novonome);

  //print_r($_POST);
  


include"conexao.php";
// Create connection
$conn = new mysqli($host, $user, $pass, $db);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

 $idd = base64_decode($idd); 
$sql = "UPDATE tab_usuario SET cidade = '$cidade', login = '$novologin', nome = '$novonome' ,email='$novoemail',celular='$novocelular' WHERE id_usuario='$idd' ";
 
 
if ($conn->query($sql) === TRUE) {
  print'<script type="text/javascript" language="">  alert("SALVO COM SUCESSO!"); </script>';
 
  echo"<script type='text/javascript'> 
  window.open('usuarios','_parent');

   </script>";
  	// setTimeout(function() {window.history.back()}, 1000);

	 
} else {
      echo "Error updating record: " . $conn->error;
	  print'<script type="text/javascript" language="">  alert("OCORREU UM ERRO!"); </script>';
}

$conn->close();




exit();
}









$id = $_GET["id"]; 
$id = base64_decode($id);
 
$sql = "select * from tab_usuario where id_usuario = '$id'";
$res = mysqli_query($con, $sql);
$total = mysqli_num_rows($res);

while ($f = mysqli_fetch_array($res))
{
$nomee = $f['nome'];
$loginn = $f['login'];
$emaill = $f['email']; 
$celular = $f['celular']; 
$cidade = $f['cidade']; 
 $nomee = utf8_encode($nomee); 

}

$id = base64_encode($id);

?>


<form name="form1" action="editarusuarios.php" method="post" >
  <div align="center">


<label style = "margin-right:15px;" >
Nome completo</br>
<input type="text" name="novonome" required size="30" value = "<? echo $nomee ;?>" class = "form-control animated  bounceInleft " placeholder=" NOME COMPLETO" style="width:280px; margin-bottom:10px">
</label>
	  
<label style = "margin-right:15px;" >
Apelido ( login de acesso)</br>
<input type="text" name="novologin" required size="30" value = "<? echo $loginn ;?>"  class = "form-control animated  bounceInleft " placeholder=" LOGIN DE ACESSO" style="width:280px; margin-bottom:10px">
</label>


</br>

<label style = "margin-right:15px;" >
E-mail </br> 
 <input type="email" name="novoemail"  size="30" value = "<? echo $emaill ;?>"  class = "form-control animated  bounceInleft " placeholder=" EMAIL" style="width:280px; margin-bottom:10px">
</label>



<label style = "margin-right:15px;" >
Celular </br>  
<input type="text" name="novocelular"  size="30" value = "<? echo $celular ;?>"  class = "form-control animated  bounceInleft " placeholder=" CELULAR" style="width:280px; margin-bottom:10px">
</label>
	  

<label style = "margin-right:15px;" >
Cidade </br> 
<? 

echo"<input list=\"browsers\" placeholder=\"Cidade\"  value = \"$cidade\"  class=\"form-control\" name=\"cidade\" style=\"width:100% ;width:210px; margin-bottom:10px; height :30px;\">
<datalist id=\"browsers\">
";
 
$sql = "SELECT * FROM cidades where cidade <> '$cidade' ";
$res = mysqli_query($con, $sql);
$total = mysqli_num_rows($res);
 
while ($f = mysqli_fetch_array($res))
{
$cidadee = $f["cidade"];

echo"<option value=\"$cidadee\">";
}
// fecha a conexão
mysqli_close($con);
print'</datalist>';
?>
</label>



	<input type="hidden" name="idd" value="<? echo $id;?>">
	
 </br></br>
     <input type="submit" name="buttom" class = "btn btn-success animated  bounceInright "  value="SALVAR" style="width:180px; margin-bottom:10px">
                 </div>
</form>
<p align="center">&nbsp;</p>
<p align="center"></p>
<?
 include"rodape.php";
?>

Zerion Mini Shell 1.0