// ------------------------------------------- // BEDINGUNGEN // ------------------------------------------- $table = new Table(array("", "")); $table->addSpacer(0, 15); $table->setColSizes(array(130)); $ttlBedingung = new Title("Ausloesende Bedingungen"); $ttlBedingung->setAlign("left"); $r2Title = $table->createRow(); $r2Title->setSpawnAll(true); $r2Title->setAttribute(0, $ttlBedingung); $table->addRow($r2Title); $table->addSpacer(0, 15); $sqlRegelItems = "SELECT id, name FROM homecontrol_regeln"; $cobSelectItems = new ComboBoxBySql($_SESSION['config']->DBCONNECT, $sqlRegelItems, "SelectedRegelToEdit", isset($_SESSION['SelectedRegelToEdit']) ? $_SESSION['SelectedRegelToEdit'] : "", 0, 1, " "); $cobSelectItems->setDirectSelect(true); $r2Auswahl = $table->createRow(); $r2Auswahl->setAttribute(0, new Text("Regel auswaehlen: ")); $r2Auswahl->setAttribute(1, $cobSelectItems); $table->addRow($r2Auswahl); $table->addSpacer(0, 10); if (isset($_SESSION['SelectedRegelToEdit']) && strlen($_SESSION['SelectedRegelToEdit']) > 0) { $where = "trigger_id=" . $_SESSION['SelectedRegelToEdit'] . " AND trigger_type=1 "; $termDbTable = new DbTable($_SESSION['config']->DBCONNECT, 'homecontrol_term', array("id", "trigger_id", "trigger_type", "config_id", "term_type", "sensor_id", "min", "std", "value", "termcondition", "status", "montag", "dienstag", "mittwoch", "donnerstag", "freitag", "samstag", "sonntag", "order_nr", "and_or", "lastSensorintervall", "trigger_jn"), "", "", "term_type,order_nr", $where); $termDbTable->setReadOnlyCols(array("id")); $termDbTable->setNoInsertCols(array("id")); $termDbTable->setDeleteInUpdate(true); $termDbTable->setHeaderEnabled(true); $termDbTable->setWidth("100%"); $table->addSpacer(0, 10); if (isset($_REQUEST[$termDbTable->getNewEntryButtonName()])) {
// Zuordnungen // -------------------------------------------------- if (isset($_REQUEST['SelectedCronToEdit'])) { $_SESSION['SelectedCronToEdit'] = $_REQUEST['SelectedCronToEdit']; } $table = new Table(array("", "")); $table->setWidth("100%"); $ttlZuord = new Title("Zuordnungen bearbeiten"); $ttlZuord->setAlign("left"); $rTitle = $table->createRow(); $rTitle->setAttribute(0, $ttlZuord); $rTitle->setSpawnAll(true); $table->addRow($rTitle); $table->addSpacer(0, 10); $cobSelect = new ComboBoxBySql($_SESSION['config']->DBCONNECT, "SELECT id, name FROM homecontrol_cron ORDER BY name", "SelectedCronToEdit", isset($_SESSION['SelectedCronToEdit']) ? $_SESSION['SelectedCronToEdit'] : "", "id", "name", " "); $cobSelect->setDirectSelect(true); $rAuswahl = $table->createRow(); $rAuswahl->setColSizes(array(120)); $rAuswahl->setAttribute(0, new Text("Job auswaehlen: ")); $rAuswahl->setAttribute(1, $cobSelect); $table->addRow($rAuswahl); $table->addSpacer(0, 20); $form = new Form(); // Zuordnung ausgewählt if (isset($_SESSION['SelectedCronToEdit']) && strlen($_SESSION['SelectedCronToEdit']) > 0) { $scItemsDbTable = new DbTable($_SESSION['config']->DBCONNECT, 'homecontrol_cron_items', array("config_id", "art_id", "zimmer_id", "etagen_id", "on_off", "cron_id"), "Objekt, Objekt-Art, Zimmer, Etage, An/Aus, Job", "cron_id=" . $_SESSION['SelectedCronToEdit'], "config_id DESC, zimmer_id DESC, etagen_id DESC", "cron_id=" . $_SESSION['SelectedCronToEdit']); $scItemsDbTable->setReadOnlyCols(array("id")); $scItemsDbTable->setNoInsertCols(array("id")); $scItemsDbTable->setNoUpdateCols(array("cron_id")); $scItemsDbTable->setDeleteInUpdate(true); $scItemsDbTable->setHeaderEnabled(true);
$contentLayoutRow1 = $layoutTable->createRow(); $contentLayoutRow1->setAlign("left"); $contentLayoutRow1->setAttribute(0, $banner); $contentLayoutRow1->setStyle("padding", "10px"); $layoutTable->addRow($contentLayoutRow1); } else { $_SESSION['additionalLayoutHeight'] = 15; $bannerHeight = $_SESSION['additionalLayoutHeight']; } $modeSwitchComboTbl = new Table(array("")); $modeSwitchComboTbl->setWidth(100); $modeSwitchComboTbl->setAlign("center"); $modeSwitchComboTbl->setVAlign("middle"); $modeSwitchComboTbl->setHeight(25); $cobMode = new ComboBoxBySql($_SESSION['config']->DBCONNECT, "SELECT id, name FROM homecontrol_modes WHERE selectable = 'J'", "changeMode", $_SESSION['config']->PUBLICVARS['currentMode']); $cobMode->setDirectSelect(true); $rMode = $modeSwitchComboTbl->createRow(); $rMode->setAttribute(0, $cobMode); $modeSwitchComboTbl->addRow($rMode); $fMode = new Form(); $fMode->add($modeSwitchComboTbl); /* ------------------------------------ HAUPT-MENU ------------------------------------ */ $menuDiv = new Div(); $menuDiv->setWidth($bannerWidth - 80); $menuDiv->setBorder(0); $menuDiv->setOverflow("hidden"); $menuDiv->setAlign("left"); $menuDiv->setStyle("padding-left", "2px"); $menuDiv->setBackgroundColor($_SESSION['config']->COLORS['panel_background']);
<?php $ttl = new Title("Sensor Logs"); $cboSensorSelect = new ComboBoxBySql($_SESSION['config']->DBCONNECT, "SELECT id, concat(name ,' (', id ,')') descr FROM homecontrol_sensor", "sensorSelectCob", $_REQUEST['sensorSelectCob']); $cboSensorSelect->setDirectSelect(true); $cboSensorSelect->setNullValue(" "); $cobStartTime = new ComboBoxBySql($_SESSION['config']->DBCONNECT, "SELECT distinct from_unixtime(update_time, '%d.%m.%Y') as zeit, from_unixtime(update_time, '%d.%m.%Y') as zeit2 FROM homecontrol_sensor_log", "startTimeCob", $_REQUEST['startTimeCob']); $cobStartTime->setDirectSelect(true); $cobStartTime->setNullValue(" "); $sqlEndCob = "SELECT distinct from_unixtime(update_time, '%d.%m.%Y') as zeit, from_unixtime(update_time, '%d.%m.%Y') as zeit2 FROM homecontrol_sensor_log"; if (isset($_REQUEST['startTimeCob']) && strlen($_REQUEST['startTimeCob']) > 0) { $sqlEndCob .= " WHERE update_time >= " . strtotime(substr($_REQUEST['startTimeCob'], 8, 2) . "-" . substr($_REQUEST['startTimeCob'], 3, 2) . "-" . substr($_REQUEST['startTimeCob'], 0, 2)); } $cobEndTime = new ComboBoxBySql($_SESSION['config']->DBCONNECT, $sqlEndCob, "endTimeCob", $_REQUEST['endTimeCob']); $cobEndTime->setDirectSelect(true); $cobEndTime->setNullValue(" "); $txtSelect = new Text("Sensor Auswahl:"); $frmSelect = new Form(); $timeSelect = new Table(array("", "", "", "")); $rT = $timeSelect->createRow(); $rT->setColSizes(array(130, 100, 63)); $rT->setAlignments(array("left", "left", "center")); $rT->setAttribute(0, new Text("Zeitraum von: ")); $rT->setAttribute(1, $cobStartTime); $rT->setAttribute(2, new Text("bis: ")); $rT->setAttribute(3, $cobEndTime); $timeSelect->addRow($rT); // ------------------------- // Show // ------------------------- $tbl = new Table(array("", ""));
function getMobileView() { $columnCount = 1; $this->handleEtage(); $layoutTable = new Table(array("")); $etagenSql = "SELECT id, name FROM homecontrol_etagen"; $cobChooser = new ComboBoxBySql($_SESSION['config']->DBCONNECT, $etagenSql, "aktEtage", strlen($_SESSION['aktEtage']) > 0 ? $_SESSION['aktEtage'] : ""); $cobChooser->setDirectSelect(true); $cobChooser->setStyle("font-size", "40px"); $frmChooser = new Form(); $frmChooser->add($cobChooser); $layoutTable->addSpacer(0, 30); $rChooser = $layoutTable->createRow(); $rChooser->setSpawnAll(true); $rChooser->setAttribute(0, $frmChooser); $layoutTable->addRow($rChooser); $layoutTable->addSpacer(0, 15); $layoutRow = $layoutTable->createRow(); $layoutTable->addRow($layoutRow); if (isset($_SESSION['aktEtage']) && strlen($_SESSION['aktEtage']) > 0) { $dbTable = new DbTable($_SESSION['config']->DBCONNECT, 'homecontrol_config', array("id", "name", "funk_id", "funk_id2", "beschreibung", "control_art", "etage", "zimmer", "x", "y", "dimmer", "sender_id"), "", "", "zimmer", "etage=" . $_SESSION['aktEtage']); $currCol = 0; $zimmer = null; foreach ($dbTable->ROWS as $row) { if ($currCol >= $columnCount) { $currCol = 0; $layoutTable->addSpacer(0, 7); $layoutTable->addSpacer(1, 2); $layoutTable->addSpacer(0, 7); $layoutRow = $layoutTable->createRow(); $layoutTable->addRow($layoutRow); } if ($zimmer != $row->getNamedAttribute("zimmer")) { //zimmer $zimmer = $row->getNamedAttribute("zimmer"); $currCol = 0; $layoutTable->addSpacer(0, 25); $layoutRow = $layoutTable->createRow(); $layoutTable->addRow($layoutRow); $iT = new Text($this->getZimmerName($zimmer), "7", true); $iTFt = $iT->getFonttype(); $iTFt->setColor("#7babdb"); $iT->setFonttype($iTFt); $layoutRow->setAttribute(0, $iT); $layoutTable->addSpacer(0, 15); $layoutTable->addSpacer(1, 2); $layoutTable->addSpacer(0, 15); $layoutRow = $layoutTable->createRow(); $layoutTable->addRow($layoutRow); } $hcItem = new HomeControlItem($row, false); $switchComp = $hcItem->getMobileSwitch(); $layoutRow->setAttribute($currCol, $switchComp); $currCol++; } } return $layoutTable; }