Guest User

Untitled

a guest
Dec 13th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <?php
  2. include("header.php");
  3. include_once "Classe.php";
  4. ?>
  5.  
  6. <?php
  7. $Ano = $_POST["Ano"];
  8. $Estado = $_POST["Estado"];
  9. $N_arvores_cortadas = $_POST["N_arvores_cortadas"];
  10. $Volume = $_POST["Volume"];
  11.  
  12.  
  13.  
  14.  
  15. $con = new mysqli("localhost","root",null,"calculo");
  16.  
  17. $con->query("INSERT INTO cal
  18. (Ano,Estado,N_arvores_cortadas,Volume,arvore_repor,valor_pagar)
  19. VALUES ('$Ano','$Estado','$N_arvores_cortadas','$Volume','$arvore_repor','$valor_pagar')");
  20.  
  21. ?>
  22.  
  23. <div class="alert alert-primary" role="alert">
  24. Gravado com Sucesso!
  25. </div>
  26.  
  27.  
  28. <a href="CalculadoraReflorestamento.php">Cadastrar</a>
  29. <a align="left"><h3><font color='blue'>Valor R$ = 300</font></h3></a>
  30. <table class="table">
  31. <thead class="thead-dark">
  32. <tr>
  33. <th scope="col">Ano</th>
  34. <th scope="col">Estado</th>
  35. <th scope="col">Nº arvores cortadas</th>
  36. <th scope="col">Volume(m³)</th>
  37. <th scope="col">Árvores a
  38. Repor </th>
  39.  
  40. <th scope="col">Valor a ser
  41. pago </th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <?php
  46. $con = new mysqli("localhost","root",null,"calculo");
  47. $r = $con->query("SELECT Ano,Estado,N_arvores_cortadas,Volume,arvore_repor,valor_pagar FROM cal");
  48. while ($l = $r->fetch_assoc()) {
  49. echo "
  50. <tr>
  51. <th scope='row'><font color='white'><h3>$l[Ano]</h3></font></th>
  52. <td ><font color='white'><h3>$l[Estado]</h3></font></td>
  53. <td><font color='white'><h3>$l[N_arvores_cortadas]</h3></font></td>
  54. <td><font color='white'><h3>$l[Volume]</h3></font></td>
  55. <td><font color='white'><h3>$l[arvore_repor]</h3></font></td>
  56. <td><font color='white'><h3>$l[valor_pagar]</h3></font></td>
  57. </tr>
  58.  
  59. ";
  60. echo "$Estado";
  61. }
  62. ?>
Add Comment
Please, Sign In to add comment