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.
209 lines
7.2 KiB
209 lines
7.2 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
$UID = intval( $CUser->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 =<<<jodjhowierewt
|
|
{
|
|
xtype: 'panel',
|
|
html: '<table id="tbl_ph_ccc_%%ID%%" style="color: black; background-image: url(\'/style/assets/16-9-nocam.png\');" width="100%" border=0><tr><td colspan=3> </td></tr><tr><td> </td><td align="center"><div id="btn_ph_ccc_%%ID%%"></div></td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></table>',
|
|
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: '<center>Proceed to Cameras Settings to Assign One</center>'
|
|
},{
|
|
xtype: 'spacer',
|
|
height: 20
|
|
},{
|
|
xtype: 'button',
|
|
width: '100%',
|
|
text: 'Open Camera Settings',
|
|
handler: function(){
|
|
showContent( 2020 );
|
|
}
|
|
}]
|
|
});
|
|
jaja.doLayout();
|
|
}
|
|
}
|
|
}
|
|
jodjhowierewt;
|
|
|
|
$LOGIO=<<<kahkjahskfgkgkh
|
|
{
|
|
xtype: 'grid',
|
|
id: 'rep_grid',
|
|
border: false,
|
|
frame: false,
|
|
autoScroll: true,
|
|
//width: '100%',
|
|
lazyRender: true,
|
|
height: 210,
|
|
ds: rep_store,
|
|
cm: new Ext.grid.ColumnModel( rep_ColModel_ops ),
|
|
sm: new Ext.grid.RowSelectionModel( rep_SelModel_ops ),
|
|
viewConfig: {
|
|
forceFit: true,
|
|
getRowClass: function( record, rowIndex, rowParams, store){
|
|
switch( record.get('node_id')%5 ){
|
|
case 0: return 'row-level01';
|
|
case 1: return 'row-level02';
|
|
case 2: return 'row-level03';
|
|
case 3: return 'row-level04';
|
|
case 4: return 'row-level05';
|
|
};
|
|
return '';
|
|
}
|
|
},
|
|
listeners:{
|
|
afterrender : function( t ){
|
|
var papa = Ext.getCmp('segment_portal');
|
|
var jj = papa.getComponent( 1 ).getHeight();
|
|
var mama = Ext.getCmp('lg_panel');
|
|
var R = PanelH - jj - 30;
|
|
mama.setHeight( R+40 );
|
|
t.setHeight( R );
|
|
}
|
|
}
|
|
}
|
|
kahkjahskfgkgkh;
|
|
|
|
$DUMMY['camera']="{xtype:'panel', id:'pan_ph_ccc_%%ID%%', title: 'Camera Placeholder', frame: true, border: true, draggable: false, layouit: 'fit', items:{$TABA}}";
|
|
$DUMMY['sensor']="{xtype:'panel', title: 'Sensor Placeholder', frame: true, border: true, draggable: false, html:'NO SENSOR', listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 66+W );}}}";
|
|
$DUMMY['map']="{xtype:'panel', title: 'Map Placeholder', frame: true, height: 200, border: true, draggable: false, html:'NO MAP'}";
|
|
$DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: 'Report Log', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
|
|
} else {
|
|
$DUMMY['camera']="{xtype:'panel', title: false, frame: true, draggable: false, html: ' ', listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9);}}}";
|
|
$DUMMY['sensor']="{xtype:'panel', title: false, frame: true, draggable: false, html: ' ', listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9);}}}";
|
|
$DUMMY['map']="{xtype:'panel', title: false, frame: true, draggable: false, height: 200, html: ' '}";
|
|
$DUMMY['log']="{xtype:'panel', title: false, frame: true, draggable: false, height: 200, html: ' '}";
|
|
};
|
|
$STA = array();
|
|
$END="]}";
|
|
$OUT = array();
|
|
{
|
|
$STA[0]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
|
|
$STA[1]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
|
|
$STA[2]="{ columnWidth: .50, 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 = 'report/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 );
|
|
$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 = 'report/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 );
|
|
$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 );
|
|
|
|
$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( 1 ){
|
|
case 1:{
|
|
// LA Metro
|
|
$OUT[]= $STA[3] . $DUMMY['log'] . $END;
|
|
break;
|
|
};
|
|
case 2:{
|
|
//Togo
|
|
$OUT[]= $STA[3] . $DUMMY['map'] . $END;
|
|
break;
|
|
};
|
|
}
|
|
};
|
|
$Data = '[' . implode( ',' , $OUT ) . ']';
|
|
} else {
|
|
$Data = '[{columnWidth: 1, items:{html:"NO SYSTEM PROPS"}} ]';
|
|
};
|
|
};
|
|
if( $Data != '' ) {
|
|
echo $Data;
|
|
} else {
|
|
echo '[]';
|
|
};
|
|
?>
|