Guest User

Untitled

a guest
Feb 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. if (!file_exists($pasta)){
  2. mkdir("$pasta", 0777);
  3. }
  4. $diretorio = "img/";
  5.  
  6. foreach ($registro as $Id => $estado) {
  7.  
  8. $url = $diretorio . $_FILES['Imagem']['name'][$Id];
  9.  
  10. $nome_arquivo = $_FILES['Imagem']['name'][$Id];
  11.  
  12. // salva as imagens na pasta
  13. move_uploaded_file($_FILES['Imagem']['tmp_name'][$Id], $url);
  14.  
  15. $pasta = "/var/www/html/wordpress/wp-content/themes/busiprof/img";
  16. if (!file_exists($pasta)){
  17. mkdir("$pasta", 0777);
  18. }
  19.  
  20. $diretorio = "/var/www/html/wordpress/wp-content/themes/busiprof/img/";
  21. foreach ($registro as $Id => $estado) {
  22.  
  23. $url = $diretorio . $_FILES['Imagem']['name'][$Id];
  24.  
  25. $nome_arquivo = $_FILES['Imagem']['name'][$Id];
  26.  
  27. // salva as imagens na pasta
  28. move_uploaded_file($_FILES['Imagem']['tmp_name'][$Id], $url);
  29.  
  30. $result_cursos = "SELECT
  31. Funcionario,
  32. Imagem
  33.  
  34. FROM centrodb.RegistoManutencao LEFT OUTER JOIN centrodb.InfoLuvas
  35.  
  36. ON centrodb.InfoLuvas.Id = centrodb.RegistoManutencao.Colaborador
  37.  
  38. WHERE Estado IS NULL OR Estado <> 'Concluído';";
  39. $resultado_cursos = mysqli_query($conn, $result_cursos);
  40.  
  41. $tabela1 .= '<div style="float: center" table align="center">';
  42.  
  43. $tabela1 .= '<table border="5">';
  44.  
  45. $tabela1 .= '<tr>';
  46.  
  47. $tabela1 .='<thead>';
  48.  
  49. $tabela1 .= '<tr>';
  50.  
  51. $tabela1 .= '<th>Colaborador</th>';
  52.  
  53. $tabela1 .= '<th>Imagem</th>';
  54.  
  55. $tabela1 .= '</tr>';
  56.  
  57. $tabela1 .='</thead>';
  58.  
  59. $tabela1 .='<tbody>';
  60.  
  61. while($rows_cursos = mysqli_fetch_array($resultado_cursos)) {
  62.  
  63. $tabela1 .= '<tr>';
  64.  
  65. $tabela1 .= '<td>'.$rows_cursos['Funcionario'].'</td>';
  66.  
  67. $tabela1 .= '<td><img src="/var/www/html/wordpress/wp-content/themes/busiprof/img/' .$rows_cursos['Imagem']. '" /></td>';
  68.  
  69. $tabela1 .= '</tr>';
  70. }}
  71. $tabela1 .= '</tr>';
  72.  
  73. $tabela1 .='</tbody>';
  74.  
  75. $tabela1 .= '</table>';
  76.  
  77. $tabela1 .= '</div>';
  78.  
  79. echo $tabela1;
Add Comment
Please, Sign In to add comment