コード例 #1
0
// Copyright (C) Ron Klinkien, The Netherlands.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General PUBLIC License for more details.
// You should have received a copy of the GNU General PUBLIC License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
include "config.php";
include "functions.php";
$device = $_GET["device"];
$value = $_GET["value"];
if ($locations) {
    if (!isset($_GET["location"])) {
        $location = "*";
    } else {
        $location = $_GET["location"];
    }
    $data = get_device_list($location);
} else {
    $data = get_device_list("*");
}
$response = do_jsonrpc("device.set", array("device_id" => intval($device), "value" => $value));
if ($locations) {
    header('Location: device.php?location=' . $location);
} else {
    header('Location: device.php');
}
コード例 #2
0
ファイル: index.php プロジェクト: rayvenwalker/DomotiGa
echo "<div id='header'>\n";
echo "<h1><a href='index.php?reload=1'><img src='images/logo.png' alt='logo'></img></a></h1><br/>\n";
echo "<div id='boxright'>\n";
// Status
$status = get_status();
echo "<p>\n";
//echo "House Mode: <span class='inline house' id='house_mode'>".$status['house_mode']."</span>&nbsp;&nbsp;&nbsp;\n";
echo "Version: <span class='inline version' id='program_version'>" . $status['program_version'] . "</span>\n";
echo "</p>\n";
// Settings
echo "<p><a class='submodal-600-520' href='settings.php'>Settings</a></p>\n";
echo "</div>\n";
echo "</div>\n";
// Title End
// Get list of devices
$data = get_device_list($_SESSION['view']);
// Sort the list
if (is_array($data)) {
    if (strtolower($_SESSION['sortord'] == "asc")) {
        $sortkey = $_SESSION['sortkey'];
        usort($data, 'sort_matches_asc');
    } else {
        $sortkey = $_SESSION['sortkey'];
        usort($data, 'sort_matches_desc');
    }
} else {
    $data = array();
}
// Tabs
echo "<div id='navcontainer'>\n";
echo "<ul id='navlist'>\n";
コード例 #3
0
<script src="calendar.js" type="text/javascript"></script>
<table>
	<tr>
		<th>device</th>
		<th>user</th>
		<th>start date</th>
		<th>end date</th>
		<th>per page</th>
		<th>&nbsp;</th>
	</tr>
	<tr>
		<td>
			<select name="device" onChange="this.form.submit()">
				<option>all</option>
			<?php 
get_device_list($db);
?>
			</select>
		</td>
		<td>
			<select name="user" onChange="this.form.submit()">
				<option>all</option>
			<?php 
get_user_list($db);
?>
			</select>
		</td>
		<td>
			<input onclick="ds_sh(this);" name="begin_date" style="cursor: text" value="<?php 
echo $begin_date;
?>
コード例 #4
0
ファイル: json.php プロジェクト: rayvenwalker/DomotiGa
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General PUBLIC License for more details.
// You should have received a copy of the GNU General PUBLIC License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
session_start();
include "config.php";
include "functions.php";
extract($_REQUEST, EXTR_PREFIX_ALL | EXTR_REFS, 'r_');
if (!isset($r_view)) {
    $r_view = "main";
}
$totcount = 0;
// Get devices
$data = get_device_list("{$r_view}");
foreach ($data as $subitem) {
    $subdata[$totcount]['id'] = $subitem['id'];
    $subdata[$totcount]['deviceicon'] = $subitem['deviceicon'];
    $subdata[$totcount]['devicename'] = $subitem['devicename'];
    $subdata[$totcount]['devicelocation'] = $subitem['devicelocation'];
    $subdata[$totcount]['devicevalue1'] = $subitem['devicevalue1'];
    $subdata[$totcount]['devicevalue2'] = $subitem['devicevalue2'];
    $subdata[$totcount]['devicevalue3'] = $subitem['devicevalue3'];
    $subdata[$totcount]['devicevalue4'] = $subitem['devicevalue4'];
    $subdata[$totcount]['devicelastseen'] = $subitem['devicelastseen'];
    $totcount++;
}
// Get status
$status = get_status();
$subdata[$totcount]['house_mode'] = $status['house_mode'];