// ---------------- // echo " <div id=\"aSelect\">\n"; echo " <form name='navigation' method='get'>\n"; echo " <center>Zeitraum der Charts<br/></center>\n"; echo datePicker("Start", "s", $year, $day, $month); echo " <select name=\"range\">\n"; echo " <option value='1' " . ($range == 1 ? "SELECTED" : "") . ">Tag</option>\n"; echo " <option value='7' " . ($range == 7 ? "SELECTED" : "") . ">Woche</option>\n"; echo " <option value='31' " . ($range == 31 ? "SELECTED" : "") . ">Monat</option>\n"; echo " </select>\n"; echo " <input type=submit value=\"Go\">"; echo " </form>\n"; echo " </div>\n"; $from = date_create_from_format('!Y-m-d', $year . '-' . $month . '-' . $day)->getTimestamp(); seperator("Messwerte vom " . $maxPretty, 290); // ------------------ // table echo " <div>\n"; echo " <table class=\"table\" cellspacing=0 rules=rows style=\"position:absolute; top:330px;\">\n"; echo " <tr class=\"tableHead1\">\n"; if ($debug) { echo " <td>Id</td>\n"; echo " <td>Typ</td>\n"; } echo " <td>Sensor</td>\n"; echo " <td>Wert</td>\n"; echo " </tr>\n"; $strQuery = sprintf("select s.address as s_address, s.type as s_type, s.time as s_time, s.value as s_value, s.text as s_text, f.title as f_title, f.unit as f_unit \n from samples s, valuefacts f where f.state = 'A' and f.address = s.address and f.type = s.type and s.time = '%s';", $max); $result = mysql_query($strQuery) or die("Error" . mysql_error()); $i = 0;
} seperator("Login", 0, 2); configStrItem(1, "User", "user", $_SESSION['user'], "", 400); configStrItem(6, "Passwort", "passwd1", "", "", 350, "", true); seperator("Daemon Konfiguration", 0, 1); seperator("Mail Benachrichtigungen", 0, 2); $a = $_SESSION['mail'] ? "" : "disabled=true"; $ro = $_SESSION['mail'] ? "'" : "; background-color:#ddd;' readOnly=\"true\""; configBoolItem(1, "Mail Benachrichtigung", "mail onClick=\"disableContent('htM',this); readonlyContent('Mail',this)\"", $_SESSION['mail'], "Mail Benachrichtigungen aktivieren/deaktivieren"); configBoolItem(5, "HTML-Mail?", "htmlMail id='htM'", $_SESSION['htmlMail'], "gilt für alle Mails", $a); configStrItem(2, "Status Mail Empfänger", "stateMailTo id=Mail1", $_SESSION['stateMailTo'], "Komma separierte Empängerliste", 500, $ro); configStrItem(2, "Fehler Mail Empfänger", "errorMailTo id=Mail2", $_SESSION['errorMailTo'], "Komma separierte Empängerliste", 500, $ro); configStrItem(2, "Status Mail für folgende Stati", "stateMailStates id=Mail3", $_SESSION['stateMailStates'], "Komma separierte Liste der Stati", 400, $ro); configStrItem(2, "p4d sendet Mails über das Skript", "mailScript id=Mail4", $_SESSION['mailScript'], "", 400, $ro); configStrItem(6, "URL deiner Visualisierung", "webUrl id=Mail5", $_SESSION['webUrl'], "kann mit %weburl% in die Mails eingefügt werden", 350, $ro); seperator("Sonstiges", 0, 2); $ro = $_SESSION['tsync'] ? "'" : "; background-color:#ddd;' readOnly=\"true\""; configBoolItem(1, "Zeitsynchronisation", "tsync onClick=\"readonlyContent('timeLeak',this)\"", $_SESSION['tsync'], "tägl. 23:00Uhr"); configStrItem(4, "Mind. Abweichung [s]", "maxTimeLeak id='timeLeak'", $_SESSION['maxTimeLeak'], "Mindestabweichung für Synchronisation", 45, $ro); echo " </form>\n"; include "footer.php"; // --------------------------------------------------------------------------- // Color Scheme // --------------------------------------------------------------------------- function colorSchemeItem($new, $title) { $actual = readlink("stylesheet.css"); $end = htmTags($new); echo " {$title}:\n"; echo " <select class=checkbox name=\"style\">\n"; foreach (glob("stylesheet-*.css") as $filename) {
} // ------------------ // setup form $i = 0; $cnt = "0"; echo " <form action=" . htmlspecialchars($_SERVER["PHP_SELF"]) . " method=post>\n"; echo " <br/>\n"; echo " <button class=\"button3\" type=submit name=action value=store>Speichern</button>\n"; echo " <br/></br>\n"; // ------------------------ // setup items ... seperator("Benachrichtigung bei bestimmten Sensor-Werten", 0, 1); echo " <div class=\"input\" id=\"hlp\" style=\"display:none;\" onClick=\"showContent('hlp')\">\n"; echo " <span class=\"inputComment\">\n Hier formulierst du die Bedingungen (Alarmwerte) für die einzelnen Sensoren, dabei gilt wieder: Sensor-ID und Typ aus der Tabelle <br />\n 'Aufzeichnung' entnehmen und hier eintragen.<br /><br />\n <b>Beispiel:</b> Nachricht wenn die Kesselstellgröße unter 50% sinkt, oder sich mehr als 10% in 1min ändert, aber nicht öfter als alle 5min.<br />\n <b>ID:18 Typ:VA min:50 \n max:100 Intervall:5 Änderung:10 Zeitraum:1</b><br />\n <b>Zulässige Werte:</b><br /><b>ID:</b> Zahl (auch Hex) | <b>Typ:</b> UD, VA, DI, DO, W1 | <b>min, max, Änderung:</b> Zahl | <b>\n Intervall, Zeitraum:</b> Zahl (Minuten)<br /><br />\n für Betreff und Text können folgende Platzhalter verwendet werden:<br /> \n %sensorid% %title% %value% %unit% %min% %max% %repeat% %delta% %range% %time% %weburl%<br />\n mit 'aktiv' aktivierst oder deaktivierst du nur die Benachrichtigung, auf die Steuerung hat dies keinen Einfluss\n </span>\n"; echo " </div><br/>\n"; seperator("Bedingungen <span class=\"help\" onClick=\"showContent('hlp')\">(Hilfe)</span>", 0, 2); $result = mysql_query("select * from sensoralert") or die("<br/>Error: " . mysql_error()); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $ID = $row['id']; $i++; $a = chr($ID + 64); $cnt = $cnt . "|" . $row['id']; $s = $row['state'] == "D" ? "; background-color:#ddd\" readOnly=\"true" : ""; echo " <div class=\"input\" >\n"; echo " <input type=checkbox name=Act(" . $ID . ")" . ($row['state'] == "A" ? " checked" : "") . " onClick=\"readonlyContent('{$a}',this)\" onLoad=\"disableContent('{$a}',this)\"></input> aktiv?\n"; echo " ID:<input class=\"inputEdit2\" id=\"a{$a}\" style=\"width:77px{$s}\" type=\"text\" name=\"Adr(" . $ID . ")\" value=\"" . $row['address'] . "\"></input> \n"; echo " Typ:<input class=\"inputEdit2\" id=\"b{$a}\" style=\"width:28px{$s}\" type=\"text\" name=\"Type(" . $ID . ")\" value=\"" . $row['type'] . "\"></input> \n"; echo " min:<input class=\"inputEdit2\" id=\"c{$a}\" style=\"width:42px{$s}\" type=\"text\" name=\"min(" . $ID . ")\" value=\"" . $row['min'] . "\"></input> \n"; echo " max:<input class=\"inputEdit2\" id=\"d{$a}\" style=\"width:42px{$s}\" type=\"text\" name=\"max(" . $ID . ")\" value=\"" . $row['max'] . "\"></input> \n"; echo " Intervall:<input class=\"inputEdit2\" id=\"e{$a}\" style=\"width:42px{$s}\" type=\"text\" name=\"Int(" . $ID . ")\" value=\"" . $row['maxrepeat'] . "\"></input> \n"; echo " Änderung:<input class=\"inputEdit2\" id=\"f{$a}\" style=\"width:33px{$s}\" type=\"text\" name=\"Delta(" . $ID . ")\" value=\"" . $row['delta'] . "\"></input> \n";