21 changed files with 1123 additions and 634 deletions
-
2lib/1.json
-
98lib/controller/doPlatformOperations.php
-
13lib/controller/doStationOperations.php
-
20lib/controller/getHistorySessionView.php
-
305lib/controller/getPlatformEditor.php
-
306lib/controller/getScadaEditor.php
-
23lib/controller/getScadaModules.php
-
13lib/controller/getSessionData.php
-
39lib/controller/getStationEditor.php
-
18lib/controller/getStatus.php
-
196lib/controller/getVideoComposerSettings.php
-
24lib/javascript/jsapi_dynamic/argus_main.js
-
395lib/javascript/jsapi_dynamic/argus_monitoring.js
-
20lib/javascript/jsapi_dynamic/argus_reports.js
-
163lib/javascript/jsapi_dynamic/argus_settings.js
-
4lib/php/argus/templates.php
-
4lib/php/ui/UI_functions.php
-
2lib/settings.php
-
44lib/upgrade_database.php
-
2lib/version.var
-
66style/style.css
2
lib/1.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,306 @@ |
|||||
|
<?php |
||||
|
require_once('../ajax_asm.php'); |
||||
|
require_once('../php/argus/server.php'); |
||||
|
if( $CUser->Data['id'] > 1 ){ |
||||
|
$EID = intval( $_POST['MID'] ); |
||||
|
$QS = "SELECT * FROM `modbus_modules` WHERE `id`={$EID}"; |
||||
|
$Result = $DATABASE->Query( $QS, false ); |
||||
|
if( count( $Result ) ){ |
||||
|
$SC = $Result[0]; |
||||
|
$CCCV = intval( $SC['values'] ); |
||||
|
if( ( $CCCV & 0x01 ) == 0x01 ) $P1 = 'true'; else $P1 = 'false'; |
||||
|
if( ( $CCCV & 0x02 ) == 0x02 ) $P2 = 'true'; else $P2 = 'false'; |
||||
|
if( ( $CCCV & 0x04 ) == 0x04 ) $P3 = 'true'; else $P3 = 'false'; |
||||
|
if( ( $CCCV & 0x08 ) == 0x08 ) $P4 = 'true'; else $P4 = 'false'; |
||||
|
$MODBUS=<<<DATA_BOUNDARY |
||||
|
{ |
||||
|
xtype: 'form', |
||||
|
labelWidth: 150, |
||||
|
labelAlign: 'right', |
||||
|
width: '100%', |
||||
|
items:[{ |
||||
|
xtype: 'panel', |
||||
|
border: false, |
||||
|
frame: false, |
||||
|
html: '<table width="100%" border=0><tr><td class="small_prop_logo" id="adam"> </td><td class="small_prop_title" align="center">{$Labels->GetLabel('_MODBUS_RTU_')}:{$SC['label']}</td></tr></table>' |
||||
|
},{ |
||||
|
xtype: 'textfield', |
||||
|
id: 'sca_label', |
||||
|
fieldLabel: '{$Labels->GetLabel('_NAME_LABEL_')}', |
||||
|
maxlength: 64, |
||||
|
value: '{$SC['label']}', |
||||
|
listeners:{ |
||||
|
change: function( a, c, b ){ |
||||
|
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 14, c, true ); |
||||
|
} |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
id: 'sca_ena', |
||||
|
fieldLabel: "{$Labels->GetLabel('_STATUS_')}", |
||||
|
lazyRender: true, |
||||
|
mode: 'local', |
||||
|
forceSelection: true, |
||||
|
triggerAction: 'all', |
||||
|
editable: false, |
||||
|
disableKeyFilter: true, |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['mode','mode_txt'], |
||||
|
data: [ |
||||
|
['D','{$Labels->GetLabel('__DISABLED__')}'], |
||||
|
['E','{$Labels->GetLabel('___ENABLED__')}'] |
||||
|
] |
||||
|
}), |
||||
|
valueField: 'mode', |
||||
|
displayField: 'mode_txt', |
||||
|
value: '{$SC['wm']}', |
||||
|
fwidth: 200, |
||||
|
listeners:{ |
||||
|
select: function( a, c, b ){ |
||||
|
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 17, b, true ); |
||||
|
} |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'textfield', |
||||
|
id: 'sca_ip', |
||||
|
fieldLabel: '{$Labels->GetLabel('_DEVICE_IP_')}', |
||||
|
maxlength: 64, |
||||
|
value: '{$SC['ip4']}', |
||||
|
listeners:{ |
||||
|
change: function( a, c, b ){ |
||||
|
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 15, c, true ); |
||||
|
} |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'textfield', |
||||
|
id: 'sca_port', |
||||
|
fieldLabel: '{$Labels->GetLabel('_DEVICE_PORT_')}', |
||||
|
maxlength: 2, |
||||
|
value: '{$SC['port']}', |
||||
|
listeners:{ |
||||
|
change: function( a, c, b ){ |
||||
|
doPlatformOperation( {$SC['platform_id']}, 16, c, true ); |
||||
|
} |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'panel', |
||||
|
layout: 'table', |
||||
|
border: false, |
||||
|
frame: false, |
||||
|
width: '100%', |
||||
|
defaults: { |
||||
|
// applied to each contained panel
|
||||
|
bodyStyle:'padding:10px; text-align: center;' |
||||
|
}, |
||||
|
layoutConfig: { |
||||
|
// The total column count must be specified here
|
||||
|
columns: 4 |
||||
|
}, |
||||
|
items:[{ |
||||
|
xtype: 'panel', |
||||
|
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;', |
||||
|
html: 'Upper Track' |
||||
|
},{ |
||||
|
xtype: 'panel', |
||||
|
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;', |
||||
|
html: 'Bottom Track' |
||||
|
},{ |
||||
|
xtype: 'panel', |
||||
|
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;', |
||||
|
html: 'Health Signal' |
||||
|
},{ |
||||
|
xtype: 'panel', |
||||
|
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;', |
||||
|
html: 'AUX Signal' |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
fieldLabel: "Upper Track", |
||||
|
lazyRender: true, |
||||
|
mode: 'local', |
||||
|
forceSelection: true, |
||||
|
triggerAction: 'all', |
||||
|
editable: false, |
||||
|
disableKeyFilter: true, |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['mode','mode_txt'], |
||||
|
data: [ |
||||
|
[-1,'{$Labels->GetLabel('__DISABLED__')}'], |
||||
|
[0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4'] |
||||
|
] |
||||
|
}), |
||||
|
valueField: 'mode', |
||||
|
displayField: 'mode_txt', |
||||
|
value: '{$SC['crossbar_a']}', |
||||
|
width: 100, |
||||
|
listeners:{ |
||||
|
select: function( a, c, b ){ |
||||
|
//doPlatformOperation( {$SC['platform_id']}, 12, b, true );
|
||||
|
} |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
fieldLabel: "Upper Track", |
||||
|
lazyRender: true, |
||||
|
mode: 'local', |
||||
|
forceSelection: true, |
||||
|
triggerAction: 'all', |
||||
|
editable: false, |
||||
|
disableKeyFilter: true, |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['mode','mode_txt'], |
||||
|
data: [ |
||||
|
[-1,'{$Labels->GetLabel('__DISABLED__')}'], |
||||
|
[0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4'] |
||||
|
] |
||||
|
}), |
||||
|
valueField: 'mode', |
||||
|
displayField: 'mode_txt', |
||||
|
value: '{$SC['crossbar_b']}', |
||||
|
width: 100, |
||||
|
listeners:{ |
||||
|
select: function( a, c, b ){ |
||||
|
//doPlatformOperation( {$SC['platform_id']}, 12, b, true );
|
||||
|
} |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
fieldLabel: "Upper Track", |
||||
|
lazyRender: true, |
||||
|
mode: 'local', |
||||
|
forceSelection: true, |
||||
|
triggerAction: 'all', |
||||
|
editable: false, |
||||
|
disableKeyFilter: true, |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['mode','mode_txt'], |
||||
|
data: [ |
||||
|
[-1,'{$Labels->GetLabel('__DISABLED__')}'], |
||||
|
[0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4'] |
||||
|
] |
||||
|
}), |
||||
|
valueField: 'mode', |
||||
|
displayField: 'mode_txt', |
||||
|
value: '{$SC['crossbar_c']}', |
||||
|
width: 100, |
||||
|
listeners:{ |
||||
|
select: function( a, c, b ){ |
||||
|
//doPlatformOperation( {$SC['platform_id']}, 12, b, true );
|
||||
|
} |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
fieldLabel: "Upper Track", |
||||
|
lazyRender: true, |
||||
|
mode: 'local', |
||||
|
forceSelection: true, |
||||
|
triggerAction: 'all', |
||||
|
editable: false, |
||||
|
disableKeyFilter: true, |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['mode','mode_txt'], |
||||
|
data: [ |
||||
|
[-1,'{$Labels->GetLabel('__DISABLED__')}'], |
||||
|
[0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4'] |
||||
|
] |
||||
|
}), |
||||
|
valueField: 'mode', |
||||
|
displayField: 'mode_txt', |
||||
|
value: '{$SC['crossbar_d']}', |
||||
|
width: 100, |
||||
|
listeners:{ |
||||
|
select: function( a, c, b ){ |
||||
|
//doPlatformOperation( {$SC['platform_id']}, 12, b, true );
|
||||
|
} |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10, |
||||
|
colspan: 4 |
||||
|
},{ |
||||
|
xtype: 'panel', |
||||
|
colspan: 4, |
||||
|
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;', |
||||
|
html: 'TEST MODBUS MODULE COILS' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 5, |
||||
|
colspan: 4 |
||||
|
},{ |
||||
|
xtype: 'button', |
||||
|
enableToggle: true, |
||||
|
allowDepress: true, |
||||
|
width: '80%', |
||||
|
text: 'Test D1', |
||||
|
pressed: {$P1}, |
||||
|
handler: function( b, e ){ |
||||
|
if( b.pressed ){ |
||||
|
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 1 ), true ); |
||||
|
} else { |
||||
|
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~1 ) ), true ); |
||||
|
}; |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'button', |
||||
|
width: '80%', |
||||
|
enableToggle: true, |
||||
|
allowDepress: true, |
||||
|
text: 'Test D2', |
||||
|
pressed: {$P2}, |
||||
|
handler: function( b, e ){ |
||||
|
if( b.pressed ){ |
||||
|
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 2 ), true ); |
||||
|
} else { |
||||
|
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~2 ) ), true ); |
||||
|
}; |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'button', |
||||
|
enableToggle: true, |
||||
|
allowDepress: true, |
||||
|
width: '80%', |
||||
|
text: 'Test D3', |
||||
|
pressed: {$P3}, |
||||
|
handler: function( b, e ){ |
||||
|
if( b.pressed ){ |
||||
|
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 4 ), true ); |
||||
|
} else { |
||||
|
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~4 ) ), true ); |
||||
|
}; |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'button', |
||||
|
enableToggle: true, |
||||
|
allowDepress: true, |
||||
|
width: '80%', |
||||
|
text: 'Test D4', |
||||
|
pressed: {$P4}, |
||||
|
handler: function( b, e ){ |
||||
|
if( b.pressed ){ |
||||
|
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 8 ), true ); |
||||
|
} else { |
||||
|
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~8 ) ), true ); |
||||
|
}; |
||||
|
} |
||||
|
}] |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 5, |
||||
|
colspan: 4 |
||||
|
},{ |
||||
|
xtype: 'button', |
||||
|
text: 'Remove this Scada Module', |
||||
|
width: '100%', |
||||
|
handler: function(){ |
||||
|
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 13, 'true', true ); |
||||
|
} |
||||
|
}] |
||||
|
} |
||||
|
DATA_BOUNDARY; |
||||
|
echo $MODBUS; |
||||
|
} else { |
||||
|
echo '{ xtype: \'panel\', html: \'Node '.$_POST['EID'].' Loadded\'}'; |
||||
|
}; |
||||
|
} else { |
||||
|
header('location: /'); |
||||
|
}; |
||||
|
?>
|
||||
@ -0,0 +1,23 @@ |
|||||
|
<?php |
||||
|
require_once('../ajax_asm.php'); |
||||
|
ob_start(); |
||||
|
if( $CUser->Data['id'] > 1 ){ |
||||
|
$Data['status'] = 'na'; |
||||
|
$EID = intval( $_POST['PID'] ); |
||||
|
$QS = "SELECT * FROM `modbus_modules` WHERE `platform_id`={$EID}"; |
||||
|
$Result = $DATABASE->Query( $QS, false ); |
||||
|
if( count( $Result ) ){ |
||||
|
$SenPart = array(); |
||||
|
foreach( $Result as $R ){ |
||||
|
$AA = ($R['wm']=='E')?'active_green':'active_gray'; |
||||
|
$SenPart[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item '.$AA.'" onclick="editScadaModule('.$R['id'].');">'.$R['ip4'].' '.urldecode($R['label']).'</a>\'}'; |
||||
|
}; |
||||
|
$Data['status']='ok'; |
||||
|
$Data['modules'] = '['.implode( ',', $SenPart ) .']'; |
||||
|
}; |
||||
|
$Data['messages'] = ob_get_clean(); |
||||
|
echo json_encode( $Data ); |
||||
|
} else { |
||||
|
header('location: /'); |
||||
|
}; |
||||
|
?>
|
||||
@ -0,0 +1,196 @@ |
|||||
|
<?php |
||||
|
require_once('../ajax_asm.php'); |
||||
|
|
||||
|
if( $CUser->Data['id'] > 1 ){ |
||||
|
$Data['status'] = 'error'; |
||||
|
if( $CUser->Data['access'] > 5 ){ |
||||
|
$QS = "SELECT * FROM `system_props` WHERE `id`=1"; |
||||
|
$Result = $DATABASE->Query( $QS ); |
||||
|
$CS = $Result[0]; |
||||
|
$SKEL=<<<DATABOUNDARY |
||||
|
{ |
||||
|
xtype: 'panel', |
||||
|
border: false, |
||||
|
frame: false, |
||||
|
items:[{ |
||||
|
xtype: 'form', |
||||
|
labelAlign: 'right', |
||||
|
labelWidth: 250, |
||||
|
//height: PanelH - 30,
|
||||
|
items:[{ |
||||
|
xtype:'panel', |
||||
|
border: false, |
||||
|
frame: false, |
||||
|
html: '<table width="100%" border=0 class="setEd_infoPanel" id="LIBAV_LOGO"><tr><td width="200px"><div class="appis_logo_img"></div></td><td valign="middle">Application Settings</td></tr><tr><td colspan=2></td></tr></table><br/>' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
id: 'db_loging', |
||||
|
fieldLabel: '{$Labels->GetLabel('_DB_LOGGING_')}', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['0',"Disabled"], ['1',"Enabled"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 32 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
doApplicationOperation( 41, r.data.cid ); |
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['use_db_logging']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
id: 'ses_window', |
||||
|
fieldLabel: '{$Labels->GetLabel('_APP_SESS_WND_')}', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['1',"30 Seconds"],['2',"1 Minute"], ['3',"2 Minutes"], ['4',"3 Minutes"], ['5',"4 Minutes"],['6',"5 Minutes"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 33 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
doApplicationOperation( 6, r.data.cid ); |
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['session_end']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
id: 'menc_cnt', |
||||
|
fieldLabel: '{$Labels->GetLabel('_APP_MENC_COUNT_')}', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['1',"1"], ['2',"2"], ['3',"3"], ['4',"4"],['5',"5"],['6',"6"],['7',"7"],['8',"8"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 34 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
doApplicationOperation( 7, r.data.cid ); |
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['encoder_limit']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'numberfield', |
||||
|
fieldLabel: 'SCADA Auto Time', |
||||
|
editable: true, |
||||
|
width: 250, |
||||
|
value: '{$CS['modbus_auto_rise']}', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 35 ); |
||||
|
}, |
||||
|
change: function( t, r, i ){ |
||||
|
doApplicationOperation( 43, r ); |
||||
|
} |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
fieldLabel: 'SCADA Manual Activation', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['0',"Disabled"], ['3',"Alert"], ['4',"Hazard"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 36 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
doApplicationOperation( 44, r.data.cid, true ); |
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['modbus_hazard_level']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
fieldLabel: 'SCADA Health Level', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['0',"Disabled"],['1',"Camera Failure"],['2',"LRF Failure"],['3',"Sensor Communication"],['4',"Module SW Failure"],['5',"Module Network Failure"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 37 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
doApplicationOperation( 45, r.data.cid, true ); |
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['modbus_health_level']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
}] |
||||
|
}] |
||||
|
} |
||||
|
DATABOUNDARY; |
||||
|
$Data['status']= 'ok'; |
||||
|
$Data['content']=$SKEL; |
||||
|
} else { |
||||
|
$Data['msg']='Access Denied!'; |
||||
|
}; |
||||
|
echo json_encode( $Data ); |
||||
|
} else { |
||||
|
header('location: /'); |
||||
|
}; |
||||
|
?>
|
||||
@ -0,0 +1,44 @@ |
|||||
|
<?php |
||||
|
error_reporting( E_ALL ); |
||||
|
require_once('settings.php'); |
||||
|
require_once('defines.php'); |
||||
|
$UPGRADE = false; |
||||
|
$TT_123 = explode( '.', PHP_VERSION ); |
||||
|
if( $TT_123[0] == '4' ){ |
||||
|
require_once( 'php/db/MySQL_class.php' ); |
||||
|
$DATABASE = new MySQL_DB($DBHost, $DBName, $DBUser, $DBPassword); |
||||
|
} elseif( $TT_123[0] > '4' ){ |
||||
|
require_once( 'php/db/MySQLi_class.php' ); |
||||
|
$DATABASE = new MySQLi_DB($DBHost, $DBName, $DBUser, $DBPassword); |
||||
|
} else { |
||||
|
echo "CANNOT DETERMINE DATABASE ENGINE!!!!!!!\n\n"; |
||||
|
exit(); |
||||
|
}; |
||||
|
|
||||
|
$QS="SHOW INDEX FROM `modbus_modules` WHERE Column_name='platform_id'"; |
||||
|
$R = $DATABASE->Query( $QS ); |
||||
|
if( count( $R ) ){ |
||||
|
$QS = "ALTER TABLE `modbus_modules` DROP INDEX `{$R[0]['Key_name']}`"; |
||||
|
$UPGRADE = true; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
}; |
||||
|
$QS = "SHOW COLUMNS FROM `modbus_modules` LIKE 'label'"; |
||||
|
$R = $DATABASE->Query( $QS ); |
||||
|
if( count( $R ) == 0 ){ |
||||
|
$QS = "ALTER TABLE `modbus_modules` ADD `label` CHAR(32) DEFAULT ''"; |
||||
|
$UPGRADE = true; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
}; |
||||
|
$QS = "SHOW COLUMNS FROM `metro_stations` LIKE 'short'"; |
||||
|
$R = $DATABASE->Query( $QS ); |
||||
|
if( count( $R ) == 0 ){ |
||||
|
$QS = "ALTER TABLE `metro_stations` ADD `short` CHAR(32) DEFAULT ''"; |
||||
|
$UPGRADE = true; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
}; |
||||
|
if( $UPGRADE ){ |
||||
|
echo "Upgrade Done!\n\n"; |
||||
|
} else { |
||||
|
echo "No Upgrade Needed!\n\n"; |
||||
|
}; |
||||
|
?>
|
||||
@ -1 +1 @@ |
|||||
20251012 |
|
||||
|
20260304 |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue