updates to M3 module

This commit is contained in:
Mark Gregory
2026-09-16 16:51:59 +01:00
parent ce06aa9fac
commit 0237b1dc2a
6 changed files with 99 additions and 69 deletions
@@ -17,10 +17,19 @@ class carrierMaintController extends Controller
public static function index(Request $request) {
$currentUser = Helper::getUserCOWHSPLT();
$UserCO = $currentUser['UserCO'] ?? '';
$ICM160M = DB::connection(config('m3.connection', 'pgsql'))->select("
select canum, canam, substr(CATPID,1,3) as TwoshipCarrierCode, substr(CATPID,4,1) as ParcelCarrierCode, caspr10A01, caspr1A01
from icm160m WHERE CACO='$UserCO'");
$power_user = DB::connection(config('m3.connection', 'pgsql'))->select("select R428PWRUSR, R428CO, R428PL, R428WH from ICM428M where R428US='".strtoUpper(m3_user())."'");
$ICM160M = [];
$power_user = [];
$schema = \Illuminate\Support\Facades\Schema::connection(config('m3.connection', 'pgsql'));
if ($schema->hasTable('icm160m')) {
$ICM160M = DB::connection(config('m3.connection', 'pgsql'))->select("
select canum, canam, substr(CATPID,1,3) as TwoshipCarrierCode, substr(CATPID,4,1) as ParcelCarrierCode, caspr10A01, caspr1A01
from icm160m WHERE CACO=?", [$UserCO]);
}
if ($schema->hasTable('icm428m')) {
$power_user = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428PWRUSR', 'R428CO', 'R428PL', 'R428WH')
->where('R428US', strtoUpper(m3_user()))->get()->all();
}
return view('m3::liberty-theme.pages.carrierMaint', compact('ICM160M','power_user'));
}