master crud setup
This commit is contained in:
39
resources/views/crud/form/create.blade.php
Normal file
39
resources/views/crud/form/create.blade.php
Normal file
@ -0,0 +1,39 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="nk-content">
|
||||
<div class="container-fluid">
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<div class="nk-content-inner">
|
||||
<form method="get" action="{{ route('form.store') }}" enctype="multipart/form-data">
|
||||
{{Label('Operation')}}
|
||||
|
||||
{{ customCreateSelect('type', 'type', '', '', ['ajax-curd' => 'Ajax CURD']) }}
|
||||
|
||||
{{Label('Table Name')}}
|
||||
|
||||
{{ customCreateSelect('tableName', 'tableName', 'form-control custom-select2', '', $allTables) }}
|
||||
|
||||
{{Label('Write To')}}
|
||||
|
||||
{{ createText('directoryName', 'directoryName', 'Directory Name') }}
|
||||
<?php createButton('mt-3 btn-primary', '', 'Submit'); ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.custom-select2').select2();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
65
resources/views/crud/form/tables.blade.php
Normal file
65
resources/views/crud/form/tables.blade.php
Normal file
@ -0,0 +1,65 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="nk-content">
|
||||
<div class="container">
|
||||
<div class="nk-content-inner">
|
||||
<div class="nk-content-body">
|
||||
<div class="nk-block-head">
|
||||
<div class="nk-block-head-between flex-wrap gap g-2">
|
||||
<div class="nk-block-head-content">
|
||||
<h2 class="nk-block-title">Tables in Database</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nk-block">
|
||||
<div class="card">
|
||||
<div class="accordion" id="accordionTables">
|
||||
<?php $a = 0; ?>
|
||||
|
||||
@foreach ($allTables as $Table)
|
||||
<?php $a++; ?>
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header"> <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse{{$a}}"> {{$a}}: {{$Table->tablename}} </button> </h2>
|
||||
<div id="collapse{{$a}}" class="accordion-collapse collapse" data-bs-parent="#accordionTables">
|
||||
<div class="accordion-body">
|
||||
<table class="datatable-init table" data-nk-container="table-responsive">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N.</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{__('lang.Column')}}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{label("Datatype")}}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $sn = 0; ?>
|
||||
@foreach($Table->tablecolumns as $column)
|
||||
<tr>
|
||||
<?php $sn++; ?>
|
||||
<td class="tb-col"><span >{{$sn}}</span></td>
|
||||
<td class="tb-col"><span > {{$column->COLUMN_NAME}}</span></td>
|
||||
<td class="tb-col"><span > {{$column->COLUMN_TYPE}}</span></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.custom-select2').select2();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
BIN
resources/views/crud/generated/.DS_Store
vendored
Normal file
BIN
resources/views/crud/generated/.DS_Store
vendored
Normal file
Binary file not shown.
26
resources/views/crud/generated/branches/create.blade.php
Normal file
26
resources/views/crud/generated/branches/create.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 class="">{{ label('Add Branche') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('branches.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('branches.update',[$data->branch_id]):route('branches.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='branch_id' value='{{$editable?$data->branch_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_companies', 'title', 'company_id', $editable?$data->companies_id:'', 'Companies Id','companies_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div><div class="col-lg-6">{{createText("email","email","Email",'',$editable?$data->email:'')}}
|
||||
</div><div class="col-lg-6">{{createText("telephone","telephone","Telephone",'',$editable?$data->telephone:'')}}
|
||||
</div><div class="col-lg-6">{{createText("phone1","phone1","Phone1",'',$editable?$data->phone1:'')}}
|
||||
</div><div class="col-lg-6">{{createText("phone2","phone2","Phone2",'',$editable?$data->phone2:'')}}
|
||||
</div><div class="col-lg-6">{{createText("address","address","Address",'',$editable?$data->address:'')}}
|
||||
</div><div class="col-lg-6">{{createText("company_reg","company_reg","Company Reg",'',$editable?$data->company_reg:'')}}
|
||||
</div><div class="col-lg-6">{{createText("company_pan","company_pan","Company Pan",'',$editable?$data->company_pan:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("logo","Logo",'',$editable?$data->logo:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('branches.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
26
resources/views/crud/generated/branches/edit.blade.php
Normal file
26
resources/views/crud/generated/branches/edit.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 class="">{{ label('Edit Branches') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('branches.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('branches.update',[$data->branch_id]):route('branches.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='branch_id' value='{{$editable?$data->branch_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_companies', 'title', 'company_id', $editable?$data->companies_id:'', 'Companies Id','companies_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div><div class="col-lg-6">{{createText("email","email","Email",'',$editable?$data->email:'')}}
|
||||
</div><div class="col-lg-6">{{createText("telephone","telephone","Telephone",'',$editable?$data->telephone:'')}}
|
||||
</div><div class="col-lg-6">{{createText("phone1","phone1","Phone1",'',$editable?$data->phone1:'')}}
|
||||
</div><div class="col-lg-6">{{createText("phone2","phone2","Phone2",'',$editable?$data->phone2:'')}}
|
||||
</div><div class="col-lg-6">{{createText("address","address","Address",'',$editable?$data->address:'')}}
|
||||
</div><div class="col-lg-6">{{createText("company_reg","company_reg","Company Reg",'',$editable?$data->company_reg:'')}}
|
||||
</div><div class="col-lg-6">{{createText("company_pan","company_pan","Company Pan",'',$editable?$data->company_pan:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("logo","Logo",'',$editable?$data->logo:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('branches.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
289
resources/views/crud/generated/branches/index.blade.php
Normal file
289
resources/views/crud/generated/branches/index.blade.php
Normal file
@ -0,0 +1,289 @@
|
||||
@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("companies") }}</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("telephone") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("phone1") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("phone2") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("address") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("company_reg") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("company_pan") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("logo") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("is_main") }}</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_companies", "title", "company_id", $item->companies_id) !!}
|
||||
</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->email }}</td>
|
||||
<td class="tb-col">{{ $item->telephone }}</td>
|
||||
<td class="tb-col">{{ $item->phone1 }}</td>
|
||||
<td class="tb-col">{{ $item->phone2 }}</td>
|
||||
<td class="tb-col">{{ $item->address }}</td>
|
||||
<td class="tb-col">{{ $item->company_reg }}</td>
|
||||
<td class="tb-col">{{ $item->company_pan }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->logo) }}</td>
|
||||
<td class="tb-col">{{ $item->is_main }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{route('branches.show',[$item->branch_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('branches.edit',[$item->branch_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li>
|
||||
<li>
|
||||
<a href="{{route('branches.toggle',[$item->branch_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('branches.clone',[$item->branch_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', '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>Companies Id : </b> <span>{{$data->companies_id}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Email : </b> <span>{{$data->email}}</span></p><p><b>Telephone : </b> <span>{{$data->telephone}}</span></p><p><b>Phone1 : </b> <span>{{$data->phone1}}</span></p><p><b>Phone2 : </b> <span>{{$data->phone2}}</span></p><p><b>Address : </b> <span>{{$data->address}}</span></p><p><b>Company Reg : </b> <span>{{$data->company_reg}}</span></p><p><b>Company Pan : </b> <span>{{$data->company_pan}}</span></p><p><b>Logo : </b> <span>{{$data->logo}}</span></p><p><b>Is Main : </b> <span>{{$data->is_main}}</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
|
17
resources/views/crud/generated/castes/edit.blade.php
Normal file
17
resources/views/crud/generated/castes/edit.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Caste') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('castes.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('castes.update',[$data->caste_id]):route('castes.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='caste_id' value='{{$editable?$data->caste_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('castes.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
268
resources/views/crud/generated/castes/index.blade.php
Normal file
268
resources/views/crud/generated/castes/index.blade.php
Normal file
@ -0,0 +1,268 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Caste List") }}</h2>
|
||||
<a href="{{ route('castes.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_castes" data-url="{{ route('castes.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" 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->caste_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->caste_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->caste_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('castes.show',[$item->caste_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('castes.edit',[$item->caste_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('castes.toggle',[$item->caste_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('castes.clone',[$item->caste_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('castes.destroy',[$item->caste_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('castes.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/castes/show.blade.php
Normal file
29
resources/views/crud/generated/castes/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('castes.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>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>Display Order : </b> <span>{{$data->display_order}}</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
|
18
resources/views/crud/generated/cities/edit.blade.php
Normal file
18
resources/views/crud/generated/cities/edit.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Cities') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('cities.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('cities.update',[$data->city_id]):route('cities.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='city_id' value='{{$editable?$data->city_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_districts', 'title', 'district_id', $editable?$data->districts_id:'', 'Districts Id','districts_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('cities.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
271
resources/views/crud/generated/cities/index.blade.php
Normal file
271
resources/views/crud/generated/cities/index.blade.php
Normal file
@ -0,0 +1,271 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Cities List") }}</h2>
|
||||
<a href="{{ route('cities.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_cities" data-url="{{ route('cities.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("districts") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span
|
||||
class="overline-title">{{ label("Action") }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
|
||||
<tr data-id="{{$item->city_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">
|
||||
{!! getFieldData("tbl_districts", "title", "district_id", $item->districts_id) !!}
|
||||
</td><td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->city_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->city_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{route('cities.show',[$item->city_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('cities.edit',[$item->city_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li>
|
||||
<li>
|
||||
<a href="{{route('cities.toggle',[$item->city_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('cities.clone',[$item->city_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('cities.destroy',[$item->city_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('cities.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete=false;
|
||||
}
|
||||
});
|
||||
});
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/cities/show.blade.php
Normal file
29
resources/views/crud/generated/cities/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('cities.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Districts Id : </b> <span>{{$data->districts_id}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
19
resources/views/crud/generated/companies/edit.blade.php
Normal file
19
resources/views/crud/generated/companies/edit.blade.php
Normal file
@ -0,0 +1,19 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Company') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('companies.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('companies.update',[$data->company_id]):route('companies.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='company_id' value='{{$editable?$data->company_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div><div class="col-lg-6">{{createText("address","address","Address",'',$editable?$data->address:'')}}
|
||||
</div><div class="col-lg-6">{{createCustomSelect('tbl_cities', 'title', 'city_id', $editable?$data->cities_id:'', 'Cities Id','cities_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_companytypes', 'title', 'companytype_id', $editable?$data->companytypes_id:'', 'Companytypes Id','companytypes_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('companies.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
276
resources/views/crud/generated/companies/index.blade.php
Normal file
276
resources/views/crud/generated/companies/index.blade.php
Normal file
@ -0,0 +1,276 @@
|
||||
@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("address") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("cities") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("companytypes") }}</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 <?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->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->address }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_cities", "title", "city_id", $item->cities_id) !!}
|
||||
</td><td class="tb-col">
|
||||
{!! getFieldData("tbl_companytypes", "title", "companytype_id", $item->companytypes_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('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.toggle',[$item->company_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('companies.clone',[$item->company_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/companies/show.blade.php
Normal file
29
resources/views/crud/generated/companies/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('companies.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>Description : </b> <span>{{$data->description}}</span></p><p><b>Address : </b> <span>{{$data->address}}</span></p><p><b>Cities Id : </b> <span>{{$data->cities_id}}</span></p><p><b>Companytypes Id : </b> <span>{{$data->companytypes_id}}</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
|
18
resources/views/crud/generated/companytypes/edit.blade.php
Normal file
18
resources/views/crud/generated/companytypes/edit.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Company Type') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('companytypes.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('companytypes.update',[$data->companytype_id]):route('companytypes.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='companytype_id' value='{{$editable?$data->companytype_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('companytypes.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
268
resources/views/crud/generated/companytypes/index.blade.php
Normal file
268
resources/views/crud/generated/companytypes/index.blade.php
Normal file
@ -0,0 +1,268 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Company Type List") }}</h2>
|
||||
<a href="{{ route('companytypes.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_companytypes" data-url="{{ route('companytypes.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" 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->companytype_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->companytype_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->companytype_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('companytypes.show',[$item->companytype_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('companytypes.edit',[$item->companytype_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('companytypes.toggle',[$item->companytype_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('companytypes.clone',[$item->companytype_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('companytypes.destroy',[$item->companytype_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('companytypes.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/companytypes/show.blade.php
Normal file
29
resources/views/crud/generated/companytypes/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('companytypes.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>Description : </b> <span>{{$data->description}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
34
resources/views/crud/generated/countries/create.blade.php
Normal file
34
resources/views/crud/generated/countries/create.blade.php
Normal file
@ -0,0 +1,34 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">Add Country</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">Add Country</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{route('countries.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
|
||||
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
|
||||
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
<?php createButton("btn-danger btn-cancel","","Cancel",route('countries.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
39
resources/views/crud/generated/countries/edit.blade.php
Normal file
39
resources/views/crud/generated/countries/edit.blade.php
Normal file
@ -0,0 +1,39 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">Edit Country </h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">Edit Country </li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{route('countries.update',[$data->country_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='country_id' value='{{$data->country_id}}'/>
|
||||
<div class='card'>
|
||||
|
||||
<div class='card-body'>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("title","title","Title",'',$data->title)}}</div>
|
||||
<div class="col-lg-12 pb-4">{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}</div>
|
||||
<div class="border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$data->remarks)}}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="col-md-12"><?php createButton("btn-primary btn-update","","Update"); ?>
|
||||
<?php createButton("btn-danger btn-cancel","","Cancel",route('countries.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
241
resources/views/crud/generated/countries/index.blade.php
Normal file
241
resources/views/crud/generated/countries/index.blade.php
Normal file
@ -0,0 +1,241 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<form action="{{route('countries.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class='card'>
|
||||
<div class="card-header">
|
||||
<h2 class="card-title mb-0">Add Country</h2>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
|
||||
<div class="border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-3">{{createTextarea("description","description ","Description")}}</div>
|
||||
<div class="border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="col-md-12">
|
||||
<?php createButton("btn-primary btn-store", "", "Submit");?>
|
||||
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('countries.index'));?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2 class="card-title mb-0">{{ label("Countries List") }}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_countries" data-url="{{ route('countries.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th>
|
||||
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th>
|
||||
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th>
|
||||
<th class="tb-col text-uppercase" data-sortable="false"><span
|
||||
class="overline-title">{{ label("Action") }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
<tr data-id="{{$item->country_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status == 0) ? "bg-light bg-danger" : ""; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->country_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->country_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{route('countries.show',[$item->country_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('countries.edit',[$item->country_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li>
|
||||
<li>
|
||||
<a href="{{route('countries.toggle',[$item->country_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('countries.destroy',[$item->country_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('countries.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
var isRowReorderComplete = false;
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete=false;
|
||||
}
|
||||
});
|
||||
});
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
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>Description : </b> <span>{{$data->description}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
17
resources/views/crud/generated/dags/edit.blade.php
Normal file
17
resources/views/crud/generated/dags/edit.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Dags') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('dags.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('dags.update',[$data->dag_id]):route('dags.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='dag_id' value='{{$editable?$data->dag_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('dags.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
268
resources/views/crud/generated/dags/index.blade.php
Normal file
268
resources/views/crud/generated/dags/index.blade.php
Normal file
@ -0,0 +1,268 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Dags List") }}</h2>
|
||||
<a href="{{ route('dags.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_dags" data-url="{{ route('dags.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" 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->dag_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->dag_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->dag_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('dags.show',[$item->dag_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('dags.edit',[$item->dag_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('dags.toggle',[$item->dag_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('dags.clone',[$item->dag_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('dags.destroy',[$item->dag_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('dags.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/dags/show.blade.php
Normal file
29
resources/views/crud/generated/dags/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('dags.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>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>Display Order : </b> <span>{{$data->display_order}}</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
|
18
resources/views/crud/generated/departments/edit.blade.php
Normal file
18
resources/views/crud/generated/departments/edit.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Department') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('departments.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('departments.update',[$data->department_id]):route('departments.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='department_id' value='{{$editable?$data->department_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div><div class="col-lg-6">{{createCustomSelect('tbl_branches', 'title', 'branch_id', $editable?$data->branches_id:'', 'Branches Id','branches_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('departments.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
271
resources/views/crud/generated/departments/index.blade.php
Normal file
271
resources/views/crud/generated/departments/index.blade.php
Normal file
@ -0,0 +1,271 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Departments List") }}</h2>
|
||||
<a href="{{ route('departments.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_departments" data-url="{{ route('departments.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("branches") }}</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->department_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->department_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->department_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_branches", "title", "branch_id", $item->branches_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('departments.show',[$item->department_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('departments.edit',[$item->department_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('departments.toggle',[$item->department_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('departments.clone',[$item->department_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('departments.destroy',[$item->department_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('departments.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/departments/show.blade.php
Normal file
29
resources/views/crud/generated/departments/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('departments.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>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>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><p><b>Branches Id : </b> <span>{{$data->branches_id}}</span></p><p><b>Description : </b> <span>{{$data->description}}</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
|
18
resources/views/crud/generated/designations/edit.blade.php
Normal file
18
resources/views/crud/generated/designations/edit.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Designations') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('designations.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('designations.update',[$data->designation_id]):route('designations.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='designation_id' value='{{$editable?$data->designation_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div><div class="col-lg-6">{{createText("job_description","job_description","Job Description",'',$editable?$data->job_description:'')}}
|
||||
</div><div class="col-lg-6">{{createCustomSelect('tbl_departments', 'title', 'department_id', $editable?$data->departments_id:'', 'Departments Id','departments_id', 'form-control select2','status<>-1')}}</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('designations.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
273
resources/views/crud/generated/designations/index.blade.php
Normal file
273
resources/views/crud/generated/designations/index.blade.php
Normal file
@ -0,0 +1,273 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Designations List") }}</h2>
|
||||
<a href="{{ route('designations.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_designations" data-url="{{ route('designations.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("job_description") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("departments") }}</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->designation_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->designation_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->designation_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->job_description }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_departments", "title", "department_id", $item->departments_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('designations.show',[$item->designation_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('designations.edit',[$item->designation_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('designations.toggle',[$item->designation_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('designations.clone',[$item->designation_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('designations.destroy',[$item->designation_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('designations.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/designations/show.blade.php
Normal file
29
resources/views/crud/generated/designations/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('designations.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>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>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><p><b>Job Description : </b> <span>{{$data->job_description}}</span></p><p><b>Departments Id : </b> <span>{{$data->departments_id}}</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
|
18
resources/views/crud/generated/districts/edit.blade.php
Normal file
18
resources/views/crud/generated/districts/edit.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Districts') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('districts.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('districts.update',[$data->district_id]):route('districts.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='district_id' value='{{$editable?$data->district_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_proviences', 'title', 'provience_id', $editable?$data->proviences_id:'', 'Proviences Id','proviences_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('districts.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
271
resources/views/crud/generated/districts/index.blade.php
Normal file
271
resources/views/crud/generated/districts/index.blade.php
Normal file
@ -0,0 +1,271 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Districts List") }}</h2>
|
||||
<a href="{{ route('districts.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_districts" data-url="{{ route('districts.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("proviences") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span
|
||||
class="overline-title">{{ label("Action") }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
|
||||
<tr data-id="{{$item->district_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">
|
||||
{!! getFieldData("tbl_proviences", "title", "provience_id", $item->proviences_id) !!}
|
||||
</td><td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->district_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->district_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{route('districts.show',[$item->district_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('districts.edit',[$item->district_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li>
|
||||
<li>
|
||||
<a href="{{route('districts.toggle',[$item->district_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('districts.clone',[$item->district_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('districts.destroy',[$item->district_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('districts.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete=false;
|
||||
}
|
||||
});
|
||||
});
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/districts/show.blade.php
Normal file
29
resources/views/crud/generated/districts/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('districts.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Proviences Id : </b> <span>{{$data->proviences_id}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
129
resources/views/crud/generated/employees/edit.blade.php
Normal file
129
resources/views/crud/generated/employees/edit.blade.php
Normal file
@ -0,0 +1,129 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Employees') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('employees.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('employees.update',[$data->employee_id]):route('employees.store')}}"
|
||||
id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='employee_id' value='{{$editable?$data->employee_id:''}}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{createText("first_name","first_name","First
|
||||
Name",'',$editable?$data->first_name:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("middle_name","middle_name","Middle
|
||||
Name",'',$editable?$data->middle_name:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("last_name","last_name","Last
|
||||
Name",'',$editable?$data->last_name:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("email","email","Email",'',$editable?$data->email:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_genders', 'title', 'gender_id',
|
||||
$editable?$data->genders_id:'', 'Genders Id','genders_id', 'form-control
|
||||
select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{createText("nepali_dob","nepali_dob","Nepali
|
||||
Dob",'',$editable?$data->nepali_dob:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6 pb-2">{{createDate("dob","Dob",'',$editable?$data->dob:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_nationalities', 'title',
|
||||
'nationality_id', $editable?$data->nationalities_id:'', 'Nationalities
|
||||
Id','nationalities_id', 'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{createText("about_me","about_me","About
|
||||
Me",'',$editable?$data->about_me:'')}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{createImageInput("signature","Signature",'',$editable?$data->signature:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("father_name","father_name","Father
|
||||
Name",'',$editable?$data->father_name:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("mother_name","mother_name","Mother
|
||||
Name",'',$editable?$data->mother_name:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("grand_father_name","grand_father_name","Grand Father
|
||||
Name",'',$editable?$data->grand_father_name:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("grand_mother_name","grand_mother_name","Grand Mother
|
||||
Name",'',$editable?$data->grand_mother_name:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("spouse","spouse","Spouse",'',$editable?$data->spouse:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("contact","contact","Contact",'',$editable?$data->contact:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("alt_contact","alt_contact","Alt
|
||||
Contact",'',$editable?$data->alt_contact:'')}}
|
||||
|
||||
</div>
|
||||
<div class="col-lg-6 pb-2">{{createImageInput("profile_picture","Profile
|
||||
Picture",'',$editable?$data->profile_picture:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_users', 'name', 'id',
|
||||
$editable?$data->users_id:'', 'Users Id','users_id', 'form-control
|
||||
select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{createText("is_login_required","is_login_required","Is Login
|
||||
Required",'',$editable?$data->is_login_required:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("skills","skills","Skills",'',$editable?$data->skills:'')}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{createTextarea("experience","experience
|
||||
ckeditor-classic","Experience",$editable?$data->experience:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("permanent_address","permanent_address","Permanent
|
||||
Address",'',$editable?$data->permanent_address:'')}}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_cities', 'title', 'city_id',
|
||||
$editable?$data->permanent_city:'', 'Permanent
|
||||
City','permanent_city', 'form-control
|
||||
select2','status<>-1')}}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">{{createText("temporary_address","temporary_address","Temporary
|
||||
Address",'',$editable?$data->temporary_address:'')}}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_cities', 'title', 'city_id',
|
||||
$editable?$data->temporary_city:'', 'Temporary
|
||||
City','temporary_city', 'form-control
|
||||
select2','status<>-1')}}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">{{createText("old_system_address","old_system_address","Old System
|
||||
Address",'',$editable?$data->old_system_address:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("education","education","Education",'',$editable?$data->education:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_castes', 'title', 'caste_id',
|
||||
$editable?$data->castes_id:'', 'Castes Id','castes_id', 'form-control
|
||||
select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_ethnicities', 'title', 'ethnicity_id',
|
||||
$editable?$data->ethnicities_id:'', 'Ethnicities Id','ethnicities_id',
|
||||
'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_dags', 'title', 'dag_id',
|
||||
$editable?$data->dags_id:'', 'Dags Id','dags_id', 'form-control select2','status
|
||||
<>-1')}}</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('employees.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
336
resources/views/crud/generated/employees/index.blade.php
Normal file
336
resources/views/crud/generated/employees/index.blade.php
Normal file
@ -0,0 +1,336 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Employees List") }}</h2>
|
||||
<a href="{{ route('employees.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_employees" data-url="{{ route('employees.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("first_name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("middle_name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("last_name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("email") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("genders") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("nepali_dob") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("dob") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("nationalities") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("about_me") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("signature") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("father_name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("mother_name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("grand_father_name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("grand_mother_name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("spouse") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("contact") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("alt_contact") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("profile_picture") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("users") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("is_login_required") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("skills") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("experience") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("permanent_address") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("permanent_city") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("temporary_address") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("temporary_city") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("old_system_address") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("education") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("castes") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("ethnicities") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("dags") }}</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->employee_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->first_name }}</td>
|
||||
<td class="tb-col">{{ $item->middle_name }}</td>
|
||||
<td class="tb-col">{{ $item->last_name }}</td>
|
||||
<td class="tb-col">{{ $item->email }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_genders", "title", "gender_id", $item->genders_id) !!}
|
||||
</td><td class="tb-col">{{ $item->nepali_dob }}</td>
|
||||
<td class="tb-col">{{ myDate($item->dob) }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_nationalities", "title", "nationality_id", $item->nationalities_id) !!}
|
||||
</td><td class="tb-col">{{ $item->about_me }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->signature) }}</td>
|
||||
<td class="tb-col">{{ $item->father_name }}</td>
|
||||
<td class="tb-col">{{ $item->mother_name }}</td>
|
||||
<td class="tb-col">{{ $item->grand_father_name }}</td>
|
||||
<td class="tb-col">{{ $item->grand_mother_name }}</td>
|
||||
<td class="tb-col">{{ $item->spouse }}</td>
|
||||
<td class="tb-col">{{ $item->contact }}</td>
|
||||
<td class="tb-col">{{ $item->alt_contact }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->profile_picture) }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_users", "name", "id", $item->users_id) !!}
|
||||
</td><td class="tb-col">{{ $item->is_login_required }}</td>
|
||||
<td class="tb-col">{{ $item->skills }}</td>
|
||||
<td class="tb-col">{{ $item->experience }}</td>
|
||||
<td class="tb-col">{{ $item->permanent_address }}</td>
|
||||
<td class="tb-col">{{ $item->permanent_city }}</td>
|
||||
<td class="tb-col">{{ $item->temporary_address }}</td>
|
||||
<td class="tb-col">{{ $item->temporary_city }}</td>
|
||||
<td class="tb-col">{{ $item->old_system_address }}</td>
|
||||
<td class="tb-col">{{ $item->education }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_castes", "title", "caste_id", $item->castes_id) !!}
|
||||
</td><td class="tb-col">
|
||||
{!! getFieldData("tbl_ethnicities", "title", "ethnicity_id", $item->ethnicities_id) !!}
|
||||
</td><td class="tb-col">
|
||||
{!! getFieldData("tbl_dags", "title", "dag_id", $item->dags_id) !!}
|
||||
</td><td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->employee_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->employee_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('employees.show',[$item->employee_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('employees.edit',[$item->employee_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('employees.toggle',[$item->employee_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('employees.clone',[$item->employee_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('employees.destroy',[$item->employee_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('employees.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/employees/show.blade.php
Normal file
29
resources/views/crud/generated/employees/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('employees.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>First Name : </b> <span>{{$data->first_name}}</span></p><p><b>Middle Name : </b> <span>{{$data->middle_name}}</span></p><p><b>Last Name : </b> <span>{{$data->last_name}}</span></p><p><b>Email : </b> <span>{{$data->email}}</span></p><p><b>Genders Id : </b> <span>{{$data->genders_id}}</span></p><p><b>Nepali Dob : </b> <span>{{$data->nepali_dob}}</span></p><p><b>Dob : </b> <span>{{$data->dob}}</span></p><p><b>Nationalities Id : </b> <span>{{$data->nationalities_id}}</span></p><p><b>About Me : </b> <span>{{$data->about_me}}</span></p><p><b>Signature : </b> <span>{{$data->signature}}</span></p><p><b>Father Name : </b> <span>{{$data->father_name}}</span></p><p><b>Mother Name : </b> <span>{{$data->mother_name}}</span></p><p><b>Grand Father Name : </b> <span>{{$data->grand_father_name}}</span></p><p><b>Grand Mother Name : </b> <span>{{$data->grand_mother_name}}</span></p><p><b>Spouse : </b> <span>{{$data->spouse}}</span></p><p><b>Contact : </b> <span>{{$data->contact}}</span></p><p><b>Alt Contact : </b> <span>{{$data->alt_contact}}</span></p><p><b>Profile Picture : </b> <span>{{$data->profile_picture}}</span></p><p><b>Users Id : </b> <span>{{$data->users_id}}</span></p><p><b>Is Login Required : </b> <span>{{$data->is_login_required}}</span></p><p><b>Skills : </b> <span>{{$data->skills}}</span></p><p><b>Experience : </b> <span>{{$data->experience}}</span></p><p><b>Permanent Address : </b> <span>{{$data->permanent_address}}</span></p><p><b>Permanent City : </b> <span>{{$data->permanent_city}}</span></p><p><b>Temporary Address : </b> <span>{{$data->temporary_address}}</span></p><p><b>Temporary City : </b> <span>{{$data->temporary_city}}</span></p><p><b>Old System Address : </b> <span>{{$data->old_system_address}}</span></p><p><b>Education : </b> <span>{{$data->education}}</span></p><p><b>Castes Id : </b> <span>{{$data->castes_id}}</span></p><p><b>Ethnicities Id : </b> <span>{{$data->ethnicities_id}}</span></p><p><b>Dags Id : </b> <span>{{$data->dags_id}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</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>
|
||||
|
||||
@endSection
|
17
resources/views/crud/generated/ethnicities/edit.blade.php
Normal file
17
resources/views/crud/generated/ethnicities/edit.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Ethnicities') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('ethnicities.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('ethnicities.update',[$data->ethnicity_id]):route('ethnicities.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='ethnicity_id' value='{{$editable?$data->ethnicity_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('ethnicities.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
268
resources/views/crud/generated/ethnicities/index.blade.php
Normal file
268
resources/views/crud/generated/ethnicities/index.blade.php
Normal file
@ -0,0 +1,268 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Ethnicities List") }}</h2>
|
||||
<a href="{{ route('ethnicities.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_ethnicities" data-url="{{ route('ethnicities.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" 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->ethnicity_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->ethnicity_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->ethnicity_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('ethnicities.show',[$item->ethnicity_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('ethnicities.edit',[$item->ethnicity_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('ethnicities.toggle',[$item->ethnicity_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('ethnicities.clone',[$item->ethnicity_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('ethnicities.destroy',[$item->ethnicity_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('ethnicities.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/ethnicities/show.blade.php
Normal file
29
resources/views/crud/generated/ethnicities/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('ethnicities.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>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>Display Order : </b> <span>{{$data->display_order}}</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
|
17
resources/views/crud/generated/genders/edit.blade.php
Normal file
17
resources/views/crud/generated/genders/edit.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Genders') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('genders.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('genders.update',[$data->gender_id]):route('genders.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='gender_id' value='{{$editable?$data->gender_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('genders.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
268
resources/views/crud/generated/genders/index.blade.php
Normal file
268
resources/views/crud/generated/genders/index.blade.php
Normal file
@ -0,0 +1,268 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Genders List") }}</h2>
|
||||
<a href="{{ route('genders.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_genders" data-url="{{ route('genders.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" 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->gender_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->gender_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->gender_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('genders.show',[$item->gender_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('genders.edit',[$item->gender_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('genders.toggle',[$item->gender_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('genders.clone',[$item->gender_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('genders.destroy',[$item->gender_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('genders.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/genders/show.blade.php
Normal file
29
resources/views/crud/generated/genders/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('genders.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>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>Display Order : </b> <span>{{$data->display_order}}</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
|
17
resources/views/crud/generated/leaves/edit.blade.php
Normal file
17
resources/views/crud/generated/leaves/edit.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Leaves') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('leaves.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('leaves.update',[$data->leave_id]):route('leaves.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='leave_id' value='{{$editable?$data->leave_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div><div class="col-lg-6">{{createCustomSelect('tbl_leavetypes', 'title', 'leavetype_id', $editable?$data->leavetypes_id:'', 'Leavetypes Id','leavetypes_id', 'form-control select2','status<>-1')}}</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('leaves.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
271
resources/views/crud/generated/leaves/index.blade.php
Normal file
271
resources/views/crud/generated/leaves/index.blade.php
Normal file
@ -0,0 +1,271 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Leaves List") }}</h2>
|
||||
<a href="{{ route('leaves.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_leaves" data-url="{{ route('leaves.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("leavetypes") }}</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->leave_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->leave_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->leave_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_leavetypes", "title", "leavetype_id", $item->leavetypes_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('leaves.show',[$item->leave_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('leaves.edit',[$item->leave_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('leaves.toggle',[$item->leave_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('leaves.clone',[$item->leave_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('leaves.destroy',[$item->leave_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('leaves.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/leaves/show.blade.php
Normal file
29
resources/views/crud/generated/leaves/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('leaves.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>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>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><p><b>Leavetypes Id : </b> <span>{{$data->leavetypes_id}}</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
|
17
resources/views/crud/generated/leavetypes/edit.blade.php
Normal file
17
resources/views/crud/generated/leavetypes/edit.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Leavetypes') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('leavetypes.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('leavetypes.update',[$data->leavetype_id]):route('leavetypes.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='leavetype_id' value='{{$editable?$data->leavetype_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('leavetypes.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
268
resources/views/crud/generated/leavetypes/index.blade.php
Normal file
268
resources/views/crud/generated/leavetypes/index.blade.php
Normal file
@ -0,0 +1,268 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Leavetypes List") }}</h2>
|
||||
<a href="{{ route('leavetypes.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_leavetypes" data-url="{{ route('leavetypes.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" 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->leavetype_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->leavetype_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->leavetype_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('leavetypes.show',[$item->leavetype_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('leavetypes.edit',[$item->leavetype_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('leavetypes.toggle',[$item->leavetype_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('leavetypes.clone',[$item->leavetype_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('leavetypes.destroy',[$item->leavetype_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('leavetypes.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/leavetypes/show.blade.php
Normal file
29
resources/views/crud/generated/leavetypes/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('leavetypes.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>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>Display Order : </b> <span>{{$data->display_order}}</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
|
17
resources/views/crud/generated/nationalities/edit.blade.php
Normal file
17
resources/views/crud/generated/nationalities/edit.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Nationalities') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('nationalities.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('nationalities.update',[$data->nationality_id]):route('nationalities.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='nationality_id' value='{{$editable?$data->nationality_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('nationalities.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
268
resources/views/crud/generated/nationalities/index.blade.php
Normal file
268
resources/views/crud/generated/nationalities/index.blade.php
Normal file
@ -0,0 +1,268 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Nationalities List") }}</h2>
|
||||
<a href="{{ route('nationalities.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_nationalities" data-url="{{ route('nationalities.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" 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->nationality_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->nationality_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->nationality_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('nationalities.show',[$item->nationality_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('nationalities.edit',[$item->nationality_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('nationalities.toggle',[$item->nationality_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('nationalities.clone',[$item->nationality_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('nationalities.destroy',[$item->nationality_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('nationalities.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/nationalities/show.blade.php
Normal file
29
resources/views/crud/generated/nationalities/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('nationalities.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>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>Display Order : </b> <span>{{$data->display_order}}</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
|
58
resources/views/crud/generated/onboardings/edit.blade.php
Normal file
58
resources/views/crud/generated/onboardings/edit.blade.php
Normal file
@ -0,0 +1,58 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Onboardings') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('onboardings.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('onboardings.update',[$data->onboarding_id]):route('onboardings.store')}}"
|
||||
id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='onboarding_id' value='{{$editable?$data->onboarding_id:''}}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-6 pb-2">{{createDate("doj","Doj",'',$editable?$data->doj:'')}}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_designations', 'title',
|
||||
'designation_id', $editable?$data->designations_id:'', 'Designations
|
||||
Id','designations_id', 'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{createText("position_status","position_status","Position
|
||||
Status",'',$editable?$data->position_status:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_departments', 'title', 'department_id',
|
||||
$editable?$data->departments_id:'', 'Departments Id','departments_id',
|
||||
'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_shifts', 'title', 'shift_id',
|
||||
$editable?$data->shifts_id:'', 'Shifts Id','shifts_id', 'form-control
|
||||
select2','status<>-1')}}
|
||||
|
||||
<!-- </div><div class="col-lg-6">{{createText("agreement","agreement","Agreement",'',$editable?$data->agreement:'')}} -->
|
||||
</div>
|
||||
<div class="col-lg-6 pb-2">
|
||||
{{createImageInput("agreement","Agreement",'',$editable?$data->agreement:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6 pb-2">{{createImageInput("nda","Nda",'',$editable?$data->nda:'')}}
|
||||
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("terms","terms","Terms",'',$editable?$data->terms:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("workoptions","workoptions","Workoptions",'',$editable?$data->workoptions:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('onboardings.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
291
resources/views/crud/generated/onboardings/index.blade.php
Normal file
291
resources/views/crud/generated/onboardings/index.blade.php
Normal file
@ -0,0 +1,291 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Onboardings List") }}</h2>
|
||||
<a href="{{ route('onboardings.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_onboardings" data-url="{{ route('onboardings.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("doj") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("designations") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("position_status") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("departments") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("shifts") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("agreement") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("nda") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("terms") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("workoptions") }}</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->onboarding_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->doj }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_designations", "title", "designation_id", $item->designations_id) !!}
|
||||
</td><td class="tb-col">{{ $item->position_status }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_departments", "title", "department_id", $item->departments_id) !!}
|
||||
</td><td class="tb-col">
|
||||
{!! getFieldData("tbl_shifts", "title", "shift_id", $item->shifts_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->agreement) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->nda) }}</td>
|
||||
|
||||
<td class="tb-col">{{ $item->terms }}</td>
|
||||
<td class="tb-col">{{ $item->workoptions }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->onboarding_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->onboarding_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('onboardings.show',[$item->onboarding_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('onboardings.edit',[$item->onboarding_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('onboardings.toggle',[$item->onboarding_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('onboardings.clone',[$item->onboarding_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('onboardings.destroy',[$item->onboarding_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('onboardings.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/onboardings/show.blade.php
Normal file
29
resources/views/crud/generated/onboardings/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('onboardings.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Doj : </b> <span>{{$data->doj}}</span></p><p><b>Designations Id : </b> <span>{{$data->designations_id}}</span></p><p><b>Position Status : </b> <span>{{$data->position_status}}</span></p><p><b>Departments Id : </b> <span>{{$data->departments_id}}</span></p><p><b>Shifts Id : </b> <span>{{$data->shifts_id}}</span></p><p><b>Agreement : </b> <span>{{$data->agreement}}</span></p><p><b>Nda : </b> <span>{{$data->nda}}</span></p><p><b>Terms : </b> <span>{{$data->terms}}</span></p><p><b>Workoptions : </b> <span>{{$data->workoptions}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</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>Display Order : </b> <span>{{$data->display_order}}</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
|
18
resources/views/crud/generated/permissions/edit.blade.php
Normal file
18
resources/views/crud/generated/permissions/edit.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Permissions') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('permissions.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('permissions.update',[$data->permission_id]):route('permissions.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='permission_id' value='{{$editable?$data->permission_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-6">{{createText("modal","modal","Modal",'',$editable?$data->modal:'')}}
|
||||
</div><div class="col-lg-6">{{createText("command","command","Command",'',$editable?$data->command:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('permissions.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
272
resources/views/crud/generated/permissions/index.blade.php
Normal file
272
resources/views/crud/generated/permissions/index.blade.php
Normal file
@ -0,0 +1,272 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Permissions List") }}</h2>
|
||||
<a href="{{ route('permissions.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_permissions" data-url="{{ route('permissions.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("modal") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("command") }}</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->permission_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->permission_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->permission_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->modal }}</td>
|
||||
<td class="tb-col">{{ $item->command }}</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('permissions.show',[$item->permission_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('permissions.edit',[$item->permission_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('permissions.toggle',[$item->permission_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('permissions.clone',[$item->permission_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('permissions.destroy',[$item->permission_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('permissions.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/permissions/show.blade.php
Normal file
29
resources/views/crud/generated/permissions/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('permissions.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>Modal : </b> <span>{{$data->modal}}</span></p><p><b>Command : </b> <span>{{$data->command}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</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
|
18
resources/views/crud/generated/proviences/edit.blade.php
Normal file
18
resources/views/crud/generated/proviences/edit.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Proviences') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('proviences.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('proviences.update',[$data->provience_id]):route('proviences.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='provience_id' value='{{$editable?$data->provience_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_countries', 'title', 'country_id', $editable?$data->countries_id:'', 'Countries Id','countries_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('proviences.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
324
resources/views/crud/generated/proviences/index.blade.php
Normal file
324
resources/views/crud/generated/proviences/index.blade.php
Normal file
@ -0,0 +1,324 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-4">
|
||||
<form action="{{route('proviences.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Proviences') }}</h2>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
<div class="row">
|
||||
<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">{{createText("title","title","Title")}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{createTextarea("description","description ","Description")}}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="col-md-12"><?php createButton("btn-primary btn-update", "", "Submit"); ?>
|
||||
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('proviences.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="col-xl-8">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Proviences List") }}</h2>
|
||||
<a href="{{ route('proviences.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_proviences" data-url="{{ route('proviences.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("countries") }}</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->provience_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_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->provience_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->provience_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('proviences.show',[$item->provience_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('proviences.edit',[$item->provience_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('proviences.toggle',[$item->provience_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('proviences.clone',[$item->provience_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('proviences.destroy',[$item->provience_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('proviences.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
29
resources/views/crud/generated/proviences/show.blade.php
Normal file
29
resources/views/crud/generated/proviences/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('proviences.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>Description : </b> <span>{{$data->description}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
@ -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 Rolepermissions') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('rolepermissions.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('rolepermissions.update',[$data->rolepermission_id]):route('rolepermissions.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='rolepermission_id' value='{{$editable?$data->rolepermission_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_roles', 'title', 'role_id', $editable?$data->roles_id:'', 'Roles Id','roles_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_permissions', 'title', 'permission_id', $editable?$data->permissions_id:'', 'Permissions Id','permissions_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('rolepermissions.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
189
resources/views/crud/generated/rolepermissions/index.blade.php
Normal file
189
resources/views/crud/generated/rolepermissions/index.blade.php
Normal file
@ -0,0 +1,189 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Rolepermissions List") }}</h2>
|
||||
<a href="{{ route('rolepermissions.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@foreach($PermissionGroups as $PermissionGroup)
|
||||
<div class="row">
|
||||
@foreach($PermissionGroup->Commands as $Permission)
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="permission_{{$Permission->permission_id}}">{{$Permission->title}}</label>
|
||||
<input type="checkbox" name="permission_{{$Permission->permission_id}}" id="permission_{{$Permission->permission_id}}" />
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endforeach
|
||||
<table class="table dataTable" id="tbl_rolepermissions" data-url="{{ route('rolepermissions.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("roles") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("permissions") }}</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->rolepermission_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_roles", "title", "role_id", $item->roles_id) !!}
|
||||
</td><td class="tb-col">
|
||||
{!! getFieldData("tbl_permissions", "title", "permission_id", $item->permissions_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('rolepermissions.show',[$item->rolepermission_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('rolepermissions.edit',[$item->rolepermission_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('rolepermissions.toggle',[$item->rolepermission_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('rolepermissions.clone',[$item->rolepermission_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('rolepermissions.destroy',[$item->rolepermission_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('rolepermissions.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;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</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('rolepermissions.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Roles Id : </b> <span>{{$data->roles_id}}</span></p><p><b>Permissions Id : </b> <span>{{$data->permissions_id}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</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><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</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
|
25
resources/views/crud/generated/roles/edit.blade.php
Normal file
25
resources/views/crud/generated/roles/edit.blade.php
Normal file
@ -0,0 +1,25 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Role') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel", "", "Cancel", route('roles.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('roles.update',[$data->role_id]):route('roles.store')}}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='role_id' value='{{$editable?$data->role_id:''}}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton("btn-primary btn-update", "", "Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel", "", "Cancel", route('roles.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
301
resources/views/crud/generated/roles/index.blade.php
Normal file
301
resources/views/crud/generated/roles/index.blade.php
Normal file
@ -0,0 +1,301 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<form action="{{route('roles.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Role') }}</h2>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("title","title","Title",)}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{createTextarea("description","description ","Description")}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="col-md-12"><?php createButton("btn-primary btn-update", "", "Submit"); ?>
|
||||
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('roles.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Roles List") }}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_roles" data-url="{{ route('roles.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" 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->role_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->role_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->role_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('roles.show',[$item->role_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('roles.edit',[$item->role_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('roles.toggle',[$item->role_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('roles.clone',[$item->role_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('roles.destroy',[$item->role_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('roles.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
29
resources/views/crud/generated/roles/show.blade.php
Normal file
29
resources/views/crud/generated/roles/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('roles.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>Description : </b> <span>{{$data->description}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
40
resources/views/crud/generated/settings/create.blade.php
Normal file
40
resources/views/crud/generated/settings/create.blade.php
Normal file
@ -0,0 +1,40 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Settings') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('settings.index')); ?>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('settings.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}
|
||||
</div><div class="col-l g-6">{{ createText("url1","url1","Url1")}}
|
||||
</div><div class="col-lg-6">{{createText("url2","url2","Url2")}}
|
||||
</div><div class="col-lg-6">{{createText("email","email","Email")}}
|
||||
</div><div class="col-l g-6">{{ createText("phone","phone","Phone")}}
|
||||
</div><div class="col-lg-6">{{createText("secondary_phone","secondary_phone","Secondary Phone")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("google_map","google_map ","Google Map")}}
|
||||
</div><div class="col-lg -6">{{createText("fb","fb","Fb")}}
|
||||
</div><div class="col-lg-6">{{createText("insta","insta","Insta")}}
|
||||
</div><div class="col-lg-6">{{createText("twitter","twitter","Twitter")}}
|
||||
</div><div class="col-lg -6">{{createText("tiktok","tiktok","Tiktok")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("primary_logo","Primary Logo")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("secondary_logo","Secondary Logo")}}
|
||||
</div><div class="col-lg-12 pb-2"> {{createImageInput ("thumb","Thumb")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("icon","Icon")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput("og_image","Og Image")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createImageInput ("no_image","No Image")}}
|
||||
</div><div class="col-lg-6">{{createText("copyright_text","copyright_text","Copyright Text")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("content1","content1 ckeditor-classic","Content1")}}
|
||||
</div><div class="col -lg-1 2 pb-2">{{createTextarea("content2","content2 ckeditor-classic","Content2")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("content3","content3 ckeditor-classic","Content3")}}
|
||||
</div><div class="col-lg-6">{{createText("seo_title","seo_title","Seo Title")}}
|
||||
</div><div class="col-lg -12 pb-2 ">{{createPlainTextArea("seo_description","seo_description ","Seo Description")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("seo_keywords","seo_keywords ","Seo Keywords")}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("og_tags","og_tags ","Og Tags")}}
|
||||
</div> <br> <div class="co l-md-12">< ?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('settings.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@end section
|
154
resources/views/crud/generated/settings/edit.blade.php
Normal file
154
resources/views/crud/generated/settings/edit.blade.php
Normal file
@ -0,0 +1,154 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">Edit Setting</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">Add Branch</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{route('settings.update',[$data->setting_id])}}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='setting_id' value='{{$data->setting_id}}' />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-3 ">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("title","title","Title",'',$data->title)}}</div>
|
||||
<div class="border border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Contact Details</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{createText("address","address","Address",'',$data->address)}}</div>
|
||||
<div class="col-lg-6">{{createText("url1","url1","Url1",'',$data->url1)}}</div>
|
||||
|
||||
<div class="col-lg-6">{{createText("email","email","Email",'',$data->email)}}</div>
|
||||
<div class="col-lg-3">{{createText("phone","phone","Phone",'',$data->phone)}}</div>
|
||||
<div class="col-lg-3">{{createText("secondary_phone","secondary_phone","Secondary Phone",'',$data->secondary_phone)}}</div>
|
||||
<div class="col-lg-12 pb-2">{{createPlainTextArea("google_map",'',"Google Map",$data->google_map)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-title mb-0">Footer</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("copyright_text","copyright_text","Copyright Text",'',$data->copyright_text)}}</div>
|
||||
<div class="col-lg-12 pb-2">{{createTextarea("content1","content1","Content1",$data->content1)}}</div>
|
||||
<div class="col-lg-12 pb-2">{{createTextarea("content2","content2","Content2",$data->content2)}}</div>
|
||||
<div class="col-lg-12 pb-2">{{createTextarea("content3","content3","Content3",$data->content3)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-title mb-0">SEO Related</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{createText("seo_title","seo_title","Seo Title",'',$data->seo_title)}}</div>
|
||||
<div class="col-lg-12 pb-2">{{createPlainTextArea("seo_description",'',"Seo Description",$data->seo_description)}}</div>
|
||||
<div class="col-lg-12 pb-2">{{createPlainTextArea("seo_keywords",'',"Seo Keywords",$data->seo_keywords)}}</div>
|
||||
<div class="col-lg-12 pb-2">{{createPlainTextArea("og_tags",'',"Og Tags",$data->og_tags)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-title mb-0">Site Settings</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{createPlainTextArea("meta_pixel_code",'',"Meta Pixel Code",$data->meta_pixel_code,10)}}</div>
|
||||
<div class="col-lg-12">{{createText("smtp_server","smtp_server","SMTP Server",'',$data->smtp_server)}}</div>
|
||||
<div class="col-lg-12">{{createText("smtp_security","smtp_security","SMTP Security (TSL/SSL/Empty for none)",'',$data->smtp_security)}}</div>
|
||||
<div class="col-lg-12">{{createText("smtp_port","smtp_port","SMTP PORT (25/587/465)",'',$data->smtp_port)}}</div>
|
||||
<div class="col-lg-12">{{createText("smtp_user","smtp_user","SMTP Username",'',$data->smtp_user)}}</div>
|
||||
<div class="col-lg-12">{{createText("smtp_password","smtp_password","SMTP Password",'',$data->smtp_password)}}</div>
|
||||
<div class="col-lg-12">{{createText("sms_api","sms_api","SMS API",'',$data->sms_api)}}</div>
|
||||
<div class="col-lg-12">{{createText("sms_username","sms_username","SMS Username",'',$data->sms_username)}}</div>
|
||||
<div class="col-lg-12">{{createText("sms_password","sms_password","SMS Password",'',$data->sms_password)}}</div>
|
||||
<div class="col-lg-12">{{createText("sms_sender","sms_sender","SMS Sender (Default is SMS)",'',$data->sms_sender)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3 mb-3 ">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Social Media</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("fb","fb","Facebook",'',$data->fb)}}</div>
|
||||
<div class="col-lg-12">{{createText("insta","insta","Instagram",'',$data->insta)}}</div>
|
||||
<div class="col-lg-12">{{createText("twitter","twitter","Twitter",'',$data->twitter)}}</div>
|
||||
<div class="col-lg-12">{{createText("tiktok","tiktok","Tiktok",'',$data->tiktok)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Images</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">{{createImageInput("primary_logo","Primary Logo",'',$data->primary_logo)}}</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{createImageInput("secondary_logo","Secondary Logo",'',$data->secondary_logo)}}</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{createImageInput("thumb","Thumb",'',$data->thumb)}}</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{createImageInput("icon","Icon",'',$data->icon)}}</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{createImageInput("og_image","Og Image",'',$data->og_image)}}</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{createImageInput("no_image","No Image",'',$data->no_image)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">Published</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-check form-switch form-switch-lg form-switch-success mb-3" dir="ltr">
|
||||
<input type="checkbox" class="form-check-input" id="customSwitchsizelg" checked="">
|
||||
<label class="form-check-label" for="customSwitchsizelg">Active</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<?php createButton("btn-primary btn-update", "", "Submit"); ?>
|
||||
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('settings.index')); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
266
resources/views/crud/generated/settings/index.blade.php
Normal file
266
resources/views/crud/generated/settings/index.blade.php
Normal file
@ -0,0 +1,266 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Settings List") }}</h2>
|
||||
<a href="{{ route('settings.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_settings" data-url="{{ route('settings.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("url1") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("url2") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("email") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("phone") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("secondary_phone") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("fb") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("insta") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("twitter") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("tiktok") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("primary_logo") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("secondary_logo") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("thumb") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("icon") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("og_image") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("no_image") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("copyright_text") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("content1") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("content2") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("content3") }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span
|
||||
class="overline-title">{{ label("Action") }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
|
||||
<tr data-id="{{$item->setting_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">{{ $item->url1 }}</td>
|
||||
<td class="tb-col">{{ $item->url2 }}</td>
|
||||
<td class="tb-col">{{ $item->email }}</td>
|
||||
<td class="tb-col">{{ $item->phone }}</td>
|
||||
<td class="tb-col">{{ $item->secondary_phone }}</td>
|
||||
<td class="tb-col">{{ $item->fb }}</td>
|
||||
<td class="tb-col">{{ $item->insta }}</td>
|
||||
<td class="tb-col">{{ $item->twitter }}</td>
|
||||
<td class="tb-col">{{ $item->tiktok }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->primary_logo) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->secondary_logo) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->thumb) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->icon) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->og_image) }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->no_image) }}</td>
|
||||
<td class="tb-col">{{ $item->copyright_text }}</td>
|
||||
<td class="tb-col">{{ $item->content1 }}</td>
|
||||
<td class="tb-col">{{ $item->content2 }}</td>
|
||||
<td class="tb-col">{{ $item->content3 }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{route('settings.show',[$item->setting_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('settings.edit',[$item->setting_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li>
|
||||
<li>
|
||||
<a href="{{route('settings.toggle',[$item->setting_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('settings.destroy',[$item->setting_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('settings.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete=false;
|
||||
}
|
||||
});
|
||||
});
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/settings/show.blade.php
Normal file
29
resources/views/crud/generated/settings/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('settings.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Url1 : </b> <span>{{$data->url1}}</span></p><p><b>Url2 : </b> <span>{{$data->url2}}</span></p><p><b>Email : </b> <span>{{$data->email}}</span></p><p><b>Phone : </b> <span>{{$data->phone}}</span></p><p><b>Secondary Phone : </b> <span>{{$data->secondary_phone}}</span></p><p><b>Google Map : </b> <span>{{$data->google_map}}</span></p><p><b>Fb : </b> <span>{{$data->fb}}</span></p><p><b>Insta : </b> <span>{{$data->insta}}</span></p><p><b>Twitter : </b> <span>{{$data->twitter}}</span></p><p><b>Tiktok : </b> <span>{{$data->tiktok}}</span></p><p><b>Primary Logo : </b> <span>{{$data->primary_logo}}</span></p><p><b>Secondary Logo : </b> <span>{{$data->secondary_logo}}</span></p><p><b>Thumb : </b> <span>{{$data->thumb}}</span></p><p><b>Icon : </b> <span>{{$data->icon}}</span></p><p><b>Og Image : </b> <span>{{$data->og_image}}</span></p><p><b>No Image : </b> <span>{{$data->no_image}}</span></p><p><b>Copyright Text : </b> <span>{{$data->copyright_text}}</span></p><p><b>Content1 : </b> <span>{{$data->content1}}</span></p><p><b>Content2 : </b> <span>{{$data->content2}}</span></p><p><b>Content3 : </b> <span>{{$data->content3}}</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
|
17
resources/views/crud/generated/shifts/edit.blade.php
Normal file
17
resources/views/crud/generated/shifts/edit.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Shifts') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('shifts.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('shifts.update',[$data->shift_id]):route('shifts.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='shift_id' value='{{$editable?$data->shift_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('shifts.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
268
resources/views/crud/generated/shifts/index.blade.php
Normal file
268
resources/views/crud/generated/shifts/index.blade.php
Normal file
@ -0,0 +1,268 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Shifts List") }}</h2>
|
||||
<a href="{{ route('shifts.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_shifts" data-url="{{ route('shifts.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" 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->shift_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->shift_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->shift_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('shifts.show',[$item->shift_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('shifts.edit',[$item->shift_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('shifts.toggle',[$item->shift_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('shifts.clone',[$item->shift_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('shifts.destroy',[$item->shift_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('shifts.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/shifts/show.blade.php
Normal file
29
resources/views/crud/generated/shifts/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('shifts.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>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>Display Order : </b> <span>{{$data->display_order}}</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
|
45
resources/views/crud/generated/users/__edit.blade.php
Normal file
45
resources/views/crud/generated/users/__edit.blade.php
Normal file
@ -0,0 +1,45 @@
|
||||
@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 User</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 Usre</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{route('users.update',[$data->id])}}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='id' value='{{$data->id}}' />
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("name","name","Name",'',$data->name)}}</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("username","username","Username",'',$data->username)}}</div>
|
||||
<div class="col-lg-6 pb-2">{{createPassword("password","Password",'',$data->password)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("email","email","Email",'',$data->email)}}</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_roles', 'title', 'role_id', $data->roles_id,
|
||||
'Role','roles_id', 'form-control select2','status<>-1')}}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-danger btn-cancel","","Cancel",route('users.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
37
resources/views/crud/generated/users/create.blade.php
Normal file
37
resources/views/crud/generated/users/create.blade.php
Normal file
@ -0,0 +1,37 @@
|
||||
@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 User</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 Usre</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{route('users.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("name","name","Name")}}</div>
|
||||
<div class="col-lg-6">{{createText("username","username","Username")}}</div>
|
||||
<div class="col-lg-6 pb-2">{{createPassword("password","Password",'')}}</div>
|
||||
<div class="col-lg-6">{{createText("email","email","Email")}}</div>
|
||||
<div class="col-lg-6">{{createText("remember_token","remember_token","Remember Token")}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
<?php createButton("btn-danger btn-cancel","","Cancel",route('users.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
44
resources/views/crud/generated/users/edit.blade.php
Normal file
44
resources/views/crud/generated/users/edit.blade.php
Normal file
@ -0,0 +1,44 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Users') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel", "", "Cancel", route('users.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('users.update',[$data->id]):route('users.store')}}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='id' value='{{$editable?$data->id:''}}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{createText("name","name","Name",'',$editable?$data->name:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("email","email","Email",'',$editable?$data->email:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{createText("username","username","Username",'',$editable?$data->username:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6 pb-2">
|
||||
{{createPassword("password","Password",'',$editable?$data->password:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createText("remember_token","remember_token","Remember
|
||||
Token",'',$editable?$data->remember_token:'')}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_roles', 'title', 'role_id',
|
||||
$editable?$data->roles_id:'', 'Roles Id','roles_id', 'form-control
|
||||
select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_branches', 'title', 'branch_id',
|
||||
$editable?$data->branches_id:'', 'Branches Id','branches_id', 'form-control
|
||||
select2','status<>-1')}}</div>
|
||||
|
||||
<div class="col-lg-12">{{createCustomSelect('tbl_employees', 'title', 'employee_id',
|
||||
$editable?$data->employees_id:'', 'employees Id','employees_id', 'form-control
|
||||
select2','status<>-1')}}</div>
|
||||
<div class="col-md-12">
|
||||
<?php createButton("btn-primary btn-update", "", "Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel", "", "Cancel", route('users.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
273
resources/views/crud/generated/users/index.blade.php
Normal file
273
resources/views/crud/generated/users/index.blade.php
Normal file
@ -0,0 +1,273 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>{{ label("Create User") }}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{$editable?route('users.update',[$data->id]):route('users.store')}}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='id' value='{{$editable?$data->id:''}}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("name","name","Name",'',$editable?$data->name:'')}}
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
{{createText("email","email","Email",'',$editable?$data->email:'')}}
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
{{createText("username","username","Username",'',$editable?$data->username:'')}}
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
{{createPassword("password","Password",'',$editable?$data->password:'')}}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12">{{createCustomSelect('tbl_roles', 'title', 'role_id',
|
||||
$editable?$data->roles_id:'', 'Roles Id','roles_id', 'form-control
|
||||
select2','status<>-1')}}</div>
|
||||
<div class="col-lg-12">{{createCustomSelect('tbl_branches', 'title', 'branch_id',
|
||||
$editable?$data->branches_id:'', 'Branches Id','branches_id', 'form-control
|
||||
select2','status<>-1')}}</div>
|
||||
|
||||
<div class="col-lg-12">{{createCustomSelect('tbl_employees', 'title', 'employee_id',
|
||||
$editable?$data->employees_id:'', 'employees Id','employees_id', 'form-control
|
||||
select2','status<>-1')}}</div>
|
||||
<div class="col-md-12">
|
||||
<?php createButton("btn-primary btn-update", "", "Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel", "", "Cancel", route('users.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Users List") }}</h2>
|
||||
<!-- <a href="{{ route('users.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a> -->
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_users" data-url="{{ route('users.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("Email") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("User Name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Role") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Branch") }}</span></th>
|
||||
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Employee") }}</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->id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status == 0) ? " bg-light bg-danger" : ""; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->email }}</td>
|
||||
<td class="tb-col">{{ $item->username }}</td>
|
||||
<td class="tb-col">{!! getFieldData("tbl_roles", "title", "role_id", $item->roles_id) !!}
|
||||
<td class="tb-col">{!! getFieldData("tbl_branches", "title", "branch_id", $item->branches_id) !!}
|
||||
|
||||
<td class="tb-col">{!! getFieldData("tbl_employees", "title", "employee_id", $item->employees_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('users.show',[$item->id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{label("View")}}</a></li>
|
||||
<li><a href="{{route('users.edit',[$item->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('users.toggle',[$item->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('users.destroy',[$item->id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{
|
||||
label('Delete') }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script>
|
||||
$(d.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('users.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/users/show.blade.php
Normal file
29
resources/views/crud/generated/users/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('users.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Name : </b> <span>{{$data->name}}</span></p><p><b>Email : </b> <span>{{$data->email}}</span></p><p><b>Username : </b> <span>{{$data->username}}</span></p><p><b>Email Verified At : </b> <span>{{$data->email_verified_at}}</span></p><p><b>Password : </b> <span>{{$data->password}}</span></p><p><b>Remember Token : </b> <span>{{$data->remember_token}}</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
|
18
resources/views/crud/generated/vendors/edit.blade.php
vendored
Normal file
18
resources/views/crud/generated/vendors/edit.blade.php
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Vendors') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('vendors.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('vendors.update',[$data->vendor_id]):route('vendors.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='vendor_id' value='{{$editable?$data->vendor_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_vendortypes', 'title', 'vendortypes_id', $editable?$data->vendortypes_id:'', 'Vendortypes Id','vendortypes_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('vendors.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
271
resources/views/crud/generated/vendors/index.blade.php
vendored
Normal file
271
resources/views/crud/generated/vendors/index.blade.php
vendored
Normal file
@ -0,0 +1,271 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Vendors List") }}</h2>
|
||||
<a href="{{ route('vendors.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_vendors" data-url="{{ route('vendors.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("vendortypes") }}</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->vendor_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_vendortypes", "title", "vendortypes_id", $item->vendortypes_id) !!}
|
||||
</td><td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->vendor_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->vendor_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('vendors.show',[$item->vendor_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('vendors.edit',[$item->vendor_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('vendors.toggle',[$item->vendor_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('vendors.clone',[$item->vendor_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('vendors.destroy',[$item->vendor_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('vendors.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/vendors/show.blade.php
vendored
Normal file
29
resources/views/crud/generated/vendors/show.blade.php
vendored
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('vendors.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Vendortypes Id : </b> <span>{{$data->vendortypes_id}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
18
resources/views/crud/generated/vendortypes/edit.blade.php
Normal file
18
resources/views/crud/generated/vendortypes/edit.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Vendortypes') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('vendortypes.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('vendortypes.update',[$data->vendortypes_id]):route('vendortypes.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='vendortypes_id' value='{{$editable?$data->vendortypes_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('vendortypes.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
268
resources/views/crud/generated/vendortypes/index.blade.php
Normal file
268
resources/views/crud/generated/vendortypes/index.blade.php
Normal file
@ -0,0 +1,268 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Vendortypes List") }}</h2>
|
||||
<a href="{{ route('vendortypes.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_vendortypes" data-url="{{ route('vendortypes.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" 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->vendortypes_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->vendortypes_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->vendortypes_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('vendortypes.show',[$item->vendortypes_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('vendortypes.edit',[$item->vendortypes_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('vendortypes.toggle',[$item->vendortypes_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('vendortypes.clone',[$item->vendortypes_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('vendortypes.destroy',[$item->vendortypes_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('vendortypes.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/vendortypes/show.blade.php
Normal file
29
resources/views/crud/generated/vendortypes/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('vendortypes.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>Description : </b> <span>{{$data->description}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
17
resources/views/crud/generated/workoptions/edit.blade.php
Normal file
17
resources/views/crud/generated/workoptions/edit.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Workoptions') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('workoptions.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{$editable?route('workoptions.update',[$data->workoption_id]):route('workoptions.store')}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='workoption_id' value='{{$editable?$data->workoption_id:''}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}}
|
||||
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('workoptions.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
268
resources/views/crud/generated/workoptions/index.blade.php
Normal file
268
resources/views/crud/generated/workoptions/index.blade.php
Normal file
@ -0,0 +1,268 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Workoptions List") }}</h2>
|
||||
<a href="{{ route('workoptions.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_workoptions" data-url="{{ route('workoptions.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" 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->workoption_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->workoption_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->workoption_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('workoptions.show',[$item->workoption_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('workoptions.edit',[$item->workoption_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('workoptions.toggle',[$item->workoption_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('workoptions.clone',[$item->workoption_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
|
||||
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('workoptions.destroy',[$item->workoption_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('workoptions.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: 'GET',
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
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!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/workoptions/show.blade.php
Normal file
29
resources/views/crud/generated/workoptions/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('workoptions.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>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>Display Order : </b> <span>{{$data->display_order}}</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
|
63
resources/views/crud/settings/ajax-curd.blade.php
Normal file
63
resources/views/crud/settings/ajax-curd.blade.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\GeneralFormController;
|
||||
?>
|
||||
@extends("backend.template")
|
||||
@section("content")
|
||||
|
||||
<div class="nk-content">
|
||||
<div class="container-fluid">
|
||||
<div class="nk-content-inner">
|
||||
<div class="nk-content-body">
|
||||
<div class="form-group"> <label for="exampleFormControlTextarea8" class="form-label">Migrations Code Content</label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea class="form-control" id="exampleFormControlTextarea8" rows="8">{{GeneralFormController::migrationContent($tableName)}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"> <label for="exampleFormControlTextarea8" class="form-label">Route Code Content</label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea class="form-control" id="exampleFormControlTextarea8" rows="8">
|
||||
{{GeneralFormController::routeContent($tableName, $directoryName)}}
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"> <label for="exampleFormControlTextarea8" class="form-label">Model Code</label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea class="form-control" id="exampleFormControlTextarea8" rows="8">{{GeneralFormController::modelContent($tableName, $directoryName)}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"> <label for="exampleFormControlTextarea8" class="form-label">Controllers Code</label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea class="form-control" id="exampleFormControlTextarea8" rows="8">{{GeneralFormController::controllerContent($tableName, $directoryName)}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"> <label for="exampleFormControlTextarea8" class="form-label">List File Code</label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea class="form-control" id="exampleFormControlTextarea8" rows="8">{{GeneralFormController::listContent($tableName, $directoryName)}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"> <label for="exampleFormControlTextarea8" class="form-label">Create File Code</label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea class="form-control" id="exampleFormControlTextarea8" rows="8">{{GeneralFormController::addContent($tableName, $directoryName)}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"> <label for="exampleFormControlTextarea8" class="form-label">Edit File Code</label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea class="form-control" id="exampleFormControlTextarea8" rows="8">{{GeneralFormController::editContent($tableName, $directoryName)}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"> <label for="exampleFormControlTextarea8" class="form-label">Show File Code</label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea class="form-control" id="exampleFormControlTextarea8" rows="8">{{GeneralFormController::showContent($tableName, $directoryName)}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
41
resources/views/crud/template.blade.php
Normal file
41
resources/views/crud/template.blade.php
Normal file
@ -0,0 +1,41 @@
|
||||
@extends('backend.template')
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ label($title . ' List') }}
|
||||
|
||||
<ul class="d-flex">
|
||||
<li>
|
||||
<a href="{{ route($routeName . 'create') }}" class="btn btn-md d-md-none btn-primary" data-bs-toggle="modal" data-bs-target="">
|
||||
<em class="icon ni ni-plus"></em><span>Add</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route($routeName . 'create') }}" class="btn btn-primary d-none d-md-inline-flex">
|
||||
<em class="icon ni ni-plus"></em><span>Add {{ label($translated) }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="datatable-init table" data-nk-container="table-responsive" id="CustomTable">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N.</span></th>
|
||||
{{ $tableHeader }}
|
||||
<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)
|
||||
{{ $tableRows }}
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
Reference in New Issue
Block a user