if else fix

This commit is contained in:
Karl Hudgell 2016-12-01 14:49:32 +00:00
parent 0c77463d19
commit 4ee49d9a43

View File

@ -79,21 +79,16 @@ for ($count = 1; $count < sizeof($diskfree); $count ++) {
//Read in RGB file //Read in RGB file
$file = file_get_contents('/home/pi/hugh/rgb', FILE_USE_INCLUDE_PATH); $file = file_get_contents('/home/pi/hugh/rgb', FILE_USE_INCLUDE_PATH);
if ($file > "0, 0, 0") { if (($file > "0, 0, 0") {
$rgb = "Off"; $rgb = "Off";
} } else if ($file > "255, 0, 0") {
if ($file > "255, 0, 0") {
$rgb = "Red"; $rgb = "Red";
} } else if ($file > "0, 255, 0") {
if ($file > "0, 255, 0") {
$rgb = "Green"; $rgb = "Green";
} else if ($file > "0, 0, 255") {
if ($file > "0, 0, 255") {
$rgb = "Blue"; $rgb = "Blue";
} }
}
// Rendering Page. // Rendering Page.
?><!DOCTYPE html> ?><!DOCTYPE html>
@ -186,7 +181,7 @@ if ($file > "0, 0, 255") {
</table> </table>
</div> </div>
<div class="mdl-color--white mdl-shadow--2dp mdl-cell mdl-cell--6-col mdl-grid"> <div class="mdl-color--white mdl-shadow--2dp mdl-cell mdl-cell--6-col mdl-grid">
<h3>Desk Colour - <?php echo $rgb;?></h3> <h3>Desk Colour - <?php echo $rgb;?> - (<?php echo $file;?>)</h3>
<table class="mdl-data-table mdl-js-data-table" style="width:100%;"> <table class="mdl-data-table mdl-js-data-table" style="width:100%;">
<tbody> <tbody>