first commit
This commit is contained in:
@ -0,0 +1,231 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">Add Offer Application</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">Add Offer Application</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<form action="{{ route('offerapplications.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-9 col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">
|
||||
{{ createCustomSelect('tbl_students', 'name', 'student_id', '', 'Students', 'students_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Offer Application</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_programs', 'title', 'program_id', '', 'Programs', 'programs_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('title', 'title', 'Title') }}</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">
|
||||
Advice
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createTextArea('advice', 'advic', '') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Description</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('description', 'description', '') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Remarks</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', 'remarks ', '') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">
|
||||
Mandatory Documents
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
@foreach ($mandatoryDocuments as $document)
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input requireddocuments-checkbox"
|
||||
name="required_documents[]" value="{{ $document->requireddocument_id }}"
|
||||
checked>
|
||||
<label class="form-check-label">{{ $document->title }}</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Additional Documents</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">
|
||||
<p class="text-muted mb-2">
|
||||
<a href="#" class="float-end text-decoration-underline" id="addNewDocument">Add New</a>
|
||||
</p>
|
||||
<div id="additionalDocumentsContainer">
|
||||
<div class="document-input" style="display: none;">
|
||||
<input type="text" name="additional_documents[]" class="form-control"
|
||||
placeholder="Document Name">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Applications Status</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{{ createDate('application_date', 'Application Date', '', date('Y-m-d')) }}
|
||||
<!-- {{ createText('application_date', 'application_date', 'Application Date') }} -->
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
{{ createText('application_fee', 'application_fee', 'Application Fee') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-3">
|
||||
{{ createDate('applicationfee_deadline', 'application Fee_deadline', '', date('Y-m-d')) }}
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<label>Application Fee Paid</label>
|
||||
<div>
|
||||
<input type="radio" id="applicationfee_paid_yes" name="applicationfee_paid" value="1">
|
||||
<label for="applicationfee_paid_yes">Yes</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" id="applicationfee_paid_no" name="applicationfee_paid" value="0">
|
||||
<label for="applicationfee_paid_no">No</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12">
|
||||
{{ createText('applicationfee_paymentdate', 'applicationfee_paymentdate', 'Application Fee Payment Date') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Offer Status</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{ createText('offer_status', 'offer_status', 'Offer Status') }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('offer_letter', 'offer_letter', 'Offer Letter') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-3">
|
||||
{{ createDate('offerletter_date', 'Offer Letter Date', '', date('Y-m-d')) }}
|
||||
<!-- {{ createText('offerletter_date', 'offerletter_date', 'Offer Letter Date') }} -->
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
{{ createText('offered_conditions', 'offered_conditions', 'Offered Conditions') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-footer">
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('offerapplications.index')); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const addNewDocumentButton = document.getElementById('addNewDocument');
|
||||
const additionalDocumentsContainer = document.getElementById('additionalDocumentsContainer');
|
||||
const additionalDocumentsArray = document.getElementById('additionalDocumentsArray');
|
||||
let inputValuesArray = [];
|
||||
let count = 0; // Track the count of clicks
|
||||
|
||||
addNewDocumentButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
if (count === 0) {
|
||||
// Show the first input field
|
||||
additionalDocumentsContainer.querySelector('.document-input:first-child').style.display = 'block';
|
||||
count += 1;
|
||||
} else {
|
||||
const lastInput = additionalDocumentsContainer.querySelector(
|
||||
'.document-input:last-child input[type="text"]');
|
||||
if (!lastInput || lastInput.value.trim() !== '') {
|
||||
const newDocumentInput = document.createElement('div');
|
||||
newDocumentInput.className = 'document-input';
|
||||
newDocumentInput.innerHTML =
|
||||
`<input type="text" name="additional_documents[]" class="form-control" placeholder="Document Name">`;
|
||||
additionalDocumentsContainer.appendChild(newDocumentInput);
|
||||
inputValuesArray.push(lastInput.value);
|
||||
} else {
|
||||
inputValuesArray.push('');
|
||||
}
|
||||
}
|
||||
additionalDocumentsArray.value = inputValuesArray.join(', ');
|
||||
});
|
||||
|
||||
document.querySelector('form').addEventListener('submit', function() {
|
||||
const lastInput = additionalDocumentsContainer.querySelector(
|
||||
'.document-input:last-child input[type="text"]');
|
||||
if (lastInput) {
|
||||
inputValuesArray.push(lastInput.value);
|
||||
additionalDocumentsArray.value = inputValuesArray.join(', ');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
@ -0,0 +1,29 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Edit Offerapplications') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('offerapplications.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('offerapplications.update',[$data->offerapplication_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='offerapplication_id' value='{{$data->offerapplication_id}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
|
||||
</div><div class="col-lg-6">{{createCustomSelect('tbl_students', 'name', 'student_id', $data->students_id, 'Students Id','students_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_programs', 'title', 'program_id', $data->programs_id, 'Programs Id','programs_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("advice","advice","Advice",'',$data->advice)}}
|
||||
</div><div class="col-lg-6">{{createCustomSelect('tbl_requireddocuments', 'title', 'requireddocument_id', $data->requireddocuments_id, 'Requireddocuments Id','requireddocuments_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("additional_documents","additional_documents","Additional Documents",'',$data->additional_documents)}}
|
||||
</div><div class="col-lg-6">{{createText("application_date","application_date","Application Date",'',$data->application_date)}}
|
||||
</div><div class="col-lg-6">{{createText("application_fee","application_fee","Application Fee",'',$data->application_fee)}}
|
||||
</div><div class="col-lg-6">{{createText("applicationfee_deadline","applicationfee_deadline","Applicationfee Deadline",'',$data->applicationfee_deadline)}}
|
||||
</div><div class="col-lg-6">{{createText("applicationfee_paid","applicationfee_paid","Applicationfee Paid",'',$data->applicationfee_paid)}}
|
||||
</div><div class="col-lg-6">{{createText("applicationfee_paymentdate","applicationfee_paymentdate","Applicationfee Paymentdate",'',$data->applicationfee_paymentdate)}}
|
||||
</div><div class="col-lg-6">{{createText("offer_status","offer_status","Offer Status",'',$data->offer_status)}}
|
||||
</div><div class="col-lg-6">{{createText("offer_letter","offer_letter","Offer Letter",'',$data->offer_letter)}}
|
||||
</div><div class="col-lg-6">{{createText("offerletter_date","offerletter_date","Offerletter Date",'',$data->offerletter_date)}}
|
||||
</div><div class="col-lg-6">{{createText("offered_conditions","offered_conditions","Offered Conditions",'',$data->offered_conditions)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$data->remarks)}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('offerapplications.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
264
resources/views/crud/generated/offerapplications/index.blade.php
Normal file
264
resources/views/crud/generated/offerapplications/index.blade.php
Normal file
@ -0,0 +1,264 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Offer Applications List') }}</h2>
|
||||
<a href="{{ route('offerapplications.create') }}" class="btn btn-primary"><span><i
|
||||
class="ri-add-line align-bottom me-1"></i> {{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive table-card">
|
||||
<table class="table dataTable align-middle" id="tbl_offerapplications"
|
||||
data-url="{{ route('offerapplications.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('SN.') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('title') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('alias') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('students') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('programs') }}</span></th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('application date') }}</span></th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('application deadline') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('Fee status') }}</span>
|
||||
</th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('offer status') }}</span>
|
||||
</th>
|
||||
<th class="sort text-uppercase" data-sortable="false"><span
|
||||
class="overline-title">{{ label('Action') }}</span></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody> @php $i=1; @endphp @foreach ($data as $item)
|
||||
<tr data-id="{{ $item->offerapplication_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->offerapplication_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->offerapplication_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col"> {!! getFieldData('tbl_students', 'name', 'student_id', $item->students_id) !!} </td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_programs', 'title', 'program_id', $item->programs_id) !!}
|
||||
</td>
|
||||
|
||||
<td class="tb-col">{{ $item->application_date }}</td>
|
||||
<td class="tb-col">{{ $item->applicationfee_deadline }}</td>
|
||||
<td class="tb-col">
|
||||
@if ($item->applicationfee_paid === 1)
|
||||
Fee paid
|
||||
@elseif ($item->applicationfee_paid === 0)
|
||||
Fee not paid
|
||||
@else
|
||||
not valid
|
||||
@endif
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->offer_status }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('offerapplications.show', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('offerapplications.edit', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item
|
||||
edit-item-btn"><i
|
||||
class="ri-pencil-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('offerapplications.toggle', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item toggle-item-btn"
|
||||
onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('offerapplications.destroy', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item remove-item-btn"
|
||||
onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection @push('css')
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push('js')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var
|
||||
aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var
|
||||
isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) { // Update alias text and
|
||||
switch to non - editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('offerapplications.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token" ]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else { // Switch to editing state aliasSpan.hide(); aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: { //selector: 'tr' }, }); var isRowReorderComplete=false; mytable.on('row-reorder', function(e, diff,
|
||||
edit) {
|
||||
isRowReorderComplete = true;
|
||||
}); mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var
|
||||
url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return
|
||||
$(node).data('id');
|
||||
}).toArray();
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token" ]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.',
|
||||
'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
@ -0,0 +1,388 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Offer Applications List') }}</h2>
|
||||
<a href="{{ route('offerapplications.create') }}" class="btn btn-primary"><span><i
|
||||
class="ri-add-line align-bottom me-1"></i> {{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive table-card">
|
||||
<table class="table dataTable align-middle" id="tbl_offerapplications"
|
||||
data-url="{{ route('offerapplications.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('SN.') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('title') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('alias') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('students') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('programs') }}</span></th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('application date') }}</span></th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('application deadline') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('Fee status') }}</span>
|
||||
</th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('offer status') }}</span>
|
||||
</th>
|
||||
<th class="sort text-uppercase" data-sortable="false"><span
|
||||
class="overline-title">{{ label('Action') }}</span></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody> @php $i=1; @endphp @foreach ($data as $item)
|
||||
<tr data-id="{{ $item->offerapplication_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->offerapplication_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->offerapplication_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col"> {!! getFieldData('tbl_students', 'name', 'student_id', $item->students_id) !!} </td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_programs', 'title', 'program_id', $item->programs_id) !!}
|
||||
</td>
|
||||
|
||||
<td class="tb-col">{{ $item->application_date }}</td>
|
||||
<td class="tb-col">{{ $item->applicationfee_deadline }}</td>
|
||||
<td class="tb-col">
|
||||
@if ($item->applicationfee_paid === 1)
|
||||
Fee paid
|
||||
@elseif ($item->applicationfee_paid === 0)
|
||||
Fee not paid
|
||||
@else
|
||||
not valid
|
||||
@endif
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->offer_status }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('offerapplications.show', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('offerapplications.edit', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item
|
||||
edit-item-btn"><i
|
||||
class="ri-pencil-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('offerapplications.toggle', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item toggle-item-btn"
|
||||
onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('offerapplications.destroy', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item remove-item-btn"
|
||||
onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
|
||||
<!-- <thead class="table-light">
|
||||
<tr>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('SN.') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('title') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('alias') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('students') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('programs') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('advice') }}</span></th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('Required documents') }}</span></th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('Additional documents') }}</span></th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('application date') }}</span></th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('application fee') }}</span></th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('application deadline') }}</span></th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('Fee status') }}</span>
|
||||
</th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('Fee Paid on') }}</span>
|
||||
</th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('offer status') }}</span>
|
||||
</th>
|
||||
<th class="sort text-uppercase"><span class="overline-title">{{ label('offer Letter') }}</span>
|
||||
</th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('offer Letter Date') }}</span></th>
|
||||
<th class="sort text-uppercase"><span
|
||||
class="overline-title">{{ label('offer conditions') }}</span></th>
|
||||
<th class="sort text-uppercase" data-sortable="false"><span
|
||||
class="overline-title">{{ label('Action') }}</span></th>
|
||||
</tr>
|
||||
</thead> -->
|
||||
<tbody> @php $i=1; @endphp @foreach ($data as $item)
|
||||
<tr data-id="{{ $item->offerapplication_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->offerapplication_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->offerapplication_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col"> {!! getFieldData('tbl_students', 'name', 'student_id', $item->students_id) !!} </td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_programs', 'title', 'program_id', $item->programs_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->advice }}</td>
|
||||
<td class="tb-col">
|
||||
@php
|
||||
$documentIDs = explode(',', $item->requireddocuments_id);
|
||||
$documentTitle = [];
|
||||
foreach ($documentIDs as $documentID) {
|
||||
$title = getFieldData('tbl_requireddocuments', 'title', 'requireddocument_id', $documentID);
|
||||
$documentTitle[] = $title;
|
||||
}
|
||||
$displayTitles = implode(', ', $documentTitle);
|
||||
|
||||
@endphp
|
||||
{{ $displayTitles }}
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->additional_documents }}</td>
|
||||
<td class="tb-col">{{ $item->application_date }}</td>
|
||||
<td class="tb-col">{{ $item->application_fee }}</td>
|
||||
<td class="tb-col">{{ $item->applicationfee_deadline }}</td>
|
||||
<td class="tb-col">
|
||||
@if ($item->applicationfee_paid === 1)
|
||||
Fee paid
|
||||
@elseif ($item->applicationfee_paid === 0)
|
||||
Fee not paid
|
||||
@else
|
||||
not valid
|
||||
@endif
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->applicationfee_paymentdate }}</td>
|
||||
<td class="tb-col">{{ $item->offer_status }}</td>
|
||||
<td class="tb-col">{{ $item->offer_letter }}</td>
|
||||
<td class="tb-col">{{ $item->offerletter_date }}</td>
|
||||
<td class="tb-col">{{ $item->offered_conditions }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('offerapplications.show', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('offerapplications.edit', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item
|
||||
edit-item-btn"><i
|
||||
class="ri-pencil-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('offerapplications.toggle', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item toggle-item-btn"
|
||||
onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('offerapplications.destroy', [$item->offerapplication_id]) }}"
|
||||
class="dropdown-item remove-item-btn"
|
||||
onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection @push('css')
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push('js')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var
|
||||
aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var
|
||||
isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) { // Update alias text and
|
||||
switch to non - editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('offerapplications.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token" ]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else { // Switch to editing state aliasSpan.hide(); aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: { //selector: 'tr' }, }); var isRowReorderComplete=false; mytable.on('row-reorder', function(e, diff,
|
||||
edit) {
|
||||
isRowReorderComplete = true;
|
||||
}); mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var
|
||||
url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return
|
||||
$(node).data('id');
|
||||
}).toArray();
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token" ]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.',
|
||||
'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
@ -0,0 +1,29 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('offerapplications.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Students Id : </b> <span>{{$data->students_id}}</span></p><p><b>Programs Id : </b> <span>{{$data->programs_id}}</span></p><p><b>Advice : </b> <span>{{$data->advice}}</span></p><p><b>Requireddocuments Id : </b> <span>{{$data->requireddocuments_id}}</span></p><p><b>Additional Documents : </b> <span>{{$data->additional_documents}}</span></p><p><b>Application Date : </b> <span>{{$data->application_date}}</span></p><p><b>Application Fee : </b> <span>{{$data->application_fee}}</span></p><p><b>Applicationfee Deadline : </b> <span>{{$data->applicationfee_deadline}}</span></p><p><b>Applicationfee Paid : </b> <span>{{$data->applicationfee_paid}}</span></p><p><b>Applicationfee Paymentdate : </b> <span>{{$data->applicationfee_paymentdate}}</span></p><p><b>Offer Status : </b> <span>{{$data->offer_status}}</span></p><p><b>Offer Letter : </b> <span>{{$data->offer_letter}}</span></p><p><b>Offerletter Date : </b> <span>{{$data->offerletter_date}}</span></p><p><b>Offered Conditions : </b> <span>{{$data->offered_conditions}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
Reference in New Issue
Block a user