Prechádzať zdrojové kódy

commented out everything connetced to sql

koellenberger 2 rokov pred
rodič
commit
ccf5db5204
3 zmenil súbory, kde vykonal 5 pridanie a 118 odobranie
  1. 3 3
      public/checklist.php
  2. 0 73
      public/index.php
  3. 2 42
      public/submit.php

+ 3 - 3
public/checklist.php

@@ -33,9 +33,9 @@
     <h2 style="text-align:right">Step 2/3</h2>
 
     <center>
-      <body onload="document.getElementById('result').innerHTML = 'Welcome ' + localStorage.getItem('author') + '<br><br>The last check has been performed based on:<br>' + localStorage.getItem('lastChecked')">
+      <!-- <body onload="document.getElementById('result').innerHTML = 'Welcome ' + localStorage.getItem('author') + '<br><br>The last check has been performed based on:<br>' + localStorage.getItem('lastChecked')">
         <h3 id="result"></h3>
-      </body>
+      </body> -->
       <h3>Please check the following parameters and values. <br>If any runs are effected, note down the run numbers in the comments and contact the corresponding system expert. </h3>
       <br>
 
@@ -271,7 +271,7 @@
             localStorage.setItem('summary', Summary);
             forwardingInfo += "&Summary="  + Summary;
 
-            window.location.href="submit.php"+forwardingInfo;
+            //window.location.href="submit.php"+forwardingInfo; <----
           }
       </script>
 

+ 0 - 73
public/index.php

@@ -66,79 +66,6 @@
           table th#green {font-weight:normal; background-color:#bdffce;}
         </style>
 
-        <?php
-          $file = "recentSQLName.txt";
-          $f = fopen($file, 'r');
-          $tableName = fgets($f);
-          fclose($f);
-          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, 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 )");
-          $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 = '';
-
-          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); at";
-                  }
-                  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;
-          }
-          echo "</table>";
-        ?>
-
-        <script type="text/javascript">
-            function detailedInfo(message) {
-                var str = message;
-                var alert_string = str.replace(/<br?>/gi, "\n").replace(/<pre?>/gi, "").replace(/<\/pre?>/gi, "");
-                alert(alert_string)
-            }
-        </script>
-
-      </p>
-
     </center>
   </body>
 </html>

+ 2 - 42
public/submit.php

@@ -31,9 +31,9 @@
       <hr>
       <table id="table" style="max-width:600px;">
         <tr>
-        <td style="text-align:left"><body onload="document.getElementById('result').innerHTML = localStorage.getItem('summary')">
+        <!-- <td style="text-align:left"><body onload="document.getElementById('result').innerHTML = localStorage.getItem('summary')">
           <text id="result"></text>
-        </body></td>
+        </body></td> -->
         </tr>
       </table>
       <br>
@@ -51,51 +51,11 @@
 
           function submit() {
 
-              <?php
-                $file = "recentSQLName.txt";
-                $f = fopen($file, 'r');
-                $tableName = fgets($f);
-                fclose($f);
-                $db= new SQLite3("data/mydb.sqlite");
 
-                $Run_Range        = $_GET["Run_Range"];
-                $Mode             = $_GET["Mode"];
-                $Submitted        = $_GET["Submitted"];
-                $Author           = $_GET["Author"];
-                $HV_K65           = $_GET["HV_K65"];
-                $HV_TankPotential = $_GET["HV_TankPotential"];
-                $BIXS             = $_GET["BIXS"];
-                $LARA             = $_GET["LARA"];
-                $LARA_Crosscheck  = $_GET["LARA_crosscheck"];
-                $FBM              = $_GET["FBM"];
-                $RW               = $_GET["RW"];
-                $Run_Length       = $_GET["Run_Length"];
-                $Data_Size        = $_GET["Data_Size"];
-                $FPD_Energy       = $_GET["FPD_Energy"];
-                $Grid_sync        = $_GET["Grid_sync"];
-                $Rate_300         = $_GET["Rate_300"];
-                $Rate_90          = $_GET["Rate_90"];
-                $Tritium_Purity   = $_GET["Tritium_Purity"];
-                $Summary   = $_GET["Summary"];
-
-                #$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 )");
-
-
-                //#$string_to_insert=$db->escapeString($author);
-                $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')");
-
-
-              ?>
-
-              localStorage.clear()
               window.location.href="index.php";
           }
       </script>
 
-
-
-
-
     </center>
   </body>
 </html>