Guest User

Untitled

a guest
Feb 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. <?php
  2. $tabela1 .= '<td> <input type="file" name= "Imagem['.$rows_cursos['Id'].']" value="'.$rows_cursos['Imagem'].'"></td>';
  3.  
  4. $tabela1 .= '<td> <input type="text" name= "Tratamento['.$rows_cursos['Id'].']" value="'.$rows_cursos['Tratamento'].'"></td>';
  5.  
  6. $tabela1 .= '<td> <input type="radio" name= "Id['.$rows_cursos['Id'].']" value="Pendente"> Pendente <input type="radio" name= "Id['.$rows_cursos['Id'].']" value="Concluido">Concluido</td>';
  7. ?>
  8.  
  9. <?php
  10. if(isset($_POST['registar']))
  11. {
  12. $servername = "xxx.xxx.x.xx";
  13. $username = "xxxxx";
  14. $password = "xxxxxxx";
  15. $dbname = "xxxxxxxx";
  16.  
  17. $conn = new mysqli($servername, $username, $password, $dbname);
  18. $conn->set_charset('utf8');
  19.  
  20. $registro = $_POST['Id'];
  21. $imagem = $_POST['Imagem'];
  22. $tratamento = $_POST['Tratamento'];
  23.  
  24.  
  25. foreach($registro as $Id => $estado) {
  26.  
  27.  
  28. $conn->query("UPDATE RegistoManutencao SET Estado='$registro[$Id]', Imagem = '$imagem[$Id]', Tratamento = '$tratamento[$Id]' WHERE Id='".$Id."'");
  29. }
  30.  
  31.  
  32. }
  33. ?>
  34.  
  35. <?php
  36. $result_cursos = "SELECT centrodb.RegistoManutencao.Imagem FROM centrodb.RegistoManutencao";
  37.  
  38. $resultado_cursos = mysqli_query($conn, $result_cursos);
  39.  
  40. $tabela1 .= '<div style="float: center" table align="center">';
  41.  
  42. $tabela1 .= '<table border="5">';
  43.  
  44. $tabela1 .= '<tr>';
  45.  
  46. $tabela1 .='<thead>';
  47.  
  48. $tabela1 .= '<tr>';
  49.  
  50. $tabela1 .= '<th>Imagem</th>';
  51.  
  52. $tabela1 .= '</tr>';
  53.  
  54. $tabela1 .='</thead>';
  55.  
  56. $tabela1 .='<tbody>';
  57.  
  58. while($rows_cursos = mysqli_fetch_array($resultado_cursos)) {
  59.  
  60. $tabela1 .= '<tr>';
  61.  
  62. $tabela1 .= '<td><img src="' .$rows_cursos['Imagem']. '" /></td>';
  63.  
  64. $tabela1 .= '</tr>';
  65. }
  66. $tabela1 .= '</tr>';
  67.  
  68. $tabela1 .='</tbody>';
  69.  
  70. $tabela1 .= '</table>';
  71.  
  72. $tabela1 .= '</div>';
  73.  
  74. echo $tabela1;
  75.  
  76. ?>
  77.  
  78. $tabela1 .= '<td><img src="' .$rows_cursos['Imagem']. '" /></td>';
  79.  
  80. $tabela1 .= '<td><img src="/imagens/'.$rows_cursos['Imagem']. '" /></td>';
  81.  
  82. $tabela1 .= '<td> <input type="text" name= "Imagem['.$rows_cursos['Id'].']" id= "Imagem"></td>';
  83.  
  84. /images/imagem01.jpg
  85. /fotos/familia/titia.png
Add Comment
Please, Sign In to add comment