Пример #1
0
 function addDefaultHeaderToTable()
 {
     if (count($this->COLNAMES) >= 0 && $this->HEADER_ENABLED && isset($this->COLNAMES[0]) && strlen($this->COLNAMES[0]) > 0) {
         $rX = $this->getRow(0);
         if (!($rX != null && $rX->getAttribute(0) instanceof Title && $rX->getAttribute(0)->getText() == $this->COLNAMES[0])) {
             $rH = $this->createRow();
             for ($i = 0; $i < count($this->COLNAMES); $i++) {
                 $t = new Title($this->COLNAMES[$i]);
                 $t->setAlign("left");
                 $rH->setAttribute($i, $t);
             }
             $this->addRow($rH);
         }
     }
 }
 <?php 
$tblMain = new Table(array("", ""));
$t2 = new Title("Benutzer-Einstellungen");
$t2->setAlign("left");
$rMainT1 = $tblMain->createRow();
$rMainT1->setSpawnAll(true);
$rMainT1->setAttribute(0, $t2);
$tblMain->addRow($rMainT1);
$dbTblBenutzer = new DbTable($_SESSION['config']->DBCONNECT, 'user', array("Vorname", "Nachname", "User", "Status", "aktiv", "Pw"), "Vorname, Nachname, Benutzername, Status, Aktiv?, Passwort", "", "Nachname, Vorname");
$dbTblBenutzer->setHeaderEnabled(true);
$dbTblBenutzer->setDeleteInUpdate(true);
$dbTblBenutzer->setInvisibleCols(array("Pw"));
$dbTblBenutzer->setNoUpdateCols(array("Pw"));
$dbTblBenutzer->setColSizes(array("200", "40", "60", "90", "50", "50"));
$deleteMask = null;
if ($dbTblBenutzer->isDeleteInUpdate()) {
    $deleteMask = !$dbTblBenutzer->doDeleteFromUpdatemask() ? null : $dbTblBenutzer->doDeleteFromUpdatemask();
}
if ($deleteMask != null) {
    $rDel = $tblMain->createRow();
    $rDel->setAttribute(0, $deleteMask);
    $rDel->setSpawnAll(true);
    $tblMain->addRow($rDel);
}
$newBenutzerBtn = new Text("");
// Neuer Eintrag
if (isset($_REQUEST['InsertIntoDBuser']) && $_REQUEST['InsertIntoDBuser'] == "Speichern") {
    if (isset($_REQUEST['Pw']) && strlen($_REQUEST['Pw']) > 0) {
        $_REQUEST['Pw'] = md5($_REQUEST['Pw']);
    }
    $dbTblBenutzer->doInsert();
<?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);
Пример #4
0
if ($_SESSION['config']->CURRENTUSER->STATUS != "admin" && $_SESSION['config']->CURRENTUSER->STATUS != "user") {
    /* ------------------------------------
       BENUTZERSTATUS ANZEIGEN
       ------------------------------------ */
    $USR = $_SESSION['config']->CURRENTUSER;
    $USERSTATUS = new UserStatus($USR, -1, -1);
    $tbl = new Table(array(""));
    $tbl->setAlign("center");
    $r = $tbl->createRow();
    $r->setAttribute(0, $USERSTATUS);
    $tbl->addRow($r);
    $tbl->show();
    /* --------------------------------- */
} else {
    $ttlC = new Title("Zeitsteuerung");
    $ttlC->setAlign("left");
    $ttlC->show();
    $spc = new Spacer(20);
    $ln = new Line();
    $scDbTable = new CronDbTable($_SESSION['config']->DBCONNECT, 'homecontrol_cron', array("name", "montag", "dienstag", "mittwoch", "donnerstag", "freitag", "samstag", "sonntag", "stunde", "minute"), "Name,  Mo, Di, Mi, Do, Fr, Sa, So, Std, Min", "", "montag, dienstag, mittwoch, donnerstag, freitag, samstag, sonntag, stunde, minute", "");
    $scDbTable->setDeleteInUpdate(true);
    $scDbTable->setHeaderEnabled(true);
    $scDbTable->setWidth("100%");
    $spc->show();
    $scDbTable->setBorder(0);
    // --------------------------------------------------
    //  Neuer Eintrag
    // --------------------------------------------------
    if (isset($_REQUEST['dbTableNewhomecontrol_cron']) || isset($_REQUEST['InsertIntoDBhomecontrol_cron']) && $_REQUEST['InsertIntoDBhomecontrol_cron'] == "Speichern") {
        $scDbTable->showInsertMask();
    }
<?php

$ttl = new Title("Netzwerk-Einstellungen");
$ttl->setAlign("left");
$ttl->show();
$spc = new Spacer(10);
$spc->show();
$netConfigEditor = new NetworksettingsEditor();
$netConfigEditor->show();
 $newBtn = $scDbTable->getNewEntryButton();
 $newBtn->show();
 $spc->show();
 $ln->show();
 $spc->setHeight(20);
 $spc->show();
 // --------------------------------------------------
 //  Zuordnungen
 // --------------------------------------------------
 if (isset($_REQUEST['SelectedShortcutToEdit'])) {
     $_SESSION['SelectedShortcutToEdit'] = $_REQUEST['SelectedShortcutToEdit'];
 }
 $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_shortcut ORDER BY name", "SelectedShortcutToEdit", isset($_SESSION['SelectedShortcutToEdit']) ? $_SESSION['SelectedShortcutToEdit'] : "", "id", "name", " ");
 $cobSelect->setDirectSelect(true);
 $rAuswahl = $table->createRow();
 $rAuswahl->setColSizes(array(150));
 $rAuswahl->setAttribute(0, new Text("Shortcut auswaehlen: "));
 $rAuswahl->setAttribute(1, $cobSelect);
 $table->addRow($rAuswahl);
 $table->addSpacer(0, 20);
 $form = new Form();
 // Zuordnung ausgewählt
Пример #7
0
 $t2 = new Title("Anwesenheits-Einstellungen");
 $t2->setAlign("left");
 $rMainT1 = $tblMain->createRow();
 $rMainT1->setSpawnAll(true);
 $rMainT1->setAttribute(0, $t2);
 $tblMain->addRow($rMainT1);
 $tblMain->addSpacer(0, 10);
 $rMain0 = $tblMain->createRow();
 $rMain0->setAttribute(0, $chbAnwesendMotion);
 $rMain0->setAttribute(1, "");
 $tblMain->addRow($rMain0);
 $tblMain->addSpacer(0, 20);
 $tblMain->addSpacer(1, 15);
 $tblMain->addSpacer(0, 20);
 $t3 = new Title("Abwesenheits-Einstellungen");
 $t3->setAlign("left");
 $rMainT2 = $tblMain->createRow();
 $rMainT2->setSpawnAll(true);
 $rMainT2->setAttribute(0, $t3);
 $tblMain->addRow($rMainT2);
 $tblMain->addSpacer(0, 10);
 $rMain1 = $tblMain->createRow();
 $rMain1->setAttribute(0, $chbAbwesendAlarm);
 $rMain1->setAttribute(1, $chbAbwesendSimulation);
 $tblMain->addRow($rMain1);
 $rMain2 = $tblMain->createRow();
 $rMain2->setAttribute(0, $chbAbwesendMotion);
 $rMain2->setAttribute(1, "");
 $tblMain->addRow($rMain2);
 $tblMain->addSpacer(0, 25);
 $rMainOk = $tblMain->createRow();
<?php

$tblMain = new Table(array("", ""));
$tS = new Title("Sonstige Einstellungen");
$tS->setAlign("left");
$rMainTs = $tblMain->createRow();
$rMainTs->setSpawnAll(true);
$rMainTs->setAttribute(0, $tS);
$tblMain->addRow($rMainTs);
$tblMain->addSpacer(0, 10);
$dvMotion = new Table(array("", ""));
$fMotion = new Form();
// Dienst aktiv?
//echo exec("sudo pgrep -x motion", $output, $return);
//echo "/";
//print_r($output);
//echo"/".$return."/";
//echo "Ok, Motion-Detection-Process ist gestartet\n";
$fMotion->add(new Hiddenfield("Motion", isset($return) && $return == 0 ? "off" : "on"));
$fMotion->add(new Button("ok", "Bewegungserkennung der Kamera " . (isset($return) && $return == 0 ? "deaktivieren" : "aktivieren")));
$rMotion = $tblMain->createRow();
$rMotion->setSpawnAll(true);
$rMotion->setAttribute(0, $fMotion);
$tblMain->addRow($rMotion);
$tblMain->addSpacer(0, 10);
$fNoFrame = new Form();
$fNoFrame->add(new Hiddenfield("noFrame", $noFrameExists ? "off" : "on"));
$fNoFrame->add(new Button("ok", "Banner auf dieser IP " . ($noFrameExists ? "einblenden" : "ausblenden")));
$rNoFrame = $tblMain->createRow();
$rNoFrame->setSpawnAll(true);
$rNoFrame->setAttribute(0, $fNoFrame);