|
|
<?php require_once('../ajax_asm.php'); ob_start(); $UID = intval( $CUser->Data['id'] ); $ACCESS = intval( $CUser->Data['access'] ); if( $UID > 1 ){ $Data['status']='na'; $TY = intval( $_POST['TYP'] ); $QS="SELECT * FROM system_props LIMIT 1"; $RV = $DATABASE->Query( $QS ); if( count( $RV ) ){ $AP_DATA = $RV[0]; if( $AP_DATA['hw_info'] == '' ) $AP_DATA['hw_info'] = 'MUST_DO_DETECTION'; if( $AP_DATA['os_info'] == '' ) $AP_DATA['os_info'] = 'MUST_RESTART_SERVER'; } else { $AP_DATA = array( 'anchor_lat'=>0, 'anchor_lon'=>0, 'anchor_alt'=>0, 'type'=>0, 'name'=>'INITIAL_SETUP_MODE', 'os_info'=>'MUST_RESTART_SERVER', 'hw_info'=>'MUST_DO_DETECTION' ); }; $QS="SELECT `site_id`, `version_string` FROM `servers` LIMIT 1"; $RR = $DATABASE->Query( $QS ); if( count( $RR ) ){ $AP_DATA['site_id'] = intval( $RR[0]['site_id']); $AP_DATA['build'] = $RR[0]['version_string']; } else { $AP_DATA['site_id'] = 1; $AP_DATA['build'] = 'undefined-build'; }; switch( $TY ){ case 0:{ $Data['status']='ok'; $QS = "SELECT `identity` FROM `servers` LIMIT 1"; $TT = $DATABASE->Query( $QS ); if( count( $TT ) ){ $IDT = $TT[0]['identity']; } else { $IDT = "----No-Identity-Set---"; }; $Data['content']=<<<DATA_BOUNDARY[{ xtype: 'spacer', height: 10 },{ xtype: 'panel', frame: false, border: true, bodyStyle: 'background-color: white;', html: '<center><img height=\"120px\" src=\"/style/assets/{$AP_DATA['oem_logo']}.png\"></center>', height: 130 },{ xtype: 'spacer', height: 10 },{ xtype: 'textfield', fieldLabel: "{$Labels->GetLabel( '_INSTANCE_ID_' )}", width: 300, value: '{$IDT}' },{ xtype: 'spacer', height: 10 },{ xtype: 'button', text: "{$Labels->GetLabel( '_GEN_INSTANCE_ID_' )}", width: 550, handler: function(){ doApplicationOperation( 3, 0 ); } },{ xtype: 'spacer', height: 10 },{ xtype: 'combo', fieldLabel: "{$Labels->GetLabel('_DEBUGGING_MODE_')}", editable: false, typeAhead: true, width: 300, triggerAction: 'all', lazyRender:true, mode: 'local', store: new Ext.data.ArrayStore({ fields: ['sid', 'snam'], data: [[0,"{$Labels->GetLabel('__DISABLED__')}"], [1,"{$Labels->GetLabel('___ENABLED__')}"]] }), value: '{$AP_DATA['work_mode']}', valueField: 'sid', displayField: 'snam', listeners:{ select: function( t, r, i ){ doApplicationOperation( 1, i ); } } },{ xtype: 'spacer', height: 10 },{ xtype: 'combo', fieldLabel: "{$Labels->GetLabel('_USE_REMOTE_SERVER_')}", editable: false, typeAhead: true, width: 300, triggerAction: 'all', lazyRender:true, mode: 'local', store: new Ext.data.ArrayStore({ fields: ['sid', 'snam'], data: [[0,"{$Labels->GetLabel('__DISABLED__')}"], [1,"{$Labels->GetLabel('___ENABLED__')}"]] }), value: '{$AP_DATA['use_remote_server']}', valueField: 'sid', displayField: 'snam', listeners:{ select: function( t, r, i ){ doApplicationOperation( 10, i ); } } },{ xtype: 'spacer', height: 10 },{ xtype: 'textfield', fieldLabel: "{$Labels->GetLabel('_REMOTE_SERVER_ADDRESS_')}", width: 300, value: '{$AP_DATA['remote_ip']}', listeners:{ change: function( a, c, b ){ doApplicationOperation( 8, c ); } } },{ xtype: 'spacer', height: 10 },{ xtype: 'numberfield', fieldLabel: "{$Labels->GetLabel('_REMOTE_SERVER_PORT_')}", width: 300, value: '{$AP_DATA['remote_port']}', listeners:{ change: function( a, c, b ){ doApplicationOperation( 9, c ); } } },{ xtype: 'spacer', height: 10 },{ xtype: 'textfield', fieldLabel: "{$Labels->GetLabel('_BACKUP_SERVER_ADDRESS_')}", width: 300, value: '{$AP_DATA['remote_backup_ip']}', listeners:{ change: function( a, c, b ){ doApplicationOperation( 12, c ); } } },{ xtype: 'spacer', height: 10 },{ xtype: 'numberfield', fieldLabel: "{$Labels->GetLabel('_BACKUP_SERVER_PORT_')}", width: 300, value: '{$AP_DATA['remote_backup_port']}', listeners:{ change: function( a, c, b ){ doApplicationOperation( 13, c ); } } },{ xtype: 'spacer', height: 10 },{ xtype: 'combo', fieldLabel: "{$Labels->GetLabel('_SKIP_LOCAL_REPORTS_')}", editable: false, typeAhead: true, width: 300, triggerAction: 'all', lazyRender:true, mode: 'local', store: new Ext.data.ArrayStore({ fields: ['sid', 'snam'], data: [[0,"{$Labels->GetLabel('__DISABLED__')}"], [1,"{$Labels->GetLabel('___ENABLED__')}"]] }), value: '{$AP_DATA['skip_local_report']}', valueField: 'sid', displayField: 'snam', listeners:{ select: function( t, r, i ){ doApplicationOperation( 11, i ); } } }] DATA_BOUNDARY; break; }; case 1:{ $Data['status']='ok'; $Data['content']=<<<DATA_BOUNDARY[{ columnWidth: 0.83, frame: false, border: false, title: false, items: [{ xtype: 'panel', border: false, title: false, frame: false, id: 'sys_location_map', height: PanelH-170, html: ' ', listeners:{ afterrender: function( t, state ){ loadLocationEditor('sys_location_map'); } } },{ layout: 'table', title: "{$Labels->GetLabel('_SITE_PROP_LBL_')}", flex: 1, defaults: { bodyStyle:'padding:20px' }, layoutConfig: { columns: 8, textAlign: 'center' }, items:[{ border: false, id: 'lab_123', html: "{$Labels->GetLabel('_SYS_ANCHORT_LBL_')} "+((MAP_IS_LOCAL)?'Pos X':"{$Labels->GetLabel('_LON_SHORT_LBL_')}")+':' },{ xtype: 'numberfield', width: 100, decimalPrecision: 8, id: 'siteLon', value: SiteLon },{ border: false, id: 'lab_124', html: ((MAP_IS_LOCAL)?'Pos Y':"{$Labels->GetLabel('_LAT_SHORT_LBL_')}")+':' },{ xtype: 'numberfield', id: 'siteLat', decimalPrecision: 8, width: 100, value: SiteLat },{ border: false, html: "{$Labels->GetLabel('_ALT_SHORT_LBL_')}:" },{ xtype: 'numberfield', decimalPrecision: 2, width: 100, id: 'siteAlt', value: SiteAlt },{ xtype: 'button', text: "{$Labels->GetLabel('_UPDATE_LBL_')}", handler: updateSiteAnchor },{ xtype: 'panel', frame: false, border: false, rowspan: 2, html: ((MAP_IS_LOCAL)?'<img id="lab_125" height="64px" src="/style/assets/map_mode_decart.png">':'<img id="lab_125" height="64px" src="/style/assets/map_mode_wgs84.png">') },{ border: false, html: "{$Labels->GetLabel('_MAP_TYP_LBL_')}:" },{ xtype: 'combo', disabled: false, typeAhead: true, triggerAction: 'all', id: 'siteMap', lazyRender:true, colspan: 3, mode: 'local', store: mapListStore, value: MAP_ID, valueField: 'map_id', displayField: 'map_name', listeners:{ select: function(){ updateSiteMap(); LoadNodesList(); } } },{ xtype: 'button', disabled: false, text: "{$Labels->GetLabel('_DELETE_')}", handler: function(){ deleteCurrentMap(); } },{ xtype: 'button', id: 'add-c_map-btn', disabled: false, text: "{$Labels->GetLabel('_CREATE_NEW_LBL_')}", handler: function(){ createNewMap(); } }] }] },{ frame: true, border: false, xtype: 'panel', flex: 1, height: PanelH, columnWidth: 0.17, layout: 'fit', id: 'prop_content', items:[{ html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>" }] }]DATA_BOUNDARY; break; }; case 4:{ $Data['status']='ok'; $Data['content']=<<<DATA_BOUNDARY[{ xtype: 'spacer', height: 10 },{ xtype: 'combo', fieldLabel: "{$Labels->GetLabel('_MULTYDIS_ENA_')}", editable: false, typeAhead: true, width: 300, triggerAction: 'all', lazyRender:true, mode: 'local', disabled: true, store: new Ext.data.ArrayStore({ fields: ['sid', 'snam'], data: [[0,"{$Labels->GetLabel('__DISABLED__')}"], [1,"{$Labels->GetLabel('___ENABLED__')}"]] }), value: '{$AP_DATA['skip_local_report']}', valueField: 'sid', displayField: 'snam', listeners:{ select: function( t, r, i ){ if( i ){ showMultyLayoutEditor(); }; //doApplicationOperation( 11, i );
} } },{ xtype: 'spacer', height: 10 },{ xtype: 'panel', layout: 'fit', height: PanelH - 190, id: 'mui_editor', border: true, frame: false, disabled: true, items:[{ xtype:'portal', region:'center', margins:'35 5 5 0', items:[{ columnWidth:.33, style:'padding:10px 0 10px 10px', items:[/*{ title: 'Grid in a Portlet', layout:'fit', rowspan: 2, tools: [{ id:'gear', handler: function(){ Ext.Msg.alert('Message', 'The Settings tool was clicked.'); } },{ id:'close', handler: function(e, target, panel){ panel.ownerCt.remove(panel, true); } }], html: 'chucha' },{ title: 'Another Panel 1', tools: [{ id:'gear', handler: function(){ Ext.Msg.alert('Message', 'The Settings tool was clicked.'); } },{ id:'close', handler: function(e, target, panel){ panel.ownerCt.remove(panel, true); } }], html: 'chucha' }] },{ columnWidth:.33, style:'padding:10px 0 10px 10px', items:[{ title: 'Panel 2', tools: [{ id:'gear', handler: function(){ Ext.Msg.alert('Message', 'The Settings tool was clicked.'); } },{ id:'close', handler: function(e, target, panel){ panel.ownerCt.remove(panel, true); } }], html: 'chucha' },{ title: 'Another Panel 2', tools: [{ id:'gear', handler: function(){ Ext.Msg.alert('Message', 'The Settings tool was clicked.'); } },{ id:'close', handler: function(e, target, panel){ panel.ownerCt.remove(panel, true); } }], html: 'chucha' }] },{ columnWidth:.33, style:'padding:10px', items:[{ title: 'Panel 3', tools: [{ id:'gear', handler: function(){ Ext.Msg.alert('Message', 'The Settings tool was clicked.'); } },{ id:'close', handler: function(e, target, panel){ panel.ownerCt.remove(panel, true); } }], html: 'chucha' },{ title: 'Another Panel 3', colspan: 2, tools: [{ id:'gear', handler: function(){ Ext.Msg.alert('Message', 'The Settings tool was clicked.'); } },{ id:'close', handler: function(e, target, panel){ panel.ownerCt.remove(panel, true); } }], html: 'chucha' }*/] }] /* * Uncomment this block to test handling of the drop event. You could use this * to save portlet position state for example. The event arg e is the custom * event defined in Ext.ux.Portal.DropZone. */ // ,listeners: {
// 'drop': function(e){
// Ext.Msg.alert('Portlet Dropped', e.panel.title + '<br />Column: ' +
// e.columnIndex + '<br />Position: ' + e.position);
// }
// }
}] }]DATA_BOUNDARY; break; }; }; $Data['messages'] = ob_get_clean(); echo json_encode( $Data ); } else { header('location: /'); };?>
|