Guest User

Untitled

a guest
Mar 25th, 2015
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <?php
  2. $rfPath = '/var/www/rfoutlet/codesend ';
  3. $outletLight = $_POST['outletId'];
  4. $outletStatus = $_POST['outletStatus'];
  5.  
  6. if ($outletLight == "1" && $outletStatus == "on") {
  7. $rfCodes = array(1070387);
  8. } else if ($outletLight == "1" && $outletStatus == "off") {
  9. $rfCodes = array(1070396);
  10. } else if ($outletLight == "2" && $outletStatus == "on") {
  11. $rfCodes = array(1070531);
  12. } else if ($outletLight == "2" && $outletStatus == "off") {
  13. $rfCodes = array(1070540);
  14. } else if ($outletLight == "3" && $outletStatus == "on") {
  15. $rfCodes = array(1070851);
  16. } else if ($outletLight == "3" && $outletStatus == "off") {
  17. $rfCodes = array(1070860);
  18. } else if ($outletLight == "4" && $outletStatus == "on") {
  19. $rfCodes = array(1072387);
  20. } else if ($outletLight == "4" && $outletStatus == "off") {
  21. $rfCodes = array(1072396);
  22. } else if ($outletLight == "5" && $outletStatus == "on") {
  23. $rfCodes = array(1078531);
  24. } else if ($outletLight == "5" && $outletStatus == "off") {
  25. $rfCodes = array(1078540);
  26. } else if ($outletLight == "6" && $outletStatus == "on") {
  27. $rfCodes = array(1070387, 1070531, 1070851, 1072387, 1078531);
  28. } else if ($outletLight == "6" && $outletStatus == "off") {
  29. $rfCodes = array(1070396, 1070540, 1070860, 1072396, 1078540);
  30. }
  31.  
  32.  
  33. foreach ($rfCodes as $rfCode) {
  34. shell_exec($rfPath . $rfCode);
  35. sleep(3);
  36. }
  37.  
  38. echo json_encode(array('success' => true));
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment