index.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. <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</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 ($i < 5){
  81. echo "<th>$colname</th>";
  82. }
  83. else {
  84. echo "<th class='vertical'><div class='vertical'>$colname</div></th>";
  85. }
  86. }
  87. echo "</tr>";
  88. $rowCount = 0;
  89. $lastChecked = '';
  90. while($row = $result->fetchArray(SQLITE3_NUM))
  91. {
  92. echo "<tr>";
  93. for ($i = 1; $i < $numColumns-1; $i++)
  94. {
  95. $value=$row[$i];
  96. if ($rowCount == 0 && $i == 1){
  97. $lastChecked = "runs ($value) <br>";
  98. }
  99. if($rowCount == 0 && $i == 3){
  100. $lastChecked = "$lastChecked $value (UTC)";
  101. echo "<script>localStorage.setItem('lastChecked', '$lastChecked')</script>";
  102. }
  103. if ($value == "good"){
  104. echo "<th id='green'>$value</th>";
  105. }
  106. elseif ($value == "bad") {
  107. echo "<th id='red'>$value</th>";
  108. }
  109. else {
  110. echo "<th id='normal'>$value</th>";
  111. }
  112. }
  113. $value=$row[$numColumns-1];
  114. echo "<th><button type='submit' onclick='detailedInfo(\"$value\")' id='details'>details</button><th>";
  115. #echo "<th id='normal'>$value</th>";
  116. echo "</tr>";
  117. $rowCount += 1;
  118. }
  119. echo "</table>";
  120. }
  121. ?>
  122. <script type="text/javascript">
  123. function detailedInfo(message) {
  124. var str = message;
  125. var alert_string = str.replace(/<br?>/gi, "\n").replace(/<pre?>/gi, "").replace(/<\/pre?>/gi, "");
  126. alert(alert_string)
  127. }
  128. </script>
  129. <br><br>
  130. <hr>
  131. <br>
  132. <p style="color:grey">
  133. If you have any suggestions for improvement, please give feedback via <a href="mailto:leonard.koellenberger@kit.edu">email</a>.
  134. </p>
  135. <br>
  136. <br>
  137. </center>
  138. </body>
  139. </html>