first commit
This commit is contained in:
103
resources/views/crud/generated/!contacts/create.blade.php
Normal file
103
resources/views/crud/generated/!contacts/create.blade.php
Normal file
@ -0,0 +1,103 @@
|
||||
@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 Contact</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 Contact</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('contacts.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('name', 'name', 'Title') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('tagline', 'tagline', 'Tagline') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Address
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{ createText('address', 'address', 'Address') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('tel', 'tel', 'Tel') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('fax', 'fax', 'Fax') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('hp1', 'hp1', 'Helpline 1') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('hp2', 'hp2', 'Helpline 2') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">{{ createText('email1', 'email1', 'Email Address') }}
|
||||
</div>
|
||||
<div class="col-lg-4">{{ createText('email2', 'email2', 'Alternate Email') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">{{ createText('website', 'website', 'Website') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('google_map', 'google_map', 'Google Map') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Social Media
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('facebook', 'facebook', 'Facebook') }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('twitter', 'twitter', 'Twitter') }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('instagram', 'instagram', 'Instagram') }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('tiktok', 'tiktok', 'Tiktok') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', 'remarks', 'Remarks') }}
|
||||
</div>
|
||||
<div class="col-md-12 mb-3 mt-3"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('contacts.index')); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
28
resources/views/crud/generated/!contacts/edit.blade.php
Normal file
28
resources/views/crud/generated/!contacts/edit.blade.php
Normal file
@ -0,0 +1,28 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Edit Contacts') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('contacts.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('contacts.update',[$data->contact_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='contact_id' value='{{$data->contact_id}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_forms', 'title', 'form_id', $data->forms_id, 'Forms Id','forms_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("tagline","tagline","Tagline",'',$data->tagline)}}
|
||||
</div><div class="col-lg-6">{{createText("address","address","Address",'',$data->address)}}
|
||||
</div><div class="col-lg-6">{{createText("tel","tel","Tel",'',$data->tel)}}
|
||||
</div><div class="col-lg-6">{{createText("fax","fax","Fax",'',$data->fax)}}
|
||||
</div><div class="col-lg-6">{{createText("email1","email1","Email1",'',$data->email1)}}
|
||||
</div><div class="col-lg-6">{{createText("email2","email2","Email2",'',$data->email2)}}
|
||||
</div><div class="col-lg-6">{{createText("website","website","Website",'',$data->website)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("google_map","Google Map",'',$data->google_map)}}
|
||||
</div><div class="col-lg-6">{{createText("facebook","facebook","Facebook",'',$data->facebook)}}
|
||||
</div><div class="col-lg-6">{{createText("hp1","hp1","Hp1",'',$data->hp1)}}
|
||||
</div><div class="col-lg-6">{{createText("hp2","hp2","Hp2",'',$data->hp2)}}
|
||||
</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('contacts.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
205
resources/views/crud/generated/!contacts/index.blade.php
Normal file
205
resources/views/crud/generated/!contacts/index.blade.php
Normal file
@ -0,0 +1,205 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Contacts List') }}</h2>
|
||||
<a href="{{ route('contacts.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_contacts" data-url="{{ route('contacts.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('Forms Id') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Name') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Tagline') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Address') }}</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->contact_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_forms', 'title', 'form_id', $item->forms_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->tagline }}</td>
|
||||
<td class="tb-col">{{ $item->address }}</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('contacts.show', [$item->contact_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li> --}}
|
||||
<li><a href="{{ route('contacts.edit', [$item->contact_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('contacts.destroy', [$item->contact_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('contacts.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
29
resources/views/crud/generated/!contacts/show.blade.php
Normal file
29
resources/views/crud/generated/!contacts/show.blade.php
Normal 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('contacts.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Forms Id : </b> <span>{{$data->forms_id}}</span></p><p><b>Name : </b> <span>{{$data->name}}</span></p><p><b>Tagline : </b> <span>{{$data->tagline}}</span></p><p><b>Address : </b> <span>{{$data->address}}</span></p><p><b>Tel : </b> <span>{{$data->tel}}</span></p><p><b>Fax : </b> <span>{{$data->fax}}</span></p><p><b>Email1 : </b> <span>{{$data->email1}}</span></p><p><b>Email2 : </b> <span>{{$data->email2}}</span></p><p><b>Website : </b> <span>{{$data->website}}</span></p><p><b>Google Map : </b> <span>{{$data->google_map}}</span></p><p><b>Facebook : </b> <span>{{$data->facebook}}</span></p><p><b>Hp1 : </b> <span>{{$data->hp1}}</span></p><p><b>Hp2 : </b> <span>{{$data->hp2}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
@ -0,0 +1,83 @@
|
||||
@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 Accridiation</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 Accridiation</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('accridiations.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">
|
||||
{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('display', 'display', 'Display') }}
|
||||
</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('image', 'Image') }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('thumb', 'Thumb') }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover', 'Cover') }}
|
||||
</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-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('accridiations.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
@endsection
|
84
resources/views/crud/generated/accridiations/edit.blade.php
Normal file
84
resources/views/crud/generated/accridiations/edit.blade.php
Normal file
@ -0,0 +1,84 @@
|
||||
@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 Accridiation</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 Accridiation</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('accridiations.update', [$data->accridiation_id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='accridiation_id' value='{{ $data->accridiation_id }}' />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">
|
||||
{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('display', 'display', 'Display', '', $data->display) }}
|
||||
</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('image', 'Image', '', $data->image) }}
|
||||
</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('cover', 'Cover', '', $data->cover) }}
|
||||
</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-primary btn-cancel', '', 'Cancel', route('accridiations.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
203
resources/views/crud/generated/accridiations/index.blade.php
Normal file
203
resources/views/crud/generated/accridiations/index.blade.php
Normal file
@ -0,0 +1,203 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Accridiations List') }}</h2>
|
||||
<a href="{{ route('accridiations.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_accridiations" data-url="{{ route('accridiations.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('Display') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Title') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Image') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Thumb') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Cover') }}</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->accridiation_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->display }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->image) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->thumb) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->cover) }}</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('accridiations.show', [$item->accridiation_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li> --}}
|
||||
<li><a href="{{ route('accridiations.edit', [$item->accridiation_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('accridiations.destroy', [$item->accridiation_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('accridiations.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
29
resources/views/crud/generated/accridiations/show.blade.php
Normal file
29
resources/views/crud/generated/accridiations/show.blade.php
Normal 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('accridiations.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Display : </b> <span>{{$data->display}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Image : </b> <span>{{$data->image}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Cover : </b> <span>{{$data->cover}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
48
resources/views/crud/generated/applicants/create.blade.php
Normal file
48
resources/views/crud/generated/applicants/create.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@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">{{ label('Add Applicants') }}</h1>
|
||||
|
||||
</div>
|
||||
<div class="nk-block-head-content">
|
||||
<ul class="d-flex"> <li>
|
||||
<a href="{{ route('applicants.index') }}" class="btn btn-md d-md-none btn-primary">
|
||||
<em class="icon ni ni-plus"></em>
|
||||
<span>List All</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nk-block">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('applicants.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row"><div class="col-lg-6">{{createText("name","name","Name")}}
|
||||
</div><div class="col-lg-6">{{createText("father_name","father_name","Father Name")}}
|
||||
</div><div class="col-lg-6">{{createText("mobile","mobile","Mobile")}}
|
||||
</div><div class="col-lg-6">{{createText("sex","sex","Sex")}}
|
||||
</div><div class="col-lg-6">{{createText("dob","dob","Dob")}}
|
||||
</div><div class="col-lg-6">{{createText("email","email","Email")}}
|
||||
</div><div class="col-lg-6">{{createText("religion","religion","Religion")}}
|
||||
</div><div class="col-lg-6">{{createText("marital_status","marital_status","Marital Status")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("qualification","qualification ckeditor-classic","Qualification")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("biodata","biodata ckeditor-classic","Biodata")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("photo","Photo")}}
|
||||
</div><div class="col-lg-6">{{createText("passport_no","passport_no","Passport No")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("passport_copy","Passport Copy")}}
|
||||
</div><div class="col-lg-6">{{createText("remarks","remarks","Remarks")}}
|
||||
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
</div> </form></div></div></div></div></div></div></div></div>
|
||||
@endsection
|
48
resources/views/crud/generated/applicants/edit.blade.php
Normal file
48
resources/views/crud/generated/applicants/edit.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@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">{{ label('Edit Applicants') }}</h1>
|
||||
|
||||
</div>
|
||||
<div class="nk-block-head-content">
|
||||
<ul class="d-flex"> <li>
|
||||
<a href="{{ route('applicants.index') }}" class="btn btn-md d-md-none btn-primary">
|
||||
<em class="icon ni ni-plus"></em>
|
||||
<span>View Cities</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nk-block">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('applicants.update',[$data->applicant_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='applicant_id' value='{{$data->applicant_id}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("name","name","Name",'',$data->name)}}
|
||||
</div><div class="col-lg-6">{{createText("father_name","father_name","Father Name",'',$data->father_name)}}
|
||||
</div><div class="col-lg-6">{{createText("mobile","mobile","Mobile",'',$data->mobile)}}
|
||||
</div><div class="col-lg-6">{{createText("sex","sex","Sex",'',$data->sex)}}
|
||||
</div><div class="col-lg-6 pb-2">{{createDate("dob","Dob",'',$data->dob)}}
|
||||
</div><div class="col-lg-6">{{createText("email","email","Email",'',$data->email)}}
|
||||
</div><div class="col-lg-6">{{createText("religion","religion","Religion",'',$data->religion)}}
|
||||
</div><div class="col-lg-6">{{createText("marital_status","marital_status","Marital Status",'',$data->marital_status)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("qualification","qualification ckeditor-classic","Qualification",'','',$data->qualification)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("biodata","biodata ckeditor-classic","Biodata",'','',$data->biodata)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("photo","Photo",'',$data->photo)}}
|
||||
</div><div class="col-lg-6">{{createText("passport_no","passport_no","Passport No",'',$data->passport_no)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("passport_copy","Passport Copy",'',$data->passport_copy)}}
|
||||
</div><div class="col-lg-6">{{createText("remarks","remarks","Remarks",'',$data->remarks)}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
</div> </form></div></div></div></div></div></div></div></div>
|
||||
@endsection
|
214
resources/views/crud/generated/applicants/index.blade.php
Normal file
214
resources/views/crud/generated/applicants/index.blade.php
Normal file
@ -0,0 +1,214 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Applicants List") }}</h2>
|
||||
<a href="{{ route('applicants.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_applicants" data-url="{{ route('applicants.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("name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("father_name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("mobile") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("sex") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("dob") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("email") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("religion") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("marital_status") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("qualification") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("biodata") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("photo") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("passport_no") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("passport_copy") }}</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->applicant_id}}" data-display_order="{{$item->display_order}}" class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->father_name }}</td>
|
||||
<td class="tb-col">{{ $item->mobile }}</td>
|
||||
<td class="tb-col">{{ $item->sex }}</td>
|
||||
<td class="tb-col">{{ $item->dob }}</td>
|
||||
<td class="tb-col">{{ $item->email }}</td>
|
||||
<td class="tb-col">{{ $item->religion }}</td>
|
||||
<td class="tb-col">{{ $item->marital_status }}</td>
|
||||
<td class="tb-col">{{ $item->qualification }}</td>
|
||||
<td class="tb-col">{{ $item->biodata }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->photo) }}</td>
|
||||
<td class="tb-col">{{ $item->passport_no }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->passport_copy) }}</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('applicants.show',[$item->applicant_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('applicants.edit',[$item->applicant_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('applicants.destroy',[$item->applicant_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('applicants.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
43
resources/views/crud/generated/applicants/show.blade.php
Normal file
43
resources/views/crud/generated/applicants/show.blade.php
Normal file
@ -0,0 +1,43 @@
|
||||
@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">
|
||||
<div class="offcanvas-body" data-simplebar>
|
||||
<div class="nk-block-head-content w-100">
|
||||
<div class="d-flex justify-content-between pb-4">
|
||||
|
||||
<h2>{{ label('Applicants Details') }}</h2>
|
||||
{{-- <button class="btn btn-primary print_pdf">Print PDF</button> --}}
|
||||
</div>
|
||||
<div class="card w-100">
|
||||
<div class="p-5">
|
||||
|
||||
<div class="card-head">
|
||||
<h2 class="text-center">{{$data['name']}}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p><b>Name : </b> <span>{{$data->name}}</span></p><p><b>Father Name : </b> <span>{{$data->father_name}}</span></p><p><b>Mobile : </b> <span>{{$data->mobile}}</span></p><p><b>Sex : </b> <span>{{$data->sex}}</span></p><p><b>Dob : </b> <span>{{$data->dob}}</span></p><p><b>Email : </b> <span>{{$data->email}}</span></p><p><b>Religion : </b> <span>{{$data->religion}}</span></p><p><b>Marital Status : </b> <span>{{$data->marital_status}}</span></p><p><b>Qualification : </b> <span>{{$data->qualification}}</span></p><p><b>Biodata : </b> <span>{{$data->biodata}}</span></p><p><b>Photo : </b> <span>{{$data->photo}}</span></p><p><b>Passport No : </b> <span>{{$data->passport_no}}</span></p><p><b>Passport Copy : </b> <span>{{$data->passport_copy}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
90
resources/views/crud/generated/articles/create.blade.php
Normal file
90
resources/views/crud/generated/articles/create.blade.php
Normal file
@ -0,0 +1,90 @@
|
||||
@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 Article</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 Article</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('articles.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ createText('title', 'title', 'Title') }}
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
{{ createText('subtitle', 'subtitle', 'Sub Title') }}
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
{{ createTextarea('description', 'text ckeditor-classic', 'Description') }}
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
{{ createTextarea('additional_description', 'text ckeditor-classic', 'Additional Description') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">SEO</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('seo_keywords', 'seo_keywords ', 'Seo Keywords') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('articles.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ createCustomSelect('tbl_articles', 'title', 'article_id', '', 'Parent Article', 'parent_article', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Cover Photo</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createImageInput('cover_photo', 'Cover Photo') }}
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
{{ createImageInput('thumb', 'Thumb') }}
|
||||
</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-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('articles.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
86
resources/views/crud/generated/articles/edit.blade.php
Normal file
86
resources/views/crud/generated/articles/edit.blade.php
Normal file
@ -0,0 +1,86 @@
|
||||
@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 Article - ({{ $data->title }} )</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 Article</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('articles.update', [$data->article_id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='article_id' value='{{ $data->article_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
{{ createText('subtitle', 'subtitle', 'Sub Title', '', $data->subtitle) }}
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
{{ createTextarea('description', 'description ckeditor-classic', 'Description', $data->description) }}
|
||||
{{ createTextarea('additional_description', 'description ckeditor-classic', 'Additional Description', $data->additional_description) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">SEO</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title', '', $data->sec_title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_keywords', 'seo_keywords ', 'Seo Keywords', $data->seo_keywords) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions', '', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags', '', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('articles.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ createCustomSelect('tbl_articles', 'title', 'article_id', $data->parent_article, 'Parent Article', 'parent_article', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Cover Photo</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createImageInput('cover_photo', 'Cover Photo', '', $data->cover_photo) }}
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
{{ createImageInput('thumb', 'Thumb', '', $data->thumb) }}
|
||||
</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('articles.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
246
resources/views/crud/generated/articles/index.blade.php
Normal file
246
resources/views/crud/generated/articles/index.blade.php
Normal file
@ -0,0 +1,246 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Articles List') }}</h2>
|
||||
<a href="{{ route('articles.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_articles" data-url="{{ route('articles.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('thumb') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('cover_photo') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Parent') }}</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->article_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->cover_photo) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->thumb) }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_articles', 'title', 'article_id', $item->parent_article) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->article_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->article_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('articles.show', [$item->article_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('articles.edit', [$item->article_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('articles.toggle', [$item->article_id]) }}" class="dropdown-item toggle-item-btn"
|
||||
onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('articles.destroy', [$item->article_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></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('articles.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
|
26
resources/views/crud/generated/articles/show.blade.php
Normal file
26
resources/views/crud/generated/articles/show.blade.php
Normal file
@ -0,0 +1,26 @@
|
||||
@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('articles.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<p><b>Parent Article : </b> <span>{{$data->parent_article}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Cover Photo : </b> <span>{{$data->cover_photo}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Seo Keywords : </b> <span>{{$data->seo_keywords}}</span></p><p><b>Seo Title : </b> <span>{{$data->seo_title}}</span></p><p><b>Seo Descriptions : </b> <span>{{$data->seo_descriptions}}</span></p><p><b>Og Tags : </b> <span>{{$data->og_tags}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
95
resources/views/crud/generated/blogs/create.blade.php
Normal file
95
resources/views/crud/generated/blogs/create.blade.php
Normal file
@ -0,0 +1,95 @@
|
||||
@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 Blog</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 Blog</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('blogs.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</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="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions') }}
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
{{-- <div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Attributes</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createCustomSelect('tbl_blogs', 'title', 'blog_id', '', 'Parent Blog', 'parent_blog', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Image</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{-- {{ createImageInput('image', 'Image') }}
|
||||
<div class="mb-3 border border-dashed"></div> --}}
|
||||
|
||||
{{ createImageInput('thumb', 'Thumb') }}
|
||||
<div class="mb-3 border border-dashed"></div>
|
||||
|
||||
{{ createImageInput('cover', 'Cover') }}
|
||||
</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-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('blogs.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
98
resources/views/crud/generated/blogs/edit.blade.php
Normal file
98
resources/views/crud/generated/blogs/edit.blade.php
Normal file
@ -0,0 +1,98 @@
|
||||
@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 Blog -( {{ $data->title }})</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 Blog</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('blogs.update', [$data->blog_id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='blog_id' value='{{ $data->blog_id }}' />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</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="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title', '', $data->seo_title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_description', 'Seo Descriptions', '', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_keywords', 'seo_keywords', 'Seo Keywords', '', $data->seo_keywords) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('og_tags', 'og_tags', 'Og Tags', '', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
{{-- <div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Attributes</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createCustomSelect('tbl_blogs', 'title', 'blog_id', $data->parent_blog, 'Parent Blog', 'parent_blog', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Image</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{-- <div class="col-lg-12 pb-2">{{ createImageInput('image', 'Image', '', $data->image) }}
|
||||
</div> --}}
|
||||
<div class="mb-3 border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('thumb', 'Thumb', '', $data->thumb) }}
|
||||
</div>
|
||||
<div class="mb-3 border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover', 'Cover', '', $data->cover) }}
|
||||
</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('blogs.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
247
resources/views/crud/generated/blogs/index.blade.php
Normal file
247
resources/views/crud/generated/blogs/index.blade.php
Normal file
@ -0,0 +1,247 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Blogs List') }}</h2>
|
||||
<a href="{{ route('blogs.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_blogs" data-url="{{ route('blogs.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('Thumb') }}</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('Published at') }}</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->blog_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->thumb) }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->blog_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->blog_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{{ $item->created_at->format('Y-m-d') }}
|
||||
</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('blogs.show', [$item->blog_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li> --}}
|
||||
<li><a href="{{ route('blogs.edit', [$item->blog_id]) }}" class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('blogs.toggle', [$item->blog_id]) }}" class="dropdown-item toggle-item-btn"
|
||||
onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('blogs.destroy', [$item->blog_id]) }}" class="dropdown-item remove-item-btn"
|
||||
onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></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('blogs.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
|
29
resources/views/crud/generated/blogs/show.blade.php
Normal file
29
resources/views/crud/generated/blogs/show.blade.php
Normal 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('blogs.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Parent Blog : </b> <span>{{$data->parent_blog}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Image : </b> <span>{{$data->image}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Cover : </b> <span>{{$data->cover}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><p><b>Seo Keywords : </b> <span>{{$data->seo_keywords}}</span></p><p><b>Seo Title : </b> <span>{{$data->seo_title}}</span></p><p><b>Seo Descriptions : </b> <span>{{$data->seo_descriptions}}</span></p><p><b>Og Tags : </b> <span>{{$data->og_tags}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
@ -0,0 +1,87 @@
|
||||
@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 Article</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 Article</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('brancharticles.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_branches', 'title', 'branch_id', '', 'Branches Id', 'branches_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_brancharticles', 'title', 'article_id', '', 'Parent Article', 'parent_article', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ createText('title', 'title', 'Title') }}
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">SEO</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('seo_keywords', 'seo_keywords ', 'Seo Keywords') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('brancharticles.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<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('thumb', 'Thumb') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover_photo', 'Cover Photo') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('brancharticles.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
84
resources/views/crud/generated/brancharticles/edit.blade.php
Normal file
84
resources/views/crud/generated/brancharticles/edit.blade.php
Normal file
@ -0,0 +1,84 @@
|
||||
@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 Article - ( {{ $data->title }} )</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 Article</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('brancharticles.update',$data->article_id) }}" id="storeCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='article_id' value='{{ $data->article_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_branches', 'title', 'branch_id', $data->branches_id, 'Branches Id', 'branches_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_brancharticles', 'title', 'article_id', $data->parent_article, 'Parent Article', 'parent_article', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ createText('title', 'title', 'Title','', $data->title) }}
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">SEO</h4>
|
||||
</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_keywords', 'seo_keywords ', 'Seo Keywords','', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions','', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags','', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('brancharticles.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<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('thumb', 'Thumb','', $data->thumb) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover_photo', 'Cover Photo','', $data->cover_photo) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('brancharticles.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
254
resources/views/crud/generated/brancharticles/index.blade.php
Normal file
254
resources/views/crud/generated/brancharticles/index.blade.php
Normal file
@ -0,0 +1,254 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Branch Articles List') }}</h2>
|
||||
<a href="{{ route('brancharticles.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_brancharticles" data-url="{{ route('brancharticles.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('Branches') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Parent') }}</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('Thumb') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Cover Photo') }}</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->article_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_branches', 'title', 'branch_id', $item->branches_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_brancharticles', 'title', 'article_id', $item->parent_article) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->article_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->article_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">{{ showImageThumb($item->cover_photo) }}</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('brancharticles.show', [$item->article_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li> --}}
|
||||
<li><a href="{{ route('brancharticles.edit', [$item->article_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('brancharticles.toggle', [$item->article_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('brancharticles.destroy', [$item->article_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('brancharticles.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
|
29
resources/views/crud/generated/brancharticles/show.blade.php
Normal file
29
resources/views/crud/generated/brancharticles/show.blade.php
Normal 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('brancharticles.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Branches Id : </b> <span>{{$data->branches_id}}</span></p><p><b>Parent Article : </b> <span>{{$data->parent_article}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Cover Photo : </b> <span>{{$data->cover_photo}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Seo Keywords : </b> <span>{{$data->seo_keywords}}</span></p><p><b>Seo Title : </b> <span>{{$data->seo_title}}</span></p><p><b>Seo Descriptions : </b> <span>{{$data->seo_descriptions}}</span></p><p><b>Og Tags : </b> <span>{{$data->og_tags}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
130
resources/views/crud/generated/branches/create.blade.php
Normal file
130
resources/views/crud/generated/branches/create.blade.php
Normal file
@ -0,0 +1,130 @@
|
||||
@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 -->
|
||||
<form action="{{ route('branches.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-3 ">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ createCustomSelect('tbl_branches', 'title', 'branch_id', '', 'Parent Branch', 'parent_branch', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Add Branch</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('contact_person', 'contact_person', 'Contact Person') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('designation', 'designation', 'Designation') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Address</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('contact1', 'contact1', 'Contact Number') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('contact2', 'contact2', 'Contact Number 2') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('email', 'email', 'Email') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('address', 'address', 'Address') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('google_map', 'google_map ', 'Google Map') }}
|
||||
</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') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('seo_keywords', 'seo_keywords ', 'Seo Keywords') }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_description', 'seo_description ', 'Seo Description') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('branches.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Cover Photo</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createImageInput('cover_photo', 'Cover Photo') }}
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
{{ createImageInput('thumb', 'Thumb') }}
|
||||
</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-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('branches.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
127
resources/views/crud/generated/branches/edit.blade.php
Normal file
127
resources/views/crud/generated/branches/edit.blade.php
Normal file
@ -0,0 +1,127 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
|
||||
<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 -->
|
||||
|
||||
|
||||
<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-xl-9 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ createCustomSelect('tbl_branches', 'title', 'branch_id', $data->parent_branch, 'Parent Branch', 'parent_branch', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Edit Branch</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="col-lg-6"> {{ createText('contact_person', 'contact_person', 'Contact Person', '', $data->contact_person) }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('designation', 'designation', 'Designation', '', $data->designation) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Address</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('contact1', 'contact1', 'Contact Number', '', $data->contact1) }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('contact2', 'contact2', 'Contact Number 2', '', $data->contact2) }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('email', 'email', 'Email', '', $data->email) }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('address', 'address', 'Address', '', $data->address) }}
|
||||
</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"> <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('og_tags', '', 'Og Tags', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('branches.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Cover Photo</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createImageInput('cover_photo', 'Cover Photo', '', $data->cover_photo) }}
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
{{ createImageInput('thumb', 'Thumb', '', $data->thumb) }}
|
||||
</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('branches.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
262
resources/views/crud/generated/branches/index.blade.php
Normal file
262
resources/views/crud/generated/branches/index.blade.php
Normal file
@ -0,0 +1,262 @@
|
||||
@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"><span class="overline-title">{{ label('Parent') }}</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('Contact Person') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Designation') }}</span></th>
|
||||
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Thumb') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Contact1') }}</span></th>
|
||||
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Email') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Address') }}</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->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">
|
||||
{!! getFieldData('tbl_branches', 'title', 'branch_id', $item->parent_branch) !!}
|
||||
</td> --}}
|
||||
<td class="tb-col">{{ $item->title }}</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->contact_person }}</td>
|
||||
<td class="tb-col">{{ $item->designation }}</td>
|
||||
|
||||
<td class="tb-col">{{ showImageThumb($item->thumb) }}</td>
|
||||
<td class="tb-col">{{ $item->contact1 }}</td>
|
||||
|
||||
<td class="tb-col">{{ $item->email }}</td>
|
||||
<td class="tb-col">{{ $item->address }}</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
|
29
resources/views/crud/generated/branches/show.blade.php
Normal file
29
resources/views/crud/generated/branches/show.blade.php
Normal 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>Parent Branch : </b> <span>{{$data->parent_branch}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Contact Person : </b> <span>{{$data->contact_person}}</span></p><p><b>Designation : </b> <span>{{$data->designation}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Cover Photo : </b> <span>{{$data->cover_photo}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Contact1 : </b> <span>{{$data->contact1}}</span></p><p><b>Contact2 : </b> <span>{{$data->contact2}}</span></p><p><b>Email : </b> <span>{{$data->email}}</span></p><p><b>Address : </b> <span>{{$data->address}}</span></p><p><b>Google Map : </b> <span>{{$data->google_map}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Seo Keywords : </b> <span>{{$data->seo_keywords}}</span></p><p><b>Seo Title : </b> <span>{{$data->seo_title}}</span></p><p><b>Seo Description : </b> <span>{{$data->seo_description}}</span></p><p><b>Og Tags : </b> <span>{{$data->og_tags}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
71
resources/views/crud/generated/certificates/create.blade.php
Normal file
71
resources/views/crud/generated/certificates/create.blade.php
Normal file
@ -0,0 +1,71 @@
|
||||
@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 Certificates</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 Certificates</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<form action="{{ route('certificates.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title') }}</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('description', 'description ckeditor-classic', 'Description -2') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Cover Photo</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createImageInput('cover_photo', 'Cover Photo') }}
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
{{ createImageInput('thumb', 'Thumb') }}
|
||||
</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-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('certificates.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
73
resources/views/crud/generated/certificates/edit.blade.php
Normal file
73
resources/views/crud/generated/certificates/edit.blade.php
Normal file
@ -0,0 +1,73 @@
|
||||
@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 Certificates - ( {{ $data->title }})</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 Certificates</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<form action="{{ route('certificates.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('description', 'description ckeditor-classic', 'Description -2', $data->description) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Cover Photo</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createImageInput('cover_photo', 'Cover Photo', '', $data->cover_photo) }}
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
{{ createImageInput('thumb', 'Thumb', '', $data->thumb) }}
|
||||
</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-primary btn-cancel', '', 'Cancel', route('certificates.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
208
resources/views/crud/generated/certificates/index.blade.php
Normal file
208
resources/views/crud/generated/certificates/index.blade.php
Normal file
@ -0,0 +1,208 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Certificates List') }}</h2>
|
||||
<a href="{{ route('certificates.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_certificates" data-url="{{ route('certificates.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('Photo') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Thumb') }}</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->certificate_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->certificate_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->certificate_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->photo) }}</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('certificates.show', [$item->certificate_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li> --}}
|
||||
<li><a href="{{ route('certificates.edit', [$item->certificate_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('certificates.destroy', [$item->certificate_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('certificates.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
29
resources/views/crud/generated/certificates/show.blade.php
Normal file
29
resources/views/crud/generated/certificates/show.blade.php
Normal 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('certificates.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Photo : </b> <span>{{$data->photo}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
38
resources/views/crud/generated/companies/create.blade.php
Normal file
38
resources/views/crud/generated/companies/create.blade.php
Normal file
@ -0,0 +1,38 @@
|
||||
@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">{{ label('Add Companies') }}</h1>
|
||||
|
||||
</div>
|
||||
<div class="nk-block-head-content">
|
||||
<ul class="d-flex"> <li>
|
||||
<a href="{{ route('companies.index') }}" class="btn btn-md d-md-none btn-primary">
|
||||
<em class="icon ni ni-plus"></em>
|
||||
<span>List All</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nk-block">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('companies.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-12 pb-2">{{createTextarea("text","text ckeditor-classic","Text")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("logo","Logo")}}
|
||||
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
</div> </form></div></div></div></div></div></div></div></div>
|
||||
@endsection
|
38
resources/views/crud/generated/companies/edit.blade.php
Normal file
38
resources/views/crud/generated/companies/edit.blade.php
Normal file
@ -0,0 +1,38 @@
|
||||
@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">{{ label('Edit Companies') }}</h1>
|
||||
|
||||
</div>
|
||||
<div class="nk-block-head-content">
|
||||
<ul class="d-flex"> <li>
|
||||
<a href="{{ route('companies.index') }}" class="btn btn-md d-md-none btn-primary">
|
||||
<em class="icon ni ni-plus"></em>
|
||||
<span>View Cities</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nk-block">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('companies.update',[$data->company_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='company_id' value='{{$data->company_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-12 pb-2">{{createTextarea("text","text ckeditor-classic","Text",'','',$data->text)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("logo","Logo",'',$data->logo)}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
</div> </form></div></div></div></div></div></div></div></div>
|
||||
@endsection
|
202
resources/views/crud/generated/companies/index.blade.php
Normal file
202
resources/views/crud/generated/companies/index.blade.php
Normal file
@ -0,0 +1,202 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Companies List") }}</h2>
|
||||
<a href="{{ route('companies.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_companies" data-url="{{ route('companies.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("email") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("logo") }}</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->company_id}}" data-display_order="{{$item->display_order}}" class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->company_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->company_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->email }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->logo) }}</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('companies.show',[$item->company_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('companies.edit',[$item->company_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('companies.destroy',[$item->company_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('companies.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
43
resources/views/crud/generated/companies/show.blade.php
Normal file
43
resources/views/crud/generated/companies/show.blade.php
Normal file
@ -0,0 +1,43 @@
|
||||
@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">
|
||||
<div class="offcanvas-body" data-simplebar>
|
||||
<div class="nk-block-head-content w-100">
|
||||
<div class="d-flex justify-content-between pb-4">
|
||||
|
||||
<h2>{{ label('Companies Details') }}</h2>
|
||||
{{-- <button class="btn btn-primary print_pdf">Print PDF</button> --}}
|
||||
</div>
|
||||
<div class="card w-100">
|
||||
<div class="p-5">
|
||||
|
||||
<div class="card-head">
|
||||
<h2 class="text-center">{{$data['title']}}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Email : </b> <span>{{$data->email}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Logo : </b> <span>{{$data->logo}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
@ -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 Companyarticles') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('companyarticles.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('companyarticles.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_companyarticles', 'title', 'article_id', '', 'Parent Article','parent_article', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("text","text ckeditor-classic","Text")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("cover_photo","Cover Photo")}}
|
||||
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('companyarticles.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
@ -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 Companyarticles') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('companyarticles.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('companyarticles.update',[$data->article_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='article_id' value='{{$data->article_id}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_companyarticles', 'title', 'article_id', $data->parent_article, 'Parent Article','parent_article', '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("text","text ckeditor-classic","Text",$data->text)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("cover_photo","Cover Photo",'',$data->cover_photo)}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('companyarticles.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
204
resources/views/crud/generated/companyarticles/index.blade.php
Normal file
204
resources/views/crud/generated/companyarticles/index.blade.php
Normal file
@ -0,0 +1,204 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Companyarticles List") }}</h2>
|
||||
<a href="{{ route('companyarticles.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_companyarticles" data-url="{{ route('companyarticles.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("parent_article") }}</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("cover_photo") }}</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->article_id}}" data-display_order="{{$item->display_order}}" class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">
|
||||
{!! getFieldData("tbl_companyarticles", "title", "article_id", $item->parent_article) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->article_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->article_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->cover_photo) }}</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('companyarticles.show',[$item->article_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('companyarticles.edit',[$item->article_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('companyarticles.destroy',[$item->article_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('companyarticles.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
@ -0,0 +1,29 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('companyarticles.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Parent Article : </b> <span>{{$data->parent_article}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Cover Photo : </b> <span>{{$data->cover_photo}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
107
resources/views/crud/generated/contacts/create.blade.php
Normal file
107
resources/views/crud/generated/contacts/create.blade.php
Normal file
@ -0,0 +1,107 @@
|
||||
@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 Contact</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 Contact</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('contacts.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('name', 'name', 'Title') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_branches', 'title', 'branch_id', '', 'Branches Id','branches_id', 'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{ createText('tagline', 'tagline', 'Tagline') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_forms', 'title', 'form_id', '', 'Forms Id (if needed)','forms_id', 'form-control select2','status<>-1')}}</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Address
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{ createText('address', 'address', 'Address') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('tel', 'tel', 'Phone Number') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('fax', 'fax', 'Fax Number') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('hp1', 'hp1', 'Helpline 1') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('hp2', 'hp2', 'Helpline 2') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">{{ createText('email1', 'email1', 'Email Address') }}
|
||||
</div>
|
||||
<div class="col-lg-4">{{ createText('email2', 'email2', 'Alternate Email') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">{{ createText('website', 'website', 'Website') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('google_map', 'google_map', 'Google Map') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Social Media
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('facebook', 'facebook', 'Facebook') }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('twitter', 'twitter', 'Twitter') }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('instagram', 'instagram', 'Instagram') }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('tiktok', 'tiktok', 'Tiktok') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', 'remarks', 'Remarks') }}
|
||||
</div>
|
||||
<div class="col-md-12 mb-3 mt-3"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('contacts.index')); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
110
resources/views/crud/generated/contacts/edit.blade.php
Normal file
110
resources/views/crud/generated/contacts/edit.blade.php
Normal file
@ -0,0 +1,110 @@
|
||||
@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 Contact</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 Contact</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{route('contacts.update',[$data->contact_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='contact_id' value='{{$data->contact_id}}'/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{createText("name","name","Name",'',$data->name)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_branches', 'title', 'branch_id', $data->branches_id, 'Branches Id','branches_id', 'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{createText("tagline","tagline","Tagline",'',$data->tagline)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_forms', 'title', 'form_id', $data->forms_id, 'Forms Id','forms_id', 'form-control select2','status<>-1')}}</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Address
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("address","address","Address",'',$data->address)}}
|
||||
</div>
|
||||
<div class="col-lg-3">{{createText("tel","tel","Tel",'',$data->tel)}}
|
||||
</div>
|
||||
<div class="col-lg-3">{{createText("fax","fax","Fax",'',$data->fax)}}
|
||||
</div>
|
||||
<div class="col-lg-3">{{createText("hp1","hp1","Helpline 1",'',$data->hp1)}}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('hp2', 'hp2', 'Helpline 2','',$data->hp2)}}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">{{ createText('email1', 'email1', 'Email Address' ,'',$data->email1)}}
|
||||
</div>
|
||||
<div class="col-lg-4">{{ createText('email2', 'email2', 'Alternate Email','',$data->email2)}}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">{{ createText('website', 'website', 'Website','',$data->website)}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('google_map', 'google_map', 'Google Map',$data->google_map)}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Social Media
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('facebook', 'facebook', 'Facebook','',$data->facebook)}}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('twitter', 'twitter', 'Twitter','',$data->twitter) }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('instagram', 'instagram', 'Instagram','',$data->instagram) }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('tiktok', 'tiktok', 'Tiktok','',$data->tiktok) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', 'remarks', 'Remarks',$data->remarks)}}
|
||||
</div>
|
||||
<div class="col-md-12 mb-3 mt-3"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('contacts.index')); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
216
resources/views/crud/generated/contacts/index.blade.php
Normal file
216
resources/views/crud/generated/contacts/index.blade.php
Normal file
@ -0,0 +1,216 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Contacts List") }}</h2>
|
||||
<a href="{{ route('contacts.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_contacts" data-url="{{ route('contacts.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("Branches") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Address") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Tel") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Email 1") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Helpline 1") }}</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->contact_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_branches", "title", "branch_id", $item->branches_id) !!}
|
||||
</td><td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->address }}</td>
|
||||
<td class="tb-col">{{ $item->tel }}</td>
|
||||
<td class="tb-col">{{ $item->email1 }}</td>
|
||||
<td class="tb-col">{{ $item->hp1 }}</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('contacts.show',[$item->contact_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li> -->
|
||||
<li><a href="{{route('contacts.edit',[$item->contact_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('contacts.toggle',[$item->contact_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('contacts.destroy',[$item->contact_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('contacts.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
|
29
resources/views/crud/generated/contacts/show.blade.php
Normal file
29
resources/views/crud/generated/contacts/show.blade.php
Normal 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('contacts.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Forms Id : </b> <span>{{$data->forms_id}}</span></p><p><b>Branches Id : </b> <span>{{$data->branches_id}}</span></p><p><b>Name : </b> <span>{{$data->name}}</span></p><p><b>Tagline : </b> <span>{{$data->tagline}}</span></p><p><b>Address : </b> <span>{{$data->address}}</span></p><p><b>Tel : </b> <span>{{$data->tel}}</span></p><p><b>Fax : </b> <span>{{$data->fax}}</span></p><p><b>Email1 : </b> <span>{{$data->email1}}</span></p><p><b>Email2 : </b> <span>{{$data->email2}}</span></p><p><b>Website : </b> <span>{{$data->website}}</span></p><p><b>Google Map : </b> <span>{{$data->google_map}}</span></p><p><b>Facebook : </b> <span>{{$data->facebook}}</span></p><p><b>Hp1 : </b> <span>{{$data->hp1}}</span></p><p><b>Hp2 : </b> <span>{{$data->hp2}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
66
resources/views/crud/generated/countries/create.blade.php
Normal file
66
resources/views/crud/generated/countries/create.blade.php
Normal 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">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="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('details', 'details ckeditor-classic', 'Details') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countries.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<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('cover_photo', 'Cover Photo') }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createMultiImageInput('images', 'Images') }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('image_thumb', 'Image Thumb') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countries.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
82
resources/views/crud/generated/countries/edit.blade.php
Normal file
82
resources/views/crud/generated/countries/edit.blade.php
Normal 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 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="row">
|
||||
<div class="col-xl-9 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</div>
|
||||
<div class="mt-3 border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('details', 'details ckeditor-classic', 'Details', $data->details) }}
|
||||
</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="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title', '', $data->sec_title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_keywords', 'seo_keywords ', 'Seo Keywords', $data->seo_keywords) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions', '', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags', '', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countries.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<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('cover_photo', 'Cover Photo', '', $data->cover_photo) }}
|
||||
</div>
|
||||
<div class="mb-3 border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createMultiImageInput('images', 'Images', '', $data->images) }}
|
||||
</div>
|
||||
<div class="mb-3 border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('image_thumb', 'Image Thumb', '', $data->image_thumb) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countries.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
208
resources/views/crud/generated/countries/index.blade.php
Normal file
208
resources/views/crud/generated/countries/index.blade.php
Normal file
@ -0,0 +1,208 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Countries List') }}</h2>
|
||||
<a href="{{ route('countries.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</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"><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('Cover Photo') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Image Thumb') }}</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->country_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row">
|
||||
<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">{{ showImageThumb($item->cover_photo) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->image_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('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.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>
|
||||
@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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
29
resources/views/crud/generated/countries/show.blade.php
Normal file
29
resources/views/crud/generated/countries/show.blade.php
Normal 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 : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Details : </b> <span>{{$data->details}}</span></p><p><b>Cover Photo : </b> <span>{{$data->cover_photo}}</span></p><p><b>Image Thumb : </b> <span>{{$data->image_thumb}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
@ -0,0 +1,89 @@
|
||||
@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 Study Abroads Article</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 Study Abroads Article</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('countryarticles.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<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('text', 'text ckeditor-classic', 'Description') }}
|
||||
</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="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions') }}
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Atributes
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createCustomSelect('tbl_countries', 'title', 'country_id', '', 'Country', 'countries_id', 'form-control select2', 'status<>-1') }}
|
||||
{{ createCustomSelect('tbl_countryarticles', 'title', 'article_id', '', 'Parent Article', 'parent_article', 'form-control select2', 'status<>-1') }}
|
||||
</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('cover_photo', 'Cover Photo') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('thumb', 'Thumb') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countryarticles.index')); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
@ -0,0 +1,91 @@
|
||||
@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 Study Abroads Article</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 Study Abroads Article</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('countryarticles.update', [$data->article_id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='article_id' value='{{ $data->article_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title','', $data->title) }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</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="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title','', $data->seo_title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions','', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('seo_keywords', 'seo_keywords ', 'Seo Keywords', '', $data->seo_keywords) }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags', '', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Atributes
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createCustomSelect('tbl_countries', 'title', 'country_id', $data->countries_id, 'Country', 'countries_id', 'form-control select2', 'status<>-1') }}
|
||||
{{ createCustomSelect('tbl_countryarticles', 'title', 'article_id', $data->parent_article, 'Parent Article', 'parent_article', 'form-control select2', 'status<>-1') }}
|
||||
</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('cover_photo', 'Cover Photo', '', $data->cover_photo) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('thumb', 'Thumb', '', $data->thumb) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Update'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countryarticles.index')); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
254
resources/views/crud/generated/countryarticles/index.blade.php
Normal file
254
resources/views/crud/generated/countryarticles/index.blade.php
Normal file
@ -0,0 +1,254 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Countryarticles List') }}</h2>
|
||||
<a href="{{ route('countryarticles.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_countryarticles" data-url="{{ route('countryarticles.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('Image') }}</span></th>
|
||||
{{-- <th class="tb-col"><span class="overline-title">{{ label('Parent') }}</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('Countries') }}</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->article_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->thumb) }}</td>
|
||||
|
||||
{{-- <td class="tb-col">
|
||||
{!! getFieldData('tbl_countryarticles', 'title', 'article_id', $item->parent_article) !!}
|
||||
</td> --}}
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->article_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->article_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_countries', 'title', 'country_id', $item->countries_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('countryarticles.show', [$item->article_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li> --}}
|
||||
<li><a href="{{ route('countryarticles.edit', [$item->article_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('countryarticles.toggle', [$item->article_id]) }}"
|
||||
class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('countryarticles.destroy', [$item->article_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></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('countryarticles.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
@ -0,0 +1,29 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('countryarticles.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Countries Id : </b> <span>{{$data->countries_id}}</span></p><p><b>Parent Article : </b> <span>{{$data->parent_article}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Cover Photo : </b> <span>{{$data->cover_photo}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Seo Keywords : </b> <span>{{$data->seo_keywords}}</span></p><p><b>Seo Title : </b> <span>{{$data->seo_title}}</span></p><p><b>Seo Descriptions : </b> <span>{{$data->seo_descriptions}}</span></p><p><b>Og Tags : </b> <span>{{$data->og_tags}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
97
resources/views/crud/generated/customfields/create.blade.php
Normal file
97
resources/views/crud/generated/customfields/create.blade.php
Normal file
@ -0,0 +1,97 @@
|
||||
@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 New Page</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 New Page</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<form action="{{ route('customfields.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Custom Fields</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-6">{{ createText('customfield_for', 'customfield_for', 'Customfield For') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createText('customfield_forref', 'customfield_forref', 'Customfield Forref') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ createText('title', 'title', 'Title') }}
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Others</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('link', 'link', 'Link') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('fa_icon', 'fa_icon', 'Fa Icon') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Logo</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createImageInput('logo', 'Logo') }}
|
||||
</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-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('customfields.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
96
resources/views/crud/generated/customfields/edit.blade.php
Normal file
96
resources/views/crud/generated/customfields/edit.blade.php
Normal file
@ -0,0 +1,96 @@
|
||||
@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 Custom Field ({{ $data->title }})</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 Custom Field</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<form action="{{ route('customfields.update', [$data->customfield_id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='customfield_id' value='{{ $data->customfield_id }}' />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Custom Fields</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{{ createText('customfield_for', 'customfield_for', 'Customfield For', '', $data->customfield_for) }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createText('customfield_forref', 'customfield_forref', 'Customfield Forref', '', $data->customfield_forref) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Others</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('link', 'link', 'Link', '', $data->link) }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('fa_icon', 'fa_icon', 'Fa Icon', '', $data->fa_icon) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Logo</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createImageInput('logo', 'Logo', '', $data->logo) }}
|
||||
</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('customfields.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
242
resources/views/crud/generated/customfields/index.blade.php
Normal file
242
resources/views/crud/generated/customfields/index.blade.php
Normal 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("Custom Fields List") }}</h2>
|
||||
<a href="{{ route('customfields.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_customfields" data-url="{{ route('customfields.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("Link") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Icon") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Logo") }}</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->customfield_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->customfield_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->customfield_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->link }}</td>
|
||||
<td class="tb-col">{{ $item->fa_icon }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->logo) }}</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('customfields.show',[$item->customfield_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li> --}}
|
||||
<li><a href="{{route('customfields.edit',[$item->customfield_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('customfields.toggle',[$item->customfield_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('customfields.destroy',[$item->customfield_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('customfields.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
|
29
resources/views/crud/generated/customfields/show.blade.php
Normal file
29
resources/views/crud/generated/customfields/show.blade.php
Normal 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('customfields.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Customfield For : </b> <span>{{$data->customfield_for}}</span></p><p><b>Customfield Forref : </b> <span>{{$data->customfield_forref}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Link : </b> <span>{{$data->link}}</span></p><p><b>Fa Icon : </b> <span>{{$data->fa_icon}}</span></p><p><b>Logo : </b> <span>{{$data->logo}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
103
resources/views/crud/generated/events/create.blade.php
Normal file
103
resources/views/crud/generated/events/create.blade.php
Normal file
@ -0,0 +1,103 @@
|
||||
@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 Event</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 Event</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('events.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="mb-3">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Descriptioon') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('description', 'description ckeditor-classic', 'Details') }}
|
||||
</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="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions') }}
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Attributes</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">{{ createDate('startdate', 'Startdate', '', date('Y-m-d')) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createDate('enddate', 'Enddate', '', date('Y-m-d')) }}
|
||||
</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('image', 'Image') }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('thumb', 'Thumb') }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover', 'Cover') }}
|
||||
</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-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('events.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
@endsection
|
101
resources/views/crud/generated/events/edit.blade.php
Normal file
101
resources/views/crud/generated/events/edit.blade.php
Normal file
@ -0,0 +1,101 @@
|
||||
@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 Event - ({{ $data->title }})</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 Event</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{route('events.update',[$data->event_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='event_id' value='{{$data->event_id}}'/>
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="mb-3">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title','', $data->title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Descriptioon', $data->text) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('description', 'description ckeditor-classic', 'Details', $data->description) }}
|
||||
</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="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title', '', $data->seo_title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_description', 'Seo Descriptions', '', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_keywords', 'seo_keywords', 'Seo Keywords', '', $data->seo_keywords) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('og_tags', 'og_tags', 'Og Tags', '', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Attributes</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">{{createDate("startdate","Startdate",'',$data->startdate)}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createDate('enddate', 'Enddate','',$data->enddate)}}
|
||||
</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("image","Image",'',$data->image)}}</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("cover","Cover",'',$data->cover)}}
|
||||
</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('events.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
249
resources/views/crud/generated/events/index.blade.php
Normal file
249
resources/views/crud/generated/events/index.blade.php
Normal file
@ -0,0 +1,249 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Events List') }}</h2>
|
||||
<a href="{{ route('events.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_events" data-url="{{ route('events.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('Start Date') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('End date') }}</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->event_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">{{ myDate($item->startdate) }}</td>
|
||||
<td class="tb-col">{{ myDate($item->enddate) }}</td>
|
||||
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->event_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->event_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('events.show', [$item->event_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li> --}}
|
||||
<li><a href="{{ route('events.edit', [$item->event_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('events.toggle', [$item->event_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('events.destroy', [$item->event_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('events.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
|
29
resources/views/crud/generated/events/show.blade.php
Normal file
29
resources/views/crud/generated/events/show.blade.php
Normal 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('events.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Startdate : </b> <span>{{$data->startdate}}</span></p><p><b>Enddate : </b> <span>{{$data->enddate}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Image : </b> <span>{{$data->image}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Cover : </b> <span>{{$data->cover}}</span></p><p><b>Link : </b> <span>{{$data->link}}</span></p><p><b>Seo Title : </b> <span>{{$data->seo_title}}</span></p><p><b>Seo Description : </b> <span>{{$data->seo_description}}</span></p><p><b>Seo Keywords : </b> <span>{{$data->seo_keywords}}</span></p><p><b>Og Tags : </b> <span>{{$data->og_tags}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
21
resources/views/crud/generated/faqs/create.blade.php
Normal file
21
resources/views/crud/generated/faqs/create.blade.php
Normal file
@ -0,0 +1,21 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Faqs') }}</h2>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('faqs.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Question') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Answer') }}
|
||||
</div> <br>
|
||||
<div class="col-md-12 mt-2"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('faqs.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
21
resources/views/crud/generated/faqs/edit.blade.php
Normal file
21
resources/views/crud/generated/faqs/edit.blade.php
Normal file
@ -0,0 +1,21 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Edit Faqs') }}</h2>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<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="row">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Question', '', $data->title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Answer', $data->text) }}
|
||||
</div>
|
||||
<div class="col-md-12 mt-2"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('faqs.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
225
resources/views/crud/generated/faqs/index.blade.php
Normal file
225
resources/views/crud/generated/faqs/index.blade.php
Normal 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="dataTable table" id="tbl_faqs" data-url="{{ route('faqs.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('S.N') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Question') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Answer') }}</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">{!! $item->text !!}</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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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
|
29
resources/views/crud/generated/faqs/show.blade.php
Normal file
29
resources/views/crud/generated/faqs/show.blade.php
Normal 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 : </b> <span>{{$data->title}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
28
resources/views/crud/generated/features/create.blade.php
Normal file
28
resources/views/crud/generated/features/create.blade.php
Normal file
@ -0,0 +1,28 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h5>{{ label('Add Feature') }}</h5>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('features.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-4">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="col-lg-4">{{ createText('icon', 'icon', 'Icon') }}
|
||||
</div>
|
||||
<div class="col-lg-4">{{ createText('number', 'number', 'Number') }}
|
||||
</div>
|
||||
{{-- <div class="col-lg-6 pb-2">{{ createImageInput('thumb', 'Thumb') }}
|
||||
</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-danger btn-cancel', '', 'Cancel', route('features.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
28
resources/views/crud/generated/features/edit.blade.php
Normal file
28
resources/views/crud/generated/features/edit.blade.php
Normal file
@ -0,0 +1,28 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h5>{{ label('Edit Feature') }}</h5>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('features.update', [$data->feature_id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='feature_id' value='{{ $data->feature_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-4">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="col-lg-4">{{ createText('icon', 'icon', 'Icon', '', $data->icon) }}
|
||||
</div>
|
||||
<div class="col-lg-4">{{ createText('number', 'number', 'Number', '', $data->number) }}
|
||||
</div>
|
||||
{{-- <div class="col-lg-6 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 mt-2">
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('features.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
240
resources/views/crud/generated/features/index.blade.php
Normal file
240
resources/views/crud/generated/features/index.blade.php
Normal file
@ -0,0 +1,240 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5>{{ label('Features List') }}</h5>
|
||||
<a href="{{ route('features.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_features" data-url="{{ route('features.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('S.N') }}</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('Number') }}</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->feature_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->feature_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->feature_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->number }}</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('features.show', [$item->feature_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('features.edit', [$item->feature_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('features.toggle', [$item->feature_id]) }}" class="dropdown-item toggle-item-btn"
|
||||
onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('features.destroy', [$item->feature_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></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('features.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
|
29
resources/views/crud/generated/features/show.blade.php
Normal file
29
resources/views/crud/generated/features/show.blade.php
Normal 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('features.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Number : </b> <span>{{$data->number}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
252
resources/views/crud/generated/forms/create.blade.php
Normal file
252
resources/views/crud/generated/forms/create.blade.php
Normal file
@ -0,0 +1,252 @@
|
||||
@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 New Form</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 New Form</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<form action="{{route('forms.store')}}" id="my-form" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div>
|
||||
{{createText("title","title","Title")}}
|
||||
<h5 class="fs-14 mt-2 mb-3 text-muted">Parmalink: <a href="#" target="_blank">http://localhost/bibadmin/bibcms/about.php</a> </h5>
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed mb-3"></div>
|
||||
{{createTextarea("text","text ckeditor-classic","Description")}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header"><h4 class="card-title mb-0">Add Custom Field</h4></div>
|
||||
<div class="card-body">
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header"><h4 class="card-title mb-0">Email Notification</h4></div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{createText("headers","headers","Headers")}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("toemail","toemail","To Email")}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("fromemail","fromemail","From Email")}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("emailsubject","emailsubject","Email Subject")}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("emailtext","emailtext","Email Text")}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("autoresponse","autoresponse","Auto Response")}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("responseheaders","responseheaders","Response Headers")}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("responsefrom","responsefrom","Response From")}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("responsesubject","responsesubject","Response Subject")}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("responsetext","responsetext","Response Text")}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Featured Image</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<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("image_thumb","Image Thumb")}}
|
||||
</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-store", "", "Submit"); ?>
|
||||
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('forms.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@push("js")
|
||||
<script>
|
||||
createFormFieldsRepeater();
|
||||
// addFormField();
|
||||
|
||||
// const addButtonContainer = document.getElementById('add-button-container');
|
||||
|
||||
|
||||
function createFormFieldsRepeater() {
|
||||
const repeaterContainer = document.getElementById('repeater-container');
|
||||
const addButtonContainer = document.getElementById('add-button-container');
|
||||
|
||||
// Add button
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'Add Field';
|
||||
addButton.addEventListener('click', addFormField);
|
||||
addButtonContainer.appendChild(addButton);
|
||||
|
||||
// Repeater fields
|
||||
let fieldCount = 0;
|
||||
|
||||
function addFormField() {
|
||||
event.preventDefault();
|
||||
fieldCount++;
|
||||
|
||||
// Create form field container
|
||||
const fieldContainer = document.createElement('div');
|
||||
fieldContainer.classList.add('form-field');
|
||||
fieldContainer.classList.add('row');
|
||||
const fieldInputContainer = document.createElement('div');
|
||||
fieldInputContainer.classList.add("col");
|
||||
fieldInputContainer.innerHTML = ("<label for=\"fieldName\" class=\"form-label col-form-label\"> Field Name </label>");
|
||||
const fieldNameInput = document.createElement('input');
|
||||
fieldNameInput.setAttribute('type', 'text');
|
||||
fieldNameInput.setAttribute('name', `fieldNames[]`);
|
||||
fieldNameInput.setAttribute('placeholder', 'Field Name');
|
||||
fieldInputContainer.classList.add('col');
|
||||
fieldNameInput.classList.add('form-control');
|
||||
fieldInputContainer.appendChild(fieldNameInput);
|
||||
fieldContainer.appendChild(fieldInputContainer);
|
||||
|
||||
// Field Type select
|
||||
const fieldInputContainers2 = document.createElement('div');
|
||||
fieldInputContainers2.classList.add("col");
|
||||
fieldInputContainers2.innerHTML = ("<label for=\"fieldName\" class=\"form-label col-form-label\"> Field Type </label>");
|
||||
|
||||
const fieldTypeSelect = document.createElement('select');
|
||||
fieldTypeSelect.setAttribute('name', `fieldTypes[]`);
|
||||
const textOption = document.createElement('option');
|
||||
textOption.setAttribute('value', 'text');
|
||||
textOption.textContent = 'Text';
|
||||
|
||||
fieldTypeSelect.appendChild(textOption);
|
||||
|
||||
const textareaOption = document.createElement('option');
|
||||
textareaOption.setAttribute('value', 'textarea');
|
||||
textareaOption.textContent = 'Textarea';
|
||||
fieldTypeSelect.appendChild(textareaOption);
|
||||
fieldTypeSelect.classList.add('col');
|
||||
fieldTypeSelect.classList.add('form-control');
|
||||
fieldInputContainers2.appendChild(fieldTypeSelect);
|
||||
fieldContainer.appendChild(fieldInputContainers2);
|
||||
|
||||
// Field Default input
|
||||
const fieldInputContainer3 = document.createElement('div');
|
||||
fieldInputContainer3.classList.add("col");
|
||||
fieldInputContainer3.innerHTML = ("<label for=\"fieldName\" class=\"form-label col-form-label\"> Default Value </label>");
|
||||
const fieldDefaultInput = document.createElement('input');
|
||||
fieldDefaultInput.setAttribute('type', 'text');
|
||||
fieldDefaultInput.setAttribute('name', `fieldDefaults[]`);
|
||||
fieldDefaultInput.setAttribute('placeholder', 'Field Default Value');
|
||||
fieldDefaultInput.classList.add('col');
|
||||
fieldDefaultInput.classList.add('form-control');
|
||||
fieldInputContainer3.appendChild(fieldDefaultInput);
|
||||
fieldContainer.appendChild(fieldInputContainer3);
|
||||
|
||||
// Field CSS input
|
||||
const fieldInputContainer4 = document.createElement('div');
|
||||
fieldInputContainer4.classList.add("col");
|
||||
fieldInputContainer4.innerHTML = ("<label for=\"fieldName\" class=\"form-label col-form-label\"> Extra CSS </label>");
|
||||
const fieldCssInput = document.createElement('input');
|
||||
fieldCssInput.setAttribute('type', 'text');
|
||||
fieldCssInput.setAttribute('name', `fieldCss[]`);
|
||||
fieldCssInput.classList.add('form-control');
|
||||
fieldInputContainer4.appendChild(fieldCssInput);
|
||||
fieldContainer.appendChild(fieldInputContainer4);
|
||||
|
||||
// Remove button
|
||||
const fieldInputContainer5 = document.createElement('div');
|
||||
fieldInputContainer5.classList.add("col");
|
||||
fieldInputContainer5.innerHTML = ("<label for=\"fieldName\" class=\"form-label col-form-label\">   <span class=\"row-selector-handle\">☰</span></label>");
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'Remove Field';
|
||||
removeButton.classList.add('btn');
|
||||
removeButton.classList.add('btn-danger');
|
||||
removeButton.classList.add('col');
|
||||
removeButton.classList.add('form-control');
|
||||
removeButton.addEventListener('click', () => {
|
||||
repeaterContainer.removeChild(fieldContainer);
|
||||
});
|
||||
fieldInputContainer5.appendChild(removeButton);
|
||||
fieldContainer.appendChild(fieldInputContainer5);
|
||||
|
||||
repeaterContainer.appendChild(fieldContainer);
|
||||
makeSortable();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<!-- jQuery UI Sortable library -->
|
||||
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
|
||||
|
||||
<!-- Add the CSS for jQuery UI Sortable (optional, but recommended for styling) -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
|
||||
|
||||
<script>
|
||||
function makeSortable(){
|
||||
$(document).ready(function () {
|
||||
// Make the repeater-container sortable
|
||||
$("#repeater-container").sortable({
|
||||
axis: "y", // Allow sorting only vertically
|
||||
handle: ".row-selector-handle", // Define the handle element for dragging (form-field class)
|
||||
containment: "parent", // Keep the sorting within the repeater-container
|
||||
});
|
||||
|
||||
// Disable text selection while dragging to avoid text highlighting
|
||||
$("#repeater-container").disableSelection();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
277
resources/views/crud/generated/forms/edit.blade.php
Normal file
277
resources/views/crud/generated/forms/edit.blade.php
Normal file
@ -0,0 +1,277 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
|
||||
<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 Form</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 Form</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<form action="{{route('forms.update',[$data->form_id])}}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='form_id' value='{{$data->form_id}}' />
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div>
|
||||
{{createText("title","title","Title",'',$data->title)}}
|
||||
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed mb-3"></div>
|
||||
{{createTextarea("text","text ckeditor-classic","Description",$data->text)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Edit Custom Field</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="repeater-container">
|
||||
@foreach(json_decode($data->form_fields) as $field)
|
||||
<div class="form-field row">
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Field Name </label><input type="text" name="fieldNames[]" placeholder="Field Name" class="form-control" autocomplete="off" value="{{$field->fieldName}}"></div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Field Type </label><select name="fieldTypes[]" class="col form-control">
|
||||
<option value="text" <?php if($field->fieldType=="text") echo "SELECTED"; ?>>Text</option>
|
||||
<option value="textarea" <?php if($field->fieldType=="textarea") echo "SELECTED"; ?>>Textarea</option>
|
||||
</select></div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Default Value </label><input type="text" name="fieldDefaults[]" placeholder="Field Default Value" class="col form-control" value="{{$field->fieldDefault}}"></div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Extra CSS </label><input type="text" name="fieldCss[]" class="form-control" value="{{$field->fieldCss}}"></div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> <span class="row-selector-handle">☰</span></label><button class="btn btn-danger col form-control" onclick="removeRow(this);">Remove Field</button></div>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed mb-3"></div>
|
||||
<div id="add-button-container">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Email Notification</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{createText("headers","headers","Headers",'',$data->headers)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("toemail","toemail","Toemail",'',$data->toemail)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("fromemail","fromemail","Fromemail",'',$data->fromemail)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("emailsubject","emailsubject","Emailsubject",'',$data->emailsubject)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("emailtext","emailtext","Emailtext",'',$data->emailtext)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("autoresponse","autoresponse","Autoresponse",'',$data->autoresponse)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("responseheaders","responseheaders","Responseheaders",'',$data->responseheaders)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("responsefrom","responsefrom","Responsefrom",'',$data->responsefrom)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("responsesubject","responsesubject","Responsesubject",'',$data->responsesubject)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("responsetext","responsetext","Responsetext",'',$data->responsetext)}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Featured Image</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<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("image_thumb","Image Thumb",'',$data->image_thumb)}}
|
||||
</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('forms.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
@push("js")
|
||||
<script>
|
||||
|
||||
|
||||
function createFormFieldsRepeater() {
|
||||
const repeaterContainer = document.getElementById('repeater-container');
|
||||
const addButtonContainer = document.getElementById('add-button-container');
|
||||
|
||||
// Add button
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'Add Field';
|
||||
addButton.addEventListener('click', addFormField);
|
||||
addButtonContainer.appendChild(addButton);
|
||||
|
||||
// Repeater fields
|
||||
let fieldCount = 0;
|
||||
|
||||
function addFormField() {
|
||||
event.preventDefault();
|
||||
fieldCount++;
|
||||
|
||||
// Create form field container
|
||||
const fieldContainer = document.createElement('div');
|
||||
fieldContainer.classList.add('form-field');
|
||||
fieldContainer.classList.add('row');
|
||||
const fieldInputContainer = document.createElement('div');
|
||||
fieldInputContainer.classList.add("col");
|
||||
fieldInputContainer.innerHTML = ("<label for=\"fieldName\" class=\"form-label col-form-label\"> Field Name </label>");
|
||||
const fieldNameInput = document.createElement('input');
|
||||
fieldNameInput.setAttribute('type', 'text');
|
||||
fieldNameInput.setAttribute('name', `fieldNames[]`);
|
||||
fieldNameInput.setAttribute('placeholder', 'Field Name');
|
||||
fieldInputContainer.classList.add('col');
|
||||
fieldNameInput.classList.add('form-control');
|
||||
fieldInputContainer.appendChild(fieldNameInput);
|
||||
fieldContainer.appendChild(fieldInputContainer);
|
||||
|
||||
// Field Type select
|
||||
const fieldInputContainers2 = document.createElement('div');
|
||||
fieldInputContainers2.classList.add("col");
|
||||
fieldInputContainers2.innerHTML = ("<label for=\"fieldName\" class=\"form-label col-form-label\"> Field Type </label>");
|
||||
|
||||
const fieldTypeSelect = document.createElement('select');
|
||||
fieldTypeSelect.setAttribute('name', `fieldTypes[]`);
|
||||
const textOption = document.createElement('option');
|
||||
textOption.setAttribute('value', 'text');
|
||||
textOption.textContent = 'Text';
|
||||
|
||||
fieldTypeSelect.appendChild(textOption);
|
||||
|
||||
const textareaOption = document.createElement('option');
|
||||
textareaOption.setAttribute('value', 'textarea');
|
||||
textareaOption.textContent = 'Textarea';
|
||||
fieldTypeSelect.appendChild(textareaOption);
|
||||
fieldTypeSelect.classList.add('col');
|
||||
fieldTypeSelect.classList.add('form-control');
|
||||
fieldInputContainers2.appendChild(fieldTypeSelect);
|
||||
fieldContainer.appendChild(fieldInputContainers2);
|
||||
|
||||
// Field Default input
|
||||
const fieldInputContainer3 = document.createElement('div');
|
||||
fieldInputContainer3.classList.add("col");
|
||||
fieldInputContainer3.innerHTML = ("<label for=\"fieldName\" class=\"form-label col-form-label\"> Default Value </label>");
|
||||
const fieldDefaultInput = document.createElement('input');
|
||||
fieldDefaultInput.setAttribute('type', 'text');
|
||||
fieldDefaultInput.setAttribute('name', `fieldDefaults[]`);
|
||||
fieldDefaultInput.setAttribute('placeholder', 'Field Default Value');
|
||||
fieldDefaultInput.classList.add('col');
|
||||
fieldDefaultInput.classList.add('form-control');
|
||||
fieldInputContainer3.appendChild(fieldDefaultInput);
|
||||
fieldContainer.appendChild(fieldInputContainer3);
|
||||
|
||||
// Field CSS input
|
||||
const fieldInputContainer4 = document.createElement('div');
|
||||
fieldInputContainer4.classList.add("col");
|
||||
fieldInputContainer4.innerHTML = ("<label for=\"fieldName\" class=\"form-label col-form-label\"> Extra CSS </label>");
|
||||
const fieldCssInput = document.createElement('input');
|
||||
fieldCssInput.setAttribute('type', 'text');
|
||||
fieldCssInput.setAttribute('name', `fieldCss[]`);
|
||||
fieldCssInput.classList.add('form-control');
|
||||
fieldInputContainer4.appendChild(fieldCssInput);
|
||||
fieldContainer.appendChild(fieldInputContainer4);
|
||||
|
||||
// Remove button
|
||||
const fieldInputContainer5 = document.createElement('div');
|
||||
fieldInputContainer5.classList.add("col");
|
||||
fieldInputContainer5.innerHTML = ("<label for=\"fieldName\" class=\"form-label col-form-label\">   <span class=\"row-selector-handle\">☰</span></label>");
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'Remove Field';
|
||||
removeButton.classList.add('btn');
|
||||
removeButton.classList.add('btn-danger');
|
||||
removeButton.classList.add('col');
|
||||
removeButton.classList.add('form-control');
|
||||
removeButton.addEventListener('click', () => {
|
||||
//event.preventDefault();
|
||||
repeaterContainer.removeChild(fieldContainer);
|
||||
});
|
||||
fieldInputContainer5.appendChild(removeButton);
|
||||
fieldContainer.appendChild(fieldInputContainer5);
|
||||
|
||||
|
||||
|
||||
|
||||
repeaterContainer.appendChild(fieldContainer);
|
||||
}
|
||||
makeSortable();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function removeRow(button) {
|
||||
event.preventDefault();
|
||||
const row = button.parentNode.parentNode;
|
||||
row.parentNode.removeChild(row);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<!-- jQuery UI Sortable library -->
|
||||
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
|
||||
|
||||
<!-- Add the CSS for jQuery UI Sortable (optional, but recommended for styling) -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
|
||||
|
||||
<script>
|
||||
function makeSortable(){
|
||||
$(document).ready(function () {
|
||||
// Make the repeater-container sortable
|
||||
$("#repeater-container").sortable({
|
||||
axis: "y", // Allow sorting only vertically
|
||||
handle: ".row-selector-handle", // Define the handle element for dragging (form-field class)
|
||||
containment: "parent", // Keep the sorting within the repeater-container
|
||||
});
|
||||
|
||||
// Disable text selection while dragging to avoid text highlighting
|
||||
$("#repeater-container").disableSelection();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
createFormFieldsRepeater();
|
||||
</script>
|
||||
|
||||
@endpush
|
208
resources/views/crud/generated/forms/index.blade.php
Normal file
208
resources/views/crud/generated/forms/index.blade.php
Normal file
@ -0,0 +1,208 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Forms List") }}</h2>
|
||||
<a href="{{ route('forms.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="table-responsive table-card">
|
||||
|
||||
<table class="table dataTable align-middle table-nowrap mb-0" id="tbl_forms" data-url="{{ route('forms.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th scope="col">{{label("Sn.")}}</th>
|
||||
<th scope="col""><span class="overline-title">{{ label("Title") }}</span></th>
|
||||
<th scope="col"><span class="overline-title">{{ label("Alias") }}</span></th>
|
||||
<th scope="col"><span class="overline-title">{{ label("cover Photo") }}</span></th>
|
||||
|
||||
<th scope="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->form_id}}" data-display_order="{{$item->display_order}}" class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->form_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->form_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->cover_photo) }}</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('forms.show',[$item->form_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('forms.edit',[$item->form_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('forms.destroy',[$item->form_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('forms.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
29
resources/views/crud/generated/forms/show.blade.php
Normal file
29
resources/views/crud/generated/forms/show.blade.php
Normal 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('forms.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Cover Photo : </b> <span>{{$data->cover_photo}}</span></p><p><b>Image Thumb : </b> <span>{{$data->image_thumb}}</span></p><p><b>Form Fields : </b> <span>{{$data->form_fields}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Headers : </b> <span>{{$data->headers}}</span></p><p><b>Toemail : </b> <span>{{$data->toemail}}</span></p><p><b>Fromemail : </b> <span>{{$data->fromemail}}</span></p><p><b>Emailsubject : </b> <span>{{$data->emailsubject}}</span></p><p><b>Emailtext : </b> <span>{{$data->emailtext}}</span></p><p><b>Autoresponse : </b> <span>{{$data->autoresponse}}</span></p><p><b>Responseheaders : </b> <span>{{$data->responseheaders}}</span></p><p><b>Responsefrom : </b> <span>{{$data->responsefrom}}</span></p><p><b>Responsesubject : </b> <span>{{$data->responsesubject}}</span></p><p><b>Responsetext : </b> <span>{{$data->responsetext}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
@ -0,0 +1,16 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Formsubmissions') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('formsubmissions.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('formsubmissions.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_forms', 'title', 'form_id', '', 'Forms Id','forms_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("submitted_values","submitted_values","Submitted Values")}}
|
||||
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('formsubmissions.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
@ -0,0 +1,16 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Edit Formsubmissions') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('formsubmissions.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('formsubmissions.update',[$data->formsubmission_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='formsubmission_id' value='{{$data->formsubmission_id}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_forms', 'title', 'form_id', $data->forms_id, 'Forms Id','forms_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("submitted_values","submitted_values","Submitted Values",'',$data->submitted_values)}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('formsubmissions.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
193
resources/views/crud/generated/formsubmissions/index.blade.php
Normal file
193
resources/views/crud/generated/formsubmissions/index.blade.php
Normal file
@ -0,0 +1,193 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Formsubmissions List") }}</h2>
|
||||
<a href="{{ route('formsubmissions.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_formsubmissions" data-url="{{ route('formsubmissions.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("forms_id") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("submitted_values") }}</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->formsubmission_id}}" data-display_order="{{$item->display_order}}" class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">
|
||||
{!! getFieldData("tbl_forms", "title", "form_id", $item->forms_id) !!}
|
||||
</td><td class="tb-col">{{ $item->submitted_values }}</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('formsubmissions.show',[$item->formsubmission_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('formsubmissions.edit',[$item->formsubmission_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('formsubmissions.destroy',[$item->formsubmission_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('formsubmissions.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
@ -0,0 +1,29 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('formsubmissions.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Forms Id : </b> <span>{{$data->forms_id}}</span></p><p><b>Submitted Values : </b> <span>{{$data->submitted_values}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
29
resources/views/crud/generated/galleries/create.blade.php
Normal file
29
resources/views/crud/generated/galleries/create.blade.php
Normal 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('Add Galleries') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('galleries.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('galleries.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('text', 'text ckeditor-classic', 'Text') }}
|
||||
</div> --}}
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('thumb', 'Thumb') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover_photo', 'Cover') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createMultiImageInput('images', 'Gallery') }}
|
||||
</div> <br>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('galleries.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
29
resources/views/crud/generated/galleries/edit.blade.php
Normal file
29
resources/views/crud/generated/galleries/edit.blade.php
Normal 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 Galleries') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('galleries.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('galleries.update', [$data->gallery_id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='gallery_id' value='{{ $data->gallery_id }}' />
|
||||
<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-12 pb-2">{{ createImageInput('thumb', 'Thumb', '', $data->thumb) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover_photo', 'Cover Photo', '', $data->cover_photo) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createMultiImageInput('images', 'Gallery', '', $data->images) }}
|
||||
</div> <br>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('galleries.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
248
resources/views/crud/generated/galleries/index.blade.php
Normal file
248
resources/views/crud/generated/galleries/index.blade.php
Normal file
@ -0,0 +1,248 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Galleries List') }}</h2>
|
||||
<a href="{{ route('galleries.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_galleries" data-url="{{ route('galleries.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('thumb') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('cover_photo') }}</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->gallery_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->gallery_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->gallery_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">{{ showImageThumb($item->cover_photo) }}</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('galleries.show', [$item->gallery_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('galleries.edit', [$item->gallery_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('galleries.toggle', [$item->gallery_id]) }}" class="dropdown-item toggle-item-btn"
|
||||
onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('galleries.destroy', [$item->gallery_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('photos.list', [$item->gallery_id]) }}" class="dropdown-item remove-item-btn">
|
||||
<i class="ri-gallery text-muted me-2 align-bottom"></i> {{ label('Photos') }}
|
||||
</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('galleries.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
|
35
resources/views/crud/generated/galleries/show.blade.php
Normal file
35
resources/views/crud/generated/galleries/show.blade.php
Normal file
@ -0,0 +1,35 @@
|
||||
@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('galleries.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Text : </b> <span>{{ $data->text }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Thumb : </b> <span>{{ $data->thumb }}</span></p>
|
||||
<p><b>Cover Photo : </b> <span>{{ $data->cover_photo }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
95
resources/views/crud/generated/institutions/create.blade.php
Normal file
95
resources/views/crud/generated/institutions/create.blade.php
Normal file
@ -0,0 +1,95 @@
|
||||
@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 Institutions</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 Institutions</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-xl-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-6">{{ createText('email', 'email', 'Email') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('url', 'url', 'URL') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</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="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions') }}
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Attributes</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createCustomSelect('tbl_countries', 'title', 'country_id', '', 'Country', 'countries_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Image</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createImageInput('logo', '') }}
|
||||
</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-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('institutions.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
100
resources/views/crud/generated/institutions/edit.blade.php
Normal file
100
resources/views/crud/generated/institutions/edit.blade.php
Normal file
@ -0,0 +1,100 @@
|
||||
@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 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">Edit Institution</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<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-xl-9">
|
||||
<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-6">{{ createText('email', 'email', 'Email', '', $data->email) }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('url', 'url', 'url', '', $data->url) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</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="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title', '', $data->seo_title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_description', 'Seo Descriptions', '', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_keywords', 'seo_keywords', 'Seo Keywords', '', $data->seo_keywords) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('og_tags', 'og_tags', 'Og Tags', '', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Attributes</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createCustomSelect('tbl_countries', 'title', 'country_id', $data->countries_id, 'Country', 'countries_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Image
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ createImageInput('logo', '', '', $data->logo) }}
|
||||
</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', '', 'Update'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('institutions.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
@endsection
|
211
resources/views/crud/generated/institutions/index.blade.php
Normal file
211
resources/views/crud/generated/institutions/index.blade.php
Normal file
@ -0,0 +1,211 @@
|
||||
@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="dataTable table" id="tbl_institutions" data-url="{{ route('institutions.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('Country') }}</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('Email') }}</span></th> --}}
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Logo') }}</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->institution_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_countries', 'title', 'country_id', $item->countries_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->title }}</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">{{ $item->email }}</td> --}}
|
||||
<td class="tb-col">{{ showImageThumb($item->logo) }}</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 text-muted me-2 align-bottom"></i>
|
||||
{{ label('Edit') }}</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 text-muted me-2 align-bottom"></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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
29
resources/views/crud/generated/institutions/show.blade.php
Normal file
29
resources/views/crud/generated/institutions/show.blade.php
Normal 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>Countries Id : </b> <span>{{$data->countries_id}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Email : </b> <span>{{$data->email}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Logo : </b> <span>{{$data->logo}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Seo Keywords : </b> <span>{{$data->seo_keywords}}</span></p><p><b>Seo Title : </b> <span>{{$data->seo_title}}</span></p><p><b>Seo Descriptions : </b> <span>{{$data->seo_descriptions}}</span></p><p><b>Og Tags : </b> <span>{{$data->og_tags}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
@ -0,0 +1,37 @@
|
||||
@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">{{ label('Add Job_categories') }}</h1>
|
||||
|
||||
</div>
|
||||
<div class="nk-block-head-content">
|
||||
<ul class="d-flex"> <li>
|
||||
<a href="{{ route('job_categories.index') }}" class="btn btn-md d-md-none btn-primary">
|
||||
<em class="icon ni ni-plus"></em>
|
||||
<span>List All</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nk-block">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('job_categories.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">{{createImageInput("thumb","Thumb")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("details","details ckeditor-classic","Details")}}
|
||||
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
</div> </form></div></div></div></div></div></div></div></div>
|
||||
@endsection
|
37
resources/views/crud/generated/job_categories/edit.blade.php
Normal file
37
resources/views/crud/generated/job_categories/edit.blade.php
Normal file
@ -0,0 +1,37 @@
|
||||
@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">{{ label('Edit Job_categories') }}</h1>
|
||||
|
||||
</div>
|
||||
<div class="nk-block-head-content">
|
||||
<ul class="d-flex"> <li>
|
||||
<a href="{{ route('job_categories.index') }}" class="btn btn-md d-md-none btn-primary">
|
||||
<em class="icon ni ni-plus"></em>
|
||||
<span>View Cities</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nk-block">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('job_categories.update',[$data->category_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='category_id' value='{{$data->category_id}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb",'',$data->thumb)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("details","details ckeditor-classic","Details",'','',$data->details)}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
</div> </form></div></div></div></div></div></div></div></div>
|
||||
@endsection
|
200
resources/views/crud/generated/job_categories/index.blade.php
Normal file
200
resources/views/crud/generated/job_categories/index.blade.php
Normal file
@ -0,0 +1,200 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Job_categories List") }}</h2>
|
||||
<a href="{{ route('job_categories.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_job_categories" data-url="{{ route('job_categories.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("thumb") }}</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->category_id}}" data-display_order="{{$item->display_order}}" class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->category_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->category_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('job_categories.show',[$item->category_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('job_categories.edit',[$item->category_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('job_categories.destroy',[$item->category_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('job_categories.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
43
resources/views/crud/generated/job_categories/show.blade.php
Normal file
43
resources/views/crud/generated/job_categories/show.blade.php
Normal file
@ -0,0 +1,43 @@
|
||||
@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">
|
||||
<div class="offcanvas-body" data-simplebar>
|
||||
<div class="nk-block-head-content w-100">
|
||||
<div class="d-flex justify-content-between pb-4">
|
||||
|
||||
<h2>{{ label('Job_categories Details') }}</h2>
|
||||
{{-- <button class="btn btn-primary print_pdf">Print PDF</button> --}}
|
||||
</div>
|
||||
<div class="card w-100">
|
||||
<div class="p-5">
|
||||
|
||||
<div class="card-head">
|
||||
<h2 class="text-center">{{$data['title']}}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Details : </b> <span>{{$data->details}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
54
resources/views/crud/generated/jobdemand/create.blade.php
Normal file
54
resources/views/crud/generated/jobdemand/create.blade.php
Normal file
@ -0,0 +1,54 @@
|
||||
@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">{{ label('Add Jobdemand') }}</h1>
|
||||
|
||||
</div>
|
||||
<div class="nk-block-head-content">
|
||||
<ul class="d-flex"> <li>
|
||||
<a href="{{ route('jobdemand.index') }}" class="btn btn-md d-md-none btn-primary">
|
||||
<em class="icon ni ni-plus"></em>
|
||||
<span>List All</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nk-block">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('jobdemand.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("countries_id","countries_id","Countries Id")}}
|
||||
</div><div class="col-lg-6">{{createText("companies_id","companies_id","Companies Id")}}
|
||||
</div><div class="col-lg-6">{{createText("salary","salary","Salary")}}
|
||||
</div><div class="col-lg-6">{{createText("required_nos","required_nos","Required Nos")}}
|
||||
</div><div class="col-lg-6">{{createText("contract_period","contract_period","Contract Period")}}
|
||||
</div><div class="col-lg-6">{{createText("duty_hrs","duty_hrs","Duty Hrs")}}
|
||||
</div><div class="col-lg-6">{{createText("working_days","working_days","Working Days")}}
|
||||
</div><div class="col-lg-6">{{createText("overtime","overtime","Overtime")}}
|
||||
</div><div class="col-lg-6">{{createText("food_allowance","food_allowance","Food Allowance")}}
|
||||
</div><div class="col-lg-6">{{createText("transport_allowance","transport_allowance","Transport Allowance")}}
|
||||
</div><div class="col-lg-6">{{createText("accomodation_allowance","accomodation_allowance","Accomodation Allowance")}}
|
||||
</div><div class="col-lg-6">{{createText("medical_provided","medical_provided","Medical Provided")}}
|
||||
</div><div class="col-lg-6">{{createText("insurance_provided","insurance_provided","Insurance Provided")}}
|
||||
</div><div class="col-lg-6">{{createText("required_documents","required_documents","Required Documents")}}
|
||||
</div><div class="col-lg-6">{{createText("qualification","qualification","Qualification")}}
|
||||
</div><div class="col-lg-6">{{createText("work_experience","work_experience","Work Experience")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("details","details ckeditor-classic","Details")}}
|
||||
</div><div class="col-lg-6">{{createText("remarks","remarks","Remarks")}}
|
||||
</div><div class="col-lg-6">{{createText("postedon","postedon","Postedon")}}
|
||||
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
</div> </form></div></div></div></div></div></div></div></div>
|
||||
@endsection
|
54
resources/views/crud/generated/jobdemand/edit.blade.php
Normal file
54
resources/views/crud/generated/jobdemand/edit.blade.php
Normal file
@ -0,0 +1,54 @@
|
||||
@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">{{ label('Edit Jobdemand') }}</h1>
|
||||
|
||||
</div>
|
||||
<div class="nk-block-head-content">
|
||||
<ul class="d-flex"> <li>
|
||||
<a href="{{ route('jobdemand.index') }}" class="btn btn-md d-md-none btn-primary">
|
||||
<em class="icon ni ni-plus"></em>
|
||||
<span>View Cities</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nk-block">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('jobdemand.update',[$data->job_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='job_id' value='{{$data->job_id}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
|
||||
</div><div class="col-lg-6">{{createText("countries_id","countries_id","Countries Id",'',$data->countries_id)}}
|
||||
</div><div class="col-lg-6">{{createText("companies_id","companies_id","Companies Id",'',$data->companies_id)}}
|
||||
</div><div class="col-lg-6">{{createText("salary","salary","Salary",'',$data->salary)}}
|
||||
</div><div class="col-lg-6">{{createText("required_nos","required_nos","Required Nos",'',$data->required_nos)}}
|
||||
</div><div class="col-lg-6">{{createText("contract_period","contract_period","Contract Period",'',$data->contract_period)}}
|
||||
</div><div class="col-lg-6">{{createText("duty_hrs","duty_hrs","Duty Hrs",'',$data->duty_hrs)}}
|
||||
</div><div class="col-lg-6">{{createText("working_days","working_days","Working Days",'',$data->working_days)}}
|
||||
</div><div class="col-lg-6">{{createText("overtime","overtime","Overtime",'',$data->overtime)}}
|
||||
</div><div class="col-lg-6">{{createText("food_allowance","food_allowance","Food Allowance",'',$data->food_allowance)}}
|
||||
</div><div class="col-lg-6">{{createText("transport_allowance","transport_allowance","Transport Allowance",'',$data->transport_allowance)}}
|
||||
</div><div class="col-lg-6">{{createText("accomodation_allowance","accomodation_allowance","Accomodation Allowance",'',$data->accomodation_allowance)}}
|
||||
</div><div class="col-lg-6">{{createText("medical_provided","medical_provided","Medical Provided",'',$data->medical_provided)}}
|
||||
</div><div class="col-lg-6">{{createText("insurance_provided","insurance_provided","Insurance Provided",'',$data->insurance_provided)}}
|
||||
</div><div class="col-lg-6">{{createText("required_documents","required_documents","Required Documents",'',$data->required_documents)}}
|
||||
</div><div class="col-lg-6">{{createText("qualification","qualification","Qualification",'',$data->qualification)}}
|
||||
</div><div class="col-lg-6">{{createText("work_experience","work_experience","Work Experience",'',$data->work_experience)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("details","details ckeditor-classic","Details",'','',$data->details)}}
|
||||
</div><div class="col-lg-6">{{createText("remarks","remarks","Remarks",'',$data->remarks)}}
|
||||
</div><div class="col-lg-6">{{createText("postedon","postedon","Postedon",'',$data->postedon)}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
</div> </form></div></div></div></div></div></div></div></div>
|
||||
@endsection
|
232
resources/views/crud/generated/jobdemand/index.blade.php
Normal file
232
resources/views/crud/generated/jobdemand/index.blade.php
Normal file
@ -0,0 +1,232 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Jobdemand List") }}</h2>
|
||||
<a href="{{ route('jobdemand.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_jobdemand" data-url="{{ route('jobdemand.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("countries_id") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("companies_id") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("salary") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("required_nos") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("contract_period") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("duty_hrs") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("working_days") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("overtime") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("food_allowance") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("transport_allowance") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("accomodation_allowance") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("medical_provided") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("insurance_provided") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("required_documents") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("qualification") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("work_experience") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("postedon") }}</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->job_id}}" data-display_order="{{$item->display_order}}" class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->job_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->job_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->countries_id }}</td>
|
||||
<td class="tb-col">{{ $item->companies_id }}</td>
|
||||
<td class="tb-col">{{ $item->salary }}</td>
|
||||
<td class="tb-col">{{ $item->required_nos }}</td>
|
||||
<td class="tb-col">{{ $item->contract_period }}</td>
|
||||
<td class="tb-col">{{ $item->duty_hrs }}</td>
|
||||
<td class="tb-col">{{ $item->working_days }}</td>
|
||||
<td class="tb-col">{{ $item->overtime }}</td>
|
||||
<td class="tb-col">{{ $item->food_allowance }}</td>
|
||||
<td class="tb-col">{{ $item->transport_allowance }}</td>
|
||||
<td class="tb-col">{{ $item->accomodation_allowance }}</td>
|
||||
<td class="tb-col">{{ $item->medical_provided }}</td>
|
||||
<td class="tb-col">{{ $item->insurance_provided }}</td>
|
||||
<td class="tb-col">{{ $item->required_documents }}</td>
|
||||
<td class="tb-col">{{ $item->qualification }}</td>
|
||||
<td class="tb-col">{{ $item->work_experience }}</td>
|
||||
<td class="tb-col">{{ $item->postedon }}</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('jobdemand.show',[$item->job_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('jobdemand.edit',[$item->job_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('jobdemand.destroy',[$item->job_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('jobdemand.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
43
resources/views/crud/generated/jobdemand/show.blade.php
Normal file
43
resources/views/crud/generated/jobdemand/show.blade.php
Normal file
@ -0,0 +1,43 @@
|
||||
@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">
|
||||
<div class="offcanvas-body" data-simplebar>
|
||||
<div class="nk-block-head-content w-100">
|
||||
<div class="d-flex justify-content-between pb-4">
|
||||
|
||||
<h2>{{ label('Jobdemand Details') }}</h2>
|
||||
{{-- <button class="btn btn-primary print_pdf">Print PDF</button> --}}
|
||||
</div>
|
||||
<div class="card w-100">
|
||||
<div class="p-5">
|
||||
|
||||
<div class="card-head">
|
||||
<h2 class="text-center">{{$data['title']}}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Countries Id : </b> <span>{{$data->countries_id}}</span></p><p><b>Companies Id : </b> <span>{{$data->companies_id}}</span></p><p><b>Salary : </b> <span>{{$data->salary}}</span></p><p><b>Required Nos : </b> <span>{{$data->required_nos}}</span></p><p><b>Contract Period : </b> <span>{{$data->contract_period}}</span></p><p><b>Duty Hrs : </b> <span>{{$data->duty_hrs}}</span></p><p><b>Working Days : </b> <span>{{$data->working_days}}</span></p><p><b>Overtime : </b> <span>{{$data->overtime}}</span></p><p><b>Food Allowance : </b> <span>{{$data->food_allowance}}</span></p><p><b>Transport Allowance : </b> <span>{{$data->transport_allowance}}</span></p><p><b>Accomodation Allowance : </b> <span>{{$data->accomodation_allowance}}</span></p><p><b>Medical Provided : </b> <span>{{$data->medical_provided}}</span></p><p><b>Insurance Provided : </b> <span>{{$data->insurance_provided}}</span></p><p><b>Required Documents : </b> <span>{{$data->required_documents}}</span></p><p><b>Qualification : </b> <span>{{$data->qualification}}</span></p><p><b>Work Experience : </b> <span>{{$data->work_experience}}</span></p><p><b>Details : </b> <span>{{$data->details}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Postedon : </b> <span>{{$data->postedon}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
33
resources/views/crud/generated/jobdemands/create.blade.php
Normal file
33
resources/views/crud/generated/jobdemands/create.blade.php
Normal file
@ -0,0 +1,33 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header'>
|
||||
<h2 class="">{{ label('Add Jobdemands') }}</h2>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('jobdemands.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_countries', 'title', 'country_id', '', 'Countries Id','countries_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_companies', 'title', 'company_id', '', 'Companies Id','companies_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("salary","salary","Salary")}}
|
||||
</div><div class="col-lg-6">{{createText("required_nos","required_nos","Required Nos")}}
|
||||
</div><div class="col-lg-6">{{createText("contract_period","contract_period","Contract Period")}}
|
||||
</div><div class="col-lg-6">{{createText("duty_hrs","duty_hrs","Duty Hrs")}}
|
||||
</div><div class="col-lg-6">{{createText("working_days","working_days","Working Days")}}
|
||||
</div><div class="col-lg-6">{{createText("overtime","overtime","Overtime")}}
|
||||
</div><div class="col-lg-6">{{createText("food_allowance","food_allowance","Food Allowance")}}
|
||||
</div><div class="col-lg-6">{{createText("transport_allowance","transport_allowance","Transport Allowance")}}
|
||||
</div><div class="col-lg-6">{{createText("accomodation_allowance","accomodation_allowance","Accomodation Allowance")}}
|
||||
</div><div class="col-lg-6">{{createText("medical_provided","medical_provided","Medical Provided")}}
|
||||
</div><div class="col-lg-6">{{createText("insurance_provided","insurance_provided","Insurance Provided")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("required_documents","required_documents ckeditor-classic","Required Documents")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("qualification","qualification ckeditor-classic","Qualification")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("experience","experience ckeditor-classic","Experience")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("details","details ckeditor-classic","Details")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("image","Image")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("cover","Cover")}}
|
||||
</div><div class="col-lg-6">{{createText("remarks","remarks","Remarks")}}
|
||||
</div><div class="col-lg-6 pb-2">{{createDate("postedon","Postedon",'',date('Y-m-d'))}}
|
||||
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
55
resources/views/crud/generated/jobdemands/edit.blade.php
Normal file
55
resources/views/crud/generated/jobdemands/edit.blade.php
Normal file
@ -0,0 +1,55 @@
|
||||
@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">{{ label('Edit Jobdemands') }}</h1>
|
||||
|
||||
</div>
|
||||
<div class="nk-block-head-content">
|
||||
<ul class="d-flex"> <li>
|
||||
<a href="{{ route('jobdemands.index') }}" class="btn btn-md d-md-none btn-primary">
|
||||
<em class="icon ni ni-plus"></em>
|
||||
<span>View Cities</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nk-block">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('jobdemands.update',[$data->job_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='job_id' value='{{$data->job_id}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
|
||||
</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">{{createCustomSelect('tbl_companies', 'title', 'company_id', $data->companies_id, 'Companies Id','companies_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("salary","salary","Salary",'',$data->salary)}}
|
||||
</div><div class="col-lg-6">{{createText("required_nos","required_nos","Required Nos",'',$data->required_nos)}}
|
||||
</div><div class="col-lg-6">{{createText("contract_period","contract_period","Contract Period",'',$data->contract_period)}}
|
||||
</div><div class="col-lg-6">{{createText("duty_hrs","duty_hrs","Duty Hrs",'',$data->duty_hrs)}}
|
||||
</div><div class="col-lg-6">{{createText("working_days","working_days","Working Days",'',$data->working_days)}}
|
||||
</div><div class="col-lg-6">{{createText("overtime","overtime","Overtime",'',$data->overtime)}}
|
||||
</div><div class="col-lg-6">{{createText("food_allowance","food_allowance","Food Allowance",'',$data->food_allowance)}}
|
||||
</div><div class="col-lg-6">{{createText("transport_allowance","transport_allowance","Transport Allowance",'',$data->transport_allowance)}}
|
||||
</div><div class="col-lg-6">{{createText("accomodation_allowance","accomodation_allowance","Accomodation Allowance",'',$data->accomodation_allowance)}}
|
||||
</div><div class="col-lg-6">{{createText("medical_provided","medical_provided","Medical Provided",'',$data->medical_provided)}}
|
||||
</div><div class="col-lg-6">{{createText("insurance_provided","insurance_provided","Insurance Provided",'',$data->insurance_provided)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("required_documents","required_documents ckeditor-classic","Required Documents",'','',$data->required_documents)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("qualification","qualification ckeditor-classic","Qualification",'','',$data->qualification)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("experience","experience ckeditor-classic","Experience",'','',$data->experience)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("details","details ckeditor-classic","Details",'','',$data->details)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("image","Image",'',$data->image)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb",'',$data->thumb)}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("cover","Cover",'',$data->cover)}}
|
||||
</div><div class="col-lg-6">{{createText("remarks","remarks","Remarks",'',$data->remarks)}}
|
||||
</div><div class="col-lg-6 pb-2">{{createDate("postedon","Postedon",'',$data->postedon)}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
</div> </form></div></div></div></div></div></div></div></div>
|
||||
@endsection
|
240
resources/views/crud/generated/jobdemands/index.blade.php
Normal file
240
resources/views/crud/generated/jobdemands/index.blade.php
Normal file
@ -0,0 +1,240 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Jobdemands List") }}</h2>
|
||||
<a href="{{ route('jobdemands.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_jobdemands" data-url="{{ route('jobdemands.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("countries_id") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("companies_id") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("salary") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("required_nos") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("contract_period") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("duty_hrs") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("working_days") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("overtime") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("food_allowance") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("transport_allowance") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("accomodation_allowance") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("medical_provided") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("insurance_provided") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("required_documents") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("qualification") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("experience") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("image") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("thumb") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("cover") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("postedon") }}</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->job_id}}" data-display_order="{{$item->display_order}}" class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->job_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->job_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_countries", "title", "country_id", $item->countries_id) !!}
|
||||
</td><td class="tb-col">
|
||||
{!! getFieldData("tbl_companies", "title", "company_id", $item->companies_id) !!}
|
||||
</td><td class="tb-col">{{ $item->salary }}</td>
|
||||
<td class="tb-col">{{ $item->required_nos }}</td>
|
||||
<td class="tb-col">{{ $item->contract_period }}</td>
|
||||
<td class="tb-col">{{ $item->duty_hrs }}</td>
|
||||
<td class="tb-col">{{ $item->working_days }}</td>
|
||||
<td class="tb-col">{{ $item->overtime }}</td>
|
||||
<td class="tb-col">{{ $item->food_allowance }}</td>
|
||||
<td class="tb-col">{{ $item->transport_allowance }}</td>
|
||||
<td class="tb-col">{{ $item->accomodation_allowance }}</td>
|
||||
<td class="tb-col">{{ $item->medical_provided }}</td>
|
||||
<td class="tb-col">{{ $item->insurance_provided }}</td>
|
||||
<td class="tb-col">{{ $item->required_documents }}</td>
|
||||
<td class="tb-col">{{ $item->qualification }}</td>
|
||||
<td class="tb-col">{{ $item->experience }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->image) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->thumb) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->cover) }}</td>
|
||||
<td class="tb-col">{{ myDate($item->postedon) }}</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('jobdemands.show',[$item->job_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('jobdemands.edit',[$item->job_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('jobdemands.destroy',[$item->job_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('jobdemands.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
43
resources/views/crud/generated/jobdemands/show.blade.php
Normal file
43
resources/views/crud/generated/jobdemands/show.blade.php
Normal file
@ -0,0 +1,43 @@
|
||||
@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">
|
||||
<div class="offcanvas-body" data-simplebar>
|
||||
<div class="nk-block-head-content w-100">
|
||||
<div class="d-flex justify-content-between pb-4">
|
||||
|
||||
<h2>{{ label('Jobdemands Details') }}</h2>
|
||||
{{-- <button class="btn btn-primary print_pdf">Print PDF</button> --}}
|
||||
</div>
|
||||
<div class="card w-100">
|
||||
<div class="p-5">
|
||||
|
||||
<div class="card-head">
|
||||
<h2 class="text-center">{{$data['title']}}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Countries Id : </b> <span>{{$data->countries_id}}</span></p><p><b>Companies Id : </b> <span>{{$data->companies_id}}</span></p><p><b>Salary : </b> <span>{{$data->salary}}</span></p><p><b>Required Nos : </b> <span>{{$data->required_nos}}</span></p><p><b>Contract Period : </b> <span>{{$data->contract_period}}</span></p><p><b>Duty Hrs : </b> <span>{{$data->duty_hrs}}</span></p><p><b>Working Days : </b> <span>{{$data->working_days}}</span></p><p><b>Overtime : </b> <span>{{$data->overtime}}</span></p><p><b>Food Allowance : </b> <span>{{$data->food_allowance}}</span></p><p><b>Transport Allowance : </b> <span>{{$data->transport_allowance}}</span></p><p><b>Accomodation Allowance : </b> <span>{{$data->accomodation_allowance}}</span></p><p><b>Medical Provided : </b> <span>{{$data->medical_provided}}</span></p><p><b>Insurance Provided : </b> <span>{{$data->insurance_provided}}</span></p><p><b>Required Documents : </b> <span>{{$data->required_documents}}</span></p><p><b>Qualification : </b> <span>{{$data->qualification}}</span></p><p><b>Experience : </b> <span>{{$data->experience}}</span></p><p><b>Details : </b> <span>{{$data->details}}</span></p><p><b>Image : </b> <span>{{$data->image}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Cover : </b> <span>{{$data->cover}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Postedon : </b> <span>{{$data->postedon}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
130
resources/views/crud/generated/menuitems/create.blade.php
Normal file
130
resources/views/crud/generated/menuitems/create.blade.php
Normal file
@ -0,0 +1,130 @@
|
||||
@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 New Menu</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 New Menu</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<form action="{{route('menuitems.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("title","title","Display Title")}}</div>
|
||||
<div class="col-lg-3">{{createCustomSelect('tbl_menulocations', 'title', 'menulocation_id', ($menulocation)?$menulocation:'', 'Menu Location','menulocations_id', 'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-3">{{createCustomSelectFromArray($menuTypes,"Menu Type","type")}}</div>
|
||||
<div class="col-lg-3">{{createCustomSelect('tbl_menuitems', 'title', 'menu_id', '', 'Sub Menu of (Ignore if it is going as root)','parent_menu', 'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-3" id="ref-container">{{createText("ref","ref","# or Start from / or http:// or https://")}}</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Target</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{createCustomSelectFromArray(array(['display'=>'Self','value'=>"_SELF"],['display'=>'New Tab','value'=>"_BLANK"]),"","target","_SELF")}}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<?php createButton("btn-primary btn-store", "", "Submit"); ?>
|
||||
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('menuitems.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Menu Items</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@include("crud.generated.menuitems.list",[$data=$TableData])
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
@push("js")
|
||||
<script>
|
||||
var firstLevelSelect = document.getElementById('type');
|
||||
var secondLevelContainer = document.getElementById('ref-container');
|
||||
function showRef() {
|
||||
var selectedOption = firstLevelSelect.value;
|
||||
var menuTypes = <?php echo json_encode($menuTypes); ?>;
|
||||
var selectedMenuType = menuTypes.find(function(menuType) {
|
||||
return menuType.value === selectedOption;
|
||||
});
|
||||
secondLevelContainer.innerHTML = '';
|
||||
if (selectedOption == '') {
|
||||
var label = document.createElement('label');
|
||||
label.setAttribute('for', 'ref');
|
||||
label.className = 'form-label col-form-label';
|
||||
label.textContent = '# or Start from / or http:// or https://';
|
||||
secondLevelContainer.appendChild(label);
|
||||
// Create an input element
|
||||
var secondLevelInput = document.createElement('input');
|
||||
secondLevelInput.type = 'text';
|
||||
secondLevelInput.name = 'ref';
|
||||
secondLevelInput.className = 'form-control';
|
||||
secondLevelContainer.appendChild(secondLevelInput);
|
||||
} else {
|
||||
var label = document.createElement('label');
|
||||
label.setAttribute('for', 'ref');
|
||||
label.className = 'form-label col-form-label';
|
||||
label.textContent = 'Ref (Select Reference)';
|
||||
secondLevelContainer.appendChild(label);
|
||||
// Create a select element
|
||||
var secondLevelSelect = document.createElement('select');
|
||||
secondLevelSelect.name = 'ref';
|
||||
secondLevelSelect.className = 'form-select form-control';
|
||||
secondLevelContainer.appendChild(secondLevelSelect);
|
||||
|
||||
// Add the default option
|
||||
var defaultOption = document.createElement('option');
|
||||
defaultOption.value = '';
|
||||
defaultOption.textContent = 'Select Option';
|
||||
secondLevelSelect.appendChild(defaultOption);
|
||||
|
||||
if (selectedMenuType && selectedMenuType.values) {
|
||||
var values = JSON.parse(selectedMenuType.values);
|
||||
values.forEach(function(value) {
|
||||
var option = document.createElement('option');
|
||||
option.value = value.value;
|
||||
option.textContent = value.display;
|
||||
secondLevelSelect.appendChild(option);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
firstLevelSelect.addEventListener('change', function() {
|
||||
showRef();
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
131
resources/views/crud/generated/menuitems/edit.blade.php
Normal file
131
resources/views/crud/generated/menuitems/edit.blade.php
Normal file
@ -0,0 +1,131 @@
|
||||
@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 Header Menu</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 Header Menu</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<form action="{{route('menuitems.update',[$data->menu_id,'menulocation'=>($menulocation)?$menulocation:''])}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("title","title","Display Title",'',$data->title)}}</div>
|
||||
<div class="col-lg-3">{{createCustomSelect('tbl_menulocations', 'title', 'menulocation_id', $data->menulocations_id, 'Menu Location','menulocations_id', 'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-3">{{createCustomSelectFromArray($menuTypes,"Menu Type","type",$data->type,"REQUIRED")}}</div>
|
||||
<div class="col-lg-3">{{createCustomSelect('tbl_menuitems', 'title', 'menu_id', $data->parent_menu, 'Sub Menu of (Ignore if it is going as root)','parent_menu', 'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-3" id="ref-container">{{createText("ref","ref","# or Start from / or http:// or https://",'',$data->ref)}}</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Target</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{createCustomSelectFromArray(array(['display'=>'Self','value'=>"_SELF"],['display'=>'New Tab','value'=>"_BLANK"]),"","target",$data->target)}}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<?php createButton("btn-primary btn-store", "", "Submit"); ?>
|
||||
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('menuitems.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@push("js")
|
||||
<script>
|
||||
// showRef();
|
||||
var firstLevelSelect = document.getElementById('type');
|
||||
var secondLevelContainer = document.getElementById('ref-container');
|
||||
firstLevelSelect.value = '{{$data->type}}';
|
||||
firstLevelSelect.dispatchEvent(new Event('change'));
|
||||
showRef('{{$data->ref}}');
|
||||
function showRef(defaultValue = '') {
|
||||
var selectedOption = firstLevelSelect.value;
|
||||
var menuTypes = <?php echo json_encode($menuTypes); ?>;
|
||||
var selectedMenuType = menuTypes.find(function(menuType) {
|
||||
return menuType.value === selectedOption;
|
||||
});
|
||||
secondLevelContainer.innerHTML = '';
|
||||
if (selectedOption === '') {
|
||||
var label = document.createElement('label');
|
||||
label.setAttribute('for', 'ref');
|
||||
label.className = 'form-label col-form-label';
|
||||
label.textContent = '# or Start from / or http:// or https://';
|
||||
secondLevelContainer.appendChild(label);
|
||||
// Create an input element
|
||||
var secondLevelInput = document.createElement('input');
|
||||
secondLevelInput.type = 'text';
|
||||
secondLevelInput.name = 'ref';
|
||||
secondLevelInput.className = 'form-control';
|
||||
secondLevelContainer.appendChild(secondLevelInput);
|
||||
secondLevelInput.value = defaultValue;
|
||||
} else {
|
||||
var label = document.createElement('label');
|
||||
label.setAttribute('for', 'ref');
|
||||
label.className = 'form-label col-form-label';
|
||||
label.textContent = 'Ref (Select Reference)';
|
||||
secondLevelContainer.appendChild(label);
|
||||
// Create a select element
|
||||
var secondLevelSelect = document.createElement('select');
|
||||
secondLevelSelect.name = 'ref';
|
||||
secondLevelSelect.className = 'form-select form-control';
|
||||
secondLevelContainer.appendChild(secondLevelSelect);
|
||||
|
||||
// Add the default option
|
||||
var defaultOption = document.createElement('option');
|
||||
defaultOption.value = '';
|
||||
defaultOption.textContent = 'Select Option';
|
||||
secondLevelSelect.appendChild(defaultOption);
|
||||
|
||||
if (selectedMenuType && selectedMenuType.values) {
|
||||
var values = JSON.parse(selectedMenuType.values);
|
||||
values.forEach(function(value) {
|
||||
var option = document.createElement('option');
|
||||
option.value = value.value;
|
||||
option.textContent = value.display;
|
||||
secondLevelSelect.appendChild(option);
|
||||
});
|
||||
}
|
||||
secondLevelSelect.value = defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
firstLevelSelect.addEventListener('change', function() {
|
||||
showRef();
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
225
resources/views/crud/generated/menuitems/index.blade.php
Normal file
225
resources/views/crud/generated/menuitems/index.blade.php
Normal 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("Menu Items List") }}</h2>
|
||||
<?php
|
||||
if (null != $menulocation) {
|
||||
?><a href="{{ route('menuitems.create',['menulocation'=>$menulocation]) }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<a href="{{ route('menuitems.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_menuitems" data-url="{{ route('menuitems.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("parent_menu") }}</span></th>
|
||||
<!-- <th class="tb-col"><span class="overline-title">{{ label("menulocations_id") }}</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("type") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("ref") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("target") }}</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->menu_id}}" data-display_order="{{$item->display_order}}" class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_menuitems", "title", "menu_id", $item->parent_menu) !!}
|
||||
</td>
|
||||
<!-- <td class="tb-col">
|
||||
{!! getFieldData("tbl_menulocations", "title", "menulocation_id", $item->menulocations_id) !!}
|
||||
</td> -->
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->menu_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->menu_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->type }}</td>
|
||||
<td class="tb-col">{{ $item->ref }}</td>
|
||||
<td class="tb-col">{{ $item->target }}</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('menuitems.show',[$item->menu_id,'menulocation'=>($menulocation)?$menulocation:''])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('menuitems.edit',[$item->menu_id,'menulocation'=>($menulocation)?$menulocation:''])}}" 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('menuitems.destroy',[$item->menu_id,'menulocation'=>($menulocation)?$menulocation:''])}}" 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/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://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.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('menuitems.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({
|
||||
buttons: [
|
||||
'copy', 'excel', 'pdf'
|
||||
],
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
66
resources/views/crud/generated/menuitems/list.blade.php
Normal file
66
resources/views/crud/generated/menuitems/list.blade.php
Normal file
@ -0,0 +1,66 @@
|
||||
<table class="table dataTable" id="tbl_menuitems" data-url="{{ route('menuitems.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("parent_menu") }}</span></th>
|
||||
<!-- <th class="tb-col"><span class="overline-title">{{ label("menulocations_id") }}</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("type") }}</span></th>
|
||||
<!-- <th class="tb-col"><span class="overline-title">{{ label("ref") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("target") }}</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->menu_id}}" data-display_order="{{$item->display_order}}" class="draggable-row">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_menuitems", "title", "menu_id", $item->parent_menu) !!}
|
||||
</td>
|
||||
<!-- <td class="tb-col">
|
||||
{!! getFieldData("tbl_menulocations", "title", "menulocation_id", $item->menulocations_id) !!}
|
||||
</td> -->
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->menu_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->menu_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->type }}</td>
|
||||
<!-- <td class="tb-col">{{ $item->ref }}</td>
|
||||
<td class="tb-col">{{ $item->target }}</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('menuitems.show',[$item->menu_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('menuitems.edit',[$item->menu_id,'menulocation'=>($menulocation)?$menulocation:''])}}" 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('menuitems.destroy',[$item->menu_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>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user