private function getTypeChooseDialog()
 {
     $sensorWertOption = new Div("createSensorWert", 250, 40);
     $sensorWertOption->setToolTip("Sensoren die einen Messwert liefern<br><br>z.b. <br>- Helligkeitssensor<br>- Temperatursensor<br>- Abstandssensor");
     $sensorStatusOption = new Div("createSensorStatus", 250, 40);
     $sensorStatusOption->setToolTip("Sensoren die nur 1 oder 0 als Wert liefern<br><br>z.b. <br>- Bewegungsmelder<br>- Regensensor<br>- Lichtschranke");
     $zeitOption = new Div("createZeit", 250, 40);
     $wochentagOption = new Div("createWochentag", 250, 40);
     $sensorWertOption->setStyle("line-height", "40px");
     $sensorStatusOption->setStyle("line-height", "40px");
     $zeitOption->setStyle("line-height", "40px");
     $wochentagOption->setStyle("line-height", "40px");
     $sensorWertOption->setAlign("center");
     $sensorWertOption->setVAlign("middle");
     $sensorStatusOption->setAlign("center");
     $sensorStatusOption->setVAlign("middle");
     $zeitOption->setAlign("center");
     $zeitOption->setVAlign("middle");
     $wochentagOption->setAlign("center");
     $wochentagOption->setVAlign("middle");
     $sensorWertOption->add(new Text("Sensor Wert", 4, true));
     $sensorStatusOption->add(new Text("Sensor Status", 4, true));
     $zeitOption->add(new Text("Uhrzeit", 4, true));
     $wochentagOption->add(new Text("Wochentag", 4, true));
     $sensorWertOption->setBackgroundColor($_SESSION['config']->COLORS['button_background']);
     $sensorStatusOption->setBackgroundColor($_SESSION['config']->COLORS['button_background']);
     $zeitOption->setBackgroundColor($_SESSION['config']->COLORS['button_background']);
     $wochentagOption->setBackgroundColor($_SESSION['config']->COLORS['button_background']);
     $sensorWertLink = new Link("?createSensorWert=ok" . ($this->URL_PARAMS != "" ? "&" . $this->URL_PARAMS : "") . "#createSensorWert", $sensorWertOption, false, "", "", true, false);
     $sensorStatusLink = new Link("?createSensorStatus=ok" . ($this->URL_PARAMS != "" ? "&" . $this->URL_PARAMS : "") . "#createSensorStatus", $sensorStatusOption, false, "", "", true, false);
     $zeitLink = new Link("?createZeit=ok" . ($this->URL_PARAMS != "" ? "&" . $this->URL_PARAMS : "") . "#createZeit", $zeitOption, false, "", "", true, false);
     $wochentagLink = new Link("?createWochentag=ok" . ($this->URL_PARAMS != "" ? "&" . $this->URL_PARAMS : "") . "#createWochentag", $wochentagOption, false, "", "", true, false);
     $t = new Table(array("", "", ""));
     $t->setColSizes(array(null, 5, null));
     $t->setAlignments(array("center", "center", "center"));
     $r = $t->createRow();
     $r->setSpawnAll(true);
     $r->setAttribute(0, new Title("Art der neuen Bedingung auswaehlen", true, 4));
     $t->addRow($r);
     $t->addSpacer(0, 5);
     $r1 = $t->createRow();
     $r1->setAttribute(0, $sensorStatusLink);
     $r1->setAttribute(1, "");
     $r1->setAttribute(2, $sensorWertLink);
     $t->addRow($r1);
     $t->addSpacer(0, 5);
     $r2 = $t->createRow();
     $r2->setAttribute(0, $zeitLink);
     $r2->setAttribute(1, "");
     $r2->setAttribute(2, $wochentagLink);
     $t->addRow($r2);
     return $t;
 }
Example #2
0
 function showFullname()
 {
     $fp = new Text($this->getPath(), 3, true);
     $btnDel = new Button("clearLog", "Log leeren");
     $hdnDel = new Hiddenfield("clearLogFile", $this->FULLPATH);
     $frmDel = new Form();
     $tblTtl = new Table(array("", ""));
     $tblTtl->setColSizes(array(null, 100));
     $tblTtl->setAlignments(array("left", "right"));
     $rTtl = $tblTtl->createRow();
     $rTtl->setAttribute(0, $fp);
     $rTtl->setAttribute(1, $btnDel);
     $tblTtl->addRow($rTtl);
     $frmDel->add($tblTtl);
     $frmDel->add($hdnDel);
     $frmDel->show();
 }
 function getMobileSwitch()
 {
     $tbl = new Table(array("", "", "", ""));
     $tbl->setAlignments(array("center", "left", "left", "right"));
     $tbl->setColSizes(array(60, "", 170, 150));
     $tbl->setBorder(0);
     $rowTtl = $tbl->createRow();
     $rowTtl->setVAlign("middle");
     $txtAn = new Text("AN", 7, true);
     $txtAus = new Text("AUS", 7, true);
     $divAn = new Div();
     $divAn->add($txtAn);
     $divAn->setWidth(150);
     $divAn->setHeight(50);
     $divAn->setAlign("center");
     $divAn->setVAlign("middle");
     $divAn->setStyle("line-height", "50px");
     $divAn->setBorder(1);
     $divAn->setBackgroundColor("green");
     $divAus = new Div();
     $divAus->setWidth(150);
     $divAus->setHeight(50);
     $divAus->setAlign("center");
     $divAus->setVAlign("middle");
     $divAus->setStyle("line-height", "50px");
     $divAus->add($txtAus);
     $divAus->setBorder(1);
     $divAus->setBackgroundColor("red");
     $txtName = new Text($this->OBJNAME, 6, true);
     $img = $this->getControlArtIcon(false);
     $lnkAn = new Link("http://" . $this->IP . "?schalte=on", $divAn, false, "arduinoSwitch");
     $lnkAus = new Link("http://" . $this->IP . "?schalte=-" . $this->FUNK_ID, $divAus, false, "arduinoSwitch");
     $rowTtl->setAttribute(0, $img);
     $rowTtl->setAttribute(1, $txtName);
     $rowTtl->setAttribute(2, $lnkAn);
     $rowTtl->setAttribute(3, $lnkAus);
     $tbl->addRow($rowTtl);
     return $tbl;
 }
Example #4
0
<?php

/*
$fTbl = new Table(array("", ""));
$fRow = $fTbl->createRow();

$cntr = new Counter();
$fRow->setAttribute(0, $cntr);

$fTbl->addRow($fRow);
$fTbl->setWidth(940);
$fTbl->show();
*/
// $t = new Text("Arduino URL: ".$_SESSION['config']->PUBLICVARS['arduino_url'], 2, false, true, false);
$versionInfo = "Status-Info";
$t = new Link("http://status.smarthomeyourself.de", $versionInfo, false, "status");
$l = new Link("/?run=logView", "Logs", false);
$versionInfo = "Version: " . file_get_contents('version.txt');
$lVersion = new Link("/versionHistory.txt", $versionInfo, false, "versionHist");
$fTbl = new Table(array("", "", ""));
$fTbl->setAlignments(array("left", "left", "right"));
$fTbl->setColSizes(array("100", "100"));
$fTbl->setWidth($bannerWidth + 15);
$fRow = $fTbl->createRow();
$fRow->setAttribute(0, $t);
$fRow->setAttribute(1, $l);
$fRow->setAttribute(2, $lVersion);
$fTbl->addRow($fRow);
$fTbl->show();
echo "</body>\r\n  \r\n    </html>\r\n  ";
    }
}
$form = new Form();
$updMsk = $regelDbTbl->getUpdateMask();
$form->add($table);
$form->add($updMsk);
$form->add(new Spacer(10));
$form->add($regelDbTbl->getNewEntryButton("Neue Regel anlegen"));
$form->add($spc);
$form->show();
// -------------------------------------------
//                 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);
Example #6
0
 /**
  * Im Unterschied zu getUpdateMask() liefert diese Methode eine Tabelle in der Direkt alle Felder Eingabefelder sind, 
  *  somit kann man direkt mehrere Zeilen auf einmal bearbeiten. 
  */
 function getUpdateAllMask()
 {
     $tNames = array();
     $colNames = array();
     $i = 0;
     foreach ($this->COLNAMES as $colName) {
         if (!$this->isNoUpdateCol($colName)) {
             $lbl = "";
             if ($i < count($this->LABELS)) {
                 $lbl = $this->LABELS[$i];
             } else {
                 $lbl = $colName;
             }
             array_push($tNames, $lbl);
             array_push($colNames, $colName);
         }
         $i++;
     }
     $deleteMask = null;
     if ($this->isDeleteInUpdate()) {
         $deleteMask = !$this->doDeleteFromUpdatemask() ? null : $this->doDeleteFromUpdatemask();
         // Damit die Spalte mit dem Entfernen Button
         // zur Verfügung steht, in Arrays einbinden.
         array_push($colNames, "entfernen");
         array_push($tNames, "entfernen");
     }
     $table = new Table($tNames);
     if (count($this->COLSIZES) > 0) {
         $table->setColSizes($this->COLSIZES);
     }
     $table->setHeadEnabled(true);
     $table->setBackgroundColorChange(true);
     if ($this->WIDTH > 0) {
         $table->setWidth($this->WIDTH);
     }
     if ($this->HEIGHT > 0) {
         $table->setHeight($this->HEIGHT);
     }
     if ($this->BORDER != null && strlen($this->BORDER) > 0) {
         $table->setBorder($this->BORDER);
     }
     if ($this->PADDING >= 0) {
         $table->setPadding($this->PADDING);
     }
     if ($this->HEAD_ENABLED) {
         $table->setHeadEnabled($this->HEAD_ENABLED);
     }
     if ($this->SPACING >= 0) {
         $table->setSpacing($this->SPACING);
     }
     if ($this->XPOS > 0 && $this->YPOS > 0) {
         $table->setXPos($this->XPOS);
         $table->setYPos($this->YPOS);
     }
     //---------------------------------------------------
     // gesamte Tabelle einlesen um Feldtypen zu ermitteln
     //---------------------------------------------------
     $cns = "";
     foreach ($colNames as $cn) {
         if (strpos(" " . $this->COLNAMESTRING, $cn) > 0) {
             $cns .= $cns == "" ? $cn : "," . $cn;
         }
     }
     $stmnt = "SELECT " . $cns . " FROM " . $this->TABLENAME . " LIMIT 1 ";
     $result = $this->DBCONNECT->executeQuery($stmnt);
     //---------------------------------------------------
     // ROWS in Table aufnehmen
     //---------------------------------------------------
     $dbComboArrays = array();
     $bgCtr = 1;
     for ($ir = 1; $ir <= count($this->ROWS); $ir++) {
         $r = $table->createRow();
         $r->setStyle("padding", "5px 5px");
         $rowId = $this->ROWS[$ir]->getAttribute(count($this->COLNAMES));
         $r->setBackgroundColor($_SESSION['config']->COLORS['Tabelle_Hintergrund_' . $bgCtr]);
         if ($bgCtr == 1) {
             $bgCtr = 2;
         } else {
             $bgCtr = 1;
         }
         //---------------------------------------------------
         // SPALTEN aufbauen
         //---------------------------------------------------
         for ($ia = 0; $ia < count($this->COLNAMES); $ia++) {
             $row = $this->ROWS[$ir];
             $t = "";
             $fieldName = mysql_field_name($result, $ia);
             $fieldLen = 30;
             if (!$this->isNoUpdateCol($fieldName)) {
                 $maxLen = mysql_field_len($result, $ia);
                 if ($maxLen < $fieldLen) {
                     $fieldLen = $maxLen;
                 }
                 $lookups = getLookupWerte($_SESSION['config']->DBCONNECT, $this->TABLENAME, $fieldName);
                 if (mysql_num_rows($lookups) > 0) {
                     $t = new LookupCombo($_SESSION['config']->DBCONNECT, $fieldName . $rowId, $this->TABLENAME, $fieldName, $row->getNamedAttribute($fieldName));
                 } else {
                     if ($this->isDbComboSet($this->TABLENAME, $fieldName)) {
                         // Wenn DbCombo definiert wurde wird die Combobox zur Spalte angezeigt
                         //Wenn die Combobox noch nicht erzeugt wurde, erzeugen.
                         if (!isset($dbComboArrays[$this->TABLENAME . $colNames[$ia]])) {
                             $dbComboArrays[$this->TABLENAME . $colNames[$ia]] = getDbComboArray($this->TABLENAME, $colNames[$ia], $this->ROWS[$ir]);
                         }
                         $dbCombo = $dbComboArrays[$this->TABLENAME . $colNames[$ia]];
                         if (count($dbCombo) > 0) {
                             $default = $row->getAttribute($ia);
                             if (!existsKeyInArray($default, $dbCombo)) {
                                 $default = null;
                             }
                             $t = new ComboBox($fieldName . $rowId, $dbCombo, $default);
                         }
                     } else {
                         if (mysql_field_type($result, $ia) == "blob") {
                             $t = new TextArea($fieldName . $rowId, $row->getNamedAttribute($colNames[$ia]), round(70 / count($this->COLNAMES), 0), 4);
                         } else {
                             if (strpos(mysql_field_flags($result, $ia), "enum") > 0) {
                                 $ev = $this->getEnumValues($fieldName);
                                 if (count($ev) == 2 && (in_array('J', $ev) && in_array('N', $ev))) {
                                     $t = new Checkbox($fieldName . $rowId);
                                     if ($row->getNamedAttribute($colNames[$ia]) == "J") {
                                         $t->setSelected(true);
                                     }
                                 } else {
                                     $t = new ComboBox($fieldName . $rowId, $this->getComboboxEnumArray($fieldName));
                                 }
                             } else {
                                 if (mysql_field_type($result, $ia) == "int") {
                                     $t = new TextField($fieldName . $rowId, $row->getNamedAttribute($colNames[$ia]), $fieldLen, $maxLen);
                                 } else {
                                     if (mysql_field_type($result, $ia) == "date") {
                                         //$t = new TextField($fieldName.$rowId,$row->getNamedAttribute($colNames[$ia]),  $tfWidth, mysql_field_len ( $result, $ia ) );
                                         $val = $row->getNamedAttribute($colNames[$ia]);
                                         $t = new DateTextfield($fieldName . $rowId, $val);
                                     } else {
                                         if (mysql_field_type($result, $ia) == "timestamp") {
                                             $t = new TextField($fieldName . $rowId, $row->getNamedAttribute($colNames[$ia]), $fieldLen, $maxLen);
                                         } else {
                                             $t = new TextField($fieldName . $rowId, $row->getNamedAttribute($colNames[$ia]), $fieldLen, $maxLen);
                                         }
                                     }
                                 }
                             }
                         }
                         $arrChk = array_search($fieldName, $this->READONLYCOLS);
                         if (strlen($arrChk) != 0) {
                             $t->setReadOnly(true);
                         }
                     }
                 }
                 // Eingabe-Objekt in Zeile einfügen
                 $r->setAttribute($ia, $t);
             } else {
                 $r->setAttribute($ia, "");
             }
         }
         // entfernen Button einfügen
         if ($this->isDeleteInUpdate()) {
             $btnDel = new Button("delete" . $rowId . $this->TABLENAME, "entfernen");
             $r->setAttribute(count($tNames) - 1, $btnDel);
         }
         $table->addRow($r);
     }
     // Speichern/Abbrechen Button einfügen
     $btnOk = new Button("DbTableUpdate" . $this->TABLENAME, "Speichern");
     $btnOkFake = new Button("DbTableUpdate" . $this->TABLENAME, "Speichern");
     $btnOkFake->setStyle("display", "none");
     $btnOkFake->setWidth(0);
     $btnOkFake->setHeight(0);
     $btnCancel = new Button("", "Abbrechen");
     $hidden = new Hiddenfield("UpdateAllMaskIsActive", "true");
     $form = new Form($_SERVER['SCRIPT_NAME']);
     $form->add($this->DEFAULT_HIDDEN_FIELDS);
     if ($deleteMask != null) {
         $form->add($deleteMask);
     }
     $form->add($btnOkFake);
     $form->add($this->getPageNavigation());
     $form->add($table);
     $form->add($btnOk);
     $form->add($btnCancel);
     $form->add($hidden);
     return $form;
 }
$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("", ""));
$tbl->setColSizes(array(130));
$rTtl = $tbl->createRow();
$rTtl->setSpawnAll(true);
$rTtl->setAttribute(0, $ttl);
$tbl->addRow($rTtl);
$tbl->addSpacer(0, 30);
$rSelect = $tbl->createRow();
$rSelect->setAttribute(0, $txtSelect);
$rSelect->setAttribute(1, $cboSensorSelect);
$tbl->addRow($rSelect);
$tbl->addSpacer(0, 10);
$rTimeSelect = $tbl->createRow();
$rTimeSelect->setSpawnAll(true);
$rTimeSelect->setAttribute(0, $timeSelect);
$tbl->addRow($rTimeSelect);
$tbl->addSpacer(0, 30);
 /**
  * Liefert die Bedingung als Table zurück 
  * incl. Bearbeiten und Löschen Links 
  */
 private function getEditableTermItem()
 {
     $t = new Table(array("name", "edit", "delete"));
     $t->setWidth("99%");
     $t->setColSizes(array(null, 65, 65));
     $t->setAlignments(array("left", "left", "right"));
     $r = $t->createRow();
     $r->setAttribute(0, $this->getDescription());
     $r->setAttribute(1, $this->getEditLink());
     $r->setAttribute(2, $this->getDeleteLink());
     $t->addRow($r);
     return $t;
 }
Example #9
0
 function getRessourceInfoBar()
 {
     if ($this->getUserRow() == null) {
         return new Div();
     }
     $dbTbl = new DbTable($_SESSION['config']->DBCONNECT, "game_ressourcen_art", array("*"), "", "", "", "");
     $tbl = new Table(array("Level", "", "EP", "", "Spacer", "Gold", "", "Erz", "", "Felsen", "", "Holz", "", "Wasser", "", "Nahrung", ""));
     $tbl->setWidth("670");
     $tbl->setColSizes(array(16, 30, 16, 40, 10, 13, 80, 13, 80, 13, 80, 13, 80, 13, 80, 13, 80));
     $tbl->setAlign("left");
     $r = $tbl->createRow();
     $r->setAttribute(0, "Level: ");
     $r->setAttribute(1, $this->getLevel());
     $r->setAttribute(2, "EP: ");
     $r->setAttribute(3, $this->getEP());
     $r->setAttribute(4, "");
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Gold"));
     $gTx = new Text($this->getGold());
     $gTx->setToolTip("Gold");
     $gImg = $ress->getRessourceImage();
     $gImg->setWidth(10);
     $gImg->setHeight(10);
     $gImg->setToolTip("Gold");
     $r->setAttribute(5, $gImg);
     $r->setAttribute(6, $gTx);
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Erz"));
     $eTx = new Text($this->getErz());
     $eTx->setToolTip("Felsen");
     $eImg = $ress->getRessourceImage();
     $eImg->setWidth(10);
     $eImg->setHeight(10);
     $eImg->setToolTip("Erz");
     $r->setAttribute(7, $eImg);
     $r->setAttribute(8, $eTx);
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Felsen"));
     $fTx = new Text($this->getFelsen());
     $fTx->setToolTip("Felsen");
     $fImg = $ress->getRessourceImage();
     $fImg->setWidth(10);
     $fImg->setHeight(10);
     $fImg->setToolTip("Felsen");
     $r->setAttribute(9, $fImg);
     $r->setAttribute(10, $fTx);
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Holz"));
     $hTx = new Text($this->getHolz());
     $hTx->setToolTip("Holz");
     $hImg = $ress->getRessourceImage();
     $hImg->setWidth(10);
     $hImg->setHeight(10);
     $hImg->setToolTip("Holz");
     $r->setAttribute(11, $hImg);
     $r->setAttribute(12, $hTx);
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Wasser"));
     $wTx = new Text($this->getWasser());
     $wTx->setToolTip("Wasser");
     $wImg = $ress->getRessourceImage();
     $wImg->setWidth(10);
     $wImg->setHeight(10);
     $wImg->setToolTip("Wasser");
     $r->setAttribute(13, $wImg);
     $r->setAttribute(14, $wTx);
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Nahrung"));
     $nTx = new Text($this->getNahrung());
     $nTx->setToolTip("Nahrung");
     $nImg = $ress->getRessourceImage();
     $nImg->setWidth(10);
     $nImg->setHeight(10);
     $nImg->setToolTip("Nahrung");
     $r->setAttribute(15, $nImg);
     $r->setAttribute(16, $nTx);
     $tbl->addRow($r);
     return $tbl;
 }
Example #10
0
    $spcr->setWidth(0);
    $spcr->setHeight($mainHeight);
    $tbl = new Table(array("", "", ""));
    $tbl->setBorder(0);
    $tbl->setColSizes(array($mainWidth, "1"));
    $tbl->setBackgroundColor($_SESSION['config']->COLORS['Tabelle_Hintergrund_1']);
    $rMain = $tbl->createRow();
    $rMain->setAttribute(0, $cont);
    $rMain->setAttribute(1, $spcr);
    $rMain->setAttribute(2, $cont2);
    $tbl->addRow($rMain);
    $MainPanel->add($tbl);
} else {
    $tbl = new Table(array(""));
    $tbl->setBorder(0);
    $tbl->setColSizes(array($mainWidth));
    $tbl->setBackgroundColor($_SESSION['config']->COLORS['Tabelle_Hintergrund_1']);
    $rMain = $tbl->createRow();
    $rMain->setAttribute(0, $cont);
    $tbl->addRow($rMain);
    $MainPanel->add($tbl);
}
$contentLayoutRow = $layoutTable->createRow();
$contentLayoutRow->setAttribute(0, $MainPanel);
$layoutTable->addRow($contentLayoutRow);
/* --------------------------------- */
/* ------------------------------------
FUSS-MENU 
------------------------------------ */
$footMenuDiv = new Div();
$footMenuDiv->setWidth($bannerWidth);
 function show()
 {
     if ($this->isIconViewActive()) {
         $this->showAsIcon();
         return;
     }
     $active = true;
     if (time() - 24 * 60 * 60 * 1000 > $this->LASTSIGNAL) {
         $active = false;
     }
     $tbl = new Table(array("Name", "ID", "letztes Signal", "letzter Wert"));
     $tbl->setBackgroundColorChange(false);
     $tbl->setHeadEnabled($this->isWithHeader());
     $tbl->setColSizes(array(null, 100, 150, 120));
     $tbl->setStyle("padding-left", "5px");
     $tbl->setStyle("padding-right", "25px");
     $tbl->setStyle("padding-top", "5px");
     $tbl->setStyle("padding-bottom", "5px");
     $tbl->setBackgroundColor($_SESSION['config']->COLORS['Tabelle_Hintergrund_' . ($this->BGID % 2 == 0 ? "1" : "2")]);
     $r = $tbl->createRow();
     $r->setAlignments(array("left", "left", "left", "right"));
     $r->setAttribute(0, new Text($this->SENSORNAME, 3));
     $r->setAttribute(1, new Text($this->ID, 3));
     $r->setAttribute(2, $active ? new Text(date("D d.m.Y H:i:s", $this->LASTSIGNAL), 3) : "-");
     $r->setAttribute(3, $active ? new Text($this->LASTVALUE, 3) : "-");
     $tbl->addRow($r);
     $tbl->show();
 }
Example #12
0
 function show()
 {
     //Wenn notwendig Eingabemaske, ansonsten Standard-Anzeige
     if (!$this->showInsertMaskIfNeeded()) {
         $rowsToShow = $this->getRowsToShow();
         //Tabelle für gesamte NEWS
         $tbl = new Table(array("News"));
         $tbl->setHeadEnabled(false);
         $tbl->setBorder(0);
         foreach ($rowsToShow as $row) {
             $tt = new Text($row['Text']);
             $tt->setFilter(false);
             $ta = new Text($row['Autor']);
             $tblxTitle = new Table(array("", ""));
             $tblxTitle->setColSizes(array("50"));
             $tblxTitle->setAlign("left");
             $rxtitle = $tblxTitle->createRow();
             $t0 = new Title(getFormatedDate($row['Datum'], "standard") . ":");
             $t0->setWidth(20);
             $rxtitle->setAttribute(0, $t0);
             $t1 = new Title($row['Title']);
             $rxtitle->setAttribute(1, $t1);
             $rxtitle->setAlign("left");
             $tblxTitle->addRow($rxtitle);
             //Tabelle für den jeweiligen Eintrag
             $tblx = new Table(array(""));
             if (strlen($row['pic']) > 0) {
                 $tblx = new Table(array("", ""));
                 $tblx->setColSizes(array("180"));
             }
             $tblx->setBorder($this->CONFIG->GB_CONFIG['border']);
             $tblx->setWidth("100%");
             //TEXT
             $rx = $tblx->createRow();
             if (strlen($row['pic']) > 0 && !(isset($_REQUEST['removeNewsPicId']) && $_REQUEST['removeNewsPicId'] == $row['id'])) {
                 $img = new Image($row['pic']);
                 $img->setWidth(175);
                 $rx->setAttribute(0, $img);
                 $rx->setAttribute(1, $tt);
             } else {
                 $rx->setAttribute(0, $tt);
             }
             $rx->setAlign("left");
             $tblx->addRow($rx);
             $f = new FontType();
             $rx->setFonttypes(array(0 => $f));
             $f = new FontType();
             $f->setFontsize(1);
             $f->setItalic(false);
             $rx->setFonttypes(array(0 => $f));
             $r = $tbl->createRow();
             $r->setAttribute(0, $tblxTitle);
             $tbl->addRow($r);
             $r1 = $tbl->createRow();
             $r1->setAttribute(0, $tblx);
             $tbl->addRow($r1);
             $ytElem = new YouTubeElement($row['yt_video'], "news", "yt_video", $row['id']);
             $r1 = $tbl->createRow();
             $r1->setAttribute(0, $ytElem);
             $tbl->addRow($r1);
             $tbl->addSpacer(0, 7);
             if ($_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURRENTUSER->STATUS == "user") {
                 $r2 = $tbl->createRow();
                 $xDv = new Div();
                 $xDv->setWidth(450);
                 $xDv->setHeight(40);
                 $txChngePic = new Text("Bild Hochladen/Ändern<br>");
                 $txChngePic->setFilter(false);
                 $newPicLink = new Link("?popupRunLink=imageUploaderPopup&targetPath=pics/news&DbInsertTable=news&DbInsertCol=pic&DbInsertId=" . $row['id'] . "&stayAlive=ok", $txChngePic);
                 $txRemPic = new Text("Bild Entfernen<br>");
                 $txRemPic->setFilter(false);
                 $removePicLink = new Link("?removeNewsPicId=" . $row['id'] . "", $txRemPic);
                 $spTx = new Text("&nbsp;&nbsp;&nbsp;");
                 $spTx->setFilter(false);
                 $xDv->add($newPicLink);
                 if (strlen($row['pic']) > 0) {
                     if (isset($_REQUEST['removeNewsPicId']) && $_REQUEST['removeNewsPicId'] == $row['id']) {
                         $sql = "UPDATE news SET pic = null WHERE id = " . $_REQUEST['removeNewsPicId'];
                         $_SESSION['config']->DBCONNECT->executeQuery($sql);
                     } else {
                         $xDv->add($removePicLink);
                     }
                 }
                 $newPicLink->setPopup(true);
                 $r2->setAttribute(0, $xDv);
                 $tbl->addRow($r2);
             }
             $tbl->addSpacer(0, 35);
         }
         if ($_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURRENTUSER->STATUS == "user") {
             // Neuer Eintrag- BUTTON
             //--------------------------------
             $insertButton = new Button('dbTableNew', 'News eintragen');
             $form = new Form($_SERVER['SCRIPT_NAME']);
             $form->add($insertButton);
             $form->show();
         }
         // Tabelle anzeigen
         //--------------------------------
         $tbl->show();
         if ($_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURRENTUSER->STATUS == "user" && $tbl->getRowcount() > 2) {
             // Neuer Eintrag- BUTTON
             //--------------------------------
             $insertButton = new Button('dbTableNew', 'News eintragen');
             $form = new Form($_SERVER['SCRIPT_NAME']);
             $form->add($insertButton);
             $form->show();
         }
     }
 }
 function getMobileSwitch()
 {
     $tbl = new Table(array("", "", "", "", ""));
     $tbl->setAlignments(array("center", "left", "left", "left", "right"));
     $tbl->setColSizes(array(60, "", 100, 160, 150));
     $tbl->setBorder(0);
     $rowTtl = $tbl->createRow();
     $rowTtl->setVAlign("middle");
     $txtAn = new Text("AN", 7, true);
     $txtAus = new Text("AUS", 7, true);
     switch ($this->ART) {
         case 1:
             // Steckdosen
         // Steckdosen
         case 3:
             // Glühbirne
             $txtAn = new Text("AN", 7, true);
             $txtAus = new Text("AUS", 7, true);
             break;
         case 2:
             // Jalousien
             $txtAn = new Text("AUF", 7, true);
             $txtAus = new Text("ZU", 7, true);
             break;
         case 4:
             // Heizung
             $txtAn = new Text("WARM", 7, true);
             $txtAus = new Text("KALT", 7, true);
             break;
         default:
             $txtAn = new Text("AN", 7, true);
             $txtAus = new Text("AUS", 7, true);
     }
     $divAn = new Div();
     $divAn->add($txtAn);
     $divAn->setWidth(150);
     $divAn->setHeight(50);
     $divAn->setAlign("center");
     $divAn->setVAlign("middle");
     $divAn->setStyle("line-height", "50px");
     $divAn->setBorder(1);
     $divAn->setBackgroundColor("green");
     $divAn->setOverflow("hidden");
     $divAus = new Div();
     $divAus->setWidth(150);
     $divAus->setHeight(50);
     $divAus->setAlign("center");
     $divAus->setVAlign("middle");
     $divAus->setStyle("line-height", "50px");
     $divAus->add($txtAus);
     $divAus->setBorder(1);
     $divAus->setBackgroundColor("red");
     $divAus->setOverflow("hidden");
     $txtName = new Text($this->OBJNAME, 6, true);
     $img = $this->getControlArtIcon(false);
     $lnkAn = new Link("?switchShortcut=" . $this->FUNK_ID . "-on", $divAn, false, "arduinoSwitch");
     $lnkAus = new Link("?switchShortcut=" . $this->FUNK_ID . "-off", $divAus, false, "arduinoSwitch");
     $fDimmLvl = "";
     if ($this->isDimmable()) {
         $fDimmLvl = new Form();
         $cobDimmLvl = new Combobox("dimmer", getNumberComboArray(1, 16), "", " ");
         $cobDimmLvl->setDirectSelect(true);
         $cobDimmLvl->setStyle("font-size", "40px");
         $fDimmLvl->add($cobDimmLvl);
         $fDimmLvl->add(new Hiddenfield("schalte", $this->FUNK_ID));
     }
     $rowTtl->setAttribute(0, $img);
     $rowTtl->setAttribute(1, $txtName);
     $rowTtl->setAttribute(2, $fDimmLvl);
     $rowTtl->setAttribute(3, $lnkAn);
     $rowTtl->setAttribute(4, $lnkAus);
     $tbl->addRow($rowTtl);
     return $tbl;
 }
Example #14
0
 /**
  * show-Methode für TYPE = default
  */
 function showNormalMenu()
 {
     $tbl = new Table(array(""));
     if (!(get_class($this->SPACER) == "Text" && $this->SPACER->getText() == "&nbsp|&nbsp;")) {
         $tbl = new Table(array("", ""));
         $tbl->setColSizes(array("27"));
     }
     $tbl->setHeadEnabled(false);
     if (strlen($this->getAlign()) > 0) {
         $tbl->setAlign($this->getAlign());
     }
     $tbl->setXPos($this->XPOS);
     $tbl->setYPos($this->YPOS);
     $tbl->setBorder($this->BORDER);
     $userStatus = $this->CONFIG->CURRENTUSER->STATUS;
     $menuArray = $this->MENUTABLE->getMenuByStatus($userStatus);
     $r = array();
     $txt = array();
     $lSpacer = "";
     while ($row = mysql_fetch_array($menuArray)) {
         if ($row['id'] > 0) {
             $rcnt = count($r);
             if (!(get_class($this->SPACER) == "Text" && $this->SPACER->getText() == "&nbsp|&nbsp;")) {
                 // Spacer ( | oder übergebener Spacer )
                 $lnk = $row['link'];
                 if (strlen($row['parent']) > 0 && !strpos($lnk, "menuParent")) {
                     $lnk .= "&menuParent=" . $row['parent'];
                 }
                 $lSpacer = new Link($lnk, $this->SPACER, false, $row['target']);
                 //$lSpacer->setToolTip($row['tooltip']);
             }
             $txt[$rcnt] = new Text($row['text']);
             $txt[$rcnt]->setFonttype($this->getFonttype());
             $lnk = $row['link'];
             if (strlen($row['parent']) > 0 && !strpos($lnk, "menuParent")) {
                 $lnk .= "&menuParent=" . $row['parent'];
             }
             $l = new Link($lnk, $txt[$rcnt], false, $row['target']);
             $l->setStyleclass("menulink");
             // $l->setToolTip($row['tooltip']);
             $r[$rcnt] = $tbl->createRow();
             $r[$rcnt]->setVAlign("middle");
             if (!(get_class($this->SPACER) == "Text" && $this->SPACER->getText() == "&nbsp|&nbsp;")) {
                 $r[$rcnt]->setAttribute(0, $lSpacer);
                 $r[$rcnt]->setAttribute(1, $l);
             } else {
                 $r[$rcnt]->setAttribute(0, $l);
             }
             $tbl->addRow($r[$rcnt]);
             $ftx = $txt[$rcnt]->getFonttype();
             if ($row['name'] == $_SESSION['MENU_PARENT'] || $row['name'] == $this->getLabelByRunlink($_SESSION['runLink'], $_SESSION['MENU_PARENT'])) {
                 $ftx->setColor($_SESSION['config']->COLORS['hover']);
                 #
                 $ftx->setBold(true);
             } else {
                 $ftx->setBold(false);
             }
             $txt[$rcnt]->setFonttype($ftx);
         }
         $tbl->addSpacer(0, 2);
     }
     $tbl->show();
 }