Data['id'] ); $Data = ''; if( $UID > 1 ){ $QS = "SELECT * FROM `system_props` LIMIT 1"; $SPD = $DATABASE->Query( $QS ); if( count( $SPD ) ){ $SP = $SPD[0]; $DUMMY = array(); if( $CUser->Data['access'] > 5 ){ $TABA =<<  
    ', listeners:{ afterrender : function( ){ var tb = document.getElementById('tbl_ph_ccc_%%ID%%'); var W = tb.offsetWidth; var H = (W/16)*9; tb.setAttribute("height", H ); tb.style.backgroundSize=W+"px "+H+"px"; var p = Ext.getCmp('pan_ph_ccc_%%ID%%'); p.setHeight( H+40 ); var jaja = Ext.create({ xtype: 'panel', title: 'Camera is Not Assigned to the System', frame: true, renderTo: 'btn_ph_ccc_%%ID%%', layout: 'vbox', width: 500, height: 120, items:[{ xtype: 'spacer', height: 10 },{ width: '100%', html: '
Proceed to Cameras Settings to Assign One
' },{ xtype: 'spacer', height: 20 },{ xtype: 'button', width: '100%', text: 'Open Camera Settings', handler: function(){ showContent( 2020 ); } }] }); jaja.doLayout(); } } } jodjhowierewt; $LOGIO=<<Query( $QS ); $idx = 0; if( count( $R ) ){ foreach( $R as $DD ){ if( $idx < 4 ){ $TFN = 'dash/node_' . $DD['type'] . '.js'; if(!file_exists( $TFN )) continue; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''. urldecode( $DD['name'] ), $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); $OUT[]= $STA[$idx] . $TPL . $END; } else break; $idx++; }; if( $idx < 4 ){ for( ;$idx<4;$idx++ ){ $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END; }; }; } else { for( ;$idx<4;$idx++ ){ $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END; }; }; $QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 14 AND `enable`=1"; $R = $DATABASE->Query( $QS ); $idx = 0; if( count( $R ) ){ foreach( $R as $DD ){ if( $idx < 2 ){ $TFN = 'dash/node_' . $DD['type'] . '.js'; if(!file_exists( $TFN )) continue; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.urldecode( $DD['name'] ) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}"; $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_eve` WHERE `id`=1"; $S=$DATABASE->Query( $QS ); $MODULE_DATA = $S[0]; $TPL = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL ); //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter']; $FU = '/video_feed/stream?id='. $Z[0]['aux_parameter']; $CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']'; $TPL = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL ); $TPL = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL ); $TPL = str_replace( '%%%SELURL%%%', $FU, $TPL ); $TPL = str_replace( '%%%STREAMID%%%', $DD['aux_parameter'], $TPL ); if( $DD['type'] == 13 || $DD['type'] == 11 ){ $QS = "SELECT `homing_enable` FROM `cameras` WHERE `id`={$DD['aux_id']}"; $JUA = $DATABASE->Query( $QS ); $CAMDATA = $JUA[0]; if( $CAMDATA['homing_enable'] ){ if( $CUser->Data['access'] > 5 ){ $TPL = str_replace( '%%%HBTN%%%', '', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', 'document.getElementById(\'img_btn_0ZZ_'.$DD['aux_id'].'\').addEventListener( \'mousedown\', makePtzHome );', $TPL ); } else { $TPL = str_replace('%%%HBTN%%%', ' ', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL ); }; } else { $TPL = str_replace('%%%HBTN%%%', ' ', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL ); }; }; $FK = $MODULE_DATA['height'] /$MODULE_DATA['width']; $W = 244; $H = $W * $FK; $TPL = str_replace( '%%%WIDTH%%%', $W, $TPL ); $TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL ); $OUT[]= $STA[4+$idx] . $TPL . $END; } else break; $idx++; }; if( $idx < 2 ){ for( ;$idx<2;$idx++ ){ $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] ); $OUT[]= $STA[4+$idx] . $T . $END; }; }; } else { for( ;$idx<2;$idx++ ){ $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] ); $OUT[]= $STA[4+$idx] . $T . $END; }; }; switch( $SP['type'] ){ case 1:{ // LA Metro $OUT[]= $STA[6] . $DUMMY['log'] . $END; break; }; case 2:{ //Togo $OUT[]= $STA[6] . $DUMMY['map'] . $END; break; }; } break; }; case 1:{ $STA[0]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:["; $STA[1]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:["; $STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:["; $STA[3]="{ columnWidth: 1.0, stylse:'padding:10px 0 10px 10px', items:["; $QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1"; $R = $DATABASE->Query( $QS ); $idx = 0; if( count( $R ) ){ foreach( $R as $DD ){ if( $idx < 2 ){ $TFN = 'dash/node_' . $DD['type'] . '.js'; if(!file_exists( $TFN )) continue; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); $OUT[]= $STA[$idx] . $TPL . $END; } else break; $idx++; }; if( $idx < 2 ){ for( ;$idx<2;$idx++ ){ $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END; }; }; } else { for( ;$idx<2;$idx++ ){ $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END; }; }; $QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 14 AND `enable`=1"; $R = $DATABASE->Query( $QS ); $idx = 0; if( count( $R ) ){ foreach( $R as $DD ){ if( $idx < 1 ){ $TFN = 'dash/node_' . $DD['type'] . '.js'; if(!file_exists( $TFN )) continue; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}"; $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_eve` WHERE `id`=1"; $S=$DATABASE->Query( $QS ); $MODULE_DATA = $S[0]; $TPL = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL ); //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter']; $FU = '/video_feed/stream?id='. $Z[0]['aux_parameter']; $CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']'; $TPL = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL ); $TPL = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL ); $TPL = str_replace( '%%%SELURL%%%', $FU, $TPL ); $TPL = str_replace( '%%%STREAMID%%%', $DD['aux_parameter'], $TPL ); if( $DD['type'] == 13 || $DD['type'] == 11 ){ $QS = "SELECT `homing_enable` FROM `cameras` WHERE `id`={$DD['aux_id']}"; $JUA = $DATABASE->Query( $QS ); $CAMDATA = $JUA[0]; if( $CAMDATA['homing_enable'] ){ if( $CUser->Data['access'] > 5 ){ $TPL = str_replace( '%%%HBTN%%%', '', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', 'document.getElementById(\'img_btn_0ZZ_'.$DD['aux_id'].'\').addEventListener( \'mousedown\', makePtzHome );', $TPL ); } else { $TPL = str_replace('%%%HBTN%%%', ' ', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL ); }; } else { $TPL = str_replace('%%%HBTN%%%', ' ', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL ); }; }; $FK = $MODULE_DATA['height'] /$MODULE_DATA['width']; $W = 244; $H = $W * $FK; $TPL = str_replace( '%%%WIDTH%%%', $W, $TPL ); $TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL ); $OUT[]= $STA[2+$idx] . $TPL . $END; } else break; $idx++; }; if( $idx < 1 ){ for( ;$idx<1;$idx++ ){ $T = str_replace( '%%ID%%', 2+$idx , $DUMMY['camera'] ); $OUT[]= $STA[2+$idx] . $T . $END; }; }; } else { for( ;$idx<1;$idx++ ){ $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] ); $OUT[]= $STA[2+$idx] . $T . $END; }; }; switch( $SP['type'] ){ case 1:{ // LA Metro $OUT[]= $STA[3] . $DUMMY['log'] . $END; break; }; case 2:{ //Togo $OUT[]= $STA[3] . $DUMMY['map'] . $END; break; }; } break; }; case 2:{ $STA[0]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:["; $STA[1]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:["; $STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:["; $STA[3]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:["; $STA[4]="{ columnWidth: .5, stylde:'padding:10px 0 10px 10px', items:["; $idx = 0; $QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1"; $R = $DATABASE->Query( $QS ); if( count( $R ) ){ foreach( $R as $DD ){ if( $idx < 3 ){ $TFN = 'dash/node_' . $DD['type'] . '.js'; if(!file_exists( $TFN )) continue; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); $OUT[]= $STA[$idx] . $TPL . $END; } else break; $idx++; }; if( $idx < 3 ){ for( ;$idx<3;$idx++ ){ $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END; }; }; } else { for( ;$idx<3;$idx++ ){ $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END; }; }; $QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 14 AND `enable`=1"; $R = $DATABASE->Query( $QS ); $idx = 0; if( count( $R ) ){ foreach( $R as $DD ){ if( $idx < 2 ){ $TFN = 'dash/node_' . $DD['type'] . '.js'; if(!file_exists( $TFN )) continue; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}"; $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_eve` WHERE `id`=1"; $S=$DATABASE->Query( $QS ); $MODULE_DATA = $S[0]; $TPL = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL ); //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter']; $FU = '/video_feed/stream?id='. $Z[0]['aux_parameter']; $CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']'; $TPL = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL ); $TPL = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL ); $TPL = str_replace( '%%%SELURL%%%', $FU, $TPL ); $TPL = str_replace( '%%%STREAMID%%%', $DD['aux_parameter'], $TPL ); if( $DD['type'] == 13 || $DD['type'] == 11 ){ $QS = "SELECT `homing_enable` FROM `cameras` WHERE `id`={$DD['aux_id']}"; $JUA = $DATABASE->Query( $QS ); $CAMDATA = $JUA[0]; if( $CAMDATA['homing_enable'] ){ if( $CUser->Data['access'] > 5 ){ $TPL = str_replace( '%%%HBTN%%%', '', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', 'document.getElementById(\'img_btn_0ZZ_'.$DD['aux_id'].'\').addEventListener( \'mousedown\', makePtzHome );', $TPL ); } else { $TPL = str_replace('%%%HBTN%%%', ' ', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL ); }; } else { $TPL = str_replace('%%%HBTN%%%', ' ', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL ); }; }; $FK = $MODULE_DATA['height'] /$MODULE_DATA['width']; $W = 244; $H = $W * $FK; $TPL = str_replace( '%%%WIDTH%%%', $W, $TPL ); $TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL ); $OUT[]= $STA[3+$idx] . $TPL . $END; } else break; $idx++; }; if( $idx < 2 ){ for( ;$idx<2;$idx++ ){ $T = str_replace( '%%ID%%', 2+$idx , $DUMMY['camera'] ); $OUT[]= $STA[3+$idx] . $T . $END; }; }; } else { for( ;$idx<2;$idx++ ){ $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] ); $OUT[]= $STA[3+$idx] . $T . $END; }; }; $OUT[]= $STA[3] . $DUMMY['log'] . $END; $OUT[]= $STA[4] . $DUMMY['map'] . $END; break; }; case 3:{ $STA[0]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:["; $STA[1]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:["; $STA[2]="{ columnWidth: .35, stylse:'padding:10px 0 10px 10px', items:["; $STA[3]="{ columnWidth: .65, stylse:'padding:10px 0 10px 10px', items:["; $OUT[]= $STA[0] . $DUMMY['map'] . $END; $QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 14 AND `enable`=1"; $R = $DATABASE->Query( $QS ); $idx = 0; if( count( $R ) ){ foreach( $R as $DD ){ if( $idx < 1 ){ $TFN = 'dash/node_' . $DD['type'] . '.js'; if(!file_exists( $TFN )) continue; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}"; $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_eve` WHERE `id`=1"; $S=$DATABASE->Query( $QS ); $MODULE_DATA = $S[0]; $TPL = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL ); //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter']; $FU = '/video_feed/stream?id='. $Z[0]['aux_parameter']; $CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']'; $TPL = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL ); $TPL = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL ); $TPL = str_replace( '%%%SELURL%%%', $FU, $TPL ); $TPL = str_replace( '%%%STREAMID%%%', $DD['aux_parameter'], $TPL ); if( $DD['type'] == 13 || $DD['type'] == 11 ){ $QS = "SELECT `homing_enable` FROM `cameras` WHERE `id`={$DD['aux_id']}"; $JUA = $DATABASE->Query( $QS ); $CAMDATA = $JUA[0]; if( $CAMDATA['homing_enable'] ){ if( $CUser->Data['access'] > 5 ){ $TPL = str_replace( '%%%HBTN%%%', '', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', 'document.getElementById(\'img_btn_0ZZ_'.$DD['aux_id'].'\').addEventListener( \'mousedown\', makePtzHome );', $TPL ); } else { $TPL = str_replace('%%%HBTN%%%', ' ', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL ); }; } else { $TPL = str_replace('%%%HBTN%%%', ' ', $TPL ); $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL ); }; }; $FK = $MODULE_DATA['height'] /$MODULE_DATA['width']; $W = 244; $H = $W * $FK; $TPL = str_replace( '%%%WIDTH%%%', $W, $TPL ); $TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL ); $OUT[]= $STA[1+$idx] . $TPL . $END; } else break; $idx++; }; } else { for( ;$idx<1;$idx++ ){ $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] ); $OUT[]= $STA[1+$idx] . $T . $END; }; }; $QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1"; $R = $DATABASE->Query( $QS ); $idx = 0; if( count( $R ) ){ foreach( $R as $DD ){ if( $idx < 1 ){ $TFN = 'dash/node_' . $DD['type'] . '.js'; if(!file_exists( $TFN )) continue; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); $OUT[]= $STA[2+$idx] . $TPL . $END; } else break; $idx++; }; } else { for( ;$idx<1;$idx++ ){ $OUT[]= $STA[2+$idx] . $DUMMY['sensor'] . $END; }; }; $OUT[]= $STA[3] . $DUMMY['log'] . $END; break; }; case 4: case 5: default: }; $Data = '[' . implode( ',' , $OUT ) . ']'; } else { $Data = '[{columnWidth: 1, items:{html:"NO SYSTEM PROPS"}} ]'; }; }; if( $Data != '' ) { echo $Data; } else { echo '[]'; }; ?>