Ejemplo n.º 1
0
echo date("Y-m-d");
$_SESSION["error_msg"] = "";
require_once 'read.php';
?>
 ...
            </div>                
        </div>

        <!-- Main content -->
        <div class="view-container container content">
            <div class="row">
                <div class="col-md-1"></div>
                <div class="col-md-5">
                    <button type="button" class="btn btn-success" data-toggle="modal" 
                            data-target="#popup" onclick="setLastData('Humidity: <?php 
ArduiData::readLastData('hum');
?>
');">Humidity</button>
                    
                    <button type="button" class="btn btn-primary">Sound</button>
                    <button type="button" class="btn btn-danger">Temperature</button>
                    <button type="button" class="btn btn-warning">Light</button>                    
                </div>
                <div class="col-md-1">
                    <a href="#" id="arduinput" data-toggle="popover" title="Popover Header" data-content="" onclick="sendInput('alert');">
                        <button type="button" class="btn btn-danger">Send Command</button>
                    </a>
                </div>
            </div>

            <!-- Generate the javascript code for plotting graphes with Google API
Ejemplo n.º 2
0
        // Create our data table out of JSON data loaded from server.
        var data;
        var options;
        var chart;
<?php 
$i = 0;
for (; $i < sizeof($charts); $i++) {
    ?>

            data = new google.visualization.DataTable();
            data.addColumn('datetime', 'Time');
    <?php 
    echo "\t\t\t data.addColumn('number', '" . $charts[$i] . "');" . "\n\t\t\t data.addRows([ ";
    require_once 'read.php';
    $obj = new ArduiData();
    json_encode($obj->getData($charts[$i]));
    ?>
            ]);
            options = {
                title: '<?php 
    echo $charts[$i];
    ?>
 vs time',
                curveType: 'function',
                legend: {position: 'top'},
                width: 500,
                height: 300
            };

            // Instantiate and draw our chart