bug fixes and new additions

This commit is contained in:
Kwesi Banson Jnr
2025-08-13 00:10:17 +00:00
parent cf39ff2682
commit eabf61b7da
133 changed files with 4231 additions and 590 deletions

View File

@@ -35,7 +35,7 @@ class OfficeLocationsController extends Controller
$id = $request->branch_id;
$document_arr = \DB::table('branch_files')
->join('auth_users', 'auth_users.id', '=', 'branch_files.uploaded_by')
->select('branch_files.id', 'branch_files.name','branch_files.file_reff', 'auth_users.name AS UploadedBy', 'branch_files.created_at')
->select('branch_files.id', 'branch_files.name', 'branch_files.validity_period','branch_files.file_reff', 'auth_users.name AS UploadedBy', 'branch_files.created_at')
->orderBy('branch_files.name', 'ASC')
->where('branch_files.branch_id', $id)
->paginate(15);
@@ -44,7 +44,7 @@ class OfficeLocationsController extends Controller
$keyword = $request->keyword;
$document_arr = \DB::table('branch_files')
->join('auth_users', 'auth_users.id', '=', 'branch_files.uploaded_by')
->select('branch_files.id', 'branch_files.name','branch_files.file_reff', 'auth_users.name AS UploadedBy', 'branch_files.created_at')
->select('branch_files.id', 'branch_files.name', 'branch_files.validity_period', 'branch_files.file_reff', 'auth_users.name AS UploadedBy', 'branch_files.created_at')
->orderBy('branch_files.name', 'ASC')
->where('branch_files.branch_id', $id)
->whereRaw("branch_files.name LIKE '%$keyword%' OR branch_files.description LIKE '%$keyword%' OR branch_files.filename LIKE '%$keyword%' OR auth_users.name LIKE '%$keyword%'")
@@ -70,6 +70,7 @@ class OfficeLocationsController extends Controller
'page_title' => 'Upload Document',
'branch_id' => $id
];
// dd($data);
return view('officelocations.filescreate', $data);
}
/**
@@ -153,7 +154,7 @@ class OfficeLocationsController extends Controller
if ($request->has('document_one') && $request->has('document_one_name')) {
if ($request->file('document_one')->isValid()) {
$filename = "erp_" . time() . str_random(6) . "." . $request->document_one->extension();
$filename = "erp_" . time() . str_random(6) . "." . $request->document_one->extension();
$request->document_one->storeAs('branch_files', $filename, 'public');
$document_arr['filename'] = $filename;
$document_arr['branch_id'] = $request->branch_id;
@@ -162,6 +163,7 @@ class OfficeLocationsController extends Controller
$document_arr['file_extension'] = $request->document_one->extension();
$document_arr['file_reff'] = time() . uniqid();
$document_arr['name'] = $request->document_one_name;
$document_arr['validity_period'] = $request->validity_period_one;
$document_arr['uploaded_by'] = session('current_user.id');
$result = Models\BranchFile::create($document_arr);
}
@@ -177,6 +179,7 @@ class OfficeLocationsController extends Controller
$document_arr['file_extension'] = $request->document_two->extension();
$document_arr['file_reff'] = time() . uniqid();
$document_arr['name'] = $request->document_two_name;
$document_arr['validity_period'] = $request->validity_period_two;
$document_arr['uploaded_by'] = session('current_user.id');
$result = Models\BranchFile::create($document_arr);
}
@@ -192,6 +195,7 @@ class OfficeLocationsController extends Controller
$document_arr['file_extension'] = $request->document_three->extension();
$document_arr['file_reff'] = time() . uniqid();
$document_arr['name'] = $request->document_three_name;
$document_arr['validity_period'] = $request->validity_period_third;
$document_arr['uploaded_by'] = session('current_user.id');
$result = Models\BranchFile::create($document_arr);
}