M3 Security Fixes for scan command pass 33 major code smell fixes and style fixes
This commit is contained in:
@@ -10,22 +10,22 @@ class sentinelController extends Controller
|
||||
public static function packSyst5Func(Request $request)
|
||||
{
|
||||
|
||||
$AYINTBOX = isset($request->AYINTBOX) ? trim($request->AYINTBOX) : '';
|
||||
$AYCO = isset($request->AYCO) ? trim($request->AYCO) : '';
|
||||
$AYWHS = isset($request->AYWHS) ? trim($request->AYWHS) : '';
|
||||
$AYUSER = isset($request->AYUSER) ? trim($request->AYUSER) : '';
|
||||
$aYINTBOX = isset($request->AYINTBOX) ? trim($request->AYINTBOX) : '';
|
||||
$aYCO = isset($request->AYCO) ? trim($request->AYCO) : '';
|
||||
$aYWHS = isset($request->AYWHS) ? trim($request->AYWHS) : '';
|
||||
$aYUSER = isset($request->AYUSER) ? trim($request->AYUSER) : '';
|
||||
|
||||
if ($AYINTBOX != '') {
|
||||
if ($aYINTBOX != '') {
|
||||
// Get the record from ICM695M1
|
||||
$ICM695M1Sel = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
|
||||
$iCM695M1Sel = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
|
||||
->select()
|
||||
->where('AYINTBOX', $AYINTBOX)
|
||||
->where('AYCO', $AYCO)
|
||||
->where('AYWHS', $AYWHS)
|
||||
->where('AYINTBOX', $aYINTBOX)
|
||||
->where('AYCO', $aYCO)
|
||||
->where('AYWHS', $aYWHS)
|
||||
->where('AYSTATUS', '')
|
||||
->first();
|
||||
|
||||
$allowDeletion = isset($ICM695M1Sel->AYSENTPKR) ? ($ICM695M1Sel->AYSENTPKR != '' ? true : false) : false;
|
||||
$allowDeletion = isset($iCM695M1Sel->AYSENTPKR) ? ($iCM695M1Sel->AYSENTPKR != '' ? true : false) : false;
|
||||
|
||||
if ($allowDeletion) {
|
||||
$timestamp = date('Y-m-d H:i:s.u');
|
||||
@@ -33,25 +33,25 @@ class sentinelController extends Controller
|
||||
$time1 = date('His');
|
||||
|
||||
// Delete Records from ICM695M1 And ICM695M2
|
||||
$ICM695M1Del = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
|
||||
->where('AYINTBOX', $AYINTBOX)
|
||||
->where('AYCO', $AYCO)
|
||||
->where('AYWHS', $AYWHS)
|
||||
$iCM695M1Del = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
|
||||
->where('AYINTBOX', $aYINTBOX)
|
||||
->where('AYCO', $aYCO)
|
||||
->where('AYWHS', $aYWHS)
|
||||
->delete();
|
||||
|
||||
$ICM695M2Del = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m2')
|
||||
->where('AZINTBOX', $AYINTBOX)
|
||||
->where('AZCO', $AYCO)
|
||||
->where('AZWHS', $AYWHS)
|
||||
$iCM695M2Del = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m2')
|
||||
->where('AZINTBOX', $aYINTBOX)
|
||||
->where('AZCO', $aYCO)
|
||||
->where('AZWHS', $aYWHS)
|
||||
->delete();
|
||||
|
||||
// Log the event as an unusual transaction to appear on SPD bottom right:
|
||||
$InsertValues = "'$ICM695M1Sel->AYCO', '$ICM695M1Sel->AYWHS', '$ICM695M1Sel->AYSENTPKR', '$ICM695M1Sel->AYMACPKR', '$ICM695M1Sel->AYONO', '$ICM695M1Sel->AYRLNO', '$ICM695M1Sel->AYSHNO', '', 'Box $AYINTBOX emptied and repacked',
|
||||
'$timestamp', '$date1', '$time1', '$AYUSER','$timestamp', '$date1', '$time1', '$AYUSER','$AYINTBOX'";
|
||||
$insertValues = "'$iCM695M1Sel->AYCO', '$iCM695M1Sel->AYWHS', '$iCM695M1Sel->AYSENTPKR', '$iCM695M1Sel->AYMACPKR', '$iCM695M1Sel->AYONO', '$iCM695M1Sel->AYRLNO', '$iCM695M1Sel->AYSHNO', '', 'Box $aYINTBOX emptied and repacked',
|
||||
'$timestamp', '$date1', '$time1', '$aYUSER','$timestamp', '$date1', '$time1', '$aYUSER','$aYINTBOX'";
|
||||
|
||||
$ICM689MInsert = DB::connection(config('m3.connection', 'pgsql'))->insert("INSERT INTO ICM689M
|
||||
$iCM689MInsert = DB::connection(config('m3.connection', 'pgsql'))->insert("INSERT INTO ICM689M
|
||||
(A7CO, A7WHS, A7SENTPKR, A7MACPKR, A7ONO, A7RLNO, A7SHNO, A7SOURCE, A7ERRMSG, A7DISRAITS, A7DISRAID, A7DISRAIT, A7DISRAIU, A7DISRESTS ,A7DISRESD ,A7DISREST ,A7DISRESU , A7SPR15A01)
|
||||
values ($InsertValues)");
|
||||
values ($insertValues)");
|
||||
|
||||
return response()->json(['success' => true, 'message' => 'Line Deleted']);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user