Advertisement
brunofagis

Untitled

Feb 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. $x = $_POST['job'];
  2.  
  3. $i = 0;
  4.  
  5. foreach($x as &$key){
  6.  
  7. $job = $_POST['job'][$i];
  8. $hora = $_POST['hora'][$i];
  9.  
  10. if(!empty($job)) {
  11.  
  12. $z = 0;
  13.  
  14. foreach($job as &$tab) {
  15.  
  16. $meujob = $tab[$z];
  17.  
  18. $sql = mysqli_query($con, "select * from tabela_horarios where id_horario = '$hora'");
  19. $vetor = mysqli_fetch_array($sql);
  20.  
  21. $datetime = date($data.' '.$vetor['horainicio']);
  22. $datetime1 = date($data.' '.$vetor['horafim']);
  23.  
  24. $sql_grava = mysqli_query($con, "insert into tabela_horario_usuario (id_usuario, id_job, id_dia, id_horario, dia, start, end) VALUES ('$responsavel', '$meujob', '$id_dia', '$hora', '$data', '$datetime', '$datetime1')");
  25.  
  26. $sql_atualiza = mysqli_query($con, "update marketing SET producao = '2' where id_marketing = '$meujob'");
  27.  
  28. $z++;
  29.  
  30. }
  31.  
  32. }
  33.  
  34. $i++;
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement