Chore: small fixes for the presentation
This commit is contained in:
@@ -57,12 +57,13 @@ class ActivitiesAttendedController extends Controller
|
|||||||
// Extract year from start_date
|
// Extract year from start_date
|
||||||
$year = date('Y', strtotime($validated['start_date']));
|
$year = date('Y', strtotime($validated['start_date']));
|
||||||
$username = $response->user->name;
|
$username = $response->user->name;
|
||||||
|
$userId = $response->user->id;
|
||||||
|
|
||||||
$originalName = $request->file('proof')->getClientOriginalName();
|
$originalName = $request->file('proof')->getClientOriginalName();
|
||||||
$fileName = $username . '_' . $originalName;
|
$fileName = $username . '_' . $originalName;
|
||||||
|
|
||||||
// Create path structure: year/faculty_name
|
// Create path structure: year/faculty_name
|
||||||
$folderPath = 'proofs/' . $year . '/' . $username;
|
$folderPath = 'proofs/' . $year . '/' . $userId . '_' . $username . '/Activities-Attended';
|
||||||
|
|
||||||
// Store file in the specified path
|
// Store file in the specified path
|
||||||
$proofPath = $request->file('proof')->storeAs($folderPath, $fileName, 'public');
|
$proofPath = $request->file('proof')->storeAs($folderPath, $fileName, 'public');
|
||||||
|
|||||||
@@ -55,12 +55,13 @@ class ActivitiesOrganisedController extends Controller
|
|||||||
// Extract year from start_date
|
// Extract year from start_date
|
||||||
$year = date('Y', strtotime($validated['start_date']));
|
$year = date('Y', strtotime($validated['start_date']));
|
||||||
$username = $response->user->name;
|
$username = $response->user->name;
|
||||||
|
$userId = $response->user->id;
|
||||||
|
|
||||||
$originalName = $request->file('proof')->getClientOriginalName();
|
$originalName = $request->file('proof')->getClientOriginalName();
|
||||||
$fileName = $username . '_' . $originalName;
|
$fileName = $username . '_' . $originalName;
|
||||||
|
|
||||||
// Create path structure: year/faculty_name
|
// Create path structure: year/faculty_name
|
||||||
$folderPath = 'proofs/' . $year . '/' . $username;
|
$folderPath = 'proofs/' . $year . '/' . $userId . '_' . $username . '/Activities-Organised';
|
||||||
|
|
||||||
// Store file in the specified path
|
// Store file in the specified path
|
||||||
$proofPath = $request->file('proof')->storeAs($folderPath, $fileName, 'public');
|
$proofPath = $request->file('proof')->storeAs($folderPath, $fileName, 'public');
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ class FacultyController extends Controller
|
|||||||
|
|
||||||
public function viewActivitiesOrganisedResponses()
|
public function viewActivitiesOrganisedResponses()
|
||||||
{
|
{
|
||||||
return view('pages.activities-organised.index');
|
$departments = Department::all();
|
||||||
|
return view('pages.activities-organised.index', compact('departments'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function IvOrganisedForm()
|
public function IvOrganisedForm()
|
||||||
@@ -57,7 +58,8 @@ class FacultyController extends Controller
|
|||||||
|
|
||||||
public function viewIvOrganisedResponses()
|
public function viewIvOrganisedResponses()
|
||||||
{
|
{
|
||||||
return view('pages.iv-organised.index');
|
$departments = Department::all();
|
||||||
|
return view('pages.iv-organised.index', compact('departments'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function PublicationsForm()
|
public function PublicationsForm()
|
||||||
@@ -71,7 +73,8 @@ class FacultyController extends Controller
|
|||||||
|
|
||||||
public function viewPublicationsResponses()
|
public function viewPublicationsResponses()
|
||||||
{
|
{
|
||||||
return view('pages.publications.index');
|
$departments = Department::all();
|
||||||
|
return view('pages.publications.index', compact('departments'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function BooksPublishedForm()
|
public function BooksPublishedForm()
|
||||||
@@ -82,7 +85,8 @@ class FacultyController extends Controller
|
|||||||
|
|
||||||
public function viewBooksPublishedResponses()
|
public function viewBooksPublishedResponses()
|
||||||
{
|
{
|
||||||
return view('pages.booksPublished.index');
|
$departments = Department::all();
|
||||||
|
return view('pages.booksPublished.index', compact('departments'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ExternalEngagementForm()
|
public function ExternalEngagementForm()
|
||||||
@@ -93,7 +97,8 @@ class FacultyController extends Controller
|
|||||||
|
|
||||||
public function viewExternalEngagementResponses()
|
public function viewExternalEngagementResponses()
|
||||||
{
|
{
|
||||||
return view('pages.externalEngagement.index');
|
$departments = Department::all();
|
||||||
|
return view('pages.externalEngagement.index', compact('departments'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function OnlineCoursesForm()
|
public function OnlineCoursesForm()
|
||||||
@@ -104,7 +109,8 @@ class FacultyController extends Controller
|
|||||||
|
|
||||||
public function viewOnlineCoursesResponses()
|
public function viewOnlineCoursesResponses()
|
||||||
{
|
{
|
||||||
return view('pages.onlineCourses.index');
|
$departments = Department::all();
|
||||||
|
return view('pages.onlineCourses.index', compact('departments'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function PatentsForm()
|
public function PatentsForm()
|
||||||
@@ -115,7 +121,8 @@ class FacultyController extends Controller
|
|||||||
|
|
||||||
public function viewPatentsResponses()
|
public function viewPatentsResponses()
|
||||||
{
|
{
|
||||||
return view('pages.patents.index');
|
$departments = Department::all();
|
||||||
|
return view('pages.patents.index', compact('departments'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::table('users', function (Blueprint $table) {
|
Schema::table('users', function (Blueprint $table) {
|
||||||
$table->unsignedBigInteger('role_id')->after('id')->default(3);
|
$table->unsignedBigInteger('role_id')->after('id')->default(3);
|
||||||
$table->unsignedBigInteger('department_id')->nullable()->after('role_id');
|
$table->unsignedBigInteger('department_id')->nullable()->after('role_id')->default(1);
|
||||||
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
|
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
|
||||||
$table->foreign('department_id')->references('id')->on('departments')->onDelete('cascade');
|
$table->foreign('department_id')->references('id')->on('departments')->onDelete('cascade');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class ActivitiesAttendedResponsesTableSeeder extends Seeder
|
|||||||
'organising_institute' => $organizingInstitutes[array_rand($organizingInstitutes)], // Random organization
|
'organising_institute' => $organizingInstitutes[array_rand($organizingInstitutes)], // Random organization
|
||||||
'address' => $addresses[array_rand($addresses)], // Random address
|
'address' => $addresses[array_rand($addresses)], // Random address
|
||||||
'department_id' => rand(1, 5), // Random department ID
|
'department_id' => rand(1, 5), // Random department ID
|
||||||
'faculty_id' => rand(1, 2), // Random faculty ID
|
'faculty_id' => rand(1, 5), // Random faculty ID
|
||||||
'start_date' => $startDate->format('Y-m-d H:i:s'), // Start date and time
|
'start_date' => $startDate->format('Y-m-d H:i:s'), // Start date and time
|
||||||
'end_date' => $endDate->format('Y-m-d H:i:s'), // End date and time
|
'end_date' => $endDate->format('Y-m-d H:i:s'), // End date and time
|
||||||
'num_days' => $numDays, // Number of days
|
'num_days' => $numDays, // Number of days
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@if(auth()->user()->role->name === 'Admin')
|
@if(auth()->user()->role->name === 'Admin')
|
||||||
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#missingProofsModal">
|
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#missingProofsModal">
|
||||||
<i class="fas fa-search me-1"></i> Check Missing Proofs
|
<i class="fas fa-search me-1"></i> Send Email for Missing Proofs
|
||||||
</button>
|
</button>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user