Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. echo "<form id='assign' method ='post' action='../../assign_engineer_post_code.php'>";
  2. echo "<input type='checkbox' checked name='select-all' id='select_all' />Select All<br/><br/>";
  3. echo "<p style='font-size: 10px; '>";
  4. while($row = mysqli_fetch_assoc($res)){
  5. echo "<input type='checkbox' class='checkbox' name='engineers[]' value='".$row['Engineer_id']."' checked><label for='" .$row['Engineer'] ."'>" .$row['Engineer'] ."</label>";
  6.  
  7. echo "&nbsp;&nbsp;&nbsp;";
  8. $counter++;
  9. if ($counter == 8){
  10. //echo "<br/>";
  11. }
  12. }
  13. echo "</p>";
  14. ?>
  15. <table><tr>
  16. <td>
  17. <button type="button" onclick="clear_sap_data()">Clear Data</button>
  18. </td>
  19. <td>
  20. <button type="button" onclick="import_sap_data()">Import SAP Data</button>
  21. </td>
  22. <td>
  23. <!-- <input name="confirm" type="button" value="Assign Engineers" onclick="doit();" />
  24. <input id="submit" type="submit" name="submit" value="Submit" onclick="submitForm()" /> -->
  25. <input id="submit" type="submit" name="submit" value="Submit" onclick="submitForm()" />
  26. </td>
  27.  
  28. </tr>
  29. </table>
  30. </form>
  31.  
  32. <script>
  33. function submitForm() {
  34. var form = document.assign;
  35.  
  36. var dataString = $(form).serialize();
  37.  
  38.  
  39. $.ajax({
  40. contentType: false,
  41. processData: false
  42. type:'POST',
  43. url:'../../assign_engineer_post_code.php',
  44. data: dataString,
  45. success: function(data){
  46. window.location.reload(); // This is not jQuery but simple plain ol' JS
  47.  
  48. }
  49. });
  50. return false;
  51. }
  52. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement