function logStatus($r) { global $STATUS_FILE; if ($r == null) { return; } $cur = getAllReceivers(); $first = $cur; do { if ($cur->getIP() == $r->getIP() && $cur->getTuner() == $r->getTuner()) { $cur->setChannel($r->getChannel()); $cur->setIsStreaming($r->isStreaming()); $cur->setPort($r->getPort()); $cur->setMulticast($r->getMulticast()); $cur->setChannelName($r->getChannelName()); $cur->setSignalStrength($r->getSignalStrength()); $cur->setLastChecked($r->getLastChecked()); $cur->setUptime($r->getUptime()); $cur->setMacAddress($r->getMacAddress()); $cur->setReceiverID($r->getReceiverID()); $cur->setSmartCardID($r->getSmartCardID()); break; } $cur = $cur->getNextMulticastReceiver(); } while ($cur != null); $cur = $first; $fileHandle = fopen($STATUS_FILE, 'w'); do { fwrite($fileHandle, $cur->getFormattedString()); $cur = $cur->getNextMulticastReceiver(); } while ($cur != null); }
<BR><BR> <TABLE WIDTH="50%" ALIGN="CENTER"> <TR><TD COLSPAN=6 ALIGN="LEFT"><SPAN STYLE="font-size:10px;color:gray;">* Click on a stream to get more info </SPAN></TD></TR> </TABLE> <TABLE CLASS="sortable" WIDTH="50%" ALIGN="CENTER" STYLE="font-size:12px;border-style:solid;border-width:1px;border-color:black"> <?php print "\t\t<TR STYLE=\"font-weight:bold\">\n"; $columnHeaders = array("Status", "Channel", "IP", "Multicast", "Tuner", "Actions"); for ($i = 0; $i < count($columnHeaders); $i++) { print "<TH WIDTH=\"20%\">" . $columnHeaders[$i] . "</TH>"; } print "\t\t</TR>\n"; $cur = getAllReceivers(); $i = 0; do { if ($cur->getSignalStrength() <= 20) { print "\t\t<TR BGCOLOR=\"yellow\" onmouseover='this.style.backgroundColor=\"bcbcbc\"' onmouseout='this.style.backgroundColor=\"yellow\"'>\n"; } else { print "\t\t<TR BGCOLOR=\"white\" onmouseover='this.style.backgroundColor=\"bcbcbc\"' onmouseout='this.style.backgroundColor=\"FFFFFF\"'>\n"; } print "\t\t\t<TD ALIGN=\"CENTER\" onClick='ShowContent(\"box_" . $i . "\")'><IMG SRC=\"images/status_" . ($cur->isStreaming() ? "green.png" : "red.png") . "\"></TD>\n"; print "\t\t\t<TD ALIGN=\"CENTER\" onClick='ShowContent(\"box_" . $i . "\")'>" . $cur->getChannelName() . "</TD>\n"; print "\t\t\t<TD ALIGN=\"CENTER\" onClick='ShowContent(\"box_" . $i . "\")'>" . $cur->getIP() . "</TD>\n"; print "\t\t\t<TD ALIGN=\"CENTER\" onClick='ShowContent(\"box_" . $i . "\")'>" . $cur->getMulticast() . "</TD>\n"; print "\t\t\t<TD ALIGN=\"CENTER\" onClick='ShowContent(\"box_" . $i . "\")'>" . $cur->getTuner() . "</TD>\n"; // actions print "\t\t\t<TD ALIGN=\"CENTER\"><SPAN ID=\"actions_" . $i . "\"><IMG SRC=\"images/ping1.png\" ALT=\"Ping\" TITLE=\"Ping\" WIDTH=\"20px\" HEIGHT=\"20px\" onClick=\"receiverAction('actions_" . $i . "','ping','" . $cur->getIP() . "','" . $cur->getTuner() . "','" . $cur->getMulticast() . "')\"> "; print "<IMG SRC=\"images/restartstream.png\" ALT=\"Restart stream\" TITLE=\"Restart stream\" WIDTH=\"20px\" HEIGHT=\"20px\" onClick=\"receiverAction('actions_" . $i . "','restart','" . $i . "','0','0')\"> ";
<?php include_once $_SERVER["DOCUMENT_ROOT"] . "/222/inc/config.inc.php"; include_once $_SERVER["DOCUMENT_ROOT"] . "/222/inc/functions.inc.php"; include_once $_SERVER["DOCUMENT_ROOT"] . "/222/class/MulticastReceiver.class.php"; $receiver = $_GET["i"]; if ($receiver < 0 || $receiver > 1000) { print "Could not find the receiver"; exit; } $obj = getAllReceivers(); $i = 0; do { if ($i == $receiver) { break; } $obj = $obj->getNextMulticastReceiver(); $i++; } while ($obj != null); $ip = $obj->getIP(); $tmpTuner = $obj->getTuner(); $tmpTuner++; $tmpTuner1 = $obj->getTuner(); $wake = exec("\"" . $SOAP_DIR . "wakeup.pl\" " . $obj->getIP() . " " . $obj->getTuner()); $channel = exec("\"" . $SOAP_DIR . "setChannel.pl\" " . $obj->getIP() . " " . $obj->getChannel() . " " . $obj->getTuner()); sleep(5); $r = exec("cat /home/tg/soap/config.txt|grep {$ip}|awk -F \",\" '{if(\$4=={$tmpTuner1} && \$6==1) print \"hd\"}'"); if (preg_match("/hd/", $r)) { $r = exec("\"" . $SOAP_DIR . "increaseChannel.pl\" " . $obj->getIP() . " " . $obj->getTuner()); sleep(5); }