<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch Automation Pro |
| PseudoGeräte-Script |
| =============================================================== |
| -> WLAN / Mediapl.-WebDAV |
| |
+---------------------------------------------------------------------+
*/
include __DIR__."/../include/psg.php";
# Box 0
# WLAN
$Login=$Conf["FB"]."/login_sid.lua";
$user=$Conf["USER"];
$password=$Conf["PASSWORD"];
$url=$Conf["FB"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=wlan:status/ap_enabled";
$Status1=webget($url);
$url=$Conf["FB"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=wlan:status/ap_enabled_scnd";
$Status2=webget($url);
$url=$Conf["FB"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=wlan:status/guest_ap_enabled";
$Status3=webget($url);
$b0wl1="2";
$b0wl2="2";
$b0wl3="2";
$x1=explode('"',$Status1);
if ($x1[3]=="0" or $x1[3]=="1") {
$b0wl1=$x1[3];
}
$x2=explode('"',$Status2);
if ($x2[3]=="0" or $x2[3]=="1") {
$b0wl2=$x2[3];
}
$x3=explode('"',$Status3);
if ($x3[3]=="0" or $x3[3]=="1") {
$b0wl3=$x3[3];
}
# Media
$url=$Conf["FB"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=mediasrv:settings/enabled";
$Status1=webget($url);
$url=$Conf["FB"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=webdavclient:status/connection_state";
$Status2=webget($url);
$b0mm1="2";
$b0mm2="2";
$x1=explode('"',$Status1);
if ($x1[3]=="0" or $x1[3]=="1") {
$b0mm1=$x1[3];
}
$x2=explode('"',$Status2);
if ($x2[3]=="0" or $x2[3]=="1") {
$b0mm2=$x2[3];
}
# Box 1
# WLAN
$Login=$Conf["FB1"]."/login_sid.lua";
$user=$Conf["USER"];
$password=$Conf["PASSWORD"];
$url=$Conf["FB1"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=wlan:status/ap_enabled";
$Status1=webget($url);
$url=$Conf["FB1"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=wlan:status/ap_enabled_scnd";
$Status2=webget($url);
$url=$Conf["FB1"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=wlan:status/guest_ap_enabled";
$Status3=webget($url);
$b1wl1="2";
$b1wl2="2";
$b1wl3="2";
$x1=explode('"',$Status1);
if ($x1[3]=="0" or $x1[3]=="1") {
$b1wl1=$x1[3];
}
$x2=explode('"',$Status2);
if ($x2[3]=="0" or $x2[3]=="1") {
$b1wl2=$x2[3];
}
$x3=explode('"',$Status3);
if ($x3[3]=="0" or $x3[3]=="1") {
$b1wl3=$x3[3];
}
# Media
$url=$Conf["FB1"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=mediasrv:settings/enabled";
$Status1=webget($url);
$url=$Conf["FB1"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=webdavclient:status/connection_state";
$Status2=webget($url);
$b1mm1="2";
$b1mm2="2";
$x1=explode('"',$Status1);
if ($x1[3]=="0" or $x1[3]=="1") {
$b1mm1=$x1[3];
}
$x2=explode('"',$Status2);
if ($x2[3]=="0" or $x2[3]=="1") {
$b1mm2=$x2[3];
}
# Box 2
# WLAN
$Login=$Conf["FB2"]."/login_sid.lua";
$user=$Conf["USER"];
$password=$Conf["PASSWORD"];
$url=$Conf["FB2"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=wlan:status/ap_enabled";
$Status1=webget($url);
$url=$Conf["FB2"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=wlan:status/ap_enabled_scnd";
$Status2=webget($url);
$url=$Conf["FB2"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=wlan:status/guest_ap_enabled";
$Status3=webget($url);
$b2wl1="2";
$b2wl2="2";
$b2wl3="2";
$x1=explode('"',$Status1);
if ($x1[3]=="0" or $x1[3]=="1") {
$b2wl1=$x1[3];
}
$x2=explode('"',$Status2);
if ($x2[3]=="0" or $x2[3]=="1") {
$b2wl2=$x2[3];
}
$x3=explode('"',$Status3);
if ($x3[3]=="0" or $x3[3]=="1") {
$b2wl3=$x3[3];
}
# Media
$url=$Conf["FB2"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=mediasrv:settings/enabled";
$Status1=webget($url);
$url=$Conf["FB2"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=webdavclient:status/connection_state";
$Status2=webget($url);
$b2mm1="2";
$b2mm2="2";
$x1=explode('"',$Status1);
if ($x1[3]=="0" or $x1[3]=="1") {
$b2mm1=$x1[3];
}
$x2=explode('"',$Status2);
if ($x2[3]=="0" or $x2[3]=="1") {
$b2mm2=$x2[3];
}
# AB1
$Login=$Conf["FB"]."/login_sid.lua";
$user=$Conf["USER"];
$password=$Conf["PASSWORD"];
$url=$Conf["FB"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&TAM=tam:settings/TAM/list(Active,MSNBitmap,Mode,UserAnsVP,UserAnsRecVP,UserEndVP,RecordLength,RingCount,PIN,PlayTimestamp,CompressionLevel,Display,PushmailActive,MailAddress,PushmailServer,PushmailUser,PushmailPass,PushmailFrom,Name,NumNewMessages,NumOldMessages)";
$dat=json_decode(file_get_contents($url),true);
$ab=0; #0,1,2,3,4 sind die 5 ABs
$Status=" ".$dat["TAM"][$ab]["NumNewMessages"];
$old=$dat["TAM"][$ab]["NumOldMessages"];
$abaktiv=$dat["TAM"][$ab]["Active"];
if ($abaktiv==0) {$abaktiv="nein";} else {$abaktiv="ja";}
$abname=$dat["TAM"][$ab]["Name"];
if ($Status) {
if (trim($Status)=="0") {
$anrufeneu="0";
$anrufe="0";
$fcss="f1";
$abneu='<span id="'.$fcss.'" style="font-weight:bold;font-size:32px;">'.$anrufeneu.'</span> Nachrichten';
}
if (trim($Status)>="1") {
$anrufeneu=trim($Status);
$anrufe="1";
$fcss="f2";
$abneu='<span id="'.$fcss.'" style="font-weight:bold;font-size:32px;">'.$anrufeneu.'</span> Nachricht';
if (trim($Status)>"1") {
$abneu='<span id="'.$fcss.'" style="font-weight:bold;font-size:32px;">'.$anrufeneu.'</span> Nachrichten';
}
}
if (trim($old)=="0") {
$anrufealt="0";
$fcss="f1";
$abalt=$anrufealt.' alte Nachrichten';
}
if (trim($old)>="1") {
$anrufealt=trim($old);
$fcss="f2";
$abalt=$anrufeneu.' alte Nachricht';
if (trim($old)>"1") {
$abalt=$anrufealt.' alte Nachrichten';
}
}
$echo1='<div style="width:310px;position:absolute;text-align:right;top:10px;left:310px">';
$echo1.='<div style="font-size:12px;text-align:right;width:310px;position:absolute;top:-20px;"><img src="'.picdesign("telab".$anrufe.".png").'" border="0"></div>';
$echo1.='<div style="font-size:16px;text-align:left;width:250px;position:absolute;top:22px;">'.$abname.'</div>';
$echo1.='<div style="font-size:22px;text-align:right;width:250px;position:absolute;top:-8px;">'.$abneu.'</div>';
$echo1.='<div style="font-size:12px;text-align:right;width:250px;position:absolute;top:26px;">'.$abalt.'</div>';
$echo1.='<div style="font-size:12px;text-align:left;width:250px;position:absolute;top:-1px;"><img src="'.picdesign($abaktiv.".png").'" border="0"></div>';
$echo1.='</div>';
}
# AB2
$Login=$Conf["FB"]."/login_sid.lua";
$user=$Conf["USER"];
$password=$Conf["PASSWORD"];
$url=$Conf["FB"]."/query.lua?sid=".GetSessionID($Login,$user,$password)."&TAM=tam:settings/TAM/list(Active,MSNBitmap,Mode,UserAnsVP,UserAnsRecVP,UserEndVP,RecordLength,RingCount,PIN,PlayTimestamp,CompressionLevel,Display,PushmailActive,MailAddress,PushmailServer,PushmailUser,PushmailPass,PushmailFrom,Name,NumNewMessages,NumOldMessages)";
$dat=json_decode(file_get_contents($url),true);
$ab=2; #0,1,2,3,4 sind die 5 ABs
$Status=" ".$dat["TAM"][$ab]["NumNewMessages"];
$old=$dat["TAM"][$ab]["NumOldMessages"];
$abaktiv=$dat["TAM"][$ab]["Active"];
if ($abaktiv==0) {$abaktiv="nein";} else {$abaktiv="ja";}
$abname=$dat["TAM"][$ab]["Name"];
if ($Status) {
if (trim($Status)=="0") {
$anrufeneu="0";
$anrufe="0";
$fcss="f1";
$abneu='<span id="'.$fcss.'" style="font-weight:bold;font-size:32px;">'.$anrufeneu.'</span> Nachrichten';
}
if (trim($Status)>="1") {
$anrufeneu=trim($Status);
$anrufe="1";
$fcss="f2";
$abneu='<span id="'.$fcss.'" style="font-weight:bold;font-size:32px;">'.$anrufeneu.'</span> Nachricht';
if (trim($Status)>"1") {
$abneu='<span id="'.$fcss.'" style="font-weight:bold;font-size:32px;">'.$anrufeneu.'</span> Nachrichten';
}
}
if (trim($old)=="0") {
$anrufealt="0";
$fcss="f1";
$abalt=$anrufealt.' alte Nachrichten';
}
if (trim($old)>="1") {
$anrufealt=trim($old);
$fcss="f2";
$abalt=$anrufeneu.' alte Nachricht';
if (trim($old)>"1") {
$abalt=$anrufealt.' alte Nachrichten';
}
}
$echo2='<div style="width:310px;position:absolute;text-align:right;top:65px;left:310px">';
$echo2.='<div style="font-size:12px;text-align:right;width:310px;position:absolute;top:-20px;"><img src="'.picdesign("telab".$anrufe.".png").'" border="0"></div>';
$echo2.='<div style="font-size:16px;text-align:left;width:250px;position:absolute;top:22px;">'.$abname.'</div>';
$echo2.='<div style="font-size:22px;text-align:right;width:250px;position:absolute;top:-8px;">'.$abneu.'</div>';
$echo2.='<div style="font-size:12px;text-align:right;width:250px;position:absolute;top:26px;">'.$abalt.'</div>';
$echo2.='<div style="font-size:12px;text-align:left;width:250px;position:absolute;top:-1px;"><img src="'.picdesign($abaktiv.".png").'" border="0"></div>';
$echo2.='</div>';
}
# Anzeige
$info='';
$info.='<div style="font-size:20px;left:-135px;top:0px;position:absolute;"><img src="'.picdesign("psensor.png").'" border="0"></div>';
$info.='<div style="font-size:16px;text-align:left;width:300px;position:absolute;top:10px;">7490 WLAN: <img src="'.PIC.'mled'.$b0wl1.'.png" height="15px"><img src="'.PIC.'mled'.$b0wl2.'.png" height="15px"><img src="'.PIC.'mled'.$b0wl3.'.png" height="15px"> Media/DAV: <img src="'.PIC.'mled'.$b0mm1.'.png" height="15px"><img src="'.PIC.'mled'.$b0mm2.'.png" height="15px"></div>';
$info.='<div style="font-size:16px;text-align:left;width:300px;position:absolute;top:40px;">7490 WLAN: <img src="'.PIC.'mled'.$b1wl1.'.png" height="15px"><img src="'.PIC.'mled'.$b1wl2.'.png" height="15px"><img src="'.PIC.'mled'.$b1wl3.'.png" height="15px"> Media/DAV: <img src="'.PIC.'mled'.$b1mm1.'.png" height="15px"><img src="'.PIC.'mled'.$b1mm2.'.png" height="15px"></div>';
$info.='<div style="font-size:16px;text-align:left;width:300px;position:absolute;top:70px;">4040 WLAN: <img src="'.PIC.'mled'.$b2wl1.'.png" height="15px"><img src="'.PIC.'mled'.$b2wl2.'.png" height="15px"><img src="'.PIC.'mled'.$b2wl3.'.png" height="15px"> Media/DAV: <img src="'.PIC.'mled'.$b2mm1.'.png" height="15px"><img src="'.PIC.'mled'.$b2mm2.'.png" height="15px"></div>';
echo 'IB#<div style="position:absolute;left:85px;top:0px;">'.$info.$echo1.$echo2.'</div>#';
exit;
?>