first commit

This commit is contained in:
2024-04-16 15:43:24 +05:45
commit b49e06fa93
4387 changed files with 543889 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
@extends('backend.template')
@section('content')
<div class="nk-content">
<div class="container-fluid">
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="nk-content-inner">
<form method="get" action="{{ route('form.store') }}" enctype="multipart/form-data">
{{Label('Operation')}}
{{ customCreateSelect('type', 'type', '', '', ['ajax-curd' => 'Ajax CURD', 'make-table-nullable'=>'Make Table Nullable','store' => 'store', 'update' => 'update']) }}
{{Label('Table Name')}}
{{ customCreateSelect('tableName', 'tableName', 'form-control custom-select2', '', $allTables) }}
{{Label('Write To')}}
{{ createText('directoryName', 'directoryName', 'Directory Name') }}
<?php createButton('mt-3 btn-primary', '', 'Submit'); ?>
</form>
</div>
</div>
</div>
@endsection
@push('js')
<script>
$(document).ready(function() {
$('.custom-select2').select2();
});
</script>
@endpush

View File

@@ -0,0 +1,65 @@
@extends('backend.template')
@section('content')
<div class="nk-content">
<div class="container">
<div class="nk-content-inner">
<div class="nk-content-body">
<div class="nk-block-head">
<div class="nk-block-head-between flex-wrap gap g-2">
<div class="nk-block-head-content">
<h2 class="nk-block-title">Tables in Database</h1>
</div>
</div>
</div>
<div class="nk-block">
<div class="card">
<div class="accordion" id="accordionTables">
<?php $a = 0; ?>
@foreach ($allTables as $Table)
<?php $a++; ?>
<div class="accordion-item">
<h2 class="accordion-header"> <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse{{$a}}"> {{$a}}: {{$Table->tablename}} </button> </h2>
<div id="collapse{{$a}}" class="accordion-collapse collapse" data-bs-parent="#accordionTables">
<div class="accordion-body">
<table class="datatable-init table" data-nk-container="table-responsive">
<thead class="table-dark">
<tr>
<th class="tb-col"><span class="overline-title">S.N.</span></th>
<th class="tb-col"><span class="overline-title">{{__('lang.Column')}}</span></th>
<th class="tb-col"><span class="overline-title">{{label("Datatype")}}</span></th>
</tr>
</thead>
<tbody>
<?php $sn = 0; ?>
@foreach($Table->tablecolumns as $column)
<tr>
<?php $sn++; ?>
<td class="tb-col"><span >{{$sn}}</span></td>
<td class="tb-col"><span > {{$column->COLUMN_NAME}}</span></td>
<td class="tb-col"><span > {{$column->COLUMN_TYPE}}</span></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('js')
<script>
$(document).ready(function() {
$('.custom-select2').select2();
});
</script>
@endpush

View File

@@ -0,0 +1,38 @@
@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 Agent</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 Agent</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('agents.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-4">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
<div class="card-footer">
<div class="col-md-12">
<?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('agents.index')); ?>
</div>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,41 @@
@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">Edit Agent</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">Edit Agent</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('agents.update',[$data->agent_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='agent_id' value='{{$data->agent_id}}'/>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title",'',$data->title)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-4">{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$data->remarks)}}</div>
</div>
</div>
<div class="card-footer">
<div class="col-md-12">
<?php createButton("btn-primary btn-update","","Update"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('agents.index')); ?>
</div>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,233 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Agents List") }}</h2>
<a href="{{ route('agents.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_agents" data-url="{{ route('agents.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col 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->agent_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->agent_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->agent_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</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('agents.show',[$item->agent_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('agents.edit',[$item->agent_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('agents.toggle',[$item->agent_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('agents.destroy',[$item->agent_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>
@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('agents.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

View File

@@ -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('agents.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,65 @@
@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 Branch</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 Branch</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<form action="{{route('branches.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Company Register No.</h4>
</div>
<div class="card-body">
<div class="col-lg-12">
{{createText("company_reg","company_reg","")}}
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Contact Informations</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-6">{{createText("email","email","Email")}}</div>
<div class="col-lg-6">{{createText("telephone","telephone","Telephone")}}</div>
<div class="col-lg-6">{{createText("phone1","phone1","Phone1")}}</div>
<div class="col-lg-6">{{createText("phone2","phone2","Phone2")}}</div>
<div class="col-lg-12">{{createText("address","address","Address")}}</div>
</div>
</div>
</div>
</div>
<div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('branches.index')); ?>
</div>
</div>
</form>
</div>
@endsection

View File

@@ -0,0 +1,82 @@
@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">Edit Branch</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">Edit Branch</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<form action="{{route('branches.update',[$data->branch_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='branch_id' value='{{$data->branch_id}}'/>
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title",'',$data->title)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">
{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Company Register No.</h4>
</div>
<div class="card-body">
<div class="col-lg-12">
{{createText("company_reg","company_reg","",'',$data->company_reg)}}
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Contact Informations</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-6">
{{createText("email","email","Email",'',$data->email)}}
</div>
<div class="col-lg-6">
{{createText("telephone","telephone","Telephone",'',$data->telephone)}}
</div><div class="col-lg-6">
{{createText("phone1","phone1","Phone1",'',$data->phone1)}}
</div><div class="col-lg-6">
{{createText("phone2","phone2","Phone2",'',$data->phone2)}}
</div><div class="col-lg-12">
{{createText("address","address","Address",'',$data->address)}}
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12"> <?php createButton("btn-primary btn-update","","Update"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('branches.index')); ?>
</div>
</div>
</form>
</div>
@endsection

View File

@@ -0,0 +1,242 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Branches List") }}</h2>
<a href="{{ route('branches.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_branches" data-url="{{ route('branches.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("email") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("telephone") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("address") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("main ") }}</span></th>
<th class="tb-col 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->branch_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">{{ $item->email }}</td>
<td class="tb-col">
<div class="alias-wrapper" data-id="{{$item->branch_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->branch_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td>
<td class="tb-col">{{ $item->telephone }}</td>
<td class="tb-col">{{ $item->address }}</td>
<td class="tb-col">{{ $item->is_main }}</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('branches.show',[$item->branch_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('branches.edit',[$item->branch_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('branches.toggle',[$item->branch_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('branches.destroy',[$item->branch_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>
@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('branches.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

View File

@@ -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('branches.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Email :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->email}}</span></p><p><b>Telephone :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->telephone}}</span></p><p><b>Phone1 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->phone1}}</span></p><p><b>Phone2 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->phone2}}</span></p><p><b>Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->address}}</span></p><p><b>Company Reg :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->company_reg}}</span></p><p><b>Is Main :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->is_main}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,61 @@
@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 Campaign</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 Campaign</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('campaignarticles.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row">
<div class="col-lg-9">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("text","text ckeditor-classic","Description")}}</div>
<div class="col-lg-12">{{createText("link","link","Link")}}</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Attributes</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createCustomSelect('tbl_campaigns', 'title', 'campaign_id', '', 'Campaigns Id','campaigns_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-12">{{createCustomSelect('tbl_campaignarticles', 'title', 'campaignarticle_id', '', 'Parent Article','parent_article', 'form-control select2','status<>-1')}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Images</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12 pb-2">{{createImageInput("cover_photo","Cover Photo")}}</div>
<div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb")}}</div>
</div>
</div>
</div>
<div class="col-md-12">
<?php createButton("btn-primary btn-store", "", "Submit"); ?>
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('campaignarticles.index')); ?>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,61 @@
@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">Edit Campaign</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">Edit Campaign</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('campaignarticles.update',[$data->campaignarticle_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='campaignarticle_id' value='{{$data->campaignarticle_id}}'/>
<div class="row">
<div class="col-lg-9">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("text","text ckeditor-classic","Text",$data->text)}}</div>
<div class="col-lg-6">{{createText("link","link","Link",'',$data->link)}}</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Attributes</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createCustomSelect('tbl_campaigns', 'title', 'campaign_id', $data->campaigns_id, 'Campaigns Id','campaigns_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-12">{{createCustomSelect('tbl_campaignarticles', 'title', 'campaignarticle_id', $data->parent_article, 'Parent Article','parent_article', 'form-control select2','status<>-1')}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Images</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12 pb-2">{{createImageInput("cover_photo","Cover Photo",'',$data->cover_photo)}}</div>
<div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb",'',$data->thumb)}}</div>
</div>
</div>
</div>
<div class="col-md-12">
<?php createButton("btn-primary btn-update","","Update"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('campaignarticles.index')); ?>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,235 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Campaign Articles List") }}</h2>
<a href="{{ route('campaignarticles.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_campaignarticles" data-url="{{ route('campaignarticles.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("campaigns") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("Parent") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("ID") }}</span></th>
<th class="tb-col text-uppercase" data-sortable="false"><spanclass="overline-title">{{ label("Action") }}</span></th>
</tr>
</thead>
<tbody>
@php
$i = 1;
@endphp
@foreach ($data as $item)
<tr data-id="{{$item->campaignarticle_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">{!! getFieldData("tbl_campaigns", "title", "campaign_id", $item->campaigns_id) !!}</td>
<td class="tb-col">{!! getFieldData("tbl_campaignarticles", "title", "campaignarticle_id", $item->parent_article) !!}</td>
<td class="tb-col">
<div class="alias-wrapper" data-id="{{$item->campaignarticle_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->campaignarticle_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td>
<td class="tb-col">{{ $item->campaignarticle_id }}</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('campaignarticles.show',[$item->campaignarticle_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('campaignarticles.edit',[$item->campaignarticle_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('campaignarticles.toggle',[$item->campaignarticle_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('campaignarticles.destroy',[$item->campaignarticle_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>
@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('campaignarticles.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

View File

@@ -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('campaignarticles.index')); ?>
</div>
<div class='card-body'>
<p><b>Campaigns Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->campaigns_id}}</span></p><p><b>Parent Article :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->parent_article}}</span></p><p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Text :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->text}}</span></p><p><b>Cover Photo :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->cover_photo}}</span></p><p><b>Thumb :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->thumb}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,134 @@
@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 Campaign</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 Campaign</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('campaigns.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row">
<div class="col-lg-9">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-8">{{createText("title","title","Campaign Title")}}</div>
<div class="col-lg-2 pb-2">{{createDate("starts","Start Date",'',date('Y-m-d'))}}</div>
<div class="col-lg-2 pb-2">{{createDate("ends","End Date",'',date('Y-m-d'))}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-4">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createTextarea("details","details ","Details")}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Message</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-6">{{createTextArea("success_message","success_message","Success Message")}}</div>
<div class="col-lg-6">{{createTextArea("sms_message","sms_message","Sms Message")}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Email Details</h4>
</div>
<div class="card-body">
{{createTextArea("email","email ckeditor-classic","")}}
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">
SEO
</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("seo_title","seo_title","Seo Title")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("seo_keywords","seo_keywords ","Seo Keywords")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("seo_description","seo_description ","Seo Description")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("meta_tags","meta_tags ","Meta Tags")}}</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card">
<div class="card-body">
{{createText("coupon_codes","coupon_codes","Coupon Codes")}}
{{createText("offered_choices","offered_choices","Offered Choices")}}
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Images</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12 pb-2">{{createImageInput("cover_photo","Cover Photo")}}</div>
<div class="border border-dashed mb-3"></div>
<div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb")}}</div>
<div class="border border-dashed mb-3"></div>
<div class="col-lg-12 pb-2">{{createImageInput("og_image","Og Image")}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">
Pass
</h5>
</div>
<div class="card-body">
<div class="col-lg-12 pb-2">{{createImageInput("pass_layout","Pass Layout")}}</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">QR Placement</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-6">{{createText("id_position","id_position","ID Position")}}</div>
<div class="col-lg-6">{{createText("name_position","name_position","Name Position")}}</div>
<div class="col-lg-6">{{createText("email_position","email_position","Email Position")}}</div>
<div class="col-lg-6">{{createText("qr_position","qr_position","QR Position")}}</div>
</div>
</div>
</div>
<div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('campaigns.index')); ?>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,140 @@
@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">Edit Campaign</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">Edit Campaign</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('campaigns.update',[$data->campaign_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='campaign_id' value='{{$data->campaign_id}}'/>
<div class="row">
<div class="col-lg-9">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-8">{{createText("title","title","Title",'',$data->title)}}</div>
<div class="col-lg-2 pb-2">{{createDate("starts","Starts",'',$data->starts)}}</div>
<div class="col-lg-2 pb-2">{{createDate("ends","Ends",'',$data->ends)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-4">{{createTextarea("description","description","Description",$data->description,10)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createTextarea("details","details ","Details",$data->details,10)}}
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Message</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-6">{{createTextArea("success_message","success_message","Success Message",$data->success_message,10)}}</div>
<div class="col-lg-6">{{createTextArea("sms_message","sms_message","Sms Message",$data->sms_message,10)}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">
SEO
</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12">
{{createText("seo_title","seo_title","Seo Title",'',$data->seo_title)}}
</div>
<div class="col-lg-12 pb-2">
{{createPlainTextArea("seo_keywords",'',"Seo Keywords",$data->seo_keywords)}}
</div>
<div class="col-lg-12 pb-2">
{{createPlainTextArea("seo_description",'',"Seo Description",$data->seo_description)}}
</div>
<div class="col-lg-12 pb-2">
{{createPlainTextArea("meta_tags",'',"Meta Tags",$data->meta_tags)}}
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">
Additional Settings
</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12 pb-2">
{{createPlainTextArea("notify_emails",'pills',"Notify Emails [ Comma(,) Seperate Emails ]",$data->notify_emails)}}
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card">
<div class="card-body">
{{createText("coupon_codes","coupon_codes","Coupon Codes",'',$data->coupon_codes)}}
{{createText("offered_choices","offered_choices","Offered Choices",'',$data->offered_choices)}}
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Images</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12 pb-2">{{createImageInput("cover_photo","Cover Photo",'',$data->cover_photo)}}</div>
<div class="border border-dashed mb-3"></div>
<div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb",'',$data->thumb)}}</div>
<div class="border border-dashed mb-3"></div>
<div class="col-lg-12 pb-2">{{createImageInput("og_image","Og Image",'',$data->og_image)}}</div>
<div class="col-lg-12 pb-2">{{createImageInput("pass_layout","Pass Layout",'',$data->pass_layout)}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">QR Placement (X,Y)</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-6">{{createText("id_position","id_position","ID Position","",$data->id_position)}}</div>
<div class="col-lg-6">{{createText("name_position","name_position","Name Position","",$data->name_position)}}</div>
<div class="col-lg-6">{{createText("email_position","email_position","Email Position","",$data->email_position)}}</div>
<div class="col-lg-6">{{createText("qr_position","qr_position","QR Position","",$data->qr_position)}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Google Sheets Integration</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("google_sheet_id","google_sheet_id","Google Sheets ID","",$data->google_sheet_id)}}</div>
<div class="col-lg-12">{{createText("google_sheet_worksheet","google_sheet_worksheet","Worksheet Name","",$data->google_sheet_worksheet)}}</div>
</div>
</div>
</div>
<div class="col-md-12"><?php createButton("btn-primary btn-update","","Update"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('campaigns.index')); ?>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,244 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Campaigns List") }}</h2>
<a href="{{ route('campaigns.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_campaigns" data-url="{{ route('campaigns.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("thumb") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("starts") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("ends") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("coupon codes") }}</span></th>
<th class="tb-col 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->campaign_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->campaign_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->campaign_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td>
<td class="tb-col">{{ showImageThumb($item->thumb) }}</td>
<td class="tb-col">{{ myDate($item->starts) }}</td>
<td class="tb-col">{{ myDate($item->ends) }}</td>
<td class="tb-col">{{ $item->coupon_codes }}</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('campaigns.show',[$item->campaign_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('campaigns.edit',[$item->campaign_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('campaigns.toggle',[$item->campaign_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('campaigns.destroy',[$item->campaign_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>
@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('campaigns.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

View File

@@ -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('campaigns.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Details :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->details}}</span></p><p><b>Cover Photo :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->cover_photo}}</span></p><p><b>Thumb :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->thumb}}</span></p><p><b>Starts :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->starts}}</span></p><p><b>Ends :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->ends}}</span></p><p><b>Success Message :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->success_message}}</span></p><p><b>Sms Message :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->sms_message}}</span></p><p><b>Coupon Codes :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->coupon_codes}}</span></p><p><b>Offered Choices :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->offered_choices}}</span></p><p><b>Og Image :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->og_image}}</span></p><p><b>Seo Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->seo_title}}</span></p><p><b>Seo Keywords :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->seo_keywords}}</span></p><p><b>Seo Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->seo_description}}</span></p><p><b>Meta Tags :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->meta_tags}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,18 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Cities') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('cities.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('cities.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_districts', 'title', 'district_id', '', 'Districts Id','districts_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title")}}
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-primary btn-cancel","","Cancel",route('cities.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,18 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Cities') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('cities.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('cities.update',[$data->city_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='city_id' value='{{$data->city_id}}'/>
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_districts', 'title', 'district_id', $data->districts_id, 'Districts Id','districts_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
</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('cities.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,264 @@
@extends('backend.template')
@section('content')
<div class="row">
<div class="col-lg-4">
<form action="{{route('cities.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="mb-0">{{ label('Add City') }}</h2>
</div>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createCustomSelect('tbl_districts', 'title', 'district_id', '', 'Districts Id','districts_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description","Description")}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
</div>
<?php createButton("btn-primary btn-store","","Submit"); ?>
</form>
</div>
<div class="col-lg-8">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2 class="mb-0">{{ label("Cities List") }}</h2>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_cities" data-url="{{ route('cities.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("districts") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col" 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->city_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">
{!! getFieldData("tbl_districts", "title", "district_id", $item->districts_id) !!}
</td><td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">
<div class="alias-wrapper" data-id="{{$item->city_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->city_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</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('cities.show',[$item->city_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('cities.edit',[$item->city_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('cities.toggle',[$item->city_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('cities.destroy',[$item->city_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>
</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('cities.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

View File

@@ -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('cities.index')); ?>
</div>
<div class='card-body'>
<p><b>Districts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->districts_id}}</span></p><p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,22 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Contactus') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('contactus.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('contactus.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row"><div class="col-lg-6">{{createText("title","title","Title")}}
</div><div class="col-lg-6">{{createText("email","email","Email")}}
</div><div class="col-lg-6">{{createText("phone","phone","Phone")}}
</div><div class="col-lg-6">{{createText("country_interested","country_interested","Country Interested")}}
</div><div class="col-lg-6">{{createText("study_background","study_background","Study Background")}}
</div><div class="col-lg-6">{{createText("terms_and_condition","terms_and_condition","Terms And Condition")}}
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-primary btn-cancel","","Cancel",route('contactus.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,22 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Contactus') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('contactus.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('contactus.update',[$data->inquiries_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='inquiries_id' value='{{$data->inquiries_id}}'/>
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
</div><div class="col-lg-6">{{createText("email","email","Email",'',$data->email)}}
</div><div class="col-lg-6">{{createText("phone","phone","Phone",'',$data->phone)}}
</div><div class="col-lg-6">{{createText("country_interested","country_interested","Country Interested",'',$data->country_interested)}}
</div><div class="col-lg-6">{{createText("study_background","study_background","Study Background",'',$data->study_background)}}
</div><div class="col-lg-6">{{createText("terms_and_condition","terms_and_condition","Terms And Condition",'',$data->terms_and_condition)}}
</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('contactus.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,235 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Contactus List") }}</h2>
<a href="{{ route('contactus.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_contactus" data-url="{{ route('contactus.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("email") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("phone") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("country_interested") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("study_background") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("terms_and_condition") }}</span></th>
<th class="tb-col" 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->inquiries_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">{{ $item->email }}</td>
<td class="tb-col">{{ $item->phone }}</td>
<td class="tb-col">{{ $item->country_interested }}</td>
<td class="tb-col">{{ $item->study_background }}</td>
<td class="tb-col">{{ $item->terms_and_condition }}</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('contactus.show',[$item->inquiries_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('contactus.edit',[$item->inquiries_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('contactus.toggle',[$item->inquiries_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('contactus.destroy',[$item->inquiries_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>
@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('contactus.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

View File

@@ -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('contactus.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Email :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->email}}</span></p><p><b>Phone :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->phone}}</span></p><p><b>Country Interested :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->country_interested}}</span></p><p><b>Study Background :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->study_background}}</span></p><p><b>Terms And Condition :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->terms_and_condition}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,34 @@
@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 Country</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 Country</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('countries.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class='card'>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
</div>
<div class="col-md-12">
<?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('countries.index')); ?>
</div>
</form>
@endsection

View File

@@ -0,0 +1,39 @@
@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">Edit Country </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">Edit Country </li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('countries.update',[$data->country_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='country_id' value='{{$data->country_id}}'/>
<div class='card'>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title",'',$data->title)}}</div>
<div class="col-lg-12 pb-4">{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$data->remarks)}}</div>
</div>
</div>
<div class="card-footer">
<div class="col-md-12"><?php createButton("btn-primary btn-update","","Update"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('countries.index')); ?>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,241 @@
@extends('backend.template')
@section('content')
<div class="row">
<div class="col-lg-4">
<form action="{{route('countries.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class='card'>
<div class="card-header">
<h2 class="card-title mb-0">Add Country</h2>
</div>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-3">{{createTextarea("description","description ","Description")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
<div class="card-footer">
<div class="col-md-12">
<?php createButton("btn-primary btn-store", "", "Submit");?>
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('countries.index'));?>
</div>
</div>
</div>
</form>
</div>
<div class="col-lg-8">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2 class="card-title mb-0">{{ label("Countries List") }}</h2>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_countries" data-url="{{ route('countries.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col 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->country_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->country_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->country_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</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('countries.show',[$item->country_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('countries.edit',[$item->country_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('countries.toggle',[$item->country_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('countries.destroy',[$item->country_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>
</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('countries.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

View File

@@ -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('countries.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,18 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Districts') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('districts.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('districts.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_provinces', 'title', 'province_id', '', 'Provinces Id','provinces_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title")}}
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-primary btn-cancel","","Cancel",route('districts.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,18 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Districts') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('districts.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('districts.update',[$data->district_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='district_id' value='{{$data->district_id}}'/>
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_provinces', 'title', 'province_id', $data->provinces_id, 'Provinces Id','provinces_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
</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('districts.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,264 @@
@extends('backend.template')
@section('content')
<div class="row">
<div class="col-lg-4">
<form action="{{route('districts.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="card-title mb-0">{{ label('Add Districts') }}</h2>
</div>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createCustomSelect('tbl_provinces', 'title', 'province_id', '', 'Provinces Id','provinces_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description","Description")}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
</div>
<div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?></div>
</form>
</div>
<div class="col-lg-8">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2 class="card-title mb-0">{{ label("Districts List") }}</h2>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_districts" data-url="{{ route('districts.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("provinces") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col" 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->district_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">
{!! getFieldData("tbl_provinces", "title", "province_id", $item->provinces_id) !!}
</td><td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">
<div class="alias-wrapper" data-id="{{$item->district_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->district_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</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('districts.show',[$item->district_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('districts.edit',[$item->district_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('districts.toggle',[$item->district_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('districts.destroy',[$item->district_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>
</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('districts.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

View File

@@ -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('districts.index')); ?>
</div>
<div class='card-body'>
<p><b>Provinces Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->provinces_id}}</span></p><p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,39 @@
@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 FAQ </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 FAQ </li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('faqs.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class='card'>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createTextarea("text","text ckeditor-classic","Text")}}</div>
</div>
</div>
<div class="card-footer">
<div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('faqs.index')); ?></div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,40 @@
@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 FAQ </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 FAQ </li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('faqs.update',[$data->faq_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='faq_id' value='{{$data->faq_id}}'/>
<div class='card'>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title",'',$data->title)}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("text","text ckeditor-classic","Text",$data->text)}}</div>
</div>
</div>
<div class="card-footer">
<div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('faqs.index')); ?></div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,225 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Faqs List") }}</h2>
<a href="{{ route('faqs.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_faqs" data-url="{{ route('faqs.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col" 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->faq_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="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('faqs.show',[$item->faq_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('faqs.edit',[$item->faq_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('faqs.toggle',[$item->faq_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('faqs.destroy',[$item->faq_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>
@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('faqs.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

View File

@@ -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('faqs.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Text :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->text}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,52 @@
@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 Folow Up </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 Folow Up </li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('followups.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-6">{{createCustomSelect('tbl_registrations', 'name', 'registration_id', '', 'Registrations','registrations_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-6">{{createCustomSelect('tbl_followups', 'title', 'followup_id', '', 'Parent Followup','parent_followup', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-6">{{createText("followup_date","followup_date","Followup Date")}}</div>
<div class="col-lg-6">{{createText("followup_response","followup_response","Followup Response")}}</div>
<div class="col-lg-6">{{createText("followup_by","followup_by","Followup By")}}</div>
<div class="col-lg-6">{{createText("next_schedule","next_schedule","Next Schedule")}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="col-lg-12">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
<div class="col-md-12">
<?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('followups.index')); ?>
</div>
</form>
@endsection

View File

@@ -0,0 +1,46 @@
@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 Folow Up </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 Folow Up </li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('followups.update',[$data->followup_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='followup_id' value='{{$data->followup_id}}'/>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title",'', $data->title)}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-6">{{createCustomSelect('tbl_registrations', 'name', 'registration_id', $data->registrations_id, 'Registrations','registrations_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_followups', 'title', 'followup_id', $data->parent_followup, 'Parent Followup','parent_followup', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-6">{{createText("followup_date","followup_date","Followup Date",'',$data->followup_date)}}</div>
<div class="col-lg-6">{{createText("followup_response","followup_response","Followup Response",'',$data->followup_response)}}</div>
<div class="col-lg-6">{{createText("followup_by","followup_by","Followup By",'',$data->followup_by)}}</div>
<div class="col-lg-6">{{createText("next_schedule","next_schedule","Next Schedule",'',$data->next_schedule)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12">{{createPlainTextArea("remarks",'',"Remarks",$data->remarks)}}</div>
</div>
</div>
</div>
<div class="col-md-12">
<?php createButton("btn-primary btn-update","","Update"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('followups.index')); ?>
</div>
</form>
@endsection

View File

@@ -0,0 +1,265 @@
@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">Folow Up List</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">Folow Up List</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2 class="card-title mb-0">{{ label("Followups List") }}</h2>
<a href="{{ route('followups.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_followups" data-url="{{ route('followups.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("registrations") }}</span></th>
<!-- <th class="tb-col text-uppercase"><span class="overline-title">{{ label("Parent") }}</span></th> -->
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("followup Date") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("followup Response") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("followup By") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("next schedule") }}</span></th>
<th class="tb-col 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->followup_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->followup_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->followup_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td>
<td class="tb-col">
{!! getFieldData("tbl_registrations", "name", "registration_id", $item->registrations_id) !!}
</td>
<!-- <td class="tb-col">
{!! getFieldData("tbl_followups", "title", "followup_id", $item->parent_followup) !!}
</td> -->
<td class="tb-col">{{ $item->followup_date }}</td>
<td class="tb-col">{{ $item->followup_response }}</td>
<td class="tb-col">{{ $item->followup_by }}</td>
<td class="tb-col">{{ $item->next_schedule }}</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('followups.show',[$item->followup_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('followups.edit',[$item->followup_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('followups.toggle',[$item->followup_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('followups.destroy',[$item->followup_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>
@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('followups.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

View File

@@ -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('followups.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Registrations Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->registrations_id}}</span></p><p><b>Parent Followup :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->parent_followup}}</span></p><p><b>Followup Date :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->followup_date}}</span></p><p><b>Followup Response :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->followup_response}}</span></p><p><b>Followup By :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->followup_by}}</span></p><p><b>Next Schedule :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->next_schedule}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,66 @@
@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">{{ label('Add Institution') }}</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">{{ label('Add Institution') }}</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('institutions.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="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-6">{{createCustomSelect('tbl_institutiontypes', 'title', 'institutiontype_id', '', 'Institutiontypes Id','institutiontypes_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-6">{{createCustomSelect('tbl_countries', 'title', 'country_id', '', 'Countries Id','countries_id', 'form-control select2','status<>-1')}}</div>
</div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
<div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('institutions.index')); ?>
</div>
</div>
<div class="col-lg-3 col-md-4">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Address</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("state","state","State")}}</div>
<div class="col-lg-12">{{createText("city","city","City")}}</div>
<div class="col-lg-12">{{createText("address","address","Address")}}</div>
<div class="col-lg-12">{{createText("contact","contact","Contact")}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Image</h5>
</div>
<div class="card-body">
<div class="col-lg-12 pb-2">{{createImageInput("logo","Logo")}}</div>
<div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb")}}</div>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,24 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Institutions') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('institutions.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('institutions.update',[$data->institution_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='institution_id' value='{{$data->institution_id}}'/>
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_institutiontypes', 'title', 'institutiontype_id', $data->institutiontypes_id, 'Institutiontypes Id','institutiontypes_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_countries', 'title', 'country_id', $data->countries_id, 'Countries Id','countries_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}
</div><div class="col-lg-6">{{createText("state","state","State",'',$data->state)}}
</div><div class="col-lg-6">{{createText("city","city","City",'',$data->city)}}
</div><div class="col-lg-6">{{createText("address","address","Address",'',$data->address)}}
</div><div class="col-lg-6">{{createText("contact","contact","Contact",'',$data->contact)}}
</div><div class="col-lg-12 pb-2">{{createImageInput("logo","Logo",'',$data->logo)}}
</div><div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb",'',$data->thumb)}}
</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('institutions.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,238 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Institutions List") }}</h2>
<a href="{{ route('institutions.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_institutions" data-url="{{ route('institutions.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("S No.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Logo") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Title") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Institution Types") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Countries") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Contact No.") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Alias") }}</span></th>
<th class="tb-col" data-sortable="false"><span class="overline-title">{{ label("Action") }}</span>
</tr>
</thead>
<tbody>
@php
$i = 1;
@endphp
@foreach ($data as $item)
<tr data-id="{{$item->institution_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">{{ showImageThumb($item->logo) }}</td>
<td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">{!! getFieldData("tbl_institutiontypes", "title", "institutiontype_id", $item->institutiontypes_id) !!}</td>
<td class="tb-col">{!! getFieldData("tbl_countries", "title", "country_id", $item->countries_id) !!}</td>
<td class="tb-col">{{ $item->address }}</td>
<td class="tb-col">{{ $item->contact }}</td>
<td class="tb-col">
<div class="alias-wrapper" data-id="{{$item->institution_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->institution_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td>
<td class="tb-col">{{ showImageThumb($item->thumb) }}</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('institutions.show',[$item->institution_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('institutions.edit',[$item->institution_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('institutions.toggle',[$item->institution_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('institutions.destroy',[$item->institution_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>
@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('institutions.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

View File

@@ -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('institutions.index')); ?>
</div>
<div class='card-body'>
<p><b>Institutiontypes Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->institutiontypes_id}}</span></p><p><b>Countries Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->countries_id}}</span></p><p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>State :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->state}}</span></p><p><b>City :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->city}}</span></p><p><b>Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->address}}</span></p><p><b>Contact :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->contact}}</span></p><p><b>Logo :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->logo}}</span></p><p><b>Thumb :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->thumb}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,44 @@
@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">{{ label('Add Institution Type') }}</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">{{ label('Add Institution Type') }}</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('institutiontypes.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-4">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
<div class="card-footer">
<div class="col-md-12">
<?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('institutiontypes.index')); ?>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,18 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Institutiontypes') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('institutiontypes.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('institutiontypes.update',[$data->institutiontype_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='institutiontype_id' value='{{$data->institutiontype_id}}'/>
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
</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('institutiontypes.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,234 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Institution Types") }}</h2>
<a href="{{ route('institutiontypes.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_institutiontypes" data-url="{{ route('institutiontypes.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("S No.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Title") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Alias") }}</span></th>
<th class="tb-col" 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->institutiontype_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->institutiontype_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->institutiontype_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</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('institutiontypes.show',[$item->institutiontype_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('institutiontypes.edit',[$item->institutiontype_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('institutiontypes.toggle',[$item->institutiontype_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('institutiontypes.destroy',[$item->institutiontype_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>
@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('institutiontypes.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

View File

@@ -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('institutiontypes.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,19 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Leadcategories') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('leadcategories.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('leadcategories.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row"><div class="col-lg-12">{{createText("title","title","Title")}}
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}
</div><div class="col-lg-6">{{createText("color","color","Color")}}
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-primary btn-cancel","","Cancel",route('leadcategories.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,40 @@
@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">Edit Lead Category</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">Edit Lead Category</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('leadcategories.update',[$data->leadcategory_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='leadcategory_id' value='{{$data->leadcategory_id}}'/>
<div class='card'>
<div class='card-body'>
<div class="row">
<div class="col-lg-10">{{createText("title","title","Title",'',$data->title)}}</div>
<div class="col-lg-2">{{createText("color","color","Color",'',$data->color)}}</div>
<div class="col-lg-12 pb-3">{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$data->remarks)}}</div>
</div>
</div>
<div class="card-footer">
<div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
<?php createButton("btn-primary btn-cancel","","Cancel",route('leadcategories.index')); ?>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,271 @@
@extends('backend.template')
@section('content')
<div class="row">
<div class="col-lg-4">
<form action="{{route('leadcategories.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="mb-0">{{ label('Add Lead Category') }}</h2>
</div>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ","Description")}}</div>
<!-- <div class="col-lg-12">
{{createText("color","color","Color","classic-colorpicker")}}
</div> -->
<div class="col-lg-12 ">
<div class="mt-2">
<h5 class="fs-13 mb-2">Color</h5>
<input type="text" class="form-control" name="color">
<div class="colorpicker-input"></div>
</div>
</div><!-- end col -->
</div>
</div>
</div>
<div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?></div>
</form>
</div>
<div class="col-lg-8">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2 class="mb-0">{{ label("Lead Categories List") }}</h2>
</div>
<div class="card-body">
<div class="table-responsive table-card">
<table class="table dataTable" id="tbl_leadcategories" data-url="{{ route('leadcategories.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("color") }}</span></th>
<th class="tb-col 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->leadcategory_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->leadcategory_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->leadcategory_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td>
<td class="tb-col">
<!-- {{ $item->color }} -->
<span style="height:16px; width:16px;background-color:{{ $item->color}};display:inline-block"></span></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('leadcategories.show',[$item->leadcategory_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('leadcategories.edit',[$item->leadcategory_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('leadcategories.toggle',[$item->leadcategory_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('leadcategories.destroy',[$item->leadcategory_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>
</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('leadcategories.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

View File

@@ -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('leadcategories.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Color :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->color}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -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

View File

@@ -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

View 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

View File

@@ -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

View File

@@ -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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Students Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->students_id}}</span></p><p><b>Programs Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->programs_id}}</span></p><p><b>Advice :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->advice}}</span></p><p><b>Requireddocuments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->requireddocuments_id}}</span></p><p><b>Additional Documents :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->additional_documents}}</span></p><p><b>Application Date :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->application_date}}</span></p><p><b>Application Fee :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->application_fee}}</span></p><p><b>Applicationfee Deadline :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->applicationfee_deadline}}</span></p><p><b>Applicationfee Paid :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->applicationfee_paid}}</span></p><p><b>Applicationfee Paymentdate :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->applicationfee_paymentdate}}</span></p><p><b>Offer Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->offer_status}}</span></p><p><b>Offer Letter :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->offer_letter}}</span></p><p><b>Offerletter Date :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->offerletter_date}}</span></p><p><b>Offered Conditions :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->offered_conditions}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,218 @@
@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 Options</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 Options</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-3 col-md-4">
<form action="{{ route('options.store') }}" id="storeCustomForm" method="POST">
@csrf
<div class="card">
<div class="card-body">
<div class="form-group">
{{ createCustomSelect('tbl_students', 'name', 'student_id', '', 'Student Name', 'students_id', 'form-control select2', 'status<>-1') }}
</div>
<div class="form-group">
{{ createCustomSelect('tbl_programs', 'title', 'program_id', '', 'Program', 'programs_id', 'form-control select2', 'status<>-1') }}
</div>
<div class="form-group">
{{ createText('advices', 'advice', 'Advice') }}
</div>
<div class="form-group">
{{ createText('descriptions', 'description', 'Description') }}
</div>
<button type="button" id="btn-add-item" class="btn btn-success btn-add-item">
<i class="fas fa-plus"></i> Add More
</button>
</div>
<div class="card-footer">
<div class="col-md-12">
<button type="button" id="btn-submit" class="btn btn-primary btn-store">Submit</button>
<a href="{{ route('options.index') }}" class="btn btn-danger btn-cancel">Cancel</a>
</div>
</div>
<input type="hidden" name="programsData" id="programsData[]" value="-1">
<input type="hidden" name="advicesData" id="advicesData[]" value="-1">
<input type="hidden" name="descriptionsData" id="descriptionsData[]" value="-1">
</form>
</div>
</div>
<div class="col-lg-9 col-md-8">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Added Options</h5>
</div>
<div class="card-body">
<table class="table table-bordered">
<thead>
<tr>
<th>S.N.</th>
<th>Programs</th>
<th>Advice</th>
<th>Description</th>
<th>Action</th>
</tr>
</thead>
<tbody id="addedItemTableBody">
</tbody>
</table>
</div>
</div>
</div>
</div>
w
<script>
document.addEventListener('DOMContentLoaded', function() {
var addButton = document.getElementById('btn-add-item');
var studentsId = document.querySelector('input[name="students_id"]');
var addedItemTableBody = document.querySelector('#addedItemTableBody');
var programsSelect = document.querySelector('select[name="programs_id"]');
var advicesInput = document.querySelector('input[name="advices"]');
var descriptionsInput = document.querySelector('input[name="descriptions"]');
var submitButton = document.getElementById('btn-submit');
// Add hidden fields for JavaScript arrays
var programsDataField = document.getElementById('programsData[]');
var advicesDataField = document.getElementById('advicesData[]');
var descriptionsDataField = document.getElementById('descriptionsData[]');
var programsData = [];
var advicesData = [];
var descriptionsData = [];
addButton.addEventListener('click', function() {
var programsId = programsSelect.value;
var programsTitle = programsSelect.options[programsSelect.selectedIndex].text || "N/A";
var advice = advicesInput.value || "N/A";
var description = descriptionsInput.value || "N/A";
programsData.push(programsId);
advicesData.push(advice);
descriptionsData.push(description);
var newRow = document.createElement('tr');
var serialNumber = addedItemTableBody.querySelectorAll('tr').length + 1;
var serialCell = document.createElement('td');
serialCell.textContent = serialNumber;
newRow.appendChild(serialCell);
var programsCell = document.createElement('td');
programsCell.textContent = programsTitle;
newRow.appendChild(programsCell);
var adviceCell = document.createElement('td');
adviceCell.textContent = advice;
newRow.appendChild(adviceCell);
var descriptionCell = document.createElement('td');
descriptionCell.textContent = description;
newRow.appendChild(descriptionCell);
var deleteButton = document.createElement('a');
deleteButton.innerHTML = '<i class="ri-delete-bin-fill align-bottom text-muted"></i>';
deleteButton.className = 'text-danger d-inline-block remove-item-btn';
var deleteCell = document.createElement('td');
deleteCell.appendChild(deleteButton);
newRow.appendChild(deleteCell);
deleteButton.addEventListener('click', function() {
addedItemTableBody.removeChild(newRow);
var index = programsData.indexOf(programsId);
if (index !== -1) {
programsData.splice(index, 1);
advicesData.splice(index, 1);
descriptionsData.splice(index, 1);
}
programsDataField.value = JSON.stringify(programsData);
advicesDataField.value = JSON.stringify(advicesData);
descriptionsDataField.value = JSON.stringify(descriptionsData);
}, );
addedItemTableBody.appendChild(newRow);
advicesInput.value = '';
descriptionsInput.value = '';
addedItemTableBody.appendChild(newRow);
programsDataField.value = JSON.stringify(programsData);
advicesDataField.value = JSON.stringify(advicesData);
descriptionsDataField.value = JSON.stringify(descriptionsData);
});
submitButton.addEventListener('click', function() {
var formData = new FormData();
// Append each array to the formData
programsData.forEach(function(program) {
formData.append('programs[]', program);
});
advicesData.forEach(function(advice) {
formData.append('advices[]', advice);
});
descriptionsData.forEach(function(description) {
formData.append('descriptions[]', description);
});
// Append the CSRF token if needed
formData.append('_token', '{{ csrf_token() }}');
// Make an AJAX POST request to the server
fetch("{{ route('options.store') }}", {
method: 'POST',
body: formData,
})
.then(response => response.json())
.then(responseData => {
if (responseData.status === true) {
alert(responseData.message);
} else {
alert('Error: ' + responseData.message);
}
})
.catch(error => {
console.error(error);
});
// Prevent the form submission
storeCustomForm.submit();
});
});
</script>
@endsection

View File

@@ -0,0 +1,234 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label('Options List') }}</h2>
<a href="{{ route('options.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_options" data-url="{{ route('options.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label('Sn.') }}</span></th>
<th class="tb-col text-uppercase text-uppercase"><span class="overline-title">{{ label('students') }}</span></th>
<th class="tb-co text-uppercase"><span class="overline-title">{{ label('programs') }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label('advice') }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label('Description') }}</span></th>
<th class="tb-col 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->option_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">
@if ($item->students_id)
{!! getFieldData('tbl_students', 'name', 'student_id', $item->students_id) !!}
@endif
</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">{{ $item->description }}</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('options.show', [$item->students_id]) }}"
class="dropdown-item"><i
class="ri-eye-fill align-bottom me-2 text-muted"></i>
{{ label('View') }}</a></li>
<li>
<a href="{{ route('options.destroy', [$item->option_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>
@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('options.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

View File

@@ -0,0 +1,75 @@
@extends('backend.template')
@section('content')
<!-- start page title -->
<div class="row">
<div class="col">
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0">Issued</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">Issued</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-md-4">
<form action="{{ route('options.store') }}" id="storeCustomForm" method="POST">
@csrf
<div class="card">
<div class="card-body">
<div class="form-group">
{{ createCustomSelect('tbl_students', 'name', 'student_id', '', 'Student Name', 'students_id', 'form-control select2', 'status<>-1') }}
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="form-group">
{{ createCustomSelect('tbl_countries', 'title', 'country_id', '', 'Country', 'countries_id', 'form-control select2', 'status<>-1') }}
</div>
<div class="form-group">
{{ createCustomSelect('tbl_institutions', 'title', 'institution_id', '', 'Institution', 'institutions_id', 'form-control select2', 'status<>-1') }}
</div>
<div class="form-group">
{{ createCustomSelect('tbl_programs', 'title', 'program_id', '', 'Program', 'programs_id', 'form-control select2', 'status<>-1') }}
</div>
<div class="form-group">
{{ createText('advices', 'advice', 'Advice') }}
</div>
</div>
<div class="col-md-8">
<div id="student-details">
<!--For displaying student detail-->
</div>
<div id="program-details">
<!--For displaying program detail-->
</div>
</div>
<div class="card-footer">
<div class="col-md-12">
<button type="button" id="btn-submit" class="btn btn-primary btn-store">Submit</button>
<a href="{{ route('options.index') }}" class="btn btn-danger btn-cancel">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,36 @@
@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('options.index')); ?>
</div>
<div class='card-body'>
<p><b>Students Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{!! getFieldData('tbl_students', 'name', 'student_id', $student_id) !!}</span></p>
</div>
<div class='card-body'>
<table class="table">
<thead>
<tr>
<th style="width: 5%;">S.N.</th>
<th style="width: 20%;">Programs</th>
<th>Advice</th>
<th>Description</th>
<!-- Add more table headers as needed -->
</tr>
</thead>
<tbody>
@php $serialNumber = 1; @endphp
@foreach ($data as $option)
<tr>
<td>{{ $serialNumber++ }}</td>
<td style="width: 30%;">{{ getFieldData('tbl_programs', 'title', 'program_id', $option->programs_id) }}</td>
<td>{{ $option->advice }}</td>
<td>{{ $option->description }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection

View File

@@ -0,0 +1,111 @@
@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">{{ label('Add Program') }}</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 Program</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('programs.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-3">{{createCustomSelect('tbl_institutions', 'title', 'institution_id', '', 'Institutions','institutions_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-9">{{createText("title","title","Title")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Programe</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-4">{{createText("institution","institution","Institution")}}</div>
<div class="col-lg-4">{{createText("program_level","program_level","Program Level")}}</div>
<div class="col-lg-2">{{createText("years","years","Years")}}</div>
<div class="col-lg-2">{{createText("prospects","prospects","Prospects")}}</div>
<div class="col-lg-4">{{createText("city","city","City")}}</div>
<div class="col-lg-2">{{createText("psw","psw","Psw")}}</div>
<div class="col-lg-2">{{createText("intake","intake","Intake")}}</div>
<div class="col-lg-2">{{createDate("application_open","Application Open", "",date('Y-m-d'))}}</div>
<div class="col-lg-2">{{createDate("application_deadline","Application Deadline", "",date('Y-m-d'))}}</div>
<!-- <div class="col-lg-4">{{createDate("application_deadline","application_deadline","Application Deadline")}}</div> -->
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Level</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-4">{{createText("level","level","Level")}}</div>
<div class="col-lg-4">{{createText("min_level","min_level","Min Level")}}</div>
<div class="col-lg-4">{{createText("min_level_faculty","min_level_faculty","Min Level Faculty")}}</div>
<div class="col-lg-4">{{createText("min_level_score","min_level_score","Min Level Score")}}</div>
<div class="col-lg-4">{{createText("min_level_passout","min_level_passout","Min Level Passout")}}</div>
<div class="col-lg-4">{{createText("min_level_optional_requirement","min_level_optional_requirement","Min Level Optional Requirement")}}</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Marks Required</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-6">{{createText("prof_test_required","prof_test_required","Prof Test Required")}}</div>
<div class="col-lg-6">{{createText("prof_test_accepted","prof_test_accepted","Prof Test Accepted")}}</div>
<div class="col-lg-6">{{createText("prof_test_min_score","prof_test_min_score","Prof Test Min Score")}}</div>
<div class="col-lg-6">{{createText("prof_test_band_score","prof_test_band_score","Prof Test Band Score")}}</div>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
<div class="col-md-12 mb-4"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('programs.index')); ?>
</div>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,37 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Programs') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('programs.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('programs.update',[$data->program_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='program_id' value='{{$data->program_id}}'/>
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_institutions', 'title', 'institution_id', $data->institutions_id, 'Institutions Id','institutions_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}
</div><div class="col-lg-6">{{createText("program_level","program_level","Program Level",'',$data->program_level)}}
</div><div class="col-lg-6">{{createText("years","years","Years",'',$data->years)}}
</div><div class="col-lg-6">{{createText("psw","psw","Psw",'',$data->psw)}}
</div><div class="col-lg-6">{{createText("prospects","prospects","Prospects",'',$data->prospects)}}
</div><div class="col-lg-6">{{createText("intake","intake","Intake",'',$data->intake)}}
</div><div class="col-lg-6">{{createText("institution","institution","Institution",'',$data->institution)}}
</div><div class="col-lg-6">{{createText("city","city","City",'',$data->city)}}
</div><div class="col-lg-6">{{createText("application_open","application_open","Application Open",'',$data->application_open)}}
</div><div class="col-lg-6">{{createText("application_deadline","application_deadline","Application Deadline",'',$data->application_deadline)}}
</div><div class="col-lg-6">{{createText("level","level","Level",'',$data->level)}}
</div><div class="col-lg-6">{{createText("min_level","min_level","Min Level",'',$data->min_level)}}
</div><div class="col-lg-6">{{createText("min_level_faculty","min_level_faculty","Min Level Faculty",'',$data->min_level_faculty)}}
</div><div class="col-lg-6">{{createText("min_level_score","min_level_score","Min Level Score",'',$data->min_level_score)}}
</div><div class="col-lg-6">{{createText("min_level_passout","min_level_passout","Min Level Passout",'',$data->min_level_passout)}}
</div><div class="col-lg-6">{{createText("min_level_optional_requirement","min_level_optional_requirement","Min Level Optional Requirement",'',$data->min_level_optional_requirement)}}
</div><div class="col-lg-6">{{createText("prof_test_required","prof_test_required","Prof Test Required",'',$data->prof_test_required)}}
</div><div class="col-lg-6">{{createText("prof_test_accepted","prof_test_accepted","Prof Test Accepted",'',$data->prof_test_accepted)}}
</div><div class="col-lg-6">{{createText("prof_test_min_score","prof_test_min_score","Prof Test Min Score",'',$data->prof_test_min_score)}}
</div><div class="col-lg-6">{{createText("prof_test_band_score","prof_test_band_score","Prof Test Band Score",'',$data->prof_test_band_score)}}
</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('programs.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,239 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Programs List") }}</h2>
<a href="{{ route('programs.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_programs" data-url="{{ route('programs.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("S No.")}}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("Institutions") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("Title") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("Alias") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("Institution") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("Program Level") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("Years") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("Intake") }}</span></th>
<th class="tb-col 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->program_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">
{!! getFieldData("tbl_institutions", "title", "institution_id", $item->institutions_id) !!}
</td><td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">
<div class="alias-wrapper" data-id="{{$item->program_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->program_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td>
<td class="tb-col">{{ $item->program_level }}</td>
<td class="tb-col">{{ $item->intake }}</td>
<td class="tb-col">{{ $item->institution }}</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('programs.show',[$item->program_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('programs.edit',[$item->program_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('programs.toggle',[$item->program_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('programs.destroy',[$item->program_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>
@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('programs.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

View File

@@ -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('programs.index')); ?>
</div>
<div class='card-body'>
<p><b>Institutions Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->institutions_id}}</span></p><p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Program Level :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->program_level}}</span></p><p><b>Years :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->years}}</span></p><p><b>Psw :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->psw}}</span></p><p><b>Prospects :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->prospects}}</span></p><p><b>Intake :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->intake}}</span></p><p><b>Institution :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->institution}}</span></p><p><b>City :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->city}}</span></p><p><b>Application Open :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->application_open}}</span></p><p><b>Application Deadline :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->application_deadline}}</span></p><p><b>Level :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->level}}</span></p><p><b>Min Level :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->min_level}}</span></p><p><b>Min Level Faculty :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->min_level_faculty}}</span></p><p><b>Min Level Score :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->min_level_score}}</span></p><p><b>Min Level Passout :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->min_level_passout}}</span></p><p><b>Min Level Optional Requirement :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->min_level_optional_requirement}}</span></p><p><b>Prof Test Required :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->prof_test_required}}</span></p><p><b>Prof Test Accepted :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->prof_test_accepted}}</span></p><p><b>Prof Test Min Score :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->prof_test_min_score}}</span></p><p><b>Prof Test Band Score :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->prof_test_band_score}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,34 @@
@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 Province</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 Province</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('provinces.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class='card'>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ","Description")}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
</div>
<div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
</div>
</form>
@endsection

View File

@@ -0,0 +1,18 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Provinces') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('provinces.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('provinces.update',[$data->province_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='province_id' value='{{$data->province_id}}'/>
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
</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('provinces.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,261 @@
@extends('backend.template')
@section('content')
<div class="row">
<div class="col-lg-4">
<form action="{{route('provinces.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class='card'>
<div class="card-header">
<h4 class="mb-0 card-title">{{ label("Add Province ") }}</h4>
</div>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ","Description")}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
</div>
<div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
</div>
</form>
</div>
<div class="col-lg-8">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">{{ label("Provinces List") }}</h4>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_provinces" data-url="{{ route('provinces.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col text-uppercase">{{ label("title") }}</th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col 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->province_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->province_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->province_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</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('provinces.show',[$item->province_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('provinces.edit',[$item->province_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('provinces.toggle',[$item->province_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('provinces.destroy',[$item->province_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>
</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('provinces.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

View File

@@ -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('provinces.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,36 @@
@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 Qualification</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 Qualification</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('qualifications.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class='card'>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
<div class="card-footer">
<div class="col-md-12">
<?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('qualifications.index')); ?>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,36 @@
@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">Edit Qualification</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">Edit Qualification</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('qualifications.update',[$data->qualification_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='qualification_id' value='{{$data->qualification_id}}'/>
<div class='card'>
<div class='card-body'>
<div class="row">
<div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}</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>
</div>
<div class="card-footer">
<div class="col-md-12">
<?php createButton("btn-primary btn-update","","Update"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('qualifications.index')); ?>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,233 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Qualifications List") }}</h2>
<a href="{{ route('qualifications.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_qualifications" data-url="{{ route('qualifications.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col 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->qualification_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->qualification_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->qualification_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</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('qualifications.show',[$item->qualification_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('qualifications.edit',[$item->qualification_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('qualifications.toggle',[$item->qualification_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('qualifications.destroy',[$item->qualification_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>
@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('qualifications.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

View File

@@ -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('qualifications.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,192 @@
@extends('backend.ajaxtemplate')
@section('content')
<!-- start page title -->
<!-- end page title -->
<form action="{{route('registrations.update',[$data->registration_id])}}" id="updateCustomForm" method="POST">
@csrf <input type=hidden name='registration_id' value='{{$data->registration_id}}' />
<div class="">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<div class="row align-items-center gy-3">
<div class="col-sm">
<h5 class="card-title mb-0">Student Name - <span class="text-primary fw-medium ">{{ $data->name }}</span> </h5>
</div>
<div class="col-sm-auto">
<div class="d-flex gap-1 flex-wrap">
<?php createButton("btn-primary btn-update", "", "Update"); ?>
</div>
</div>
</div>
</div>
<!--end row-->
<div class="card-body">
<ul class="nav nav-tabs nav-tabs-custom" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" href="#student-information" role="tab" aria-selected="false">
<i class="ri-user-3-line text-muted align-bottom me-1"></i> Student Information
</a>
</li>
<!-- <li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" id="images-tab" href="#campaign" role="tab" aria-selected="true">
<i class="ri-vip-crown-line text-muted align-bottom me-1"></i> Campaign
</a>
</li> -->
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#qulification" role="tab" aria-selected="false">
<i class=" ri-book-open-line text-muted align-bottom me-1"></i> Qualifications
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#pc" role="tab" aria-selected="false">
<i class="ri-file-copy-2-line text-muted align-bottom me-1"></i> Preparation Classes
</a>
</li>
<!-- <li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#others" role="tab" aria-selected="false">
<i class=" ri-settings-2-line text-muted align-bottom me-1"></i> Others
</a>
</li> -->
<!-- <li class="nav-item ms-auto">
<div class="dropdown">
<a class="nav-link fw-medium text-reset mb-n1" href="#" role="button" id="dropdownMenuLink1" data-bs-toggle="dropdown" aria-expanded="false">
<i class="ri-settings-4-line align-middle me-1"></i> Back to List
</a>
</div>
</li> -->
</ul>
</div>
<div class="card-body p-4">
<div class="tab-content text-muted">
<div class="tab-pane active" id="student-information" role="tabpanel">
{{createText("name","name","Name",'',$data->name)}}
<div class="border border-dashed"></div>
<div class="row">
<div class="col-lg-3">{{createText("email","email","Email",'',$data->email)}}</div>
<div class="col-lg-3">{{createText("phone","phone","Phone",'',$data->phone)}}</div>
<div class="col-lg-3">{{createText("mobile","mobile","Mobile",'',$data->mobile)}}</div>
<div class="col-lg-3">{{createText("address","address","Address",'',$data->address)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-3">{{createText("address","address","Address",'',$data->address)}}</div>
<div class="col-lg-3">{{createText("dob","dob","Date of Birth",'',$data->dob)}}</div>
<div class="col-lg-3">{{createText("gender","gender","Gender",'',$data->gender)}}</div>
<div class="col-lg-3">{{createText("marital_status","marital_status","Marital Status",'',$data->marital_status)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-3">{{createCustomSelect('tbl_countries', 'title', 'country_id', $data->countries_id, 'Interested Country','countries_id', 'form-control select2','status<>-1')}}</div>
<!-- <div class="col-lg-3">{{createCustomSelect('tbl_provinces', 'title', 'province_id', $data->provinces_id, 'Province','provinces_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-3">{{createCustomSelect('tbl_districts', 'title', 'district_id', $data->districts_id, 'District','districts_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-3">{{createCustomSelect('tbl_cities', 'title', 'city_id', $data->cities_id, 'City','cities_id', 'form-control select2','status<>-1')}}</div> -->
<div class="col-lg-3">{{createText("guardian_name","guardian_name","Guardian Name",'',$data->guardian_name)}}</div>
<div class="col-lg-3">{{createText("phone","phone","Phone",'',$data->phone)}}</div>
<div class="col-lg-3">{{createCustomSelect('tbl_sources', 'title', 'source_id', $data->sources_id, 'Source','sources_id', 'form-control select2','status<>-1')}}</div>
</div>
</div>
<div class="tab-pane" id="campaign" role="tabpanel">
<div class="row">
<div class="row">
<div class="col-lg-6">{{createCustomSelect('tbl_campaigns', 'title', 'campaign_id', $data->campaigns_id, 'Campaign','campaigns_id', 'form-control select2','status<>-1')}}</div>
</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane" id="qulification" role="tabpanel">
<div class="row">
<!-- <div class="col-lg-12">
<h4 class="card-title "> {{createCustomSelect('tbl_qualifications', 'title', 'qualification_id', $data->qualifications_id, 'Qualifications','qualifications_id', 'form-control select2','status<>-1')}}</h4>
</div> -->
<!-- <div class="border border-dashed mb-3"></div> -->
<div>
<h5 class="fs-15">SEE</h5>
</div>
<div class="row">
<div class="col-lg-3">{{createText("see_year","see_year","Year",'',$data->see_year)}}</div>
<div class="col-lg-3">{{createText("see_grade","see_grade","Grade",'',$data->see_grade)}}</div>
<div class="col-lg-3">{{createText("see_stream","see_stream","Stream",'',$data->see_stream)}}</div>
<div class="col-lg-3">{{createText("see_school","see_school","School",'',$data->see_school)}}</div>
</div>
<div class="border border-dashed mb-3"></div>
<div>
<h5 class="fs-15">PLUS 2</h5>
</div>
<div class="row">
<div class="col-lg-3">{{createText("plus2_year","plus2_year","Year",'',$data->plus2_year)}}</div>
<div class="col-lg-3">{{createText("plus2_grade","plus2_grade","Grade",'',$data->plus2_grade)}}</div>
<div class="col-lg-3">{{createText("plus2_stream","plus2_stream","Stream",'',$data->plus2_stream)}}</div>
<div class="col-lg-3">{{createText("plus2_college","plus2_college","College",'',$data->plus2_college)}}</div>
</div>
<div class="border border-dashed mb-3"></div>
<div>
<h5 class="fs-15">BACHELORS</h5>
</div>
<div class="row">
<div class="col-lg-3">{{createText("bachelors_year","bachelors_year","Year",'',$data->bachelors_year)}}</div>
<div class="col-lg-3">{{createText("bachelors_grade","bachelors_grade","Grade",'',$data->bachelors_grade)}}</div>
<div class="col-lg-3">{{createText("bachelors_stream","bachelors_stream","Stream",'',$data->bachelors_stream)}}</div>
<div class="col-lg-3">{{createText("bachelors_college","bachelors_college","College",'',$data->bachelors_college)}}</div>
</div>
<div class="border border-dashed mb-3"></div>
<div>
<h5 class="fs-15">HIGHEST QUALIFICATION</h5>
</div>
<div class="row">
<div class="col-lg-3">{{createText("highest_qualification","highest_qualification","Qualification",'',$data->highest_qualification)}}</div>
<div class="col-lg-3">{{createText("highest_grade","highest_grade","Grade",'',$data->highest_grade)}}</div>
<div class="col-lg-3">{{createText("highest_stream","highest_stream","Stream",'',$data->highest_stream)}}</div>
<div class="col-lg-3">{{createText("highest_college","highest_college","College",'',$data->highest_college)}}</div>
</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane" id="pc" role="tabpanel">
<div class="row">
<div class="col-lg-6">{{createText("preparation_class","preparation_class","Preparation Class",'',$data->preparation_class)}}</div>
<div class="col-lg-6">{{createText("preparation_score","preparation_score","Preparation Score",'',$data->preparation_score)}}</div>
<div class="col-lg-6">{{createText("preparation_bandscore","preparation_bandscore","Preparation Bandscore",'',$data->preparation_bandscore)}}</div>
<div class="col-lg-6">{{createText("preparation_date","preparation_date","Preparation Date",'',$data->preparation_date)}}</div>
</div>
</div>
<!--end row-->
<div class="tab-pane" id="others">
<div class="row">
<div class="col-lg-12">{{createText("user_agent","user_agent","User Agent",'',$data->user_agent)}}</div>
<div class="col-lg-6">{{createText("tags","tags","Tags",'',$data->tags)}}</div>
<div class="col-lg-6">{{createText("coupen_code","coupen_code","Coupen Code",'',$data->coupen_code)}}</div>
</div>
</div>
</div>
<!--end tab-pane-->
</div>
<!--end tab-content-->
</div>
<!--end card-body-->
</div>
<!--end card -->
</div>
<!--end card -->
</div>
</form>
@endsection

View File

@@ -0,0 +1,47 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Registrations') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('registrations.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('registrations.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_campaigns', 'title', 'campaign_id', '', 'Campaigns Id','campaigns_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_sources', 'title', 'source_id', '', 'Sources Id','sources_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_countries', 'title', 'country_id', '', 'Countries Id','countries_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_provinces', 'title', 'province_id', '', 'Provinces Id','provinces_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_districts', 'title', 'district_id', '', 'Districts Id','districts_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_cities', 'title', 'city_id', '', 'Cities Id','cities_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_leadcategories', 'title', 'leadcategory_id', '', 'Leadcategories Id','leadcategories_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_agents', 'title', 'agent_id', '', 'Agents Id','agents_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("name","name","Name")}}
</div><div class="col-lg-6">{{createText("email","email","Email")}}
</div><div class="col-lg-6">{{createText("phone","phone","Phone")}}
</div><div class="col-lg-6">{{createText("mobile","mobile","Mobile")}}
</div><div class="col-lg-6">{{createText("address","address","Address")}}
</div><div class="col-lg-6">{{createCustomSelect('tbl_qualifications', 'title', 'qualification_id', '', 'Qualifications Id','qualifications_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("see_year","see_year","See Year")}}
</div><div class="col-lg-6">{{createText("see_grade","see_grade","See Grade")}}
</div><div class="col-lg-6">{{createText("see_stream","see_stream","See Stream")}}
</div><div class="col-lg-6">{{createText("see_school","see_school","See School")}}
</div><div class="col-lg-6">{{createText("plus2_year","plus2_year","Plus2 Year")}}
</div><div class="col-lg-6">{{createText("plus2_grade","plus2_grade","Plus2 Grade")}}
</div><div class="col-lg-6">{{createText("plus2_stream","plus2_stream","Plus2 Stream")}}
</div><div class="col-lg-6">{{createText("plus2_college","plus2_college","Plus2 College")}}
</div><div class="col-lg-6">{{createText("bachelors_year","bachelors_year","Bachelors Year")}}
</div><div class="col-lg-6">{{createText("bachelors_grade","bachelors_grade","Bachelors Grade")}}
</div><div class="col-lg-6">{{createText("bachelors_stream","bachelors_stream","Bachelors Stream")}}
</div><div class="col-lg-6">{{createText("bachelors_college","bachelors_college","Bachelors College")}}
</div><div class="col-lg-6">{{createText("highest_qualification","highest_qualification","Highest Qualification")}}
</div><div class="col-lg-6">{{createText("highest_grade","highest_grade","Highest Grade")}}
</div><div class="col-lg-6">{{createText("highest_stream","highest_stream","Highest Stream")}}
</div><div class="col-lg-6">{{createText("highest_college","highest_college","Highest College")}}
</div><div class="col-lg-6">{{createText("preparation_class","preparation_class","Preparation Class")}}
</div><div class="col-lg-6">{{createText("preparation_score","preparation_score","Preparation Score")}}
</div><div class="col-lg-6">{{createText("preparation_bandscore","preparation_bandscore","Preparation Bandscore")}}
</div><div class="col-lg-6">{{createText("preparation_date","preparation_date","Preparation Date")}}
</div><div class="col-lg-6">{{createText("preffered_location","preffered_location","Preffered Location")}}
</div><div class="col-lg-6">{{createText("intrested_for_country","intrested_for_country","Intrested For Country")}}
</div><div class="col-lg-6">{{createText("intrested_course","intrested_course","Intrested Course")}}
</div><div class="col-lg-6">{{createText("user_agent","user_agent","User Agent")}}
</div><div class="col-lg-6">{{createText("tags","tags","Tags")}}
</div><div class="col-lg-6">{{createText("coupen_code","coupen_code","Coupen Code")}}
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-primary btn-cancel","","Cancel",route('registrations.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,176 @@
@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">Edit Registration - ({{ $data->name }})</h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
<i class="breadcrumb-item active">Edit Registration</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('registrations.update',[$data->registration_id])}}" id="updateCustomForm" method="POST">
@csrf <input type=hidden name='registration_id' value='{{$data->registration_id}}' />
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<div class="row align-items-center gy-3">
<div class="col-sm">
<h5 class="card-title mb-0">Student Name - <span class="text-primary fw-medium "> {{ $data->name }}</span> </h5>
</div>
<div class="col-sm-auto">
<div class="d-flex gap-1 flex-wrap">
<?php createButton("btn-primary btn-update", "", "Update"); ?>
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('registrations.index')); ?>
</div>
</div>
</div>
<h5 class="fs-16 fw-semibold mb-0"></h5>
</div>
</div>
</div>
</div>
<div class="col-lg-7">
<div class="card">
<div class="card-body p-4">
<ul class="nav nav-tabs nav-tabs-custom" role="tabli s t">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" href="#student-information" role="tab" aria-selected="false">
<i class="ri-user-3-line text-muted al ign-bottom me-1"></i> Student Information
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" id="images-tab" href="#campaign" role="tab" aria-selected="true">
<i class="ri-vip-crown-line text-muted align-bottom me-1"></i> Campaign
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#qulification" role="tab" aria-selected="false">
<i class=" ri-book-open-line text-muted align-bottom me-1"></i> Qualifications
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#pc" role="tab" aria-selected="false">
<i class="ri-file-copy-2-line text-muted align-bottom me-1"></i> Preparation Classes
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#others" role="tab" aria-selected="false">
<i class=" ri-settings-2-line text-muted align-bottom me-1"></i> Others
</a>
</li>
</ul>
<div class="tab-content text-muted">
<!-- Student Information -->
<div class="tab-pane active" id="student-information" role="tabpanel">
{{createText("name","name","Name",'',$data->name)}}
<div class="border border-dashed"></div>
<div class="row">
<div class="col-lg-3">{{createText("email","email","Email",'',$data->email)}}</div>
<div class="col-lg -3">{{createText( "phone","phone","Phone",'',$data->phone)}}</div>
<div class="col-lg-3">{{createText("mobile","mobile","Mobile",'',$data->mobile)}}</div>
<div class="col-lg-3">{{createText("address","address","Address",'',$data->address)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-3">{{createCustomSelect('tbl_countries', 'title', 'country_id', $data->countries_id, 'Country','countries_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-3">{{createCustomSelect('tbl_provinces', 'title', 'province_id', $data->provinces_id, 'Province','provinces_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-3">{{createCustomSelect('tbl_districts', 'title', 'district_id', $data->districts_id, 'District','districts_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-3">{{createCustomSelect('tbl_cities', 'title', 'city_id', $data->cities_id, 'City','cities_id', 'form-control select2','status<>-1')}}</div>
</div>
</div>
<!--end tab-pane-->
<!--campaign-->
<div class="tab-pane" id="campaign" role="tabpanel">
<div class="row">
<div class="col-lg-6"> {{createCustomSelect('tbl_campaigns', 'title', 'campaign_id', $data->campaigns_id, 'Campaign','campaigns_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-6">{{createCustomSelect('tbl_sources', 'title', 'source_id', $data->sources_id, 'Source','sources_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-6">{{createCustomSelect('tbl_leadcategories', 'title', 'leadcategory_id', $data->leadcategories_id, 'Lead category','leadcategories_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-6"> {{createCustomSelect('tbl_agents', 'title', 'agent_id', $data->agents_id, 'Agent','agents_id', 'form-control select2','status<>-1')}}</div>
</div>
</div>
<!--end tab-pane-->
<!--Qualification tab-pane-->
<div class=" tab-pane" id="qulification" role="tabpanel">
<!-- <div class="row"> -->
<!-- <div class="col-lg-12">
< h4 class="card-title"> {{ createCustomSelect('tbl_qualifications', 'title', 'qualification_id', $data->qualifications_id, 'Qualifications','qualifications_id', 'form-control select2','status<>-1')}}</h4>
</div> -->
<!-- <div class="border border-dashed mb-3"></div> -->
<div>
<h5 class="fs-15 mt-3">SEE</h5>
</div>
<div class="row">
<div class="col-lg-3">{{createText("see_year","see_year","Year",'',$data->see_year)}}</div>
<div class="col-lg-3">{{createText(" see_grade","see_grade","Grade",'',$data->see_grade)}}</div>
<div class="col-lg-3">{{createText("see_stream","see_stream","Stream",'',$data->see_stream)}}</div>
<div class="col-lg-3">{{createText("see_school","see_school","School",'',$data->see_school)}}</div>
</div>
<div class="border border-dashed mb-3"></div>
<div>
<h5 class="fs-15">PLUS 2</h5>
</div>
<div class="row">
<div class="col-lg-3">{{createText("plus2_year","plus2_year","Year",'',$data->plus2_year)}}</div>
<div class="col-lg-3">{{createText("plus2_grade","plus2_grade","Grade",'',$data->plus2_grade)}}</div>
<div class="col-lg-3">{{createText("plus2_stream","plus2_stream","Stream",'',$data->plus2_stream)}}</div>
<div class="col-lg-3">{{createText("plus2_college","plus2_college","College",'',$data->plus2_college)}}</div>
</div>
<div class="border border-dashed mb-3"></div>
<div>
<h5 class="fs-15">BACHELORS</h5>
</div>
<div class="row">
<div class="col-lg-3">{{createText("bachelors_year","bachelors_year","Year",'',$data->bachelors_year)}}</div>
<div class="col-lg-3">{{createText("bachelors_grade","bachelors_grade","Grade",'',$data->bachelors_grade)}}</div>
<div class="col-lg-3">{{createText("bachelors_stream","bachelors_stream","Stream",'',$data->bachelors_stream)}}</div>
<div class="col-lg-3">{{createText("bachelors_college","bachelors_college","College",'',$data->bachelors_college)}}</div>
</div>
<div class="border border-dashed mb-3"></div>
<div>
<h5 class="fs-15">HIGHEST QUALIFICATION</h5>
</div>
<div class="row">
<div class="col-lg-3">{{createText("highest_qualification","highest_qualification","Qualification",'',$data->highest_qualification)}}</div>
<div class="col-lg-3">{{createText("highest_grade","highest_grade","Grade",'',$data->highest_grade)}}</div>
<div class="col-lg-3">{{createText("highest_stream","highest_stream","Stream",'',$data->highest_stream)}}</div>
<div class="col-lg-3">{{createText("highest_college","highest_college","College",'',$data->highest_college)}}</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane" id="pc" role="tabpanel">
<div class="row">
<div class="col-lg-3">{{createText("preparation_class","preparation_class","Preparation Class",'',$data->preparation_class)}}</div>
<div class="col-lg-3">{{createText("preparation_score","preparation_score","Preparation Score",'',$data->preparation_score)}}</div>
<div class="col-lg-3">{{createText("preparation_bandscore","preparation_bandscore","Preparation Bandscore",'',$data->preparation_bandscore)}}</div>
<div class="col-lg-3">{{createText("preparation_date","preparation_date","Preparation Date",'',$data->preparation_date)}}</div>
<div class="col-lg-4">{{createText("preffered_location","preffered_location","Preffered Location",'',$data->preffered_location)}}</div>
<div class="col-lg-4">{{createText("intrested_for_country","intrested_for_country","Intrested For Country",'',$data->intrested_for_country)}}</div>
<div class="col-lg-4">{{createText("intrested_course","intrested_course","Intrested Course",'',$data->intrested_course)}}</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane" id="others">
<div class="row">
<div class="col-lg-12">{{createText("user_agent","user_agent","User Agent",'',$data->user_agent)}}</div>
<div class="col-lg-6">{{createText("tags","tags","Tags",'',$data->tags)}}</div>
<div class="col-lg-6">{{createText("coupen_code","coupen_code","Coupen Code",'',$data->coupen_code)}}</div>
</div>
</div>
<!--end tab-pane-->
</div>
<!--end row-->
</div>
<!--end tab-content-->
</div>
<!--end card-body-->
</form>
@endsection

View File

@@ -0,0 +1,487 @@
@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">Registrations List</h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Jobs</a></li>
<li class="breadcrumb-item active">Registrations List</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card" id="applicationList">
<div class="card-header border-0">
<div class="d-md-flex align-items-center">
<h5 class="card-title mb-3 mb-md-0 flex-grow-1">Registrations List</h5>
<?php if (!empty($data->registration_id)) : ?>
<div class="flex-shrink-0">
<div class="d-flex gap-1 flex-wrap">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#smsModal">
<i class="ri-add-line align-bottom me-1"></i> Bulk SMS
</button>
<a href="{{ route('generate-pdf', ['ids' => implode(',', $data->pluck('registration_id')->toArray())]) }}" class="btn btn-success add-btn"><i class="ri-add-line align-bottom me-1"></i> Generate PDF</a>
<a href="{{ route('registrations.create') }}" class="btn btn-success add-btn"><i class="ri-add-line align-bottom me-1"></i> Create New Registration</a>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div class="modal fade" id="smsModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<form name="sendBulkSMS" method="POST" action="{{route('registrations.sms.send')}}">
@csrf
<input type="hidden" name="mobile" value="<?php $mobileNumbers = [];
foreach ($data as $item) {
if (isset($item->mobile)) {
$mobileNumbers[] = $item->mobile;
}
}
$csvString = implode(',', $mobileNumbers);
echo $csvString;
?>">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Send Bulk SMS</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<!-- Textbox for SMS content -->
<div class="mb-3">
<label for="smsContent" class="form-label">SMS Content:</label>
<textarea name="message" class="form-control" id="smsContent" rows="4"></textarea>
</div>
</div>
<div class="modal-footer">
<!-- Send button -->
<button type="submit" class="btn btn-primary">Send</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
<div class="card-body border border-dashed border-end-0 border-start-0">
<form method="POST" action="" id="filterForm">
@csrf
<div class="row g-3">
<div class="col-xxl-2 col-sm-6">
<div class="search-box">
<input type="text" class="form-control search datepicker" name="from" id="from" value="{{isset($request['from'])?$request['from']:''}}" placeholder="Select From Date">
<i class="ri-calendar-event-line search-icon"></i>
</div>
</div>
<!--end col-->
<div class="col-xxl-2 col-sm-6">
<div class="search-box">
<input type="text" class="form-control datepicker" name="to" id="to" value="{{isset($request['to'])?$request['to']:''}}" placeholder="Select To Date">
<i class="ri-calendar-event-line search-icon"></i>
</div>
</div>
<!--end col-->
<div class="col-xxl-2 col-sm-4">
{{createCustomSelect("tbl_campaigns","title","campaign_id",isset($request['campaign_id'])?$request['campaign_id']:null,"","campaign_id","select2 js-example-basic-single","status=1")}}
</div>
<!--end col-->
<div class="col-xxl-2 col-sm-4">
{{createCustomSelect("tbl_sources","title","source_id",isset($request['source_id'])?$request['source_id']:null,"","source_id","select2 js-example-basic-single","status=1")}}
</div>
<!--end col-->
<div class="col-xxl-2 col-sm-4">
{{createCustomSelect("tbl_countries","title","country_id",isset($request['country_id'])?$request['country_id']:null,"","country_id","select2","status=1")}}
</div>
<!--end col-->
<div class="col-xxl-2 col-sm-4">
{{createCustomSelect("tbl_leadcategories","title","leadcategory_id",isset($request['leadcategory_id'])?$request['leadcategory_id']:null,"","leadcategory_id","select2","status=1", "Placeholder='lead category'")}}
</div>
<!--end col-->
<div class="col-xxl-1 col-sm-4">
<div>
<button class="btn btn-info w-100" type="Submit">
<!-- <i class="ri-equalizer-fill me-1 align-bottom "></i> -->
Filters
</button>
</div>
</div>
<div class="col-xxl-1 col-sm-4">
<div>
<button class="btn btn-danger w-100" type="Reset" onclick="resetForm()">
<!-- <i class="ri-recycle-line me-1 align-bottom"></i> -->
Reset
</button>
</div>
</div>
<!--end col-->
</div>
</form>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">
<?php if (isset($title)) : ?>
{{ label($title) }}
<?php endif; ?>
</h4>
</div>
<div class="card-body">
<div class="table-responsive ">
<table class="table dataTable" id="tbl_registrations" data-url="{{ route('registrations.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
<!-- <th class="tb-col text-uppercase"><span class="overline-title">{{ label("campaigns") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("sources") }}</span></th> -->
<!-- <th class="tb-col text-uppercase"><span class="overline-title">{{ label("lead categories") }}</span></th> -->
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("name") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("email") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("mobile") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("qualification") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("Score") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("countries") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("Form") }}</span></th>
<!-- <th class="tb-col text-uppercase"><span class="overline-title">{{ label("agents") }}</span></th> -->
<th class="tb-col 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->registration_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">
{!! getFieldData("tbl_campaigns", "title", "campaign_id", $item->campaigns_id) !!}
</td>
<td class="tb-col">
{!! getFieldData("tbl_sources", "title", "source_id", $item->sources_id) !!}
</td> -->
<!--
<td class="tb-col">
{!! getFieldData("tbl_leadcategories", "title", "leadcategory_id", $item->leadcategories_id) !!}
</td> -->
<td class="tb-col"><span class="edit-trigger text-info">{{ $item->name }}</span></td>
<td class="tb-col">{{ $item->email }}</td>
<td class="tb-col">{{ $item->mobile }}</td>
<td class="tb-col">{{ $item->highest_qualification }}</td>
<td class="tb-col">{{ $item->highest_grade }}</td>
<!-- <td class="tb-col">
{!! getFieldData("tbl_agents", "title", "agent_id", $item->agents_id) !!}
</td> -->
<td class="tb-col">
{!! getFieldData("tbl_countries", "title", "country_id", $item->countries_id) !!}
</td>
<td><a href="{{route('pdf.generate')}}?id={{$item->registration_id}}" class="">{{label("Print Form")}}</a></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('pdf.generate')}}?id={{$item->registration_id}}" class="dropdown-item "><i class="ri-file-pdf align-bottom me-2 text-muted"></i> {{label("Download")}}</a></li>
<li><a href="{{route('registrations.edit.ajax',[$item->registration_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('registrations.toggle',[$item->registration_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('registrations.destroy',[$item->registration_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>
@push("css")
@endpush
<div class="modal fade" id="editModal" tabindex="-1" aria-labelledby="editModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-centered">
<div class="modal-content">
<div class="modal-header bg-light p-3">
<h5 class="modal-title" id="editModalLabel">Edit Registration</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body p-0">
<iframe id="editFrame" src="" width="100%" height="550px"></iframe>
</div>
<!-- <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div> -->
</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">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.1/css/buttons.dataTables.min.css">
@endpush
@push("js")
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!-- Load pdfMake library -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
<!-- Load vfs_fonts.js after pdfMake -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.1/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script>
$(document).ready(function(e) {
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
},
dom: 'Bfrtip', // Specify the buttons container
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Add export buttons here
]
});
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;
}
});
});
$('.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('registrations.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');
}
});
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>
<script>
function resetForm() {
document.getElementById("filterForm").reset();
window.location = "{{ Route::current()->uri() }}";
}
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
let editTriggers = document.querySelectorAll(".edit-trigger");
editTriggers.forEach(function(trigger) {
trigger.addEventListener("click", function() {
let row = trigger.closest("tr");
let editLink = row.querySelector(".edit-item-btn").getAttribute("href");
let editFrame = document.getElementById("editFrame");
// Set the iframe src to the edit link of the clicked row
editFrame.src = editLink;
// Show the modal
let modal = new bootstrap.Modal(document.getElementById('editModal'));
modal.show();
});
});
});
document.addEventListener('DOMContentLoaded', function() {
let editTriggers = document.querySelectorAll(".edit-item-btn");
editTriggers.forEach(function(trigger) {
trigger.addEventListener("click", function() {
// let row = trigger.closest("tr");
// let editLink = row.querySelector(".edit-item-btn").getAttribute("href");
let editLink = editTriggers.getAttribute("href");
let editFrame = document.getElementById("editFrame");
// Set the iframe src to the edit link of the clicked row
editFrame.src = editLink;
// Show the modal
let modal = new bootstrap.Modal(document.getElementById('editModal'));
modal.show();
});
});
});
</script>
@endpush

View File

@@ -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('registrations.index')); ?>
</div>
<div class='card-body'>
<p><b>Campaigns Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->campaigns_id}}</span></p><p><b>Sources Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->sources_id}}</span></p><p><b>Countries Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->countries_id}}</span></p><p><b>Provinces Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->provinces_id}}</span></p><p><b>Districts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->districts_id}}</span></p><p><b>Cities Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->cities_id}}</span></p><p><b>Leadcategories Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->leadcategories_id}}</span></p><p><b>Agents Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->agents_id}}</span></p><p><b>Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->name}}</span></p><p><b>Email :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->email}}</span></p><p><b>Phone :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->phone}}</span></p><p><b>Mobile :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->mobile}}</span></p><p><b>Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->address}}</span></p><p><b>Qualifications Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->qualifications_id}}</span></p><p><b>See Year :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->see_year}}</span></p><p><b>See Grade :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->see_grade}}</span></p><p><b>See Stream :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->see_stream}}</span></p><p><b>See School :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->see_school}}</span></p><p><b>Plus2 Year :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->plus2_year}}</span></p><p><b>Plus2 Grade :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->plus2_grade}}</span></p><p><b>Plus2 Stream :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->plus2_stream}}</span></p><p><b>Plus2 College :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->plus2_college}}</span></p><p><b>Bachelors Year :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->bachelors_year}}</span></p><p><b>Bachelors Grade :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->bachelors_grade}}</span></p><p><b>Bachelors Stream :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->bachelors_stream}}</span></p><p><b>Bachelors College :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->bachelors_college}}</span></p><p><b>Highest Qualification :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->highest_qualification}}</span></p><p><b>Highest Grade :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->highest_grade}}</span></p><p><b>Highest Stream :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->highest_stream}}</span></p><p><b>Highest College :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->highest_college}}</span></p><p><b>Preparation Class :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->preparation_class}}</span></p><p><b>Preparation Score :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->preparation_score}}</span></p><p><b>Preparation Bandscore :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->preparation_bandscore}}</span></p><p><b>Preparation Date :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->preparation_date}}</span></p><p><b>Preffered Location :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->preffered_location}}</span></p><p><b>Intrested For Country :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->intrested_for_country}}</span></p><p><b>Intrested Course :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->intrested_course}}</span></p><p><b>User Agent :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->user_agent}}</span></p><p><b>Tags :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->tags}}</span></p><p><b>Coupen Code :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->coupen_code}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,35 @@
@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 Required Documents</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 Required Documents</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('requireddocuments.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="card">
<div class="card-body">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
<div class="card-footer">
<div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('requireddocuments.index')); ?>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,18 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Requireddocuments') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('requireddocuments.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('requireddocuments.update',[$data->requireddocument_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='requireddocument_id' value='{{$data->requireddocument_id}}'/>
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
</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('requireddocuments.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,233 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Requireddocuments List") }}</h2>
<a href="{{ route('requireddocuments.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_requireddocuments" data-url="{{ route('requireddocuments.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col 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->requireddocument_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->requireddocument_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->requireddocument_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</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('requireddocuments.show',[$item->requireddocument_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('requireddocuments.edit',[$item->requireddocument_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('requireddocuments.toggle',[$item->requireddocument_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('requireddocuments.destroy',[$item->requireddocument_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>
@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('requireddocuments.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

View File

@@ -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('requireddocuments.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,40 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Settings') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('settings.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('settings.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row"><div class="col-lg-6">{{createText("title","title","Title")}}
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}
</div><div class="col-l g-6">{{ createText("url1","url1","Url1")}}
</div><div class="col-lg-6">{{createText("url2","url2","Url2")}}
</div><div class="col-lg-6">{{createText("email","email","Email")}}
</div><div class="col-l g-6">{{ createText("phone","phone","Phone")}}
</div><div class="col-lg-6">{{createText("secondary_phone","secondary_phone","Secondary Phone")}}
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("google_map","google_map ","Google Map")}}
</div><div class="col-lg -6">{{createText("fb","fb","Fb")}}
</div><div class="col-lg-6">{{createText("insta","insta","Insta")}}
</div><div class="col-lg-6">{{createText("twitter","twitter","Twitter")}}
</div><div class="col-lg -6">{{createText("tiktok","tiktok","Tiktok")}}
</div><div class="col-lg-12 pb-2">{{createImageInput("primary_logo","Primary Logo")}}
</div><div class="col-lg-12 pb-2">{{createImageInput("secondary_logo","Secondary Logo")}}
</div><div class="col-lg-12 pb-2"> {{createImageInput ("thumb","Thumb")}}
</div><div class="col-lg-12 pb-2">{{createImageInput("icon","Icon")}}
</div><div class="col-lg-12 pb-2">{{createImageInput("og_image","Og Image")}}
</div><div class="col-lg-12 pb-2">{{createImageInput ("no_image","No Image")}}
</div><div class="col-lg-6">{{createText("copyright_text","copyright_text","Copyright Text")}}
</div><div class="col-lg-12 pb-2">{{createTextarea("content1","content1 ckeditor-classic","Content1")}}
</div><div class="col -lg-1 2 pb-2">{{createTextarea("content2","content2 ckeditor-classic","Content2")}}
</div><div class="col-lg-12 pb-2">{{createTextarea("content3","content3 ckeditor-classic","Content3")}}
</div><div class="col-lg-6">{{createText("seo_title","seo_title","Seo Title")}}
</div><div class="col-lg -12 pb-2 ">{{createPlainTextArea("seo_description","seo_description ","Seo Description")}}
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("seo_keywords","seo_keywords ","Seo Keywords")}}
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("og_tags","og_tags ","Og Tags")}}
</div> <br> <div class="co l-md-12">< ?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-primary btn-cancel","","Cancel",route('settings.index')); ?>
</div> </form></div></div>
@end section

View File

@@ -0,0 +1,153 @@
@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">Edit Setting</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 Branch</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('settings.update',[$data->setting_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='setting_id' value='{{$data->setting_id}}'/>
<div class="row">
<div class="col-xl-9 mb-3 ">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title",'',$data->title)}}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Contact Details</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-6">{{createText("url1","url1","Url1",'',$data->url1)}}</div>
<div class="col-lg-6">{{createText("url2","url2","Url2",'',$data->url2)}}</div>
<div class="col-lg-6">{{createText("email","email","Email",'',$data->email)}}</div>
<div class="col-lg-3">{{createText("phone","phone","Phone",'',$data->phone)}}</div>
<div class="col-lg-3">{{createText("secondary_phone","secondary_phone","Secondary Phone",'',$data->secondary_phone)}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("google_map",'',"Google Map",$data->google_map)}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<div class="card-title mb-0">Footer</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("copyright_text","copyright_text","Copyright Text",'',$data->copyright_text)}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("content1","content1","Content1",$data->content1)}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("content2","content2","Content2",$data->content2)}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("content3","content3","Content3",$data->content3)}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<div class="card-title mb-0">SEO Related</div>
</div>
<div class="card-body">
<div class="col-lg-12">{{createText("seo_title","seo_title","Seo Title",'',$data->seo_title)}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("seo_description",'',"Seo Description",$data->seo_description)}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("seo_keywords",'',"Seo Keywords",$data->seo_keywords)}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("og_tags",'',"Og Tags",$data->og_tags)}}</div>
</div>
</div>
<div class="card">
<div class="card-header">
<div class="card-title mb-0">Site Settings</div>
</div>
<div class="card-body">
<div class="col-lg-12">{{createPlainTextArea("meta_pixel_code",'',"Meta Pixel Code",$data->meta_pixel_code,10)}}</div>
<div class="col-lg-12">{{createText("smtp_server","smtp_server","SMTP Server",'',$data->smtp_server)}}</div>
<div class="col-lg-12">{{createText("smtp_security","smtp_security","SMTP Security (TSL/SSL/Empty for none)",'',$data->smtp_security)}}</div>
<div class="col-lg-12">{{createText("smtp_port","smtp_port","SMTP PORT (25/587/465)",'',$data->smtp_port)}}</div>
<div class="col-lg-12">{{createText("smtp_user","smtp_user","SMTP Username",'',$data->smtp_user)}}</div>
<div class="col-lg-12">{{createText("smtp_password","smtp_password","SMTP Password",'',$data->smtp_password)}}</div>
<div class="col-lg-12">{{createText("sms_api","sms_api","SMS API",'',$data->sms_api)}}</div>
<div class="col-lg-12">{{createText("sms_username","sms_username","SMS Username",'',$data->sms_username)}}</div>
<div class="col-lg-12">{{createText("sms_password","sms_password","SMS Password",'',$data->sms_password)}}</div>
<div class="col-lg-12">{{createText("sms_sender","sms_sender","SMS Sender (Default is SMS)",'',$data->sms_sender)}}</div>
</div>
</div>
</div>
<div class="col-xl-3 mb-3 ">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Social Media</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12">{{createText("fb","fb","Facebook",'',$data->fb)}}</div>
<div class="col-lg-12">{{createText("insta","insta","Instagram",'',$data->insta)}}</div>
<div class="col-lg-12">{{createText("twitter","twitter","Twitter",'',$data->twitter)}}</div>
<div class="col-lg-12">{{createText("tiktok","tiktok","Tiktok",'',$data->tiktok)}}</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Images</h4>
</div>
<div class="card-body">
<div class="col-lg-12 pb-2">{{createImageInput("primary_logo","Primary Logo",'',$data->primary_logo)}}</div>
<div class="border mb-3 border-dashed"></div>
<div class="col-lg-12 pb-2">{{createImageInput("secondary_logo","Secondary Logo",'',$data->secondary_logo)}}</div>
<div class="border mb-3 border-dashed"></div>
<div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb",'',$data->thumb)}}</div>
<div class="border mb-3 border-dashed"></div>
<div class="col-lg-12 pb-2">{{createImageInput("icon","Icon",'',$data->icon)}}</div>
<div class="border mb-3 border-dashed"></div>
<div class="col-lg-12 pb-2">{{createImageInput("og_image","Og Image",'',$data->og_image)}}</div>
<div class="border mb-3 border-dashed"></div>
<div class="col-lg-12 pb-2">{{createImageInput("no_image","No Image",'',$data->no_image)}}</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Published</h4>
</div>
<div class="card-body">
<div class="form-check form-switch form-switch-lg form-switch-success mb-3" dir="ltr">
<input type="checkbox" class="form-check-input" id="customSwitchsizelg" checked="">
<label class="form-check-label" for="customSwitchsizelg">Active</label>
</div>
</div>
<div class="card-footer">
<?php createButton("btn-primary btn-update","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('settings.index')); ?>
</div>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,266 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Settings List") }}</h2>
<a href="{{ route('settings.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_settings" data-url="{{ route('settings.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("url1") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("url2") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("email") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("phone") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("secondary_phone") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("fb") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("insta") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("twitter") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("tiktok") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("primary_logo") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("secondary_logo") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("thumb") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("icon") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("og_image") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("no_image") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("copyright_text") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("content1") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("content2") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("content3") }}</span></th>
<th class="tb-col" 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->setting_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">{{ $item->url1 }}</td>
<td class="tb-col">{{ $item->url2 }}</td>
<td class="tb-col">{{ $item->email }}</td>
<td class="tb-col">{{ $item->phone }}</td>
<td class="tb-col">{{ $item->secondary_phone }}</td>
<td class="tb-col">{{ $item->fb }}</td>
<td class="tb-col">{{ $item->insta }}</td>
<td class="tb-col">{{ $item->twitter }}</td>
<td class="tb-col">{{ $item->tiktok }}</td>
<td class="tb-col">{{ showImageThumb($item->primary_logo) }}</td>
<td class="tb-col">{{ showImageThumb($item->secondary_logo) }}</td>
<td class="tb-col">{{ showImageThumb($item->thumb) }}</td>
<td class="tb-col">{{ showImageThumb($item->icon) }}</td>
<td class="tb-col">{{ showImageThumb($item->og_image) }}</td>
<td class="tb-col">{{ showImageThumb($item->no_image) }}</td>
<td class="tb-col">{{ $item->copyright_text }}</td>
<td class="tb-col">{{ $item->content1 }}</td>
<td class="tb-col">{{ $item->content2 }}</td>
<td class="tb-col">{{ $item->content3 }}</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('settings.show',[$item->setting_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('settings.edit',[$item->setting_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('settings.toggle',[$item->setting_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('settings.destroy',[$item->setting_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>
@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('settings.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

View File

@@ -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('settings.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Url1 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->url1}}</span></p><p><b>Url2 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->url2}}</span></p><p><b>Email :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->email}}</span></p><p><b>Phone :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->phone}}</span></p><p><b>Secondary Phone :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->secondary_phone}}</span></p><p><b>Google Map :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->google_map}}</span></p><p><b>Fb :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->fb}}</span></p><p><b>Insta :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->insta}}</span></p><p><b>Twitter :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->twitter}}</span></p><p><b>Tiktok :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->tiktok}}</span></p><p><b>Primary Logo :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->primary_logo}}</span></p><p><b>Secondary Logo :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->secondary_logo}}</span></p><p><b>Thumb :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->thumb}}</span></p><p><b>Icon :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->icon}}</span></p><p><b>Og Image :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->og_image}}</span></p><p><b>No Image :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->no_image}}</span></p><p><b>Copyright Text :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->copyright_text}}</span></p><p><b>Content1 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->content1}}</span></p><p><b>Content2 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->content2}}</span></p><p><b>Content3 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->content3}}</span></p><p><b>Seo Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->seo_title}}</span></p><p><b>Seo Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->seo_description}}</span></p><p><b>Seo Keywords :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->seo_keywords}}</span></p><p><b>Og Tags :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->og_tags}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,19 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Sources') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('sources.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('sources.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row"><div class="col-lg-6">{{createText("title","title","Title")}}
</div><div class="col-lg-6">{{createText("name","name","Name")}}
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-primary btn-cancel","","Cancel",route('sources.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,19 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Sources') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('sources.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('sources.update',[$data->source_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='source_id' value='{{$data->source_id}}'/>
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
</div><div class="col-lg-6">{{createText("name","name","Name",'',$data->name)}}
</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('sources.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,235 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Sources List") }}</h2>
<a href="{{ route('sources.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_sources" data-url="{{ route('sources.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("name") }}</span></th>
<th class="tb-col" 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->source_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->source_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->source_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td>
<td class="tb-col">{{ $item->name }}</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('sources.show',[$item->source_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('sources.edit',[$item->source_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('sources.toggle',[$item->source_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('sources.destroy',[$item->source_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>
@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('sources.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

View File

@@ -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('sources.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->name}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,18 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Spinthewheelwinners') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('spinthewheelwinners.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('spinthewheelwinners.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class="row"><div class="col-lg-6">{{createText("title","title","Title")}}
</div><div class="col-lg-6">{{createCustomSelect('tbl_registrations', 'title', 'registration_id', '', 'Registrations Id','registrations_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("prize","prize","Prize")}}
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-primary btn-cancel","","Cancel",route('spinthewheelwinners.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,18 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Spinthewheelwinners') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('spinthewheelwinners.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('spinthewheelwinners.update',[$data->spinthewheelwinner_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='spinthewheelwinner_id' value='{{$data->spinthewheelwinner_id}}'/>
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
</div><div class="col-lg-6">{{createCustomSelect('tbl_registrations', 'title', 'registration_id', $data->registrations_id, 'Registrations Id','registrations_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("prize","prize","Prize",'',$data->prize)}}
</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('spinthewheelwinners.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,238 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Spinthewheelwinners List") }}</h2>
<a href="{{ route('spinthewheelwinners.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_spinthewheelwinners" data-url="{{ route('spinthewheelwinners.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("registrations") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("prize") }}</span></th>
<th class="tb-col" 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->spinthewheelwinner_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->spinthewheelwinner_id}}">
<span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->spinthewheelwinner_id}}" />
</div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td>
<td class="tb-col">
{!! getFieldData("tbl_registrations", "title", "registration_id", $item->registrations_id) !!}
</td><td class="tb-col">{{ $item->prize }}</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('spinthewheelwinners.show',[$item->spinthewheelwinner_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('spinthewheelwinners.edit',[$item->spinthewheelwinner_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('spinthewheelwinners.toggle',[$item->spinthewheelwinner_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('spinthewheelwinners.destroy',[$item->spinthewheelwinner_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>
@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('spinthewheelwinners.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

View File

@@ -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('spinthewheelwinners.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Registrations Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->registrations_id}}</span></p><p><b>Prize :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->prize}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@@ -0,0 +1,141 @@
@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 Student</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 Student</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<form action="{{route('students.store')}}" id="storeCustomForm" method="POST">
@csrf
@csrf
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-lg-4 col-md-6 ">{{createCustomSelect('tbl_campaigns', 'title', 'campaign_id', '', 'Campaigns Title','campaigns_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-2 col-md-6">{{createCustomSelect('tbl_countries', 'title', 'country_id', '', 'Country','countries_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-2 col-md-4">{{createCustomSelect('tbl_sources', 'title', 'source_id', '', 'Source','sources_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-2 col-md-4">{{createCustomSelect('tbl_leadcategories', 'title', 'leadcategory_id', '', 'Lead Category','leadcategories_id', 'form-control select2','status<>-1')}}</div>
<div class="col-lg-2 col-md-4">{{createCustomSelect('tbl_agents', 'title', 'agent_id', '', 'Agent Name','agents_id', 'form-control select2','status<>-1')}}</div>
</div>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs-custom rounded card-header-tabs border-bottom-0" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" href="#personalDetails" role="tab">
<i class="fas fa-home"></i> Personal Details
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#qualification" role="tab">
<i class="far fa-user"></i> Qualification
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#pc" role="tab">
<i class="far fa-envelope"></i> Preparation Classes
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#others" role="tab">
<i class="far fa-envelope"></i> Others
</a>
</li>
</ul>
</div>
<div class="card-body p-4">
<div class="tab-content">
<div class="tab-pane active" id="personalDetails" role="tabpanel">
<form action="javascript:void(0);">
<div class="row">
<div class="col-lg-12"><div class="mb-3">{{createText("name","name","Name")}}</div></div>
<div class="col-lg-6"><div class="mb-3">{{createText("email","email","Email")}}</div></div>
<div class="col-lg-6"><div class="mb-3">{{createText("address","address","Address")}}</div></div>
<div class="col-lg-6"><div class="mb-3">{{createText("phone","phone","Phone")}}</div></div>
<div class="col-lg-6"><div class="mb-3">{{createText("mobile","mobile","Mobile")}}</div></div>
</div>
<!--end row-->
</form>
</div>
<!--end tab-pane-->
<div class="tab-pane" id="qualification" role="tabpanel">
<div class="row">
<div class="col-lg-3">{{createText("see_year","see_year","SEE Year")}}</div>
<div class="col-lg-3">{{createText("see_grade","see_grade","SEE Grade")}}</div>
<div class="col-lg-3">{{createText("see_stream","see_stream","SEE Stream")}}</div>
<div class="col-lg-3">{{createText("see_school","see_school","SEE School")}}</div>
<div class="col-lg-3">{{createText("plus2_year","plus2_year","Plus2 Year")}}</div>
<div class="col-lg-3">{{createText("plus2_grade","plus2_grade","Plus2 Grade")}}</div>
<div class="col-lg-3">{{createText("plus2_stream","plus2_stream","Plus2 Stream")}}</div>
<div class="col-lg-3">{{createText("plus2_college","plus2_college","Plus2 College")}}</div>
<div class="col-lg-3">{{createText("bachelors_year","bachelors_year","Bachelors Year")}}</div>
<div class="col-lg-3">{{createText("bachelors_grade","bachelors_grade","Bachelors Grade")}}</div>
<div class="col-lg-3">{{createText("bachelors_stream","bachelors_stream","Bachelors Stream")}}</div>
<div class="col-lg-3">{{createText("bachelors_college","bachelors_college","Bachelors College")}}</div>
<div class="col-lg-3">{{createText("highest_qualification","highest_qualification","Highest Qualification")}}</div>
<div class="col-lg-3">{{createText("highest_grade","highest_grade","Highest Grade")}}</div>
<div class="col-lg-3">{{createText("highest_stream","highest_stream","Highest Stream")}}</div>
<div class="col-lg-3">{{createText("highest_college","highest_college","Highest College")}}</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane" id="pc" role="tabpanel">
<div class="row">
<div class="col-lg-3">{{createText("preparation_class","preparation_class","Preparation Class")}}</div>
<div class="col-lg-3">{{createText("preparation_score","preparation_score","Preparation Score")}}</div>
<div class="col-lg-3">{{createText("preparation_bandscore","preparation_bandscore","Preparation Bandscore")}}</div>
<div class="col-lg-3">{{createText("preparation_date","preparation_date","Preparation Date")}}</div>
<div class="col-lg-3">{{createText("preffered_location","preffered_location","Preffered Location")}}</div>
<div class="col-lg-3">{{createText("intrested_for_country","intrested_for_country","Intrested For Country")}}</div>
<div class="col-lg-3">{{createText("intrested_course","intrested_course","Intrested Course")}}</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane" id="others" role="tabpanel">
<div class="row">
<div class="col-lg-12">{{createText("user_agent","user_agent","User Agent")}}</div>
<div class="col-lg-6">{{createText("tags","tags","Tags")}}</div>
<div class="col-lg-6">{{createText("coupen_code","coupen_code","Coupen Code")}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div>
</div>
<!--end tab-pane-->
</div>
</div>
</div>
</div>
<div class="col-md-12">
<?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('students.index')); ?>
</div>
</form>
@endsection

View File

@@ -0,0 +1,47 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Students') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('students.index')); ?>
</div>
<div class='card-body'>
<form action="{{route('students.update',[$data->student_id])}}" id="updateCustomForm" method="POST" >
@csrf <input type=hidden name='student_id' value='{{$data->student_id}}'/>
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_campaigns', 'title', 'campaign_id', $data->campaigns_id, 'Campaigns Id','campaigns_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_sources', 'title', 'source_id', $data->sources_id, 'Sources Id','sources_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_leadcategories', 'title', 'leadcategory_id', $data->leadcategories_id, 'Leadcategories Id','leadcategories_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_agents', 'title', 'agent_id', $data->agents_id, 'Agents Id','agents_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_countries', 'title', 'country_id', $data->countries_id, 'Countries Id','countries_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("name","name","Name",'',$data->name)}}
</div><div class="col-lg-6">{{createText("email","email","Email",'',$data->email)}}
</div><div class="col-lg-6">{{createText("phone","phone","Phone",'',$data->phone)}}
</div><div class="col-lg-6">{{createText("mobile","mobile","Mobile",'',$data->mobile)}}
</div><div class="col-lg-6">{{createText("address","address","Address",'',$data->address)}}
</div><div class="col-lg-6">{{createText("see_year","see_year","See Year",'',$data->see_year)}}
</div><div class="col-lg-6">{{createText("see_grade","see_grade","See Grade",'',$data->see_grade)}}
</div><div class="col-lg-6">{{createText("see_stream","see_stream","See Stream",'',$data->see_stream)}}
</div><div class="col-lg-6">{{createText("see_school","see_school","See School",'',$data->see_school)}}
</div><div class="col-lg-6">{{createText("plus2_year","plus2_year","Plus2 Year",'',$data->plus2_year)}}
</div><div class="col-lg-6">{{createText("plus2_grade","plus2_grade","Plus2 Grade",'',$data->plus2_grade)}}
</div><div class="col-lg-6">{{createText("plus2_stream","plus2_stream","Plus2 Stream",'',$data->plus2_stream)}}
</div><div class="col-lg-6">{{createText("plus2_college","plus2_college","Plus2 College",'',$data->plus2_college)}}
</div><div class="col-lg-6">{{createText("bachelors_year","bachelors_year","Bachelors Year",'',$data->bachelors_year)}}
</div><div class="col-lg-6">{{createText("bachelors_grade","bachelors_grade","Bachelors Grade",'',$data->bachelors_grade)}}
</div><div class="col-lg-6">{{createText("bachelors_stream","bachelors_stream","Bachelors Stream",'',$data->bachelors_stream)}}
</div><div class="col-lg-6">{{createText("bachelors_college","bachelors_college","Bachelors College",'',$data->bachelors_college)}}
</div><div class="col-lg-6">{{createText("highest_qualification","highest_qualification","Highest Qualification",'',$data->highest_qualification)}}
</div><div class="col-lg-6">{{createText("highest_grade","highest_grade","Highest Grade",'',$data->highest_grade)}}
</div><div class="col-lg-6">{{createText("highest_stream","highest_stream","Highest Stream",'',$data->highest_stream)}}
</div><div class="col-lg-6">{{createText("highest_college","highest_college","Highest College",'',$data->highest_college)}}
</div><div class="col-lg-6">{{createText("preparation_class","preparation_class","Preparation Class",'',$data->preparation_class)}}
</div><div class="col-lg-6">{{createText("preparation_score","preparation_score","Preparation Score",'',$data->preparation_score)}}
</div><div class="col-lg-6">{{createText("preparation_bandscore","preparation_bandscore","Preparation Bandscore",'',$data->preparation_bandscore)}}
</div><div class="col-lg-6">{{createText("preparation_date","preparation_date","Preparation Date",'',$data->preparation_date)}}
</div><div class="col-lg-6">{{createText("preffered_location","preffered_location","Preffered Location",'',$data->preffered_location)}}
</div><div class="col-lg-6">{{createText("intrested_for_country","intrested_for_country","Intrested For Country",'',$data->intrested_for_country)}}
</div><div class="col-lg-6">{{createText("intrested_course","intrested_course","Intrested Course",'',$data->intrested_course)}}
</div><div class="col-lg-6">{{createText("user_agent","user_agent","User Agent",'',$data->user_agent)}}
</div><div class="col-lg-6">{{createText("tags","tags","Tags",'',$data->tags)}}
</div><div class="col-lg-6">{{createText("coupen_code","coupen_code","Coupen Code",'',$data->coupen_code)}}
</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('students.index')); ?>
</div> </form></div></div>
@endsection

View File

@@ -0,0 +1,234 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Students List") }}</h2>
<a href="{{ route('students.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_students" data-url="{{ route('students.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("SNo.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Name") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Email") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Mobile") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Intrested for Country") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("Intrested Course") }}</span></th>
<th class="tb-col" 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->student_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->name }}</td>
<td class="tb-col">{{ $item->email }}</td>
<td class="tb-col">{{ $item->mobile }}</td>
<td class="tb-col"> {!! getFieldData("tbl_countries", "title", "country_id", $item->countries_id) !!}</td>
<td class="tb-col">{{ $item->intrested_course }}</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('students.show',[$item->student_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('students.edit',[$item->student_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('students.toggle',[$item->student_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('students.destroy',[$item->student_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>
@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('students.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

Some files were not shown because too many files have changed in this diff Show More