<table class="table table-striped" style="width:600px">
				<tbody>
					<tr>
					<?php 
$db = new MyLiveDB();
if (!$db) {
    echo $db->lastErrorMsg();
}
$sql = "SELECT * FROM battery LIMIT 1;";
$ret = $db->query($sql);
while ($row = $ret->fetchArray(SQLITE3_ASSOC)) {
    echo "<td><b>Avg Cell Voltage: </b>" . number_format($row['batt1Avg'], 2, '.', '') . "V </td>";
    echo "<td><b>Highest Cell Voltage: </b>" . number_format($row['batt1High'], 2, '.', '') . "V </td>";
    echo "<td><b>Lowest Cell Voltage: </b>" . number_format($row['batt1Low'], 2, '.', '') . "V </td>";
}
$db->close();
?>
					</tr>
				</tbody>
			</table>
			<br>
		</div class="container"> <!-- /container -->
		
		<!-- Le javascript
		================================================== -->
		<!-- Placed at the end of the document so the pages load faster -->
		<script src="assets/js/jquery.js"></script>
		<script src="assets/js/bootstrap-transition.js"></script>
		<script src="assets/js/bootstrap-alert.js"></script>
		<script src="assets/js/bootstrap-modal.js"></script>
		<script src="assets/js/bootstrap-dropdown.js"></script>
        }
        $faultCode = $rowL['faultID'];
        $sqlF = "SELECT * FROM FaultDictionary WHERE faultID = \"" . $faultCode . "\";";
        $retF = $dbF->query($sqlF);
        while ($rowF = $retF->fetchArray(SQLITE3_ASSOC)) {
            echo "<tr><td>" . $rowF['faultID'] . "</td><td>" . $rowF['message'] . "</td><td>" . $rowF['description'] . "</td><td>" . $rowF['action'] . "</td></tr>";
        }
    }
    if ($dataExists) {
        echo "</tbody>";
        echo "</table>";
    } else {
        echo "<p>No faults present.</p>";
    }
    $dbF->close();
    $dbL->close();
}
?>
	</div class="container"> <!-- /container -->
	
	<div class="container">
		<h4>Historic Fault Logs</h4>
	    <p>All faults are recorded in a diagnostic log with the date and time at which they occurred. Press the button below to download the fault log.</p>
		<br>
		<div class="col-sm-offset-2 col-sm-10">
			<button type="submit" class="btn btn-default" name="download_diagnostic_logs" onclick="document.location.href = 'downloadfaults.php';">Download Diagnostic Log</button>
		</div>
	</div class="container"> <!-- /container -->

    <!-- Le javascript
    ================================================== -->