Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $conn=mysqli_connect ("localhost","root","","xerox");
- if(isset($_POST['email']) && isset($_POST['senha'])){
- $email = $_POST['email'];
- $senha = $_POST['senha'];
- $get = mysqli_query ($conn, "SELECT * FROM usuarios WHERE email = '$email' AND senha = '$senha'");
- $num = mysqli_num_rows($get);
- if($num == 1){
- while ($percorer = mysqli_fetch_array($get)){
- $adm = $percorer['funcao'];
- $nome = $percorer['nome'];
- session_start();
- $id_usuario = mysqli_query ($conn, "SELECT nome FROM usuarios");
- $_SESSION['nome'] = $id_usuario;
- $SESSION['logado'] = true;
- if ($adm == 0) {
- $_SESSION['coor']= $nome;
- header ("Location: dentro.php");
- }
- if ($adm == 1) {
- $_SESSION['prof']= $nome;
- header ("Location: dentro.php");
- }
- if ($adm == 2) {
- $_SESSION['rep']= $nome;
- header ("Location: dentro.php");
- }
- }
- } else {
- echo 'O email ou senha digitados estão INCORRETOS.';
- }
- }
- ?>
- <?php
- session_start();
- //include("check.php");
- $id_usuario = $_SESSION['nome'];
- $_SESSION['nome'] = $id_usuario;
- $_SESSION['logado'] = TRUE;
- ?>
- <?php
- $assunto=$_POST['assunto'];
- $tipo=$_POST['tipo'];
- $quant=$_POST['quant'];
- $dataentrega=$_POST['dataentrega'];
- $anexo=$_POST['anexo'];
- $servidor='localhost';
- $banco='xerox';
- $usuario='root';
- q$senha='';
- $conexao = mysqli_connect($servidor,$usuario,$senha);
- mysqli_select_db($conexao, $banco);
- $sql= mysqli_query($conexao,"INSERT INTO requisicao (id_usuario, tipo, quant, anexo, assunto, dataentrega, status, impresso) VALUES ('$id_usuario', '$tipo', '$quant', '$anexo', '$assunto', '$dataentrega', 'pendente', 'não')");
- echo ("Requisicao enviada com sucesso!")
- ?>
- <br/><br/>
- <table border="1">
- <tr>
- <th>Número</th>
- <th>Requerente</th>
- <th>Data do Requerimento</th>
- <th>Tipo</th>
- <th>Quantidade</th>
- <th>Anexo</th>
- <th>Assunto</th>
- <th>Data de Entrega</th>
- <th>Status</th>
- </th>
- </tr>
- <tr>
- <td>
- <?php
- echo $_POST["id"];
- ?>
- </td>
- <td>
- <?php
- echo $_POST["$id_usuario"];
- ?>
- </td>
- <td>
- <?php
- echo $_POST["data_req"];
- ?>
- </td>
- <td>
- <?php
- echo $_POST["tipo"];
- ?>
- </td>
- <td>
- <?php
- echo $_POST["quant"];
- ?>
- </td>
- <td>
- <?php
- echo $_POST["anexo"];
- ?>
- </td>
- <td>
- <?php
- echo $_POST["assunto"];
- ?>
- </td>
- <td>
- <?php
- echo $_POST["dataentrega"];
- ?>
- </td>
- <td>
- <?php
- echo $_POST["status"];
- ?>
- </td>
- </tr>
- </body>
- </html>
Add Comment
Please, Sign In to add comment