Mini Shell

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

<?
	include"menu.php";


 
 

?>
<center>

</br>
<h3>Usuários </h3>

<form name="form1" action="addusuario.php" method="GET" >
 
<button type="submit" class="btn btn-success" value="" style='width:190px;'>
INCLUIR
<i class='fa fa-plus' style='font-size:18px'></i>
</button>
</form>

</center>
</BR>
</BR>
</BR>

<? /*
 echo"<center>
 <form name=\"form1\" action=\"usuarios.php\" method=\"GET\" >
<input type='hidden' name='pesq' value='sim'>


<label style = \"margin-right:15px;\" >
 
<input type=\"text\" name=\"usuario\"  size=\"30\"  class = \"form-control animated  bounceInleft\"placeholder=\"nome ou login\" style=\"width:180px; margin-bottom:10px\">
</label>";

echo"
<label>
<button type=\"submit\" class=\"btn btn-primary\" value=\"\" style='width:100px;'>
<i class='fa fa-search' style='font-size:18px'></i> 
FILTRAR
</button>
</label>


</form>
</center>
";
*/
?>

<div class="container">
<table class="table table-action">
  <thead> 
  <tr> 

    <th class="t-medium"><h5><b>Nome</b></h5></th>
	 <th class="t-small"><h5><b>Login</b></h5></th>
 
	<th class="t-medium"><b></b> </th>
 
  </tr>
  </thead> <tbody>  


  <?php

$pesq = $_GET["pesq"];
$usuario = $_GET["usuario"];


 // $empresa = utf8_decode($empresa); 
  
  
  // PEGA EMPRESA 
 include"conexao.php";  
  
  
  
 
// conexão e seleção do banco de dados
$con = mysqlI_connect($host, $user, $pass, $db);

// executa a consulta
$pesq = '1';

 if(empty($pesq))
 {
 }
 else
	 
	 {
		  $nomee = "and permissao = '2' ";
	 }
	 
	 
 if(empty($usuario))
 {
	 
 }
 else
	 
	 {
		
	 }
	 
	 
 
$sql = "SELECT * FROM tab_usuario  where permissao = '2' and id_usuario <> '0' order by nome ASC ";
$res = mysqli_query($con, $sql);
$total = mysqli_num_rows($res);
 echo"<center> <b> Listando $total usuários</b></center></br>";

 
 
// loop pelos registros
while ($f = mysqli_fetch_array($res))
{
$nome = $f['nome'];
	$nome = utf8_encode($nome); 
$id_usuario = $f['id_usuario'];
$id_situacao = $f['id_situacao'];
$permissao = $f["permissao"];
$login = $f["login"];

$email = $f["email"];
$celular = $f["celular"];
 

// 1 Ativo
// 2 Bloqueado
// 3 Inativo

switch ($id_situacao)
{
case "1":
  $font = "<font color=\"green\" size=\"2\" face=\"Arial, Helvetica, sans-serif\">";
  $status = "ATIVO";
break;


case "2":
  $font = "<font color=\"#ff9999\" size=\"2\" face=\"Arial, Helvetica, sans-serif\">";
  $status = "BLOQUEADO";
break;


case "3":
  $font = "<font color=\"red\" size=\"2\" face=\"Arial, Helvetica, sans-serif\">";
  $status = "INATIVO";
break;


 
}


echo"<tr>";

 $idd = base64_encode($id_usuario);

echo"<td>$font $nome </td>";
echo"<td>$font $login </td>";
//echo"<td>"; include"retempresaa.php"; 
/*
echo"

<form name=\"form1\" action=\"empresas.php\" method=\"GET\" >
<input type='hidden' name='id' value='$idd'>
<button type=\"submit\" class=\"btn btn-primary\" value=\"\" style='width:100px;'>

<i class='fa fa-building' style='font-size:18px'></i>
Empresas
</button>
</form>



</td>";
*/
// GERA SENHA 
// OPÇÃO DE GERAR NOVA SENHA E ENVIAR POR EMAIL / WHATSAPP USANDO WHATSAPP DO RIO BRASIL . 




 
 echo"<td><label>
<form name=\"form1\" action=\"editarusuarios.php\" method=\"GET\" >
<input type='hidden' name='id' value='$idd'>
<button type=\"submit\" class=\"btn btn-success\" value=\"\" style='width:90px;'>
<i class='fa fa-edit' style='font-size:18px'></i> 
Editar

</button>
</form>
</label>





			    <script type=\"text/javascript\">
        function pergunta$id_usuario(){ 
   return confirm('Tem certeza que quer excluir $nome?');
}
    </script>
<label>
<form name=\"form1\" action=\"excluirusuarios.php\" method=\"POST\" >
<input type='hidden' name='id' value='$idd'>
<button type=\"submit\" class=\"btn btn-danger\" value=\"\" style='width:90px;' onclick='return pergunta$id_usuario();'>
<i class='fa fa-trash-o' style='font-size:18px'></i> 
Excluir

</button>
</form>
</label>
</td>





";


}





 
 


 

    echo"</tr>";





 
// fecha a conexão
// mysqli_close($con);



?> </tbody> 
</table>
<!-- END TABLE -->
<p>&nbsp; </p>
<p><br>
  <br>
  
  
  
  <br>
  </p>
<br>

</div>

Zerion Mini Shell 1.0