Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.2 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $SiteID = intval($_POST['NID']);
  5. $NodeType = intval($_POST['TYPE']);
  6. if( $NodeType ){
  7. $QS = "INSERT INTO nodes SET type={$NodeType}, site_id={$SiteID}";
  8. $DATABASE->Query( $QS, false );
  9. $DevID = $DATABASE->getLastInsertID();
  10. if( $DevID ){
  11. switch( $NodeType ){
  12. case 1://Als
  13. case 2://Lfs
  14. case 3://Pls
  15. case 4://pls
  16. $MM = md5(microtime());
  17. $QS = "INSERT INTO sockets SET node_id={$DevID}, `mode`=" . COM_MODE_IN . ", `type`=" . COM_TYPE_UART . ", binded=0, md5='{$MM}', `name`='Device Control Line'";
  18. $DATABASE->Query( $QS, false );
  19. $MM = md5(microtime());
  20. $QS = "INSERT INTO sockets SET node_id={$DevID}, `mode`=" . COM_MODE_OUT . ", `type`=" . COM_TYPE_UART . ", binded=0, md5='{$MM}', `name`='Camera Control Line'";
  21. $DATABASE->Query( $QS, false );
  22. break;
  23. case 5://3D
  24. $MM = md5(microtime());
  25. $QS = "INSERT INTO sockets SET node_id={$DevID}, `mode`=" . COM_MODE_INOUT . ", `type`=" . COM_TYPE_TCP . ", binded=0, md5='{$MM}', `name`='Network Connection'";
  26. $DATABASE->Query( $QS, false );
  27. break;
  28. };
  29. };
  30. };
  31. } else {
  32. header('location: /');
  33. };
  34. ?>