
<!DOCTYPE HTML> <html lang="pl"> <head> <meta charset="utf-8" /> <title>Gnizdka :)</title> <script src="jquery/jquery-2.1.3.min.js"></script> <link rel=" stylesheet" type="text/css" href="tinyButton/tinytools.toggleswitch.min.css"> <script src="tinyButton/tinytools.toggleswitch.min.js"></script> <script> $(document).ready(function () { $("#gniazdko1").toggleSwitch({ width: "200px", height: "70px", onLabel: "Załączone", offLabel: "Wyłączone" }); $("#gniazdko1").change(function() { if(this.checked) { setValue("192.168.1.200","1") } else { setValue("192.168.1.200","0") } }); }); </script> </head> <body> <?php $stan; echo<<<END <h2>Panel sterowania:</h2> <table border="1" cellpadding="10" cellspacing="0"> <tr> <td><p style="font-family: Courier; font-size:20px;">Gniazdko 1 </p> </td> <td><input type="checkbox" id="gniazdko1"/></td> </tr> </table> <br><br/> $stan; END; ?> </body> </html>
i zawartość z setValue:
<?php $ch = curl_init($_GET["ip"]."/?status=".$_GET["stan"]); curl_exec($ch); if (curl_errno($ch)) { } curl_close($ch); ?>