index.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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://iap-neu-katrin.iap.kit.edu/routine/pics/KATRINlogo.ico" />
  8. <link rel="stylesheet" href="style.css">
  9. </head>
  10. <body>
  11. <iframe src="navbar.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>
  12. <br>
  13. <center>
  14. <h1>Checklist for remote analysis shifts (2023-09-07-B01)</h1>
  15. <p style="color:#eb4670"> If you have questions, problems, or findings regarding the remote analysis shift, write into the <a href="https://iap-katrin-chat.iap.kit.edu/channel/remote.monitoring" target="_blank">#remote.monitoring</a> group on RocketChat</p>
  16. <p> To summarise the week for the general KATRIN call you can find a presentation template <a href="https://docs.google.com/presentation/d/1Fj3TjNkry1fAC94sEvml2LyvrICDhh_e7i75_7pimqk/template/preview" target="_blank">here</a></p>
  17. </center>
  18. <hr>
  19. <h2 style="text-align:right">Step 1/3</h2>
  20. <center>
  21. <h3>Please enter your name:</h3>
  22. <table id="table" align="center">
  23. <tr>
  24. <th>Author name:</th>
  25. <th><input type="text" placeholder ="Author" id="author"></th>
  26. </tr>
  27. <tr>
  28. <th>Measurement type:</th>
  29. <th><select name="Measurement type" id="measurement">
  30. <option value="Tritium">Tritium</option>
  31. <option value="Krypton">Krypton</option>
  32. <option value="Other">Other</option>
  33. </select></th>
  34. </tr>
  35. </table>
  36. <br><br>
  37. <button type="submit" onclick="submitName()" id="Next">Next</button>
  38. <script type="text/javascript">
  39. function submitName() {
  40. var author = document.getElementById('author');
  41. if(author.value == ""){
  42. alert("Please provide a name.")
  43. }
  44. else {
  45. localStorage.setItem('author', author.value);
  46. localStorage.setItem('measurement', measurement.value);
  47. window.location.href="checklist.php";
  48. }
  49. }
  50. </script>
  51. <br><br>
  52. <hr>
  53. <br><br>
  54. <style type="text/css">
  55. table th#normal {font-weight:normal}
  56. table th#red {font-weight:normal; background-color:#ffbdce;}
  57. table th#green {font-weight:normal; background-color:#bdffce;}
  58. </style>
  59. <?php
  60. $Campaigns = ["KNM10", "KNM9", "KNM8", "KNM7", "KNM6"];
  61. for ($index=0; $index < count($Campaigns); $index++)
  62. {
  63. // $file = "recentSQLName.txt";
  64. // $f = fopen($file, 'r');
  65. // $tableName = fgets($f);
  66. // fclose($f);
  67. $tableName = $Campaigns[$index];
  68. echo "<h1>Checklist history - $tableName</h1>";
  69. $db= new SQLite3("data/mydb.sqlite");
  70. $db->exec("CREATE TABLE IF NOT EXISTS $tableName(id INTEGER PRIMARY KEY NOT NULL, Run_Range Text, Mode Text, Submitted Text, Author Text, webtrium text, HV_K65 Text, HV_tank_potential Text, U_MTD_discrepancy Text, Missing_K35 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. $sql_select="SELECT * FROM $tableName ORDER BY ID DESC";
  72. $result=$db->query($sql_select);
  73. echo "<table width='100%'>";
  74. echo "<tr>";
  75. $numColumns=$result->numColumns();
  76. for ($i = 1; $i < $numColumns; $i++)
  77. {
  78. $colname=$result->columnName($i);
  79. $colname = str_replace('_', ' ', $colname);
  80. if ($tableName.length < 5 || $i != 11) // column 11 = LARA, which is skipped since KNM10 (length 5, KNM9 and before length 4)
  81. {
  82. if ($i < 5){
  83. echo "<th>$colname</th>";
  84. }
  85. else {
  86. echo "<th class='vertical'><div class='vertical'>$colname</div></th>";
  87. }
  88. }
  89. }
  90. echo "</tr>";
  91. $rowCount = 0;
  92. $lastChecked = '';
  93. while($row = $result->fetchArray(SQLITE3_NUM))
  94. {
  95. echo "<tr>";
  96. for ($i = 1; $i < $numColumns-1; $i++)
  97. {
  98. $value=$row[$i];
  99. if ($rowCount == 0 && $i == 1){
  100. $lastChecked = "runs ($value) <br>";
  101. }
  102. if($rowCount == 0 && $i == 3){
  103. $lastChecked = "$lastChecked $value (UTC)";
  104. if ($index == 0) echo "<script>localStorage.setItem('lastChecked', '$lastChecked')</script>";
  105. // store most recent entry (row=0) of latest campaign (index=0) for display in checklist.php
  106. }
  107. if ($tableName.length < 5 || $i != 11) // skip column 11 = LARA, which is true since KNM10 (length 5, KNM9 and before length 4)
  108. {
  109. if ($value == "good"){
  110. echo "<th id='green'>$value</th>";
  111. }
  112. elseif ($value == "bad") {
  113. echo "<th id='red'>$value</th>";
  114. }
  115. else {
  116. echo "<th id='normal'>$value</th>";
  117. }
  118. }
  119. }
  120. $value=$row[$numColumns-1];
  121. echo "<th><button type='submit' onclick='detailedInfo(\"$value\")' id='details'>details</button><th>";
  122. #echo "<th id='normal'>$value</th>";
  123. echo "</tr>";
  124. $rowCount += 1;
  125. }
  126. echo "</table>";
  127. }
  128. ?>
  129. <script type="text/javascript">
  130. function detailedInfo(message) {
  131. var str = message;
  132. var alert_string = str.replace(/<br?>/gi, "\n").replace(/<pre?>/gi, "").replace(/<\/pre?>/gi, "");
  133. alert(alert_string);
  134. }
  135. </script>
  136. <br><br>
  137. <hr>
  138. <br>
  139. <p style="color:grey">
  140. If you have any suggestions for improvement, please give feedback via <a href="mailto:thuemmler@kit.edu">email</a>.
  141. </p>
  142. <br>
  143. <br>
  144. </center>
  145. </body>
  146. </html>