|
|
<?php require_once('../ajax_asm.php'); require_once('../php/argus/server.php'); if( $CUser->Data['id'] > 1 ){ $MID = intval( $_POST['MID'] ); $QS = "SELECT * FROM `metro_modules` WHERE `id`={$MID}"; $Result = $DATABASE->Query( $QS, false ); if( count( $Result ) ){ $CR = $Result[0]; $TTPL=<<<DATA_BOUNDARY { xtype: 'panel', border: false, frame: false, tbar:[{ id: 'btn_del_module', text: '{$Labels->GetLabel('_SMM_DEL_MODULE_')}', handler: function(){ Ext.Msg.show({ title:'{$Labels->GetLabel('_REMOVE_MODULE_')}?', msg: '{$Labels->GetLabel('_REMOVE_MODU_QUES_')}?', buttons: Ext.Msg.YESNOCANCEL, fn: function(btn){ if( btn == 'yes' ){ SelectedModule = 0; doModuleOperation( {$CR['id']}, 200, '', true ); }; }, animEl: 'elId', icon: Ext.MessageBox.QUESTION }); } }], items:[%%%ITEMS%%%] }DATA_BOUNDARY;
$ITEMS = array(); $INFO = '<table width="100%" border=0 style="font-weight: bold;"><tr><td width="130px" align="right">'.$Labels->GetLabel('_STATUS_').':</td><td>'.((0)?'Online':'Offline').'</td></tr><tr><td align="right">'.$Labels->GetLabel('_VERSION_').':</td><td>'.(($CR['tls_version']!='')?$CR['tls_version']:'No Version Info').'</td></tr></table>'; $ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<span class=\"setEd_infoPanel\" id=\"SENSOR_".(($CR['status']=='E')?'A':'N')."\"><table width=\"100%\" border=0><tr><td align=\"center\" valign=\"middle\"><div class=\"module_img_sset\"></div></td></tr><tr><td>{$INFO}</td></tr></table></span><br/>'}"; $ITEMS[1] =<<<DATA_BOUNDARY{ xtype: 'tabpanel', activeTab: 0, items:[{ title: 'General', items:[{ xtype: 'button', text: '{$Labels->GetLabel('_OP_MODULE_CTRL_')}', width: '100%', iconCls: 'srv_op_modctrl', scale: 'large', handler: moduleControl },{ xtype: 'button', text: '{$Labels->GetLabel('_OP_CAMERA_CTRL_')}', width: '100%', iconCls: 'srv_op_camctrl', scale: 'large', handler: moduleCamControl },{ xtype: 'button', text: 'Open Host Control', width: '100%', iconCls: 'srv_op_hostctrl', scale: 'large', handler: moduleHostControl }] },{ title: 'Connection Settings', xtype: 'form', labelWidth: 200, border: false, frame: false, labelAlign: 'right', items:[{ xtype: 'combo', fieldLabel: "{$Labels->GetLabel( '_STATUS_' )}", id: 'mod_stst', width: 200, lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['val','disp'], data: [['E','Enabled'], ['D','Disabled']] }), valueField: 'val', displayField: 'disp', value: '{$CR['status']}', listeners:{ select: function( t, r, i ){ doModuleOperation( {$CR['id']}, 14, r.data.val, true ); } } },{ xtype: 'textfield', fieldLabel: 'IP Address', value: '{$CR['IP4']}', listeners:{ change: function( a, c, b ){ doModuleOperation( {$CR['id']}, 4, c, true ); } } },{ xtype: 'textfield', fieldLabel: 'Identity', value: '{$CR['identity']}', listeners:{ change: function( a, c, b ){ doModuleOperation( {$CR['id']}, 5, c, false ); } } },{ xtype: 'textfield', fieldLabel: 'Module Login', value: '{$CR['m_login']}', listeners:{ change: function( a, c, b ){ doModuleOperation( {$CR['id']}, 6, c, false ); } } },{ xtype: 'textfield', fieldLabel: 'Module Password', value: '{$CR['m_password']}', listeners:{ change: function( a, c, b ){ doModuleOperation( {$CR['id']}, 7, c, false ); } } },{ xtype: 'textfield', fieldLabel: 'Host Login', value: '{$CR['h_login']}', listeners:{ change: function( a, c, b ){ doModuleOperation( {$CR['id']}, 10, c, false ); } } },{ xtype: 'textfield', fieldLabel: 'Host Password', value: '{$CR['h_password']}', listeners:{ change: function( a, c, b ){ doModuleOperation( {$CR['id']}, 11, c, false ); } } },{ xtype: 'textfield', fieldLabel: 'Camera Login', value: '{$CR['c_login']}', listeners:{ change: function( a, c, b ){ doModuleOperation( {$CR['id']}, 12, c, false ); } } },{ xtype: 'textfield', fieldLabel: 'Camera Password', value: '{$CR['c_password']}', listeners:{ change: function( a, c, b ){ doModuleOperation( {$CR['id']}, 13, c, false ); } } }] }]}DATA_BOUNDARY; $CONTENT = implode(',',$ITEMS); $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL ); echo $TTPL; } else { echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}'; }; } else { header('location: /'); };?>
|