production.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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>Production is stated.</p>
  11. <div id="cont"></div>
  12. <p>Report the problems occured during production process: </p>
  13. <form method="GET" action="../services/return_cpee.php">
  14. <input type="text" name="id" id="cbid" required>
  15. <input type="text" name="workerID" id="workerID" required>
  16. <input type="submit" name="act" value="Report Problems" onclick="reloaded(rolle);">
  17. <input type="submit" name="act" value="Next" onclick="reloaded(rolle);">
  18. </form>
  19. <script type="text/javascript" src="form.js"></script>
  20. <script>
  21. var inhalt = "";
  22. $.ajax({
  23. url: '../callbacks/'+cbid+'.txt',
  24. async: false,
  25. success: function (data){
  26. inhalt = data;
  27. }
  28. });
  29. inhalt = JSON.parse(inhalt);
  30. var params = inhalt[1];
  31. var rolle = inhalt[1]['rolle'];
  32. var mytable = "<table cellpadding=\"0\" cellspacing=\"0\">";
  33. mytable += "<thead><tr><th>Parameter</th><th>Value</th></tr></thead><tbody><tr>";
  34. Object.keys(params).forEach(val => {
  35. if (val != "form" && val != "rolle"){
  36. mytable += "<td>" + val + "</td>";
  37. mytable += "<td>" + params[val] + "</td></tr><tr>";}
  38. });
  39. mytable += "</tr></tbody></table>";
  40. var elem = document.getElementById("cont");
  41. elem.insertAdjacentHTML( 'beforeend', mytable );
  42. </script>
  43. </html>