function printHeader($refresh = 0) { // ---------------- // HTML Head //<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"> echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"de\" lang=\"de\">\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n"; $stylesheet = checkMobile() == 1 ? "stylesheet.css" : "stylesheet.css"; if ($refresh) { echo " <meta http-equiv=\"refresh\" content=\"{$refresh}\">\n"; } echo " <meta name=\"author\" content=\"Jörg Wendel\">\n <meta name=\"copyright\" content=\"Jörg Wendel\">\n <LINK REL=\"SHORTCUT ICON\" HREF=\"" . $_SESSION['heatingType'] . ".ico\">\n <link rel=\"stylesheet\" type=\"text/css\" href=\"{$stylesheet}\">\n <script type=\"text/JavaScript\" src=\"jfunctions.js\"></script> \n <title>Fröling " . $_SESSION['heatingType'] . "</title>\n </head>\n <body>\n <a class=\"button1\" href=\"main.php\">Aktuell</a>\n <a class=\"button1\" href=\"chart.php\">Charts 1+2</a>"; if ($_SESSION['chart34'] == "1") { echo "<a class=\"button1\" href=\"chart2.php\">Charts 3+4</a>"; } echo "<a class=\"button1\" href=\"schemadsp.php\">Schema</a>\n <a class=\"button1\" href=\"menu.php\">Menü</a>\n <a class=\"button1\" href=\"error.php\">Fehler</a>\n"; if (haveLogin()) { echo " <a class=\"button1\" href=\"basecfg.php\">Setup</a>\n"; echo " <a class=\"button1\" href=\"logout.php\">Logout</a>\n"; } else { echo " <a class=\"button1\" href=\"login.php\">Login</a>\n"; } // echo $stylesheet; echo " <div class=\"content\">\n"; }
<?php include "header.php"; printHeader(); include "setup.php"; // ------------------------- // check login if (!haveLogin()) { echo "<br/><div class=\"infoError\"><b><center>Login erforderlich!</center></b></div><br/>\n"; die("<br/>"); } $action = ""; if (isset($_POST["action"])) { $action = htmlspecialchars($_POST["action"]); } // ------------------------- // establish db connection mysql_connect($mysqlhost, $mysqluser, $mysqlpass); mysql_select_db($mysqldb) or die("<br/>DB error"); mysql_query("set names 'utf8'"); mysql_query("SET lc_time_names = 'de_DE'"); // ----------------------- // if ($action == "init") { requestAction("initvaluefacts", 20, 0, "", $resonse); echo "<br/><div class=\"info\"><b><center>Initialisierung abgeschlossen</center></b></div><br/><br/>"; } else { if ($action == "store") { if (isset($_POST["selected"])) { $sql = "UPDATE valuefacts SET state = 'D'"; $result = mysql_query($sql) or die("<br/>Error" . mysql_error());
<?php // ------------------------- // chaeck login if (haveLogin()) { echo " <div>\n"; echo " <a class=\"button2\" href=\"basecfg.php\">Allg. Konfiguration</a>\n"; echo " <a class=\"button2\" href=\"alertcfg.php\">Sensor Alerts</a>\n"; echo " <a class=\"button2\" href=\"settings.php\">Aufzeichnung</a>\n"; echo " <a class=\"button2\" href=\"schemacfg.php\">Schema Konfiguration</a>\n"; echo " </div>\n"; }
function showMenu($current) { $i = 0; $result = mysql_query("select * from menu where parent = " . 1) or die("Error" . mysql_error()); $count = mysql_numrows($result); echo " <div>\n"; echo " <form action=" . htmlspecialchars($_SERVER["PHP_SELF"]) . " method=post>\n"; while ($i < $count) { $child = mysql_result($result, $i, "child"); $title = mysql_result($result, $i, "title"); if ($child == $current) { echo " <button class=\"button2sel\" type=submit name=menu value={$child}>{$title}</button>\n"; } else { echo " <button class=\"button2\" type=submit name=menu value={$child}>{$title}</button>\n"; } $i++; } if (haveLogin()) { echo " <br/><br/>\n"; echo " <button class=\"button3\" type=submit name=menu value=init onclick=\"return confirmSubmit('Menüstruktur-Tabelle löschen und neu initialisieren?')\">Init</button>\n"; echo " <button class=\"button3\" type=submit name=menu value=update onclick=\"return confirmSubmit('Werte der Parameter einlesen?')\">Aktualisieren</button>\n"; } echo " </form>\n"; echo " </div>\n"; }