Advertisement
hmrneves

Untitled

Feb 28th, 2015
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.31 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>x</title>
  6. <!--icon da netflow no brower-->
  7. <link rel="icon" href="/imgs/netflow_favicon.ico" type="image/x-icon">
  8. <link rel="shortcut icon" href="/imgs/netflow_favicon.ico" type="image/x-icon">
  9. <!--código com os estilos da página-->
  10. <link rel="stylesheet" type="text/css" href="css_code.css">
  11. <?php include("get_ra.php"); ?>
  12. </head>
  13.  
  14. <body>
  15.  
  16.     <link href="../css_code.css" rel="stylesheet" type="text/css" />
  17.     <a href="../index.php"/><input name="home" type="button" value="home" class="button" /></a>
  18.     <p>
  19.    
  20.     <?php
  21.         $servername = "localhost";
  22.         $username = "root";
  23.         $password = "x";
  24.         $dbname = "gestao_trabalhos";
  25.         $i = 0;
  26.        
  27.         // Create connection
  28.         $conn = mysqli_connect($servername, $username, $password, $dbname);
  29.         mysqli_set_charset($conn, "utf8"); // mysqli extension
  30.        
  31.         // Check connection
  32.         if (!$conn) {
  33.             die("A TENTATIVA DE CONEXÃO FALHADA: " . mysqli_connect_error());
  34.         }
  35.        
  36.         $sql = "SELECT * FROM `trabalhos`";
  37.         $result = $conn->query($sql);
  38.                
  39.         if ($result->num_rows > 0) {
  40.              echo "<table border='1'><tr><th>ID</th><th>Cliente</th><th>Tipo</th><th>Data Pedido</th><th>Numero do Pedido</th><th>Site</th><th>Localização</th><th>Duração</th><th>Técnico</th><th>R/A</th></tr>";
  41.              $ra_count = 1;
  42.              // output data of each row
  43.              while($row = $result->fetch_assoc()) {
  44.                  //call the method to retrieve path and create link - it works - see img that I provided
  45.                  $y = get_ra($ra_count);
  46.                  echo "<tr><td>" . $row["id"]. "</td><td>" . $row["cliente"]. "</td><td>" . $row["tipo_trab"]. "</td><td>" . $row["data_pedido"]. "</td><td>" . $row["nro_pedido"]. "</td><td>" . $row["site"]. "</td><td>" . $row["localizacao"]. "</td><td>" . $row["duracao"]. "</td><td>" . $row["tecnico"]. "</td><td>". $row[$y] ."</td></tr>";
  47.                  $i++;
  48.                  $ra_count++;
  49.              }
  50.              echo "</table>";
  51.         } else {
  52.              echo "0 entradas";
  53.         }
  54.        
  55.         echo "<p>";
  56.         echo "<b>$i trabalhos listados</b>";
  57.        
  58.         $conn->close();
  59.     ?>
  60.  
  61.     <p>
  62.     <a href="../index.php"/><input name="home" type="button" value="home" class="button" /></a>
  63.  
  64. </body>
  65. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement