function doDeleteFromUpdatemask() { //generelle Delete bearbeitung //Zugeschnitten auf dynamische UpdateMaske (showUpdateMask) $ret = false; for ($ir = 1; $ir <= count($this->ROWS); $ir++) { $rowId = $this->ROWS[$ir]->getAttribute(count($this->COLNAMES)); $delName = "delete" . $rowId . $this->TABLENAME; if (isset($_REQUEST[$delName])) { if (isset($_REQUEST['RowDeleteCommited']) && $_REQUEST['RowDeleteCommited'] == "Wirklich entfernen") { $rowId = $this->ROWS[$ir]->getAttribute(count($this->COLNAMES)); $chk = 0; $sql = ""; $row = $this->ROWS[$ir]; // Wenn Zeile gelöscht werden soll $statement = "DELETE FROM " . $this->TABLENAME . " WHERE id = " . $rowId . " "; $result = $this->DBCONNECT->executeQuery($statement); $e = new Message("entfernen", "Entfernen erfolgreich "); $this->refresh(); $ret = true; $this->postDelete($rowId); } else { $tbl = new Table($this->COLNAMES); $dataRow = $this->getRowById($this->ROWS[$ir]->getNamedAttribute("id")); $tbl->setStyle("background-color", "#ee9999"); $tbl->setStyle("padding", "5px"); $r1 = $tbl->createRow(); $r1->setSpawnAll(true); $txt = new Text("Wollen Sie den folgenden Datensatz wirklich entfernen?"); $r1->setAttribute(0, $txt); $tbl->addRow($r1); $tbl->addSpacer(1, 8); $r = $tbl->createRow(); $c = 0; foreach ($this->COLNAMES as $colname) { $r->setAttribute($c, new Title($colname)); $c++; } $tbl->addRow($r); $r = $tbl->createRow(); $c = 0; foreach ($this->COLNAMES as $colname) { $r->setAttribute($c, new Text($this->ROWS[$ir]->getNamedAttribute($colname))); $c++; } $tbl->addRow($r); $tbl->addSpacer(1, 5); $rbtn = $tbl->createRow(); $rbtn->setSpawnAll(true); $btnOk = new Button("RowDeleteCommited", "Wirklich entfernen"); $btnCancle = new Button("Abbrechen", "Abbrechen", "location='" . $_SERVER['SCRIPT_NAME'] . "'"); $div = new Div(); $div->add($btnOk); $div->add($btnCancle); $rbtn->setAttribute(0, $div); $tbl->addRow($rbtn); $hiddenOk = new Hiddenfield($delName, $_REQUEST[$delName]); //$frm = new Form($_SERVER['SCRIPT_NAME']); $frm = new Div(); $frm->add($tbl); $frm->add($hiddenOk); $frm->add($this->DEFAULT_HIDDEN_FIELDS); return $frm; } } } return $ret; }
/** * @param OutputInterface $output * @param array $content * @param array $headers */ protected function buildTable(OutputInterface $output, $content, $headers) { $tablePW = new Table($output); $tablePW->setStyle('borderless')->setHeaders($headers)->setRows($content); return $tablePW; }
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(); }
function getSwitchButtons() { $tbl = new Table(array("", "", "")); $tbl->setStyle("position", "relative"); $tbl->setStyle("left", "-17px"); $tbl->setStyle("top", "-20px"); $tbl->setAlignments(array("left", "right")); $tbl->setColSizes(array(40, 5, 40)); $tbl->setBorder(0); $rowTtl = $tbl->createRow(); $rowTtl->setVAlign("middle"); $txtAn = null; $txtAus = null; switch ($this->ART) { case 1: // Steckdosen // Steckdosen case 3: // Glühbirne $txtAn = new Text("AN", 3, true); $txtAus = new Text("AUS", 3, true); break; case 2: // Jalousien $txtAn = new Text("AUF", 3, true); $txtAus = new Text("ZU", 3, true); break; case 4: // Heizung $txtAn = new Text("WARM", 3, true); $txtAus = new Text("KALT", 3, true); break; default: $txtAn = new Text("AN", 3, true); $txtAus = new Text("AUS", 3, true); } $divAn = new Div(); $divAn->add($txtAn); $divAn->setWidth(35); $divAn->setHeight(20); $divAn->setAlign("center"); $divAn->setVAlign("middle"); $divAn->setStyle("line-height", "20px"); $divAn->setBorder(1); $divAn->setBackgroundColor("green"); $divAn->setOverflow("hidden"); $divAus = new Div(); $divAus->setWidth(35); $divAus->setHeight(20); $divAus->setAlign("center"); $divAus->setVAlign("middle"); $divAus->setStyle("line-height", "20px"); $divAus->add($txtAus); $divAus->setBorder(1); $divAus->setBackgroundColor("red"); $divAus->setOverflow("hidden"); $lnkAn = new Link("?switchShortcut=" . $this->FUNK_ID . "-on", $divAn, false, "arduinoSwitch"); $lnkAus = new Link("?switchShortcut=" . $this->FUNK_ID . "-off", $divAus, false, "arduinoSwitch"); $rowTtl->setAttribute(0, $lnkAn); $rowTtl->setAttribute(1, " "); $rowTtl->setAttribute(2, $lnkAus); $tbl->addRow($rowTtl); return $tbl; }
<?php /** * @filename layout_mobile.php * @author Daniel Scheidler * @copyright November 2012 */ $_SESSION['additionalLayoutHeight'] = 215; $layoutTable = new Table(array("")); $layoutTable->setWidth("100%"); $layoutTable->setBORDER(0); $layoutTable->setBackgroundColor($_SESSION['config']->COLORS['panel_background']); $layoutTable->setSpacing(0); $layoutTable->setPadding(0); $layoutTable->setStyle("padding", "0px 12px"); /* ------------------------------------ BANNER ------------------------------------ */ $banner = new Image("pics/Banner.png", -1, -1, 800); $banner->setGenerated(false); $contentLayoutRow1 = $layoutTable->createRow(); $contentLayoutRow1->setAlign("left"); $contentLayoutRow1->setAttribute(0, $banner); $layoutTable->addRow($contentLayoutRow1); /* ------------------------------------ HAUPT-MENU ------------------------------------ */ $menuDiv = new Div(); $menuDiv->setWidth("99%"); $menuDiv->setBorder(0); $menuDiv->setOverflow("hidden");
function getMap($dbTable) { $dv = new Div(); $bgTbl = new Table(array("")); $bgTbl->setOnClick("Coords()"); $bgTbl->setWidth("600"); $bgTbl->setHeight("340"); $bgTbl->setStyle("background-image", "url(" . $this->getEtagenImagePath() . ")"); $rowImg = $bgTbl->createRow(); // $img = $this->getEtagenImage(); $rowImg->setAttribute(0, " "); $rowImg->setPadding("4px"); $bgTbl->addRow($rowImg); $dv->add($bgTbl); for ($i = 1; $i <= $dbTable->getRowCount(); $i++) { $currConfigRow = $dbTable->getRow($i); $ctrlItem = new HomeControlItem($currConfigRow, $this->EDITMODE); $dv->add($ctrlItem); } return $dv; }
/** * show-Methode fÃÂÃÂÃÂür TYPE = horizontalbutton */ function showHorizontalButtonMenu() { $userStatus = $this->CONFIG->CURRENTUSER->STATUS; $menuArray = $this->MENUTABLE->getMenuByStatus($userStatus); $count = 0; $c = $this->MENUTABLE->getRowCountByStatus(); $colArr = array(""); //[0] wird hier schon initialisiert! for ($i = 1; $i < $c; $i++) { $colArr[$i] = ""; } $table = new Table($colArr); $table->setStyle("text-align", "center"); $table->setStyle("vertical-align", "middle"); $tblrow = $table->createRow(); $tblrow->setStyle("vertical-align", "middle"); $tblrow->setHeight($this->getHeight()); while ($row = mysql_fetch_array($menuArray)) { if ($row['id'] > 0) { $btn = new HorizontalMenuButton($row['link'], $row['text']); $tblrow->setAttribute($count, $btn); $count++; } } $table->addRow($tblrow); $table->setHeight($this->getHeight()); $table->show(); }