Example #1
0
function wml_hddtemp()
{
    global $XPath;
    global $text;
    if ($XPath->match("/phpsysinfo/HDDTemp")) {
        for ($i = 1; $i < sizeof($XPath->getDataParts("/phpsysinfo/HDDTemp")); $i++) {
            if ($XPath->getData("/phpsysinfo/HDDTemp/Item[" . $i . "]/Value") != 0) {
                $_text .= "<p>\n";
                $_text .= $XPath->getData("/phpsysinfo/HDDTemp/Item[" . $i . "]/Model") . ": " . str_replace("&ordm;", "", temperature($XPath->getData("/phpsysinfo/HDDTemp/Item[" . $i . "]/Value"))) . "</p>\n";
            }
        }
    }
    return $_text;
}
Example #2
0
function wml_mbtemp()
{
    global $XPath;
    $_text = "";
    for ($i = 1, $max = sizeof($XPath->getDataParts("/phpsysinfo/MBinfo/Temperature")); $i < $max; $i++) {
        $_text .= "<p>" . $XPath->getData("/phpsysinfo/MBinfo/Temperature/Item[" . $i . "]/Label") . ": ";
        if ($XPath->getData("/phpsysinfo/MBinfo/Temperature/Item[" . $i . "]/Value") == 0) {
            $_text .= "Unknown - Not connected?</p>";
        } else {
            $_text .= "&nbsp;" . str_replace("&deg;", "", temperature($XPath->getData("/phpsysinfo/MBinfo/Temperature/Item[" . $i . "]/Value"))) . "</p>\n";
        }
    }
    return $_text;
}
Example #3
0
            <div class="row">
                <div class="col-lg-4 col-md-6">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <div class="row">
                                <div class="col-xs-3">
                                    <i class="fa fa-sun-o fa-5x"></i>
                                </div>
                                <div class="col-xs-9 text-right">
                                    
                                    <div>Temperature</div>
                                    <h4>
                                        <?php 
try {
    $socket = initialize_socket();
    echo temperature($socket);
    close_socket($socket);
} catch (Exception $exc) {
    echo 'error';
}
?>
                                        &deg; C
                                    </h4>
                                </div>
                            </div>
                        </div>
                        
                    </div>
                </div>
                <div class="col-lg-4 col-md-6">
                    <div class="panel panel-green">
<div class="centered container">
    <a href="bad.php"><?php 
temperature("BAD_HUMID");
humidity("BAD_HUMID");
?>
</a>
</div>
<div class="centered container">
    <a href="kueche.php"><?php 
temperature("K_HUMID");
humidity("K_HUMID");
?>
</a>
</div>
function temperature_humidity($device)
{
    temperature($device);
    humidity($device);
}
Example #7
0
function html_hardware()
{
    global $XPath;
    global $text;
    $strPcidevices = "";
    $strIdedevices = "";
    $strUsbdevices = "";
    $strScsidevices = "";
    $textdir = direction();
    for ($i = 1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Hardware/PCI")); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/PCI/Device[" . $i . "]/Name")) {
            $strPcidevices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/PCI/Device[" . $i . "]/Name") . "</font></td></tr>";
        }
    }
    for ($i = 1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Hardware/IDE")); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[" . $i . "]")) {
            $strIdedevices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/IDE/Device[" . $i . "]/Name");
            if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[" . $i . "]/Capacity")) {
                $strIdedevices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/IDE/Device[" . $i . "]/Capacity") / 2) . ")";
            }
            $strIdedevices .= "</font></td></tr>";
        }
    }
    for ($i = 1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Hardware/SCSI")); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[" . $i . "]")) {
            $strScsidevices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/SCSI/Device[" . $i . "]/Name");
            if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[" . $i . "]/Capacity")) {
                $strScsidevices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/SCSI/Device[" . $i . "]/Capacity") / 2) . ")";
            }
            $strScsidevices .= "</font></td></tr>";
        }
    }
    for ($i = 1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Hardware/USB")); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/USB/Device[" . $i . "]/Name")) {
            $strUsbdevices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/USB/Device[" . $i . "]/Name") . "</font></td></tr>";
        }
    }
    $_text = "<table border=\"0\" width=\"100%\" align=\"center\">\n";
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Number")) {
        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['numcpu'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Number") . "</font></td>\n  </tr>\n";
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Model")) {
        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cpumodel'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Model");
        if ($XPath->match("/phpsysinfo/Hardware/CPU/Cputemp")) {
            $_text .= "&nbsp;@&nbsp;" . temperature($XPath->getData("/phpsysinfo/Hardware/CPU/Cputemp"));
        }
        $_text .= "</font></td>\n  </tr>\n";
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Cpuspeed")) {
        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cpuspeed'] . "</font></td>\n    <td><font size=\"-1\">" . format_speed($XPath->getData("/phpsysinfo/Hardware/CPU/Cpuspeed")) . "</font></td>\n  </tr>\n";
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Busspeed")) {
        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['busspeed'] . "</font></td>\n    <td><font size=\"-1\">" . format_speed($XPath->getData("/phpsysinfo/Hardware/CPU/Busspeed")) . "</font></td>\n  </tr>\n";
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Cache")) {
        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cache'] . "</font></td>\n    <td><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Hardware/CPU/Cache")) . "</font></td>\n  </tr>\n";
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Bogomips")) {
        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['bogomips'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Bogomips") . "</font></td>\n  </tr>\n";
    }
    $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['pci'] . "</font></td>\n    <td>";
    if ($strPcidevices) {
        $_text .= "<table>" . $strPcidevices . "</table>";
    } else {
        $_text .= "<font size=\"-1\"><i>" . $text['none'] . "</i></font>";
    }
    $_text .= "</td>\n  </tr>\n";
    $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['ide'] . "</font></td>\n    <td>";
    if ($strIdedevices) {
        $_text .= "<table>" . $strIdedevices . "</table>";
    } else {
        $_text .= "<font size=\"-1\"><i>" . $text['none'] . "</i></font>";
    }
    $_text .= "</td>\n  </tr>\n";
    $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['scsi'] . "</font></td>\n    <td>";
    if ($strScsidevices) {
        $_text .= "<table>" . $strScsidevices . "</table></td>\n  </tr>";
    } else {
        $_text .= "<font size=\"-1\"><i>" . $text['none'] . "</i></font>";
    }
    $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['usb'] . "</font></td>\n    <td>";
    if ($strUsbdevices) {
        $_text .= "<table>" . $strUsbdevices . "</table></td>\n  </tr>";
    } else {
        $_text .= "<font size=\"-1\"><i>" . $text['none'] . "</i></font>";
    }
    $_text .= "</table>";
    return $_text;
}
<div class="centered container">
    <div>
    <a href="schlafzimmer.php"><?php 
temperature("S_THERMO");
humidity("S_THERMO");
?>
</a>
    </div>
    
    <div data-type="symbol" data-device="S_FENSTER_LINKS" class="cell" data-subtype="MAX" style="margin-top:46px !important"></div>
    <?php 
battery('S_FENSTER_LINKS', 'position:absolute;bottom:0;right:0;');
?>
</div>
Example #9
0
    $googleUrl .= ",";
}
if (!empty($_GET["city"])) {
    $city = $_GET["city"];
    $googleUrl .= $_GET["city"];
    $googleUrl .= ",";
}
if (!empty($_GET["state"])) {
    $state = $_GET["state"];
    $googleUrl .= $_GET["state"];
}
if (!empty($_GET["degree"])) {
    $degree = $_GET["degree"];
}
$temperature_unit = temperature($degree);
$dewPoint_unit = temperature($degree);
$windSpeed_unit = windSpeed($degree);
$pressure_unit = pressure($degree);
$visibility_unit = visibility($degree);
$xml = simplexml_load_file($googleUrl) or die("Error: Cannot create object");
$status = $xml->status;
$weather_data = new stdClass();
$weather_data->data = new stdClass();
$weather_data->data->units = new stdClass();
$weather_data->data->currently = new stdClass();
$weather_data->data->hourly = new stdClass();
$weather_data->data->daily = new stdClass();
if (strcmp($status, "OK") == 0) {
    $weather_data->hasError = false;
    $lat = $xml->result->geometry->location->lat;
    $lng = $xml->result->geometry->location->lng;
<div class="centered container">
    <a href="buero.php"><?php 
temperature('B_THERMO');
?>
</a>
    <div style="padding-top:84px !important">
    <?php 
thermostat('B_HEIZUNG');
?>
    </div>
    <?php 
battery('B_HEIZUNG', 'position:absolute;bottom:0;left:0;');
?>
</div>
<div class="centered container">
    <a href="wohnzimmer.php"><?php 
temperature('W_HUMID');
humidity('W_HUMID');
?>
</a>
    <div style="padding-top:33px !important">
    <?php 
thermostat('W_HEIZUNG', 'W_HEIZUNG_BALKON');
?>
    </div>
    <div data-type="symbol" data-device="W_FENSTER_Balkon" class="cell" data-subtype="MAX" data-icons='["ftui-door","ftui-door"]'></div>
    
    <?php 
battery('W_FENSTER_Balkon ', 'position:absolute;bottom:0;right:0;');
?>
    <?php 
battery('W_HEIZUNG_COUCH', 'position:absolute;bottom:0;left:0;');
?>
    <?php 
battery('W_HEIZUNG_BALKON', 'position:absolute;bottom:30px;left:0;');
?>
    <?php 
battery('W_HEIZUNG', 'position:absolute;bottom:60px;left:0;');
?>
</div>