Mini Shell

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

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

<? 


// pega email 


// final pega email 

$add = $_POST["add"];


  
 //  print_r($_POST);
switch($add) {
case"1":  

$senhanova = $_POST["senhanova"];
$novonome = $_POST["novonome"];
$novologin = $_POST["novologin"];
$novoemail = $_POST["novoemail"];
$novocelular = $_POST["novocelular"];

 
$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);
} 


if(empty($senhanova))
 {
$sql = "UPDATE tab_usuario SET login = '$novologin', nome = '$novonome' ,email='$novoemail',celular='$novocelular' WHERE id_usuario='$idUsuario' ";
 
 }
 else
 {

$senhanova = md5($senhanova);
$senhanova = base64_encode($senhanova);



 $sql = "UPDATE tab_usuario SET login = '$novologin', nome = '$novonome' ,senha='$senhanova',email='$novoemail',celular='$novocelular' WHERE id_usuario='$idUsuario'";
 
 }




  // echo"$sql";

if ($conn->query($sql) === TRUE) {
  print'<script type="text/javascript" language="">  alert("SALVO COM SUCESSO!"); </script>';
 
  echo"<script type='text/javascript'> 
 
	setTimeout(function() {window.history.back()}, 1000);

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

$conn->close();




exit();
 break;




}






 $sql = "select * from tab_usuario where id_usuario = '$idUsuario'";
$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']; 

}


?>


<form name="form1" action="cadastro.php" method="post" >
  <div align="center">
<label style = "margin-right:15px;" >Nova senha <font size ="1" >  ( deixe em branco para não mudar )</font> </br>
    <input type="password"  name="senhanova"   size="30" class = "form-control animated  bounceInleft " placeholder="SENHA NOVA" style="width:280px; margin-bottom:10px">
</label>

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


</br>

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



<label style = "margin-right:15px;" >
Seu Celular </br> ( importante para avisos e alertas )</br>
<input type="text" name="novocelular"  size="30" value = "<? echo $celular ;?>"  class = "form-control animated  bounceInleft " placeholder="SEU CELULAR" style="width:280px; margin-bottom:10px">
</label>
	  
	<input type="hidden" name="add" value="1">
 </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