<!DOCTYPE html>
<!--
********************************************************************************

    filename:     currentprobes.php
    description:  list current probe parameters
    inputs:       none
    outputs:      none
    actions:      none
    redirections: none 

********************************************************************************
-->
<html>
<head>
<style>
    table {
        border-collapse: collapse;
    }

    table, td, th {
        border: 1px solid black;
    }
</style>
<?php include 'head.html' ?>
        <script src = "navigation.js"></script>
</head>
<body>
<?php include 'navigationviewdatabase.html' ?>
<h3>CURRENT PROBES</h3>
<div id="content">
<?php
            include 'functions.php';
            $conn = connectToDB();
            $sql = "SELECT probeId, probePosition, probeTemp, targetTemp, highTemp, lowTemp, manufacturer, model, a, b, c FROM currentprobes";
            $results = mysqli_query($conn, $sql);
            echo '<form action="currentburn.php" method="post">';
                echo "<table>";
                    echo"<tr>";
                        echo "<th>Probe Position</th>";
                        echo "<th>Current Temp</th>";
                        echo "<th>Target Temp</th>";
                        echo "<th>High Temp</th>";
                        echo "<th>Low Temp</th>";
                        echo "<th>Probe ID</th>";
                        echo "<th>Manufacturer</th>";
                        echo "<th>Model</th>";
                        echo "<th>a</th>";
                        echo "<th>b</th>";
                        echo "<th>c</th>";
                    echo "</tr>";        
                    if (mysqli_num_rows($results) > 0) {
                        while($row = mysqli_fetch_assoc($results)) {
                        echo"<tr>";
                           echo "<th>" . $row["probePosition"] . "</th>";
                           echo "<th>" . $row["probeTemp"] . "</th>";
                           echo "<th>" . $row["targetTemp"] . "</th>";
                           echo "<th>" . $row["highTemp"] . "</th>";
                           echo "<th>" . $row["lowTemp"] . "</th>";
                           echo "<th>" . $row["probeId"] . "</th>";
                           echo "<th>" . $row["manufacturer"] . "</th>";
                           echo "<th>" . $row["model"] . "</th>";
                           echo "<th>" . $row["a"] . "</th>";
                           echo "<th>" . $row["b"] . "</th>";
                           echo "<th>" . $row["c"] . "</th>";
                        echo '</tr>';
                        }
                     } else {            
                       echo "no probes";
                    }
                echo "</table>";
mysqli_close($conn);
?>
</div>
</body>
</html>