Chore: Ui Improvements

This commit is contained in:
Sallu9007
2025-04-27 23:19:10 +05:30
parent 2deb7dd254
commit 6c31e189cf
10 changed files with 560 additions and 1166 deletions

View File

@@ -178,9 +178,9 @@ class ActivitiesAttendedController extends Controller
// View proof button for everyone // View proof button for everyone
if ($response->proof) { if ($response->proof) {
$actions[] = '<a href="' . asset('storage/' . $response->proof) . '" target="_blank" class="btn btn-sm btn-primary mr-1">View</a>'; $actions[] = '<a href="' . asset('storage/' . $response->proof) . '" target="_blank" class="btn btn-sm btn-primary mr-1"><i class="fas fa-eye"></i></a>';
} else { } else {
$actions[] = 'No Proof'; $actions[] = '<span class="text-muted"><i class="fas fa-times-circle"></i></span>';
} }
// Edit button with role-appropriate route // Edit button with role-appropriate route
@@ -194,10 +194,10 @@ class ActivitiesAttendedController extends Controller
$editRoute = route('faculty.ActivitiesAttended.edit', $response->id); $editRoute = route('faculty.ActivitiesAttended.edit', $response->id);
} }
$actions[] = '<a href="' . $editRoute . '" class="btn btn-sm btn-info mx-1">Edit</a>'; $actions[] = '<a href="' . $editRoute . '" class="btn btn-sm btn-info mx-1"><i class="fas fa-edit"></i></a>';
$deleteRoute = route('activitiesAttended.destroy', $response->id); $deleteRoute = route('activitiesAttended.destroy', $response->id);
$actions[] = '<button type="button" class="btn btn-sm btn-danger delete-btn" data-id="' . $response->id . '" data-url="' . $deleteRoute . '">Delete</button>'; $actions[] = '<button type="button" class="btn btn-sm btn-danger delete-btn" data-id="' . $response->id . '" data-url="' . $deleteRoute . '"><i class="fas fa-trash"></i></button>';
return implode(' ', $actions); return implode(' ', $actions);
}) })

View File

@@ -99,6 +99,9 @@
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { .dataTables_wrapper .dataTables_filter {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
display: flex;
justify-content: space-between;
align-items: center;
} }
.dataTables_wrapper .dataTables_length select, .dataTables_wrapper .dataTables_length select,
@@ -106,17 +109,65 @@
border: 1px solid #d1d5db; border: 1px solid #d1d5db;
border-radius: 0.375rem; border-radius: 0.375rem;
padding: 0.375rem 0.75rem; padding: 0.375rem 0.75rem;
transition: all 0.3s ease;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
padding: 0;
} }
.dataTables_wrapper .dataTables_paginate .paginate_button { .dataTables_wrapper .dataTables_length select:hover,
margin: 0 0.25rem; .dataTables_wrapper .dataTables_filter input:hover {
border-radius: 0.375rem; border-color: var(--primary-color);
box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
background-color: "#fff";
border-color: "#fff";
color: white;
} }
.dataTables_wrapper .dataTables_paginate .paginate_button.current { .dataTables_wrapper .dataTables_paginate .paginate_button.current {
background: var(--primary-color) !important; background: var(--primary-color) !important;
border-color: var(--primary-color) !important; border-color: var(--primary-color) !important;
color: white !important; color: white !important;
font-weight: bold;
}
.dataTables_wrapper .dataTables_info {
margin-top: 1rem;
font-size: 0.875rem;
color: #6b7280;
}
.dataTables_wrapper .dataTables_scroll {
border: 1px solid #e5e7eb;
border-radius: 0.375rem;
overflow: hidden;
}
.dataTables_wrapper .dataTables_scroll .dataTables_scrollHead {
background-color: #f8fafc;
border-bottom: 1px solid #e5e7eb;
}
.dataTables_wrapper .dataTables_scroll .dataTables_scrollBody {
background-color: white;
}
.dataTables_wrapper .dataTables_scroll .dataTables_scrollBody tr:hover {
background-color: rgba(59, 130, 246, 0.05);
}
.dataTables_wrapper .dataTables_scroll .dataTables_scrollBody td {
padding: 0.75rem;
border-bottom: 1px solid #e5e7eb;
}
.dataTables_wrapper .dataTables_scroll .dataTables_scrollBody td:last-child {
border-right: none;
} }
.dt-buttons { .dt-buttons {

View File

@@ -5,7 +5,7 @@
<a class="nav-link py-1" href="{{ route('dashboard') }}"> <a class="nav-link py-1" href="{{ route('dashboard') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/home-icon.svg') }}" alt="home-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-home text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Dashboard</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Dashboard</h6>
</div> </div>
@@ -16,7 +16,7 @@
<a class="nav-link py-1" href="{{ route('admin.ActivitiesAttendedResponses') }}"> <a class="nav-link py-1" href="{{ route('admin.ActivitiesAttendedResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="activities-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-calendar-check text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Activities Attended</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Activities Attended</h6>
</div> </div>
@@ -26,7 +26,7 @@
<a class="nav-link py-1" href="{{ route('admin.ActivitiesOrganisedResponses') }}"> <a class="nav-link py-1" href="{{ route('admin.ActivitiesOrganisedResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-calendar-alt text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Activities Organised</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Activities Organised</h6>
</div> </div>
@@ -36,7 +36,7 @@
<a class="nav-link py-1" href="{{ route('admin.IvOrganisedResponses') }}"> <a class="nav-link py-1" href="{{ route('admin.IvOrganisedResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-industry text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">IV Organised</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">IV Organised</h6>
</div> </div>
@@ -46,7 +46,7 @@
<a class="nav-link py-1" href="{{ route('admin.PublicationsResponses') }}"> <a class="nav-link py-1" href="{{ route('admin.PublicationsResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-book text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Publications</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Publications</h6>
</div> </div>
@@ -56,7 +56,7 @@
<a class="nav-link py-1" href="{{ route('admin.BooksPublishedResponses') }}"> <a class="nav-link py-1" href="{{ route('admin.BooksPublishedResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-book-open text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Books Published</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Books Published</h6>
</div> </div>
@@ -66,7 +66,7 @@
<a class="nav-link py-1" href="{{ route('admin.ExternalEngagementResponses') }}"> <a class="nav-link py-1" href="{{ route('admin.ExternalEngagementResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-handshake text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">External Engagement</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">External Engagement</h6>
</div> </div>
@@ -76,7 +76,7 @@
<a class="nav-link py-1" href="{{ route('admin.OnlineCoursesResponses') }}"> <a class="nav-link py-1" href="{{ route('admin.OnlineCoursesResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-laptop-code text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Online Courses</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Online Courses</h6>
</div> </div>
@@ -86,7 +86,7 @@
<a class="nav-link py-1" href="{{ route('admin.PatentsResponses') }}"> <a class="nav-link py-1" href="{{ route('admin.PatentsResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-file-alt text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Patents/Copyrights</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Patents/Copyrights</h6>
</div> </div>
@@ -98,7 +98,7 @@
<a class="nav-link py-1" href="{{ route('coordinator.ActivitiesAttendedResponses') }}"> <a class="nav-link py-1" href="{{ route('coordinator.ActivitiesAttendedResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="activities-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-calendar-check text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Activities Attended</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Activities Attended</h6>
</div> </div>
@@ -108,7 +108,7 @@
<a class="nav-link py-1" href="{{ route('coordinator.ActivitiesOrganisedResponses') }}"> <a class="nav-link py-1" href="{{ route('coordinator.ActivitiesOrganisedResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-calendar-alt text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Activities Organised</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Activities Organised</h6>
</div> </div>
@@ -118,7 +118,7 @@
<a class="nav-link py-1" href="{{ route('coordinator.IvOrganisedResponses') }}"> <a class="nav-link py-1" href="{{ route('coordinator.IvOrganisedResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-industry text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">IV Organised</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">IV Organised</h6>
</div> </div>
@@ -128,7 +128,7 @@
<a class="nav-link py-1" href="{{ route('coordinator.PublicationsResponses') }}"> <a class="nav-link py-1" href="{{ route('coordinator.PublicationsResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-book text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Publications</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Publications</h6>
</div> </div>
@@ -138,7 +138,7 @@
<a class="nav-link py-1" href="{{ route('coordinator.BooksPublishedResponses') }}"> <a class="nav-link py-1" href="{{ route('coordinator.BooksPublishedResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-book-open text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Books Published</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Books Published</h6>
</div> </div>
@@ -148,7 +148,7 @@
<a class="nav-link py-1" href="{{ route('coordinator.ExternalEngagementResponses') }}"> <a class="nav-link py-1" href="{{ route('coordinator.ExternalEngagementResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-handshake text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">External Engagement</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">External Engagement</h6>
</div> </div>
@@ -158,7 +158,7 @@
<a class="nav-link py-1" href="{{ route('coordinator.OnlineCoursesResponses') }}"> <a class="nav-link py-1" href="{{ route('coordinator.OnlineCoursesResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-laptop-code text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Online Courses</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Online Courses</h6>
</div> </div>
@@ -168,12 +168,13 @@
<a class="nav-link py-1" href="{{ route('coordinator.PatentsResponses') }}"> <a class="nav-link py-1" href="{{ route('coordinator.PatentsResponses') }}">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="col-2"> <div class="col-2">
<img src="{{ asset('assets/frontend/images/students.svg') }}" alt="organised-icon" class="img-fluid" style="max-height: 20px;"> <i class="fas fa-file-alt text-white"></i>
</div> </div>
<h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Patents/Copyrights</h6> <h6 class="col-10 ps-2 m-0 textWhite sidebar-text small">Patents/Copyrights</h6>
</div> </div>
</a> </a>
</li> </li>
<!-- Add other coordinator links here -->
@elseif(auth()->user()->role->name === 'Faculty') @elseif(auth()->user()->role->name === 'Faculty')
<li class="nav-item mt-1"> <li class="nav-item mt-1">
<a class="nav-link py-1" data-bs-toggle="collapse" href="#activitiesAttendedCollapse" role="button" aria-expanded="false" aria-controls="activitiesAttendedCollapse"> <a class="nav-link py-1" data-bs-toggle="collapse" href="#activitiesAttendedCollapse" role="button" aria-expanded="false" aria-controls="activitiesAttendedCollapse">

View File

@@ -1,53 +1,49 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="max-w-full mx-auto px-4 sm:px-6 lg:px-8"> <div class="container py-4">
<div class="bg-white overflow-hidden shadow sm:rounded-lg"> <div class="row">
<div class="px-4 py-5 sm:px-6"> <div class="col-12">
<h3 class="text-xl leading-6 font-semibold text-gray-900"> <div class="card shadow-sm">
All Activities Organised <div class="card-header d-flex justify-content-between align-items-center">
<h3 class="page-title m-0">
<i class="fas fa-list-alt me-2 text-primary"></i>All Activities Organised
</h3> </h3>
</div> </div>
<div class="px-4 py-5 sm:px-6"> <div class="card-body">
<div class="overflow-x-auto w-full max-w-screen-lg mx-auto"> <!-- Table -->
<table id="responses-table" class="table-auto w-full table-striped border-collapse border border-gray-200 rounded-lg"> <div class="table-responsive">
<thead class="bg-gray-100"> <table id="responses-table" class="table table-striped table-hover">
<thead>
<tr> <tr>
<th class="px-4 py-1 border border-gray-200">ID</th> <th>ID</th>
<th class="px-1 py-1 border border-gray-200">Title</th> <th>Title</th>
<th class="px-1 py-1 border border-gray-200">Resource Person</th> <th>Resource Person</th>
<th class="px-1 py-1 border border-gray-200">Organisation</th> <th>Organisation</th>
<th class="px-1 py-1 border border-gray-200">Target Audience</th> <th>Target Audience</th>
<th class="px-1 py-1 border border-gray-200">Department</th> <th>Department</th>
<th class="px-1 py-1 border border-gray-200">Faculty</th> <th>Faculty</th>
<th class="px-1 py-1 border border-gray-200">Venue</th> <th>Venue</th>
<th class="px-1 py-1 border border-gray-200">Activity Type</th> <th>Activity Type</th>
<th class="px-1 py-1 border border-gray-200">Category</th> <th>Category</th>
<th class="px-1 py-1 border border-gray-200">Level</th> <th>Level</th>
<th class="px-1 py-1 border border-gray-200">Participants</th> <th>Participants</th>
<th class="px-5 py-1 border border-gray-200">Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- Data will be loaded via AJAX -->
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
@endsection @endsection
@section('scripts') @section('scripts')
<!-- DataTables JS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
const sheetName = "Activities Organised"; const sheetName = "Activities Organised";
@@ -61,159 +57,47 @@
ajax: { ajax: {
url: route, url: route,
}, },
columns: [{ columns: [
data: 'id', { data: 'id', name: 'id', searchable: false },
name: 'id' { data: 'title', name: 'title', orderable: false },
}, { data: 'resource_person_name', name: 'resource_person_name', orderable: false },
{ { data: 'resource_person_organization', name: 'resource_person_organization', orderable: false },
data: 'title', { data: 'target_audience', name: 'target_audience', orderable: false },
name: 'title', { data: 'department_name', name: 'department_name', orderable: false, searchable: false },
orderable: false { data: 'user_name', name: 'user_name', orderable: false },
}, { data: 'venue', name: 'venue', orderable: false },
{ { data: 'activity_type', name: 'activity_type', orderable: false },
data: 'resource_person_name', { data: 'category', name: 'category', orderable: false, searchable: false },
name: 'resource_person_name', { data: 'level', name: 'level', orderable: false },
orderable: false { data: 'number_of_participants', name: 'number_of_participants', orderable: false },
}, { data: 'action', name: 'action', orderable: false, searchable: false },
{
data: 'resource_person_organization',
name: 'resource_person_organization',
orderable: false
},
{
data: 'target_audience',
name: 'target_audience',
orderable: false
},
{
data: 'department_name',
name: 'department',
orderable: false
},
{
data: 'user_name',
name: 'user_name',
orderable: false
},
// {
// data: 'start_date',
// name: 'start_date',
// orderable: false
// },
// {
// data: 'end_date',
// name: 'end_date',
// orderable: false
// },
// {
// data: 'num_days',
// name: 'num_days',
// orderable: false
// },
{
data: 'venue',
name: 'venue',
orderable: false
},
{
data: 'activity_type',
name: 'activity_type',
orderable: false
},
{
data: 'category',
name: 'category',
orderable: false
},
{
data: 'level',
name: 'level',
orderable: false
},
{
data: 'number_of_participants',
name: 'number_of_participants',
orderable: false
},
{
data: 'action',
name: 'action',
orderable: false,
searchable: false
},
], ],
columnDefs: [{ columnDefs: [
targets: '_all', { targets: '_all', className: 'text-center wrap-text' },
className: 'text-center wrap-text' ],
}, ], dom: '<"d-flex justify-content-between align-items-center mb-3"<"d-flex align-items-center"l><"d-flex"f<"ms-2"B>>>rtip',
dom: 'Bfrtip', buttons: [
buttons: [{ { extend: 'copy', text: '<i class="fas fa-copy me-1"></i> Copy', className: 'btn btn-sm btn-outline-white', title: sheetName },
extend: 'copy', { extend: 'csv', text: '<i class="fas fa-file-csv me-1"></i> CSV', className: 'btn btn-sm btn-outline-white', title: sheetName },
title: sheetName, { extend: 'excel', text: '<i class="fas fa-file-excel me-1"></i> Excel', className: 'btn btn-sm btn-outline-white', title: sheetName },
exportOptions: exportOptions() { extend: 'pdf', text: '<i class="fas fa-file-pdf me-1"></i> PDF', className: 'btn btn-sm btn-outline-white', title: sheetName },
}, { extend: 'print', text: '<i class="fas fa-print me-1"></i> Print', className: 'btn btn-sm btn-outline-white', title: sheetName },
{ ],
extend: 'csv', language: {
title: sheetName, search: "<i class='fas fa-search'></i> _INPUT_",
exportOptions: exportOptions() searchPlaceholder: "Search records...",
}, lengthMenu: "<i class='fas fa-list me-1'></i> _MENU_ records per page",
{ info: "Showing _START_ to _END_ of _TOTAL_ entries",
extend: 'excel', paginate: {
title: sheetName, first: "<i class='fas fa-angle-double-left'></i>",
exportOptions: exportOptions() last: "<i class='fas fa-angle-double-right'></i>",
}, next: "<i class='fas fa-angle-right'></i>",
{ previous: "<i class='fas fa-angle-left'></i>"
extend: 'pdf', }
title: sheetName,
exportOptions: exportOptions()
},
{
extend: 'print',
title: sheetName,
exportOptions: exportOptions()
} }
]
}); });
}; };
// Delete button event handler
$('#responses-table').on('click', '.delete-btn', function() {
if (confirm('Are you sure you want to delete this record?')) {
const id = $(this).data('id');
const url = $(this).data('url');
$.ajax({
url: url,
type: 'DELETE',
data: {
"_token": "{{ csrf_token() }}"
},
success: function(result) {
table.ajax.reload();
alert('Record deleted successfully');
},
error: function(error) {
console.error(error);
alert('Error deleting record');
}
});
}
});
function exportOptions() {
return {
columns: ':visible',
format: {
body: function(data, row, column, node) {
if ($(node).find('select').length) {
return $(node).find("select option:selected").text();
}
return $(node).text();
}
}
};
}
// Set appropriate route based on user role // Set appropriate route based on user role
const userRole = "{{ auth()->user()->role->name }}"; const userRole = "{{ auth()->user()->role->name }}";
let dataRoute = "{{ route('admin.ActivitiesOrganisedResponses.data') }}"; let dataRoute = "{{ route('admin.ActivitiesOrganisedResponses.data') }}";

View File

@@ -1,51 +1,47 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="max-w-full mx-auto px-4 sm:px-6 lg:px-8"> <div class="container py-4">
<div class="bg-white overflow-hidden shadow sm:rounded-lg"> <div class="row">
<div class="px-4 py-5 sm:px-6"> <div class="col-12">
<h3 class="text-xl leading-6 font-semibold text-gray-900"> <div class="card shadow-sm">
All Books Published <div class="card-header d-flex justify-content-between align-items-center">
<h3 class="page-title m-0">
<i class="fas fa-book me-2 text-primary"></i>All Books Published
</h3> </h3>
</div> </div>
<div class="px-4 py-5 sm:px-6"> <div class="card-body">
<div class="overflow-x-auto w-full max-w-screen-lg mx-auto"> <!-- Table -->
<table id="booksPublished-table" class="table-auto w-full table-striped border-collapse border border-gray-200 rounded-lg"> <div class="table-responsive">
<thead class="bg-gray-100"> <table id="booksPublished-table" class="table table-striped table-hover">
<thead>
<tr> <tr>
<th class="px-4 py-2 border border-gray-200">ID</th> <th>ID</th>
<th class="px-4 py-2 border border-gray-200">Title</th> <th>Title</th>
<th class="px-4 py-2 border border-gray-200">Author</th> <th>Author</th>
<th class="px-4 py-2 border border-gray-200">Publisher</th> <th>Publisher</th>
<th class="px-4 py-2 border border-gray-200">Date of Publication</th> <th>Date of Publication</th>
<th class="px-4 py-2 border border-gray-200">ISSN/eISSN number</th> <th>ISSN/eISSN number</th>
<th class="px-4 py-2 border border-gray-200">Department</th> <th>Department</th>
<th class="px-4 py-2 border border-gray-200">Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- Data will be loaded via AJAX -->
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
@endsection @endsection
@section('scripts') @section('scripts')
<!-- DataTables JS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
const sheetName = "Publications"; const sheetName = "Books Published";
var initAjaxRoute = function(route) { var initAjaxRoute = function(route) {
table = $("#booksPublished-table").DataTable({ table = $("#booksPublished-table").DataTable({
@@ -56,119 +52,42 @@
ajax: { ajax: {
url: route, url: route,
}, },
columns: [{ columns: [
data: 'id', { data: 'id', name: 'id', searchable: false },
name: 'id' { data: 'title', name: 'title', orderable: true },
}, { data: 'author', name: 'author', orderable: true },
{ { data: 'publisher', name: 'publisher', orderable: true },
data: 'title', { data: 'date_of_publication', name: 'date_of_publication', orderable: true },
name: 'title', { data: 'issn', name: 'issn', orderable: false },
orderable: true { data: 'department_name', name: 'department_name', orderable: false },
}, { data: 'action', name: 'action', orderable: false, searchable: false },
{
data: 'author',
name: 'author',
orderable: true
},
{
data: 'publisher',
name: 'publisher',
orderable: true
},
{
data: 'date_of_publication',
name: 'date_of_publication',
orderable: true
},
{
data: 'issn',
name: 'issn',
orderable: false
},
{
data: 'department_name',
name: 'department_name',
orderable: false
},
{
data: 'action',
name: 'action',
orderable: false,
searchable: false
},
], ],
columnDefs: [{ columnDefs: [
targets: '_all', { targets: '_all', className: 'text-center wrap-text' },
className: 'text-center wrap-text' ],
}, ], dom: '<"d-flex justify-content-between align-items-center mb-3"<"d-flex align-items-center"l><"d-flex"f<"ms-2"B>>>rtip',
dom: 'Bfrtip', buttons: [
buttons: [{ { extend: 'copy', text: '<i class="fas fa-copy me-1"></i> Copy', className: 'btn btn-sm btn-outline-white', title: sheetName },
extend: 'copy', { extend: 'csv', text: '<i class="fas fa-file-csv me-1"></i> CSV', className: 'btn btn-sm btn-outline-white', title: sheetName },
title: sheetName, { extend: 'excel', text: '<i class="fas fa-file-excel me-1"></i> Excel', className: 'btn btn-sm btn-outline-white', title: sheetName },
exportOptions: exportOptions() { extend: 'pdf', text: '<i class="fas fa-file-pdf me-1"></i> PDF', className: 'btn btn-sm btn-outline-white', title: sheetName },
}, { extend: 'print', text: '<i class="fas fa-print me-1"></i> Print', className: 'btn btn-sm btn-outline-white', title: sheetName },
{ ],
extend: 'csv', language: {
title: sheetName, search: "<i class='fas fa-search'></i> _INPUT_",
exportOptions: exportOptions() searchPlaceholder: "Search records...",
}, lengthMenu: "<i class='fas fa-list me-1'></i> _MENU_ records per page",
{ info: "Showing _START_ to _END_ of _TOTAL_ entries",
extend: 'excel', paginate: {
title: sheetName, first: "<i class='fas fa-angle-double-left'></i>",
exportOptions: exportOptions() last: "<i class='fas fa-angle-double-right'></i>",
}, next: "<i class='fas fa-angle-right'></i>",
{ previous: "<i class='fas fa-angle-left'></i>"
extend: 'pdf', }
title: sheetName,
exportOptions: exportOptions()
},
{
extend: 'print',
title: sheetName,
exportOptions: exportOptions()
} }
]
}); });
}; };
// Delete button event handler
$('#booksPublished-table').on('click', '.delete-btn', function() {
if (confirm('Are you sure you want to delete this record?')) {
const id = $(this).data('id');
const url = $(this).data('url');
$.ajax({
url: url,
type: 'DELETE',
data: {
"_token": "{{ csrf_token() }}"
},
success: function(result) {
table.ajax.reload();
alert('Publication deleted successfully');
},
error: function(error) {
console.error(error);
alert('Error deleting publication');
}
});
}
});
function exportOptions() {
return {
columns: ':visible',
format: {
body: function(data, row, column, node) {
if ($(node).find('select').length) {
return $(node).find("select option:selected").text();
}
return $(node).text();
}
}
};
}
// Set appropriate route based on user role // Set appropriate route based on user role
const userRole = "{{ auth()->user()->role->name }}"; const userRole = "{{ auth()->user()->role->name }}";
let dataRoute = "{{ route('admin.BooksPublishedResponses.data') }}"; let dataRoute = "{{ route('admin.BooksPublishedResponses.data') }}";

View File

@@ -1,53 +1,49 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="max-w-full mx-auto px-4 sm:px-6 lg:px-8"> <div class="container py-4">
<div class="bg-white overflow-hidden shadow sm:rounded-lg"> <div class="row">
<div class="px-4 py-5 sm:px-6"> <div class="col-12">
<h3 class="text-xl leading-6 font-semibold text-gray-900"> <div class="card shadow-sm">
All External Engagements <div class="card-header d-flex justify-content-between align-items-center">
<h3 class="page-title m-0">
<i class="fas fa-handshake me-2 text-primary"></i>All External Engagements
</h3> </h3>
</div> </div>
<div class="px-4 py-5 sm:px-6"> <div class="card-body">
<div class="overflow-x-auto w-full max-w-screen-lg mx-auto"> <!-- Table -->
<table id="externalEngagement-table" class="table-auto w-full table-striped border-collapse border border-gray-200 rounded-lg"> <div class="table-responsive">
<thead class="bg-gray-100"> <table id="externalEngagement-table" class="table table-striped table-hover">
<thead>
<tr> <tr>
<th class="px-4 py-2 border border-gray-200">ID</th> <th>ID</th>
<th class="px-4 py-2 border border-gray-200">Faculty</th> <th>Faculty</th>
<th class="px-4 py-2 border border-gray-200">Department</th> <th>Department</th>
<th class="px-4 py-2 border border-gray-200">Activity</th> <th>Activity</th>
<th class="px-4 py-2 border border-gray-200">Activity Description</th> <th>Activity Description</th>
<th class="px-4 py-2 border border-gray-200">Inviting Organization</th> <th>Inviting Organization</th>
<th class="px-4 py-2 border border-gray-200">Start Date</th> <th>Start Date</th>
<th class="px-4 py-2 border border-gray-200">End Date</th> <th>End Date</th>
<th class="px-4 py-2 border border-gray-200">Num Days</th> <th>Num Days</th>
<th class="px-4 py-2 border border-gray-200">Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- Data will be loaded via AJAX -->
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
@endsection @endsection
@section('scripts') @section('scripts')
<!-- DataTables JS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
const sheetName = "Publications"; const sheetName = "External Engagements";
var initAjaxRoute = function(route) { var initAjaxRoute = function(route) {
table = $("#externalEngagement-table").DataTable({ table = $("#externalEngagement-table").DataTable({
@@ -58,129 +54,44 @@
ajax: { ajax: {
url: route, url: route,
}, },
columns: [{ columns: [
data: 'id', { data: 'id', name: 'id', searchable: false },
name: 'id' { data: 'user_name', name: 'user_name', orderable: true },
}, { data: 'department_name', name: 'department_name', orderable: true },
{ { data: 'activity', name: 'activity', orderable: true },
data: 'user_name', { data: 'activity_description', name: 'activity_description', orderable: true },
name: 'user_name', { data: 'inviting_organization', name: 'inviting_organization', orderable: false },
orderable: true { data: 'start_date', name: 'start_date', orderable: false },
}, { data: 'end_date', name: 'end_date', orderable: false },
{ { data: 'num_days', name: 'num_days', orderable: false },
data: 'department_name', { data: 'action', name: 'action', orderable: false, searchable: false },
name: 'department_name',
orderable: true
},
{
data: 'activity',
name: 'activity',
orderable: true
},
{
data: 'activity_description',
name: 'activity_description',
orderable: true
},
{
data: 'inviting_organization',
name: 'inviting_organization',
orderable: false
},
{
data: 'start_date',
name: 'start_date',
orderable: false
},
{
data: 'end_date',
name: 'end_date',
orderable: false
},
{
data: 'num_days',
name: 'num_days',
orderable: false
},
{
data: 'action',
name: 'action',
orderable: false,
searchable: false
},
], ],
columnDefs: [{ columnDefs: [
targets: '_all', { targets: '_all', className: 'text-center wrap-text' },
className: 'text-center wrap-text' ],
}, ], dom: '<"d-flex justify-content-between align-items-center mb-3"<"d-flex align-items-center"l><"d-flex"f<"ms-2"B>>>rtip',
dom: 'Bfrtip', buttons: [
buttons: [{ { extend: 'copy', text: '<i class="fas fa-copy me-1"></i> Copy', className: 'btn btn-sm btn-outline-white', title: sheetName },
extend: 'copy', { extend: 'csv', text: '<i class="fas fa-file-csv me-1"></i> CSV', className: 'btn btn-sm btn-outline-white', title: sheetName },
title: sheetName, { extend: 'excel', text: '<i class="fas fa-file-excel me-1"></i> Excel', className: 'btn btn-sm btn-outline-white', title: sheetName },
exportOptions: exportOptions() { extend: 'pdf', text: '<i class="fas fa-file-pdf me-1"></i> PDF', className: 'btn btn-sm btn-outline-white', title: sheetName },
}, { extend: 'print', text: '<i class="fas fa-print me-1"></i> Print', className: 'btn btn-sm btn-outline-white', title: sheetName },
{ ],
extend: 'csv', language: {
title: sheetName, search: "<i class='fas fa-search'></i> _INPUT_",
exportOptions: exportOptions() searchPlaceholder: "Search records...",
}, lengthMenu: "<i class='fas fa-list me-1'></i> _MENU_ records per page",
{ info: "Showing _START_ to _END_ of _TOTAL_ entries",
extend: 'excel', paginate: {
title: sheetName, first: "<i class='fas fa-angle-double-left'></i>",
exportOptions: exportOptions() last: "<i class='fas fa-angle-double-right'></i>",
}, next: "<i class='fas fa-angle-right'></i>",
{ previous: "<i class='fas fa-angle-left'></i>"
extend: 'pdf', }
title: sheetName,
exportOptions: exportOptions()
},
{
extend: 'print',
title: sheetName,
exportOptions: exportOptions()
} }
]
}); });
}; };
// Delete button event handler
$('#externalEngagement-table').on('click', '.delete-btn', function() {
if (confirm('Are you sure you want to delete this record?')) {
const id = $(this).data('id');
const url = $(this).data('url');
$.ajax({
url: url,
type: 'DELETE',
data: {
"_token": "{{ csrf_token() }}"
},
success: function(result) {
table.ajax.reload();
alert('External Engagement deleted successfully');
},
error: function(error) {
console.error(error);
alert('Error deleting External Engagement');
}
});
}
});
function exportOptions() {
return {
columns: ':visible',
format: {
body: function(data, row, column, node) {
if ($(node).find('select').length) {
return $(node).find("select option:selected").text();
}
return $(node).text();
}
}
};
}
// Set appropriate route based on user role // Set appropriate route based on user role
const userRole = "{{ auth()->user()->role->name }}"; const userRole = "{{ auth()->user()->role->name }}";
let dataRoute = "{{ route('admin.ExternalEngagementResponses.data') }}"; let dataRoute = "{{ route('admin.ExternalEngagementResponses.data') }}";

View File

@@ -1,57 +1,53 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="max-w-full mx-auto px-4 sm:px-6 lg:px-8"> <div class="container py-4">
<div class="bg-white overflow-hidden shadow sm:rounded-lg"> <div class="row">
<div class="px-4 py-5 sm:px-6"> <div class="col-12">
<h3 class="text-xl leading-6 font-semibold text-gray-900"> <div class="card shadow-sm">
All Industrial Visits Organised <div class="card-header d-flex justify-content-between align-items-center">
<h3 class="page-title m-0">
<i class="fas fa-industry me-2 text-primary"></i>All Industrial Visits Organised
</h3> </h3>
</div> </div>
<div class="px-4 py-5 sm:px-6"> <div class="card-body">
<div class="overflow-x-auto w-full max-w-screen-lg mx-auto"> <!-- Table -->
<table id="responses-table" class="table-auto w-full table-striped border-collapse border border-gray-200 rounded-lg"> <div class="table-responsive">
<thead class="bg-gray-100"> <table id="ivOrganised-table" class="table table-striped table-hover">
<thead>
<tr> <tr>
<th class="px-4 py-2 border border-gray-200">ID</th> <th>ID</th>
<th class="px-4 py-2 border border-gray-200">Company Name</th> <th>Company Name</th>
<th class="px-4 py-2 border border-gray-200">Resource Person</th> <th>Resource Person</th>
<th class="px-4 py-2 border border-gray-200">Target Audience</th> <th>Target Audience</th>
<th class="px-4 py-2 border border-gray-200">Department</th> <th>Department</th>
<th class="px-4 py-2 border border-gray-200">Faculty</th> <th>Faculty</th>
<th class="px-4 py-2 border border-gray-200">Start Date</th> <th>Start Date</th>
<th class="px-4 py-2 border border-gray-200">End Date</th> <th>End Date</th>
<th class="px-4 py-2 border border-gray-200">Student Year</th> <th>Student Year</th>
<th class="px-4 py-2 border border-gray-200">Participants</th> <th>Participants</th>
<th class="px-4 py-2 border border-gray-200">Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- Data will be loaded via AJAX -->
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
@endsection @endsection
@section('scripts') @section('scripts')
<!-- DataTables JS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
const sheetName = "Industrial Visits Organised"; const sheetName = "Industrial Visits Organised";
var initAjaxRoute = function(route) { var initAjaxRoute = function(route) {
table = $("#responses-table").DataTable({ table = $("#ivOrganised-table").DataTable({
fnDestroy: true, fnDestroy: true,
processing: true, processing: true,
serverSide: true, serverSide: true,
@@ -59,134 +55,45 @@
ajax: { ajax: {
url: route, url: route,
}, },
columns: [{ columns: [
data: 'id', { data: 'id', name: 'id', searchable: false },
name: 'id' { data: 'company_name', name: 'company_name', orderable: true },
}, { data: 'resource_person_name', name: 'resource_person_name', orderable: true },
{ { data: 'target_audience', name: 'target_audience', orderable: true },
data: 'company_name', { data: 'department_name', name: 'department_name', orderable: true },
name: 'company_name', { data: 'user_name', name: 'user_name', orderable: true },
orderable: false { data: 'start_date', name: 'start_date', orderable: true },
}, { data: 'end_date', name: 'end_date', orderable: true },
{ { data: 'student_year', name: 'student_year', orderable: true },
data: 'resource_person_name', { data: 'number_of_participants', name: 'number_of_participants', orderable: true },
name: 'resource_person_name', { data: 'action', name: 'action', orderable: false, searchable: false },
orderable: false
},
{
data: 'target_audience',
name: 'target_audience',
orderable: false
},
{
data: 'department_name',
name: 'department',
orderable: false
},
{
data: 'user_name',
name: 'user_name',
orderable: false
},
{
data: 'start_date',
name: 'start_date',
orderable: false
},
{
data: 'end_date',
name: 'end_date',
orderable: false
},
{
data: 'student_year',
name: 'student_year',
orderable: false
},
{
data: 'number_of_participants',
name: 'number_of_participants',
orderable: false
},
{
data: 'action',
name: 'action',
orderable: false,
searchable: false
},
], ],
columnDefs: [{ columnDefs: [
targets: '_all', { targets: '_all', className: 'text-center wrap-text' },
className: 'text-center wrap-text' ],
}, ], dom: '<"d-flex justify-content-between align-items-center mb-3"<"d-flex align-items-center"l><"d-flex"f<"ms-2"B>>>rtip',
dom: 'Bfrtip', buttons: [
buttons: [{ { extend: 'copy', text: '<i class="fas fa-copy me-1"></i> Copy', className: 'btn btn-sm btn-outline-white', title: sheetName },
extend: 'copy', { extend: 'csv', text: '<i class="fas fa-file-csv me-1"></i> CSV', className: 'btn btn-sm btn-outline-white', title: sheetName },
title: sheetName, { extend: 'excel', text: '<i class="fas fa-file-excel me-1"></i> Excel', className: 'btn btn-sm btn-outline-white', title: sheetName },
exportOptions: exportOptions() { extend: 'pdf', text: '<i class="fas fa-file-pdf me-1"></i> PDF', className: 'btn btn-sm btn-outline-white', title: sheetName },
}, { extend: 'print', text: '<i class="fas fa-print me-1"></i> Print', className: 'btn btn-sm btn-outline-white', title: sheetName },
{ ],
extend: 'csv', language: {
title: sheetName, search: "<i class='fas fa-search'></i> _INPUT_",
exportOptions: exportOptions() searchPlaceholder: "Search records...",
}, lengthMenu: "<i class='fas fa-list me-1'></i> _MENU_ records per page",
{ info: "Showing _START_ to _END_ of _TOTAL_ entries",
extend: 'excel', paginate: {
title: sheetName, first: "<i class='fas fa-angle-double-left'></i>",
exportOptions: exportOptions() last: "<i class='fas fa-angle-double-right'></i>",
}, next: "<i class='fas fa-angle-right'></i>",
{ previous: "<i class='fas fa-angle-left'></i>"
extend: 'pdf', }
title: sheetName,
exportOptions: exportOptions()
},
{
extend: 'print',
title: sheetName,
exportOptions: exportOptions()
} }
]
}); });
}; };
// Delete button event handler
$('#responses-table').on('click', '.delete-btn', function() {
if (confirm('Are you sure you want to delete this record?')) {
const id = $(this).data('id');
const url = $(this).data('url');
$.ajax({
url: url,
type: 'DELETE',
data: {
"_token": "{{ csrf_token() }}"
},
success: function(result) {
table.ajax.reload();
alert('Record deleted successfully');
},
error: function(error) {
console.error(error);
alert('Error deleting record');
}
});
}
});
function exportOptions() {
return {
columns: ':visible',
format: {
body: function(data, row, column, node) {
if ($(node).find('select').length) {
return $(node).find("select option:selected").text();
}
return $(node).text();
}
}
};
}
// Set appropriate route based on user role // Set appropriate route based on user role
const userRole = "{{ auth()->user()->role->name }}"; const userRole = "{{ auth()->user()->role->name }}";
let dataRoute = "{{ route('admin.IvOrganisedResponses.data') }}"; let dataRoute = "{{ route('admin.IvOrganisedResponses.data') }}";

View File

@@ -1,52 +1,48 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="max-w-full mx-auto px-4 sm:px-6 lg:px-8"> <div class="container py-4">
<div class="bg-white overflow-hidden shadow sm:rounded-lg"> <div class="row">
<div class="px-4 py-5 sm:px-6"> <div class="col-12">
<h3 class="text-xl leading-6 font-semibold text-gray-900"> <div class="card shadow-sm">
All Online Course <div class="card-header d-flex justify-content-between align-items-center">
<h3 class="page-title m-0">
<i class="fas fa-laptop-code me-2 text-primary"></i>All Online Courses
</h3> </h3>
</div> </div>
<div class="px-4 py-5 sm:px-6"> <div class="card-body">
<div class="overflow-x-auto w-full max-w-screen-lg mx-auto"> <!-- Table -->
<table id="onlineCourse-table" class="table-auto w-full table-striped border-collapse border border-gray-200 rounded-lg"> <div class="table-responsive">
<thead class="bg-gray-100"> <table id="onlineCourse-table" class="table table-striped table-hover">
<thead>
<tr> <tr>
<th class="px-4 py-2 border border-gray-200">ID</th> <th>ID</th>
<th class="px-4 py-2 border border-gray-200">Faculty</th> <th>Faculty</th>
<th class="px-4 py-2 border border-gray-200">Department</th> <th>Department</th>
<th class="px-4 py-2 border border-gray-200">Course</th> <th>Course</th>
<th class="px-4 py-2 border border-gray-200">Offered By</th> <th>Offered By</th>
<th class="px-4 py-2 border border-gray-200">Start Date</th> <th>Start Date</th>
<th class="px-4 py-2 border border-gray-200">End Date</th> <th>End Date</th>
<th class="px-4 py-2 border border-gray-200">Num Days</th> <th>Num Days</th>
<th class="px-4 py-2 border border-gray-200">Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- Data will be loaded via AJAX -->
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
@endsection @endsection
@section('scripts') @section('scripts')
<!-- DataTables JS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
const sheetName = "Publications"; const sheetName = "Online Courses";
var initAjaxRoute = function(route) { var initAjaxRoute = function(route) {
table = $("#onlineCourse-table").DataTable({ table = $("#onlineCourse-table").DataTable({
@@ -57,124 +53,43 @@
ajax: { ajax: {
url: route, url: route,
}, },
columns: [{ columns: [
data: 'id', { data: 'id', name: 'id', searchable: false },
name: 'id' { data: 'user_name', name: 'user_name', orderable: true },
}, { data: 'department_name', name: 'department_name', orderable: true },
{ { data: 'course', name: 'course', orderable: true },
data: 'user_name', { data: 'offered_by', name: 'offered_by', orderable: true },
name: 'user_name', { data: 'start_date', name: 'start_date', orderable: true },
orderable: true { data: 'end_date', name: 'end_date', orderable: true },
}, { data: 'num_days', name: 'num_days', orderable: true },
{ { data: 'action', name: 'action', orderable: false, searchable: false },
data: 'department_name',
name: 'department_name',
orderable: true
},
{
data: 'course',
name: 'course',
orderable: true
},
{
data: 'offered_by',
name: 'offered_by',
orderable: true
},
{
data: 'start_date',
name: 'start_date',
orderable: false
},
{
data: 'end_date',
name: 'end_date',
orderable: false
},
{
data: 'num_days',
name: 'num_days',
orderable: false
},
{
data: 'action',
name: 'action',
orderable: false,
searchable: false
},
], ],
columnDefs: [{ columnDefs: [
targets: '_all', { targets: '_all', className: 'text-center wrap-text' },
className: 'text-center wrap-text' ],
}, ], dom: '<"d-flex justify-content-between align-items-center mb-3"<"d-flex align-items-center"l><"d-flex"f<"ms-2"B>>>rtip',
dom: 'Bfrtip', buttons: [
buttons: [{ { extend: 'copy', text: '<i class="fas fa-copy me-1"></i> Copy', className: 'btn btn-sm btn-outline-white', title: sheetName },
extend: 'copy', { extend: 'csv', text: '<i class="fas fa-file-csv me-1"></i> CSV', className: 'btn btn-sm btn-outline-white', title: sheetName },
title: sheetName, { extend: 'excel', text: '<i class="fas fa-file-excel me-1"></i> Excel', className: 'btn btn-sm btn-outline-white', title: sheetName },
exportOptions: exportOptions() { extend: 'pdf', text: '<i class="fas fa-file-pdf me-1"></i> PDF', className: 'btn btn-sm btn-outline-white', title: sheetName },
}, { extend: 'print', text: '<i class="fas fa-print me-1"></i> Print', className: 'btn btn-sm btn-outline-white', title: sheetName },
{ ],
extend: 'csv', language: {
title: sheetName, search: "<i class='fas fa-search'></i> _INPUT_",
exportOptions: exportOptions() searchPlaceholder: "Search records...",
}, lengthMenu: "<i class='fas fa-list me-1'></i> _MENU_ records per page",
{ info: "Showing _START_ to _END_ of _TOTAL_ entries",
extend: 'excel', paginate: {
title: sheetName, first: "<i class='fas fa-angle-double-left'></i>",
exportOptions: exportOptions() last: "<i class='fas fa-angle-double-right'></i>",
}, next: "<i class='fas fa-angle-right'></i>",
{ previous: "<i class='fas fa-angle-left'></i>"
extend: 'pdf', }
title: sheetName,
exportOptions: exportOptions()
},
{
extend: 'print',
title: sheetName,
exportOptions: exportOptions()
} }
]
}); });
}; };
// Delete button event handler
$('#onlineCourse-table').on('click', '.delete-btn', function() {
if (confirm('Are you sure you want to delete this record?')) {
const id = $(this).data('id');
const url = $(this).data('url');
$.ajax({
url: url,
type: 'DELETE',
data: {
"_token": "{{ csrf_token() }}"
},
success: function(result) {
table.ajax.reload();
alert('Online Course deleted successfully');
},
error: function(error) {
console.error(error);
alert('Error deleting Online Course');
}
});
}
});
function exportOptions() {
return {
columns: ':visible',
format: {
body: function(data, row, column, node) {
if ($(node).find('select').length) {
return $(node).find("select option:selected").text();
}
return $(node).text();
}
}
};
}
// Set appropriate route based on user role // Set appropriate route based on user role
const userRole = "{{ auth()->user()->role->name }}"; const userRole = "{{ auth()->user()->role->name }}";
let dataRoute = "{{ route('admin.OnlineCoursesResponses.data') }}"; let dataRoute = "{{ route('admin.OnlineCoursesResponses.data') }}";

View File

@@ -1,54 +1,50 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="max-w-full mx-auto px-4 sm:px-6 lg:px-8"> <div class="container py-4">
<div class="bg-white overflow-hidden shadow sm:rounded-lg"> <div class="row">
<div class="px-4 py-5 sm:px-6"> <div class="col-12">
<h3 class="text-xl leading-6 font-semibold text-gray-900"> <div class="card shadow-sm">
All Patents <div class="card-header d-flex justify-content-between align-items-center">
<h3 class="page-title m-0">
<i class="fas fa-file-alt me-2 text-primary"></i>All Patents
</h3> </h3>
</div> </div>
<div class="px-4 py-5 sm:px-6"> <div class="card-body">
<div class="overflow-x-auto w-full max-w-screen-lg mx-auto"> <!-- Table -->
<table id="patents-table" class="table-auto w-full table-striped border-collapse border border-gray-200 rounded-lg"> <div class="table-responsive">
<thead class="bg-gray-100"> <table id="patents-table" class="table table-striped table-hover">
<thead>
<tr> <tr>
<th class="px-4 py-2 border border-gray-200">ID</th> <th>ID</th>
<th class="px-4 py-2 border border-gray-200">Faculty</th> <th>Faculty</th>
<th class="px-4 py-2 border border-gray-200">Department</th> <th>Department</th>
<th class="px-4 py-2 border border-gray-200">Title</th> <th>Title</th>
<th class="px-4 py-2 border border-gray-200">Investigator</th> <th>Investigator</th>
<th class="px-4 py-2 border border-gray-200">Application No</th> <th>Application No</th>
<th class="px-4 py-2 border border-gray-200">Type</th> <th>Type</th>
<th class="px-4 py-2 border border-gray-200">Date Of Submission</th> <th>Date Of Submission</th>
<th class="px-4 py-2 border border-gray-200">Date Of Filling</th> <th>Date Of Filling</th>
<th class="px-4 py-2 border border-gray-200">Status</th> <th>Status</th>
<th class="px-4 py-2 border border-gray-200">Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- Data will be loaded via AJAX -->
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
@endsection @endsection
@section('scripts') @section('scripts')
<!-- DataTables JS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
const sheetName = "Publications"; const sheetName = "Patents";
var initAjaxRoute = function(route) { var initAjaxRoute = function(route) {
table = $("#patents-table").DataTable({ table = $("#patents-table").DataTable({
@@ -59,134 +55,45 @@
ajax: { ajax: {
url: route, url: route,
}, },
columns: [{ columns: [
data: 'id', { data: 'id', name: 'id', searchable: false },
name: 'id' { data: 'user_name', name: 'user_name', orderable: true },
}, { data: 'department_name', name: 'department_name', orderable: true },
{ { data: 'title', name: 'title', orderable: true },
data: 'user_name', { data: 'investigator', name: 'investigator', orderable: true },
name: 'user_name', { data: 'application_no', name: 'application_no', orderable: false },
orderable: true { data: 'type', name: 'type', orderable: false },
}, { data: 'date_of_submission', name: 'date_of_submission', orderable: false },
{ { data: 'date_of_filling', name: 'date_of_filling', orderable: false },
data: 'department_name', { data: 'status', name: 'status', orderable: false },
name: 'department_name', { data: 'action', name: 'action', orderable: false, searchable: false },
orderable: true
},
{
data: 'title',
name: 'title',
orderable: true
},
{
data: 'investigator',
name: 'investigator',
orderable: true
},
{
data: 'application_no',
name: 'application_no',
orderable: false
},
{
data: 'type',
name: 'type',
orderable: false
},
{
data: 'date_of_submission',
name: 'date_of_submission',
orderable: false
},
{
data: 'date_of_filling',
name: 'date_of_filling',
orderable: false
},
{
data: 'status',
name: 'status',
orderable: false
},
{
data: 'action',
name: 'action',
orderable: false,
searchable: false
},
], ],
columnDefs: [{ columnDefs: [
targets: '_all', { targets: '_all', className: 'text-center wrap-text' },
className: 'text-center wrap-text' ],
}, ], dom: '<"d-flex justify-content-between align-items-center mb-3"<"d-flex align-items-center"l><"d-flex"f<"ms-2"B>>>rtip',
dom: 'Bfrtip', buttons: [
buttons: [{ { extend: 'copy', text: '<i class="fas fa-copy me-1"></i> Copy', className: 'btn btn-sm btn-outline-white', title: sheetName },
extend: 'copy', { extend: 'csv', text: '<i class="fas fa-file-csv me-1"></i> CSV', className: 'btn btn-sm btn-outline-white', title: sheetName },
title: sheetName, { extend: 'excel', text: '<i class="fas fa-file-excel me-1"></i> Excel', className: 'btn btn-sm btn-outline-white', title: sheetName },
exportOptions: exportOptions() { extend: 'pdf', text: '<i class="fas fa-file-pdf me-1"></i> PDF', className: 'btn btn-sm btn-outline-white', title: sheetName },
}, { extend: 'print', text: '<i class="fas fa-print me-1"></i> Print', className: 'btn btn-sm btn-outline-white', title: sheetName },
{ ],
extend: 'csv', language: {
title: sheetName, search: "<i class='fas fa-search'></i> _INPUT_",
exportOptions: exportOptions() searchPlaceholder: "Search records...",
}, lengthMenu: "<i class='fas fa-list me-1'></i> _MENU_ records per page",
{ info: "Showing _START_ to _END_ of _TOTAL_ entries",
extend: 'excel', paginate: {
title: sheetName, first: "<i class='fas fa-angle-double-left'></i>",
exportOptions: exportOptions() last: "<i class='fas fa-angle-double-right'></i>",
}, next: "<i class='fas fa-angle-right'></i>",
{ previous: "<i class='fas fa-angle-left'></i>"
extend: 'pdf', }
title: sheetName,
exportOptions: exportOptions()
},
{
extend: 'print',
title: sheetName,
exportOptions: exportOptions()
} }
]
}); });
}; };
// Delete button event handler
$('#patents-table').on('click', '.delete-btn', function() {
if (confirm('Are you sure you want to delete this record?')) {
const id = $(this).data('id');
const url = $(this).data('url');
$.ajax({
url: url,
type: 'DELETE',
data: {
"_token": "{{ csrf_token() }}"
},
success: function(result) {
table.ajax.reload();
alert('Patent deleted successfully');
},
error: function(error) {
console.error(error);
alert('Error deleting Patent');
}
});
}
});
function exportOptions() {
return {
columns: ':visible',
format: {
body: function(data, row, column, node) {
if ($(node).find('select').length) {
return $(node).find("select option:selected").text();
}
return $(node).text();
}
}
};
}
// Set appropriate route based on user role // Set appropriate route based on user role
const userRole = "{{ auth()->user()->role->name }}"; const userRole = "{{ auth()->user()->role->name }}";
let dataRoute = "{{ route('admin.PatentsResponses.data') }}"; let dataRoute = "{{ route('admin.PatentsResponses.data') }}";

View File

@@ -1,53 +1,49 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="max-w-full mx-auto px-4 sm:px-6 lg:px-8"> <div class="container py-4">
<div class="bg-white overflow-hidden shadow sm:rounded-lg"> <div class="row">
<div class="px-4 py-5 sm:px-6"> <div class="col-12">
<h3 class="text-xl leading-6 font-semibold text-gray-900"> <div class="card shadow-sm">
All Publications <div class="card-header d-flex justify-content-between align-items-center">
<h3 class="page-title m-0">
<i class="fas fa-book-open me-2 text-primary"></i>All Publications
</h3> </h3>
</div> </div>
<div class="px-4 py-5 sm:px-6"> <div class="card-body">
<div class="overflow-x-auto w-full max-w-screen-lg mx-auto"> <!-- Table -->
<table id="publications-table" class="table-auto w-full table-striped border-collapse border border-gray-200 rounded-lg"> <div class="table-responsive">
<thead class="bg-gray-100"> <table id="publications-table" class="table table-striped table-hover">
<thead>
<tr> <tr>
<th class="px-4 py-2 border border-gray-200">ID</th> <th>ID</th>
<th class="px-4 py-2 border border-gray-200">Title</th> <th>Title</th>
<th class="px-4 py-2 border border-gray-200">First Author</th> <th>First Author</th>
<th class="px-4 py-2 border border-gray-200">Type</th> <th>Type</th>
<th class="px-4 py-2 border border-gray-200">Journal/Conference</th> <th>Journal/Conference</th>
<th class="px-4 py-2 border border-gray-200">Faculty</th> <th>Faculty</th>
<th class="px-4 py-2 border border-gray-200">Department</th> <th>Department</th>
<th class="px-4 py-2 border border-gray-200">Start Date</th> <th>Start Date</th>
<th class="px-4 py-2 border border-gray-200">End Date</th> <th>End Date</th>
<th class="px-4 py-2 border border-gray-200">Peer Reviewed</th> <th>Peer Reviewed</th>
<th class="px-4 py-2 border border-gray-200">Scopus</th> <th>Scopus</th>
<th class="px-4 py-2 border border-gray-200">SCI</th> <th>SCI</th>
<th class="px-4 py-2 border border-gray-200">Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- Data will be loaded via AJAX -->
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
@endsection @endsection
@section('scripts') @section('scripts')
<!-- DataTables JS -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
const sheetName = "Publications"; const sheetName = "Publications";
@@ -61,144 +57,47 @@
ajax: { ajax: {
url: route, url: route,
}, },
columns: [{ columns: [
data: 'id', { data: 'id', name: 'id', searchable: false },
name: 'id' { data: 'title', name: 'title', orderable: true },
}, { data: 'first_author_name', name: 'first_author_name', orderable: true },
{ { data: 'activity_type', name: 'activity_type', orderable: true },
data: 'title', { data: 'affiliation', name: 'affiliation', orderable: true },
name: 'title', { data: 'user_name', name: 'user_name', orderable: false },
orderable: true { data: 'department_name', name: 'department_name', orderable: false },
}, { data: 'start_date', name: 'start_date', orderable: true },
{ { data: 'end_date', name: 'end_date', orderable: true },
data: 'first_author_name', { data: 'is_peer_reviewed', name: 'is_peer_reviewed', orderable: true },
name: 'first_author_name', { data: 'is_scopus_indexed', name: 'is_scopus_indexed', orderable: false },
orderable: true { data: 'is_sci_indexed', name: 'is_sci_indexed', orderable: false },
}, { data: 'action', name: 'action', orderable: false, searchable: false },
{
data: 'activity_type',
name: 'activity_type',
orderable: true
},
{
data: 'affiliation',
name: 'affiliation',
orderable: true
},
{
data: 'user_name',
name: 'user_name',
orderable: false
},
{
data: 'department_name',
name: 'department_name',
orderable: false
},
{
data: 'start_date',
name: 'start_date',
orderable: true
},
{
data: 'end_date',
name: 'end_date',
orderable: true
},
{
data: 'is_peer_reviewed',
name: 'is_peer_reviewed',
orderable: true
},
{
data: 'is_scopus_indexed',
name: 'is_scopus_indexed',
orderable: false
},
{
data: 'is_sci_indexed',
name: 'is_sci_indexed',
orderable: false
},
{
data: 'action',
name: 'action',
orderable: false,
searchable: false
},
], ],
columnDefs: [{ columnDefs: [
targets: '_all', { targets: '_all', className: 'text-center wrap-text' },
className: 'text-center wrap-text' ],
}, ], dom: '<"d-flex justify-content-between align-items-center mb-3"<"d-flex align-items-center"l><"d-flex"f<"ms-2"B>>>rtip',
dom: 'Bfrtip', buttons: [
buttons: [{ { extend: 'copy', text: '<i class="fas fa-copy me-1"></i> Copy', className: 'btn btn-sm btn-outline-white', title: sheetName },
extend: 'copy', { extend: 'csv', text: '<i class="fas fa-file-csv me-1"></i> CSV', className: 'btn btn-sm btn-outline-white', title: sheetName },
title: sheetName, { extend: 'excel', text: '<i class="fas fa-file-excel me-1"></i> Excel', className: 'btn btn-sm btn-outline-white', title: sheetName },
exportOptions: exportOptions() { extend: 'pdf', text: '<i class="fas fa-file-pdf me-1"></i> PDF', className: 'btn btn-sm btn-outline-white', title: sheetName },
}, { extend: 'print', text: '<i class="fas fa-print me-1"></i> Print', className: 'btn btn-sm btn-outline-white', title: sheetName },
{ ],
extend: 'csv', language: {
title: sheetName, search: "<i class='fas fa-search'></i> _INPUT_",
exportOptions: exportOptions() searchPlaceholder: "Search records...",
}, lengthMenu: "<i class='fas fa-list me-1'></i> _MENU_ records per page",
{ info: "Showing _START_ to _END_ of _TOTAL_ entries",
extend: 'excel', paginate: {
title: sheetName, first: "<i class='fas fa-angle-double-left'></i>",
exportOptions: exportOptions() last: "<i class='fas fa-angle-double-right'></i>",
}, next: "<i class='fas fa-angle-right'></i>",
{ previous: "<i class='fas fa-angle-left'></i>"
extend: 'pdf', }
title: sheetName,
exportOptions: exportOptions()
},
{
extend: 'print',
title: sheetName,
exportOptions: exportOptions()
} }
]
}); });
}; };
// Delete button event handler
$('#publications-table').on('click', '.delete-btn', function() {
if (confirm('Are you sure you want to delete this record?')) {
const id = $(this).data('id');
const url = $(this).data('url');
$.ajax({
url: url,
type: 'DELETE',
data: {
"_token": "{{ csrf_token() }}"
},
success: function(result) {
table.ajax.reload();
alert('Publication deleted successfully');
},
error: function(error) {
console.error(error);
alert('Error deleting publication');
}
});
}
});
function exportOptions() {
return {
columns: ':visible',
format: {
body: function(data, row, column, node) {
if ($(node).find('select').length) {
return $(node).find("select option:selected").text();
}
return $(node).text();
}
}
};
}
// Set appropriate route based on user role // Set appropriate route based on user role
const userRole = "{{ auth()->user()->role->name }}"; const userRole = "{{ auth()->user()->role->name }}";
let dataRoute = "{{ route('admin.PublicationsResponses.data') }}"; let dataRoute = "{{ route('admin.PublicationsResponses.data') }}";