start_production.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <html>
  2. <head>
  3. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  4. </head>
  5. <style>
  6. table, th, td {
  7. border: 1px solid black;
  8. border-collapse: collapse;
  9. }</style>
  10. <p>Parameters</p>
  11. <form method="GET" action="../services/return_cpee.php">
  12. <input type="text" name="id" id="cbid" required>
  13. <input type="text" name="workerID" id="workerID" required>
  14. <input type="submit" value="Start Production" onclick="reloaded(rolle);">
  15. </form>
  16. <div id="cont"></div>
  17. <script type="text/javascript" src="form.js"></script>
  18. <script>
  19. var inhalt = "";
  20. $.ajax({
  21. url: '../callbacks/'+cbid+'.txt',
  22. async: false,
  23. success: function (data){
  24. inhalt = data;
  25. }
  26. });
  27. inhalt = JSON.parse(inhalt);
  28. var params = inhalt[1];
  29. var rolle = inhalt[1]['rolle'];
  30. var mytable = "<table cellpadding=\"0\" cellspacing=\"0\">";
  31. mytable += "<thead><tr><th>Parameter</th><th>Value</th></tr></thead><tbody><tr>";
  32. Object.keys(params).forEach(val => {
  33. if (val != "form" && val != "rolle"){
  34. mytable += "<td>" + val + "</td>";
  35. mytable += "<td>" + params[val] + "</td></tr><tr>";}
  36. });
  37. mytable += "</tr></tbody></table>";
  38. var elem = document.getElementById("cont");
  39. elem.insertAdjacentHTML( 'beforeend', mytable );
  40. </script>
  41. </html>