Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>x</title>
- <!--icon da netflow no brower-->
- <link rel="icon" href="/imgs/netflow_favicon.ico" type="image/x-icon">
- <link rel="shortcut icon" href="/imgs/netflow_favicon.ico" type="image/x-icon">
- <!--código com os estilos da página-->
- <link rel="stylesheet" type="text/css" href="css_code.css">
- <?php include("get_ra.php"); ?>
- </head>
- <body>
- <link href="../css_code.css" rel="stylesheet" type="text/css" />
- <a href="../index.php"/><input name="home" type="button" value="home" class="button" /></a>
- <p>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "x";
- $dbname = "gestao_trabalhos";
- $i = 0;
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- mysqli_set_charset($conn, "utf8"); // mysqli extension
- // Check connection
- if (!$conn) {
- die("A TENTATIVA DE CONEXÃO FALHADA: " . mysqli_connect_error());
- }
- $sql = "SELECT * FROM `trabalhos`";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- 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>";
- $ra_count = 1;
- // output data of each row
- while($row = $result->fetch_assoc()) {
- //call the method to retrieve path and create link - it works - see img that I provided
- $y = get_ra($ra_count);
- 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>";
- $i++;
- $ra_count++;
- }
- echo "</table>";
- } else {
- echo "0 entradas";
- }
- echo "<p>";
- echo "<b>$i trabalhos listados</b>";
- $conn->close();
- ?>
- <p>
- <a href="../index.php"/><input name="home" type="button" value="home" class="button" /></a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement