Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_POST['acao'])){
  4.  
  5. define('PASTA','U:COMUM - DEPARTAMENTOSEngenhariaCOMUMDesenhos');
  6.  
  7. $codigo = strtoupper($_POST['codigo']);
  8. $nome = strtoupper($_POST['nome']);
  9. $pasta = $_POST['pasta'];
  10.  
  11. $img = $_FILES['arquivo']['name'];
  12. $desenho = $_FILES['arquivo'];
  13.  
  14. if($codigo == '' || $nome == '' || $pasta == '' || $img == ''){
  15. Painel::alert("erro", "Campos vazios não são permitidos");
  16.  
  17. }else{
  18. $usuario = new Usuario();
  19. if (move_uploaded_file($_FILES['arquivo']['tmp_name'],PASTA. $pasta .'/'. $img)){
  20.  
  21. // Painel::uploadFile($img);
  22.  
  23. $usuario->cadastrarDesenho($codigo,$nome,$img,$pasta);
  24.  
  25. Painel::alert('sucesso', 'O desenho foi adicionado com sucesso!');
  26.  
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement