include 'remotebox.php'; include 'smartplug.php'; if(isset($_POST['ac'])) { $url = 'http://'; switch((int)$_POST['denki']) { case 1: $url .= 'denki01'; break; case 2: $url .= 'denki02'; break; default: die("wrong denki parameter"); } $url .= '.nobaq.net/sw?u=admin&p=igx4dzng'; if(!isset($_POST['outlet'])) die('param error'); $url .= '&o=' . (int)$_POST['outlet']; switch($_POST['ac']) { case 'On': $url .= '&f=on'; break; case 'Off': $url .= '&f=off'; break; case 'Toggle': $url .= '&f=toggle'; break; case 'Pulse': $url .= '&f=pulse'; break; } //echo '
' . $url . ''; $return = file($url); if($return === false) die("could not reach url"); //$status = parseStatus($return); //var_dump($status); //exit; header('Location: /denki/'); exit; } $status1 = getStatus('denki01.nobaq.net'); $status2 = getStatus('denki02.nobaq.net'); //$status3 = getStatusSmartplug('denki03.intra.nobaq.net'); echo '' . PHP_EOL; ?>
disabled
not yet implemented