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.

37 lines
939 B

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $SiteID = intval( $_POST['SITE'] );
  5. $QS = "SELECT * FROM nodes WHERE site_id = {$SiteID}";
  6. $result = $DATABASE->Query( $QS, false );
  7. $Data = file_get_contents( 'dash/tpl.js' );
  8. if( count( $result ) > 0 ){
  9. $index = 0;
  10. $TPL = array();
  11. foreach( $result as $R ){
  12. $TPL[$index] = file_get_contents( 'dash/node_' . $R['type'] . '.js' );
  13. $TPL[$index] = str_replace('%%%NODEID%%%', ''.$R['id'] , $TPL[$index] );
  14. switch( $R['type'] ){
  15. case ARGUS_SERVER:{
  16. break;
  17. };
  18. case ARGUS_3D_SENSOR:{
  19. break;
  20. };
  21. case ARGUS_IP_PTZ_CAMERA:{
  22. break;
  23. };
  24. };
  25. $index++;
  26. };
  27. $ITEMS = implode( ',', $TPL );
  28. $Data = str_replace('%%%ITEMS%%%', ''.$ITEMS , $Data );
  29. };
  30. if( $Data != '' ) {
  31. echo $Data;
  32. } else {
  33. echo '{}';
  34. };
  35. exit();
  36. };
  37. echo "{}";
  38. ?>