コード例 #1
0
    $alarmgeberDBTbl = new DbTable($_SESSION['config']->DBCONNECT, "homecontrol_alarm_geber", array("name", "ip"), "", "", "name", "");
    $alarmgeberDBTbl->setDeleteInUpdate(true);
    $alarmgeberDBTbl->setHeaderEnabled(true);
    $alarmgeberDBTbl->setToCheck("name", "ip");
    $alarmgeberDBTbl->setWidth("100%");
    // --------------------------------------------------
    //  Neuer Eintrag
    // --------------------------------------------------
    if (isset($_REQUEST['dbTableNew' . $alarmgeberDBTbl->TABLENAME])) {
        $alarmgeberDBTbl->showInsertMask();
    }
    if (isset($_REQUEST['InsertIntoDB' . $alarmgeberDBTbl->TABLENAME]) && $_REQUEST['InsertIntoDB' . $alarmgeberDBTbl->TABLENAME] == "Speichern") {
        $alarmgeberDBTbl->doInsert();
    }
    // --------------------------------------------------
    //  Bearbeiten-Maske
    // --------------------------------------------------
    if (isset($_REQUEST["DbTableUpdate" . $alarmgeberDBTbl->TABLENAME])) {
        $alarmgeberDBTbl->doUpdate();
    }
    $mskUpdate = $alarmgeberDBTbl->getUpdateAllMask();
    $mskUpdate->show();
    $spc = new Spacer();
    $spc->setHeight(10);
    $spc->show();
    if (!isset($_REQUEST['dbTableNew' . $alarmgeberDBTbl->TABLENAME])) {
        $newBtn = $alarmgeberDBTbl->getNewEntryButton("Neuen Alarmgeber anlegen");
        $newBtn->show();
    }
    $spc->show();
}
コード例 #2
0
<?php

doUpdateAlarm();
$t = new Title("Regeln konfigurieren");
$t->setAlign("left");
$t->show();
$spc = new Spacer();
$spc->show();
$regelDbTbl = new HcRegelnDbTable($_SESSION['config']->DBCONNECT, "homecontrol_regeln", array("name", "reverse_switch", "beschreibung"), "Name, Reverse-Switch, Beschreibung", "", "name", "");
$regelDbTbl->setDeleteInUpdate(true);
$regelDbTbl->setNoInsertCols(array("id", "beschreibung"));
$regelDbTbl->setNoUpdateCols(array("id"));
$regelDbTbl->setDefaults("reverse_switch='J'");
$regelDbTbl->setHeaderEnabled(true);
$regelDbTbl->setTexteditorEndabled(false);
$table = new Table(array("", ""));
$table->setColSizes(array(150));
// Neuer Eintrag
if (isset($_REQUEST['InsertIntoDB' . $regelDbTbl->TABLENAME]) && $_REQUEST['InsertIntoDB' . $regelDbTbl->TABLENAME] == "Speichern") {
    $regelDbTbl->doInsert();
    $regelDbTbl->refresh();
} else {
    if (isset($_REQUEST[$regelDbTbl->getNewEntryButtonName()])) {
        $regelDbTbl->setBorder(0);
        $insMsk = $regelDbTbl->getInsertMask();
        $hdnFld = $insMsk->getAttribute(1);
        if ($hdnFld instanceof Hiddenfield) {
            $insMsk->setAttribute(1, new Hiddenfield($regelDbTbl->getNewEntryButtonName(), "-"));
        }
        $rNew = $table->createRow();
        $rNew->setSpawnAll(true);
コード例 #3
0
ファイル: Div.php プロジェクト: CyborgOne/cybihomecontrol_ui
 /**
  * Zeigt das gesamte DIV an
  */
 function show()
 {
     echo "<div ";
     if ($this->XPOS > 0 || $this->YPOS > 0) {
         $tmp = ":absolute; ";
         if ($this->YPOS > 0) {
             $tmp .= " top:" . $this->YPOS . "px; ";
         }
         if ($this->XPOS > 0) {
             $tmp .= " left:" . $this->XPOS . "px; ";
         }
         $this->setStyle("position", $tmp);
     }
     $this->getToolTipTag();
     $this->showStyles();
     echo " > ";
     if ($this->KOPFTEXT_NEED) {
         /*
          * Bei berechtigung, Kopftext bearbeiten.
          */
         if ($_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURRENTUSER->STATUS == "user") {
             if (isset($_REQUEST['changeHeadInfo']) && strlen($_REQUEST['changeHeadInfo']) > 5) {
                 $ktRl = substr($_REQUEST['changeHeadInfo'], 5);
                 $dbtbl = new DbTable($_SESSION['config']->DBCONNECT, "kopftexte", array("text"), "", "", "", "runlink = '" . $ktRl . "' ");
                 if ($dbtbl->getRowCount() == 0) {
                     $dbtblInsert = new DbTable($_SESSION['config']->DBCONNECT, "kopftexte", array("runlink", "parent", "text"), "", "", "", "runlink = '" . $ktRl . "' ");
                     $dbtblInsert->insertRowByArray(array($ktRl, null, ""));
                     $dbtbl->refresh();
                 }
                 if (isset($_REQUEST['DbTableUpdate' . $dbtbl->TABLENAME]) && $_REQUEST['DbTableUpdate' . $dbtbl->TABLENAME] == "Speichern") {
                     $dbtbl->doUpdate();
                 }
                 $frm = $dbtbl->getUpdateAllMask();
                 $frm->add(new Hiddenfield("changeHeadInfo", $_REQUEST['changeHeadInfo']));
                 $frm->show();
             } else {
                 $sp = new Spacer(5);
                 $sp->show();
                 $txKtb = new Text("Kopftext bearbeiten<br>");
                 $txKtb->setFilter(false);
                 $lnk = new Link("?changeHeadInfo=Cnge-" . $_SESSION['runLink'], $txKtb);
                 $lnk->show();
             }
         }
         $tx = new Text(getKopfText());
         $tx->setFilter(false);
         $tx->show();
     }
     if ($this->getObjectCount() > 0) {
         foreach ($this->OBJECTS as $obj) {
             $obj->show();
         }
     }
     //--------------
     include $this->FILE;
     //--------------
     echo "</div>";
 }
コード例 #4
0
<?php

$t = new Title("Sensoren");
$t->show();
$sensorDBTbl = new DbTable($_SESSION['config']->DBCONNECT, "homecontrol_sensor", array("*"), "", "", "etage, zimmer, name", "");
$cnt = 0;
$bgCtr = 1;
foreach ($sensorDBTbl->ROWS as $row) {
    $s = new HomeControlSensor($row);
    if ($cnt == 0) {
        $s->setWithHeader(true);
    }
    $s->setBgId($cnt);
    $s->show();
    $cnt++;
}
$spc = new Spacer();
$spc->show();
コード例 #5
0
 function show()
 {
     $this->checkClearLogAction();
     // Kategorie anzeigen
     if ($this->isShowCategory()) {
         $this->showCategorie();
     }
     $spc = new Spacer();
     $spc->show();
     // Datei-Pfad + Name anzeigen
     $this->showFullName();
     // Beschreibung anzeigen
     if ($this->isShowDescription()) {
         $this->showDescription();
     }
     // Log-Inhalt im Div mit Scrollbar anzeigen
     $this->showLogContent();
     $spc->show();
 }