Browse Source

updated to knm7

koellenberger 2 years ago
parent
commit
24cc944cf3
2 changed files with 61 additions and 56 deletions
  1. 60 55
      public/index.php
  2. 1 1
      public/recentSQLName.txt

+ 60 - 55
public/index.php

@@ -63,66 +63,71 @@
         </style>
 
         <?php
-          $file = "recentSQLName.txt";
-          $f = fopen($file, 'r');
-          $tableName = fgets($f);
-          fclose($f);
-          echo "<h1>Checklist history - $tableName</h1>";
+          $Campaigns = ["KNM7", "KNM6"];
+          for ($index=0; $index < count($Campaigns); $index++)
+            {
+            // $file = "recentSQLName.txt";
+            // $f = fopen($file, 'r');
+            // $tableName = fgets($f);
+            // fclose($f);
+            $tableName = $Campaigns[$index];
+            echo "<h1>Checklist history - $tableName</h1>";
 
-          $db= new SQLite3("data/mydb.sqlite");
-          $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 )");
-          $sql_select="SELECT * FROM $tableName ORDER BY ID DESC";
-          $result=$db->query($sql_select);
-          echo "<table width='100%'>";
-          echo "<tr>";
-          $numColumns=$result->numColumns();
-          for ($i = 1; $i < $numColumns; $i++)
-          {
-              $colname=$result->columnName($i);
-              $colname = str_replace('_', ' ', $colname);
-              if ($i < 5){
-                echo "<th>$colname</th>";
-              }
-              else {
-                echo "<th class='vertical'><div class='vertical'>$colname</div></th>";
-              }
+            $db= new SQLite3("data/mydb.sqlite");
+            $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 )");
+            $sql_select="SELECT * FROM $tableName ORDER BY ID DESC";
+            $result=$db->query($sql_select);
+            echo "<table width='100%'>";
+            echo "<tr>";
+            $numColumns=$result->numColumns();
+            for ($i = 1; $i < $numColumns; $i++)
+            {
+                $colname=$result->columnName($i);
+                $colname = str_replace('_', ' ', $colname);
+                if ($i < 5){
+                  echo "<th>$colname</th>";
+                }
+                else {
+                  echo "<th class='vertical'><div class='vertical'>$colname</div></th>";
+                }
 
-          }
-          echo "</tr>";
-          $rowCount = 0;
-          $lastChecked = '';
+            }
+            echo "</tr>";
+            $rowCount = 0;
+            $lastChecked = '';
 
-          while($row = $result->fetchArray(SQLITE3_NUM))
-          {
-              echo "<tr>";
-              for ($i = 1; $i < $numColumns-1; $i++)
-              {
-                  $value=$row[$i];
-                  if ($rowCount == 0 && $i == 1){
-                    $lastChecked = "runs ($value) <br>";
-                  }
-                  if($rowCount == 0 && $i == 3){
-                    $lastChecked = "$lastChecked $value (UTC)";
-                    echo "<script>localStorage.setItem('lastChecked', '$lastChecked')</script>";
-                  }
+            while($row = $result->fetchArray(SQLITE3_NUM))
+            {
+                echo "<tr>";
+                for ($i = 1; $i < $numColumns-1; $i++)
+                {
+                    $value=$row[$i];
+                    if ($rowCount == 0 && $i == 1){
+                      $lastChecked = "runs ($value) <br>";
+                    }
+                    if($rowCount == 0 && $i == 3){
+                      $lastChecked = "$lastChecked $value (UTC)";
+                      echo "<script>localStorage.setItem('lastChecked', '$lastChecked')</script>";
+                    }
 
-                  if ($value == "good"){
-                    echo "<th id='green'>$value</th>";
-                  }
-                  elseif ($value == "bad") {
-                    echo "<th id='red'>$value</th>";
-                  }
-                  else {
-                    echo "<th id='normal'>$value</th>";
-                  }
-              }
-              $value=$row[$numColumns-1];
-              echo "<th><button type='submit' onclick='detailedInfo(\"$value\")' id='details'>details</button><th>";
-              #echo "<th id='normal'>$value</th>";
-              echo "</tr>";
-              $rowCount += 1;
+                    if ($value == "good"){
+                      echo "<th id='green'>$value</th>";
+                    }
+                    elseif ($value == "bad") {
+                      echo "<th id='red'>$value</th>";
+                    }
+                    else {
+                      echo "<th id='normal'>$value</th>";
+                    }
+                }
+                $value=$row[$numColumns-1];
+                echo "<th><button type='submit' onclick='detailedInfo(\"$value\")' id='details'>details</button><th>";
+                #echo "<th id='normal'>$value</th>";
+                echo "</tr>";
+                $rowCount += 1;
+            }
+            echo "</table>";
           }
-          echo "</table>";
         ?>
 
         <script type="text/javascript">

+ 1 - 1
public/recentSQLName.txt

@@ -1 +1 @@
-KNM6
+KNM7