submit.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="generator" content="GitLab Pages">
  6. <title>KATRIN remote analysis shift</title>
  7. <link rel="shortcut icon" href="https://ikp-neu-katrin.ikp.kit.edu/routine/pics/KATRINlogo.ico" />
  8. <link rel="stylesheet" href="style.css">
  9. </head>
  10. <body>
  11. <div class="navbar">
  12. <a style="background-color:#1761B2;text-decoration:none"><b>Quick links:</b></a>
  13. <a href="http://adei-katrin.kaas.kit.edu" target="_blank">Adei</a>
  14. <a href="http://katana.npl.washington.edu" target="_blank">katana</a>
  15. <a href="http://katana.npl.washington.edu/~sanshiro/brew/KNM6/" target="_blank">brew</a>
  16. <a href="https://webtrium.mpp.mpg.de" target="_blank">webtrium</a>
  17. </div>
  18. <center>
  19. <h1>Checklist for remote analysis shifts</h1>
  20. </center>
  21. <hr>
  22. <h2 style="text-align:right">Step 3/3</h2>
  23. <center>
  24. <h3>Summary:</h3>
  25. <br>
  26. <hr>
  27. <table id="table" style="max-width:600px;">
  28. <tr>
  29. <td style="text-align:left"><body onload="document.getElementById('result').innerHTML = localStorage.getItem('summary')">
  30. <text id="result"></text>
  31. </body></td>
  32. </tr>
  33. </table>
  34. <br>
  35. <hr>
  36. <br>
  37. <button type="submit" onclick="cancel()" id="Cancel">Cancel</button>
  38. <button type="submit" onclick="submit()" id="Submit">Submit report</button>
  39. <br><br><br><br>
  40. <script type="text/javascript">
  41. function cancel() {
  42. window.location.href="index.php";
  43. }
  44. function submit() {
  45. <?php
  46. $file = "recentSQLName.txt";
  47. $f = fopen($file, 'r');
  48. $tableName = fgets($f);
  49. fclose($f);
  50. $db= new SQLite3("data/mydb.sqlite");
  51. $Run_Range = $_GET["Run_Range"];
  52. $Mode = $_GET["Mode"];
  53. $Submitted = $_GET["Submitted"];
  54. $Author = $_GET["Author"];
  55. $HV_K65 = $_GET["HV_K65"];
  56. $HV_TankPotential = $_GET["HV_TankPotential"];
  57. $BIXS = $_GET["BIXS"];
  58. $LARA = $_GET["LARA"];
  59. $LARA_Crosscheck = $_GET["LARA_crosscheck"];
  60. $FBM = $_GET["FBM"];
  61. $RW = $_GET["RW"];
  62. $Run_Length = $_GET["Run_Length"];
  63. $Data_Size = $_GET["Data_Size"];
  64. $FPD_Energy = $_GET["FPD_Energy"];
  65. $Grid_sync = $_GET["Grid_sync"];
  66. $Rate_300 = $_GET["Rate_300"];
  67. $Rate_90 = $_GET["Rate_90"];
  68. $Tritium_Purity = $_GET["Tritium_Purity"];
  69. $Summary = $_GET["Summary"];
  70. #$db->exec("CREATE TABLE IF NOT EXISTS $tableName(id INTEGER PRIMARY KEY NOT NULL, Run_Range Text, Mode Text, Submitted Text, Author Text, HV_K65 Text, HV_TankPotential Text, BIXS Text, LARA Text, LARA_crosscheck Text, FBM Text, RW Text, Run_Length Text, Data_Size Text, FPD_Energy Text, Grid_sync Text, Rate_300 Text, Rate_90 Text, Tritium_Purity Text, Summary Text )");
  71. //#$string_to_insert=$db->escapeString($author);
  72. $db->exec("INSERT INTO $tableName (Run_Range, Mode, Submitted, Author, HV_K65, HV_TankPotential, BIXS, LARA, LARA_crosscheck, FBM, RW, Run_Length, Data_Size, FPD_Energy, Grid_sync, Rate_300, Rate_90, Tritium_Purity, Summary) VALUES ('$Run_Range', '$Mode', '$Submitted', '$Author', '$HV_K65', '$HV_TankPotential', '$BIXS', '$LARA', '$LARA_Crosscheck', '$FBM', '$RW', '$Run_Length', '$Data_Size', '$FPD_Energy', '$Grid_sync', '$Rate_300', '$Rate_90', '$Tritium_Purity', '$Summary')");
  73. ?>
  74. localStorage.clear()
  75. window.location.href="index.php";
  76. }
  77. </script>
  78. </center>
  79. </body>
  80. </html>