Heart
07.04.2004, 11:37
Hi,
I made a module which shows me the status of some servers. The code is:
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$eBanking = "1"; // auf 1 oder 2 stellen, wenn Störung vorliegt!
$PinTan = "0"; // auf 1 oder 2 stellen, wenn Störung vorliegt!
$InterCept = "0"; // auf 1 oder 2 stellen, wenn Störung vorliegt!
$HBCI = "1"; // auf 1 oder 2 stellen, wenn Störung vorliegt!
$FTAM = "0"; // auf 1 oder 2 stellen, wenn Störung vorliegt!
echo "<table width=\"95%\" border=\"0\" align=\"center\"><tr><td><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr align=\"center\"><td width=\"16\" class=\"newsheading\" align=\"center\"><img src=\"faq/info.png\" border=\"0\"></td><td width=\"100%\" class=\"statusheader\" align=\"center\"><strong> Verfügbarkeit</strong></td></tr></table><table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\">";
if ($eBanking == 1) {
echo "<tr><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statuslinks-rot\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_rot.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statusmitte-rot\" width=\"50%\" align=\"left\" valign=\"top\"><a href=\"inhalt/upload/status_eBanking.php\" target=\"_blank\">eBanking</a></td><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statusrechts-rot\" width=\"44%\" align=\"left\" valign=\"top\">[<a href=\"status_eBanking.php\" target=\"_blank\"><font color=\"red\"> offline</font></a> ]</td></tr>";
} elseif ($eBanking == 2) {
echo "<tr><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statuslinks-gelb\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_gelb.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statusmitte-gelb\" width=\"50%\" align=\"left\" valign=\"top\"><a href=\"inhalt/upload/status_eBanking.php\" target=\"_blank\">eBanking</a></td><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statusrechts-gelb\" width=\"44%\" align=\"left\" valign=\"top\">[<a href=\"status_eBanking.php\" target=\"_blank\"><font color=\"#bcb72a\"> teilweise</font></a> ]</td></tr>";
} else {
echo "<tr><td class=\"statuslinks\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_gruen.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td class=\"statusmitte\" width=\"50%\" align=\"left\" valign=\"top\">eBanking</td><td class=\"statusrechts\" width=\"44%\" align=\"left\" valign=\"top\">[ <font color=\"#008000\">online</font> ]</td></tr>";
}
if ($PinTan == 1) {
echo "<tr><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statuslinks-rot\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_rot.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statusmitte-rot\" width=\"50%\" align=\"left\" valign=\"top\"><a href=\"inhalt/upload/status_PinTan.php\" target=\"_blank\">PIN/TAN</a></td><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statusrechts-rot\" width=\"44%\" align=\"left\" valign=\"top\">[ <a href=\"status_PinTan.php\" target=\"_blank\"><font color=\"red\">offline</font></a> ]</td></tr>";
} elseif ($PinTan == 2) {
echo "<tr><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statuslinks-gelb\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_gelb.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statusmitte-gelb\" width=\"50%\" align=\"left\" valign=\"top\"><a href=\"inhalt/upload/status_PinTan.php\" target=\"_blank\">PIN/TAN</a></td><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statusrechts-gelb\" width=\"44%\" align=\"left\" valign=\"top\">[ <a href=\"status_PinTan.php\" target=\"_blank\"><font color=\"#bcb72a\">teilweise</font></a> ]</td></tr>";
} else {
echo "<tr><td class=\"statuslinks\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_gruen.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td class=\"statusmitte\" width=\"50%\" align=\"left\" valign=\"top\">PIN/TAN</td><td class=\"statusrechts\" width=\"44%\" align=\"left\" valign=\"top\">[ <font color=\"#008000\">online</font> ]</td></tr>";
}
if ($InterCept == 1) {........and so on
So the component i need in the mambo backend must only change the red variables (0,1 or 2) in the module-file (at the top). I think it could be done with checkboxes or input fields where I type in 0, 1 or 2 and the module-file will change.
How can I do that :question:
THANKS a lot for your help!
I made a module which shows me the status of some servers. The code is:
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$eBanking = "1"; // auf 1 oder 2 stellen, wenn Störung vorliegt!
$PinTan = "0"; // auf 1 oder 2 stellen, wenn Störung vorliegt!
$InterCept = "0"; // auf 1 oder 2 stellen, wenn Störung vorliegt!
$HBCI = "1"; // auf 1 oder 2 stellen, wenn Störung vorliegt!
$FTAM = "0"; // auf 1 oder 2 stellen, wenn Störung vorliegt!
echo "<table width=\"95%\" border=\"0\" align=\"center\"><tr><td><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr align=\"center\"><td width=\"16\" class=\"newsheading\" align=\"center\"><img src=\"faq/info.png\" border=\"0\"></td><td width=\"100%\" class=\"statusheader\" align=\"center\"><strong> Verfügbarkeit</strong></td></tr></table><table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\">";
if ($eBanking == 1) {
echo "<tr><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statuslinks-rot\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_rot.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statusmitte-rot\" width=\"50%\" align=\"left\" valign=\"top\"><a href=\"inhalt/upload/status_eBanking.php\" target=\"_blank\">eBanking</a></td><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statusrechts-rot\" width=\"44%\" align=\"left\" valign=\"top\">[<a href=\"status_eBanking.php\" target=\"_blank\"><font color=\"red\"> offline</font></a> ]</td></tr>";
} elseif ($eBanking == 2) {
echo "<tr><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statuslinks-gelb\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_gelb.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statusmitte-gelb\" width=\"50%\" align=\"left\" valign=\"top\"><a href=\"inhalt/upload/status_eBanking.php\" target=\"_blank\">eBanking</a></td><td onclick=\"window.open('inhalt/upload/status_eBanking.php', 'eBanking', 'width=500,height=300,scrollbars=no')\"; class=\"statusrechts-gelb\" width=\"44%\" align=\"left\" valign=\"top\">[<a href=\"status_eBanking.php\" target=\"_blank\"><font color=\"#bcb72a\"> teilweise</font></a> ]</td></tr>";
} else {
echo "<tr><td class=\"statuslinks\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_gruen.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td class=\"statusmitte\" width=\"50%\" align=\"left\" valign=\"top\">eBanking</td><td class=\"statusrechts\" width=\"44%\" align=\"left\" valign=\"top\">[ <font color=\"#008000\">online</font> ]</td></tr>";
}
if ($PinTan == 1) {
echo "<tr><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statuslinks-rot\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_rot.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statusmitte-rot\" width=\"50%\" align=\"left\" valign=\"top\"><a href=\"inhalt/upload/status_PinTan.php\" target=\"_blank\">PIN/TAN</a></td><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statusrechts-rot\" width=\"44%\" align=\"left\" valign=\"top\">[ <a href=\"status_PinTan.php\" target=\"_blank\"><font color=\"red\">offline</font></a> ]</td></tr>";
} elseif ($PinTan == 2) {
echo "<tr><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statuslinks-gelb\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_gelb.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statusmitte-gelb\" width=\"50%\" align=\"left\" valign=\"top\"><a href=\"inhalt/upload/status_PinTan.php\" target=\"_blank\">PIN/TAN</a></td><td onclick=\"window.open('inhalt/upload/status_PinTan.php', 'PinTan', 'width=500,height=300,scrollbars=no')\"; class=\"statusrechts-gelb\" width=\"44%\" align=\"left\" valign=\"top\">[ <a href=\"status_PinTan.php\" target=\"_blank\"><font color=\"#bcb72a\">teilweise</font></a> ]</td></tr>";
} else {
echo "<tr><td class=\"statuslinks\" width=\"6%\" align=\"center\" valign=\"top\"><img src=\"status_gruen.gif\" width=\"9\" height=\"9\" border=\"0\" align=\"middle\" vspace=\"3\"></td><td class=\"statusmitte\" width=\"50%\" align=\"left\" valign=\"top\">PIN/TAN</td><td class=\"statusrechts\" width=\"44%\" align=\"left\" valign=\"top\">[ <font color=\"#008000\">online</font> ]</td></tr>";
}
if ($InterCept == 1) {........and so on
So the component i need in the mambo backend must only change the red variables (0,1 or 2) in the module-file (at the top). I think it could be done with checkboxes or input fields where I type in 0, 1 or 2 and the module-file will change.
How can I do that :question:
THANKS a lot for your help!