leave user employee module setup

This commit is contained in:
2024-04-07 13:13:58 +05:45
parent da9f493572
commit cfd2147536
174 changed files with 9312 additions and 9540 deletions

View File

@ -1,26 +1,48 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,26 +1,48 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,203 +1,211 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -205,28 +213,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -234,28 +243,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -263,27 +273,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

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

View File

@ -1,17 +1,24 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Caste') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('castes.index')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,182 +1,189 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -184,28 +191,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -213,28 +221,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -242,27 +251,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

@ -1,29 +1,36 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('castes.index')); ?>
@extends('layouts.app')
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,18 +1,30 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,185 +1,193 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -187,28 +195,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -216,28 +225,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -245,27 +255,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

@ -1,29 +1,38 @@
@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')); ?>
@extends('layouts.app')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('cities.index')); ?>
</div>
<div class='card-body'>
<p><b>Districts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->districts_id}}</span></p><p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Districts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->districts_id }}</span></p>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->description }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,19 +1,35 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,190 +1,200 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -192,28 +202,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -221,28 +232,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -250,27 +262,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

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

View File

@ -1,18 +1,27 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,182 +1,190 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -184,28 +192,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -213,28 +222,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -242,27 +252,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

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

View File

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

View File

@ -1,39 +1,40 @@
@extends('backend.template')
@section('content')
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
@extends('layouts.app')
@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>
<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>
</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
</div>
<!-- end page title -->
<form action="{{ route('countries.update', [$data->country_id]) }}" id="updateCustomForm" method="POST">
@csrf <input type=hidden name='country_id' value='{{ $data->country_id }}' />
<div class='card'>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $data->title) }}</div>
<div class="col-lg-12 pb-4">
{{ createTextarea('description', 'description ckeditor-classic', 'Description', $data->description) }}</div>
<div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $data->remarks) }}</div>
</div>
</div>
<div class="card-footer">
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Update'); ?>
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countries.index')); ?>
</div>
</div>
</div>
</form>
@endsection

View File

@ -1,241 +1,253 @@
@extends('backend.template')
@extends('layouts.app')
@section('content')
<div class="row">
<div class="col-lg-4">
<form action="{{route('countries.store')}}" id="storeCustomForm" method="POST">
<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 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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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">
@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>
@push('js')
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script>
$(document).ready(function(e) {
$('.change-alias-badge').on('click', function() {
var aliasWrapper = $(this).prev('.alias-wrapper');
var aliasSpan = aliasWrapper.find('.alias');
var aliasInput = aliasWrapper.find('.alias-input');
var isEditing = $(this).hasClass('editing');
aliasInput.toggleClass("d-none");
if (isEditing) {
// Update alias text and switch to non-editing state
var newAlias = aliasInput.val();
aliasSpan.text(newAlias);
aliasSpan.show();
aliasInput.hide();
$(this).removeClass('editing').text('Change Alias');
var articleId = $(aliasWrapper).data('id');
var ajaxUrl = "{{ route('countries.updatealias') }}";
var data = {
articleId: articleId,
newAlias: newAlias
};
$.ajax({
url: ajaxUrl,
type: 'POST',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: data,
success: function(response) {
console.log(response);
},
error: function(xhr, status, error) {
console.error(error);
}
});
} else {
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
},
});
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
mytable.on('draw', function() {
if (isRowReorderComplete) {
var url = mytable.table().node().getAttribute('data-url');
var ids = mytable.rows().nodes().map(function(node) {
return $(node).data('id');
}).toArray();
console.log(ids);
$.ajax({
url: url,
type: "POST",
headers: {
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
},
data: {
id_order: ids
},
success: function(response) {
console.log(response);
},
error: function(xhr, status, error) {
console.error(error);
}
});
isRowReorderComplete = false;
}
});
});
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: url,
type: 'DELETE',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(response) {
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
location.reload();
},
error: function(xhr, status, error) {
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
}
});
}
});
}
function confirmToggle(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: url,
type: 'GET',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(response) {
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
location.reload();
},
error: function(xhr, status, error) {
Swal.fire('Error!', 'An error occurred.', 'error');
}
});
}
});
}
</script>
@endpush

View File

@ -1,29 +1,37 @@
@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')); ?>
@extends('layouts.app')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('countries.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->description }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,17 +1,24 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Dags') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('dags.index')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,182 +1,189 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -184,28 +191,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -213,28 +221,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -242,27 +251,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

@ -1,29 +1,36 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('dags.index')); ?>
@extends('layouts.app')
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,18 +1,30 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,185 +1,194 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -187,28 +196,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -216,28 +226,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -245,27 +256,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

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

View File

@ -1,18 +1,30 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,187 +1,196 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -189,28 +198,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -218,28 +228,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -247,27 +258,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

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

View File

@ -1,18 +1,30 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,185 +1,194 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -187,28 +196,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -216,28 +226,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -245,27 +256,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

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

View File

@ -1,129 +1,316 @@
@extends('backend.template')
@extends('layouts.app')
@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 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='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>
<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">{{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->permanent_city : '',
'Permanent
City',
'permanent_city',
'form-control
select2',
'status<>-1',
) }}
</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(
'temporary_address',
'temporary_address',
"Temporary
Address",
'',
$editable ? $data->temporary_address : '',
) }}
</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
<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

View File

@ -1,250 +1,264 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -252,28 +266,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -281,28 +296,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -310,27 +326,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

@ -1,29 +1,67 @@
@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')); ?>
@extends('layouts.app')
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->first_name}}</span></p><p><b>Middle Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->middle_name}}</span></p><p><b>Last Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->last_name}}</span></p><p><b>Email :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->email}}</span></p><p><b>Genders Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->genders_id}}</span></p><p><b>Nepali Dob :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->nepali_dob}}</span></p><p><b>Dob :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->dob}}</span></p><p><b>Nationalities Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->nationalities_id}}</span></p><p><b>About Me :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->about_me}}</span></p><p><b>Signature :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->signature}}</span></p><p><b>Father Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->father_name}}</span></p><p><b>Mother Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->mother_name}}</span></p><p><b>Grand Father Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->grand_father_name}}</span></p><p><b>Grand Mother Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->grand_mother_name}}</span></p><p><b>Spouse :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->spouse}}</span></p><p><b>Contact :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->contact}}</span></p><p><b>Alt Contact :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alt_contact}}</span></p><p><b>Profile Picture :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->profile_picture}}</span></p><p><b>Users Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->users_id}}</span></p><p><b>Is Login Required :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->is_login_required}}</span></p><p><b>Skills :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->skills}}</span></p><p><b>Experience :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->experience}}</span></p><p><b>Permanent Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->permanent_address}}</span></p><p><b>Permanent City :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->permanent_city}}</span></p><p><b>Temporary Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->temporary_address}}</span></p><p><b>Temporary City :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->temporary_city}}</span></p><p><b>Old System Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->old_system_address}}</span></p><p><b>Education :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->education}}</span></p><p><b>Castes Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->castes_id}}</span></p><p><b>Ethnicities Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->ethnicities_id}}</span></p><p><b>Dags Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->dags_id}}</span></p><p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>First Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->first_name }}</span></p>
<p><b>Middle Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->middle_name }}</span></p>
<p><b>Last Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->last_name }}</span></p>
<p><b>Email :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->email }}</span></p>
<p><b>Genders Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->genders_id }}</span></p>
<p><b>Nepali Dob :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->nepali_dob }}</span></p>
<p><b>Dob :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->dob }}</span></p>
<p><b>Nationalities Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->nationalities_id }}</span></p>
<p><b>About Me :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->about_me }}</span></p>
<p><b>Signature :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->signature }}</span></p>
<p><b>Father Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->father_name }}</span></p>
<p><b>Mother Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->mother_name }}</span></p>
<p><b>Grand Father Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->grand_father_name }}</span></p>
<p><b>Grand Mother Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->grand_mother_name }}</span></p>
<p><b>Spouse :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->spouse }}</span></p>
<p><b>Contact :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->contact }}</span></p>
<p><b>Alt Contact :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alt_contact }}</span></p>
<p><b>Profile Picture :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->profile_picture }}</span></p>
<p><b>Users Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->users_id }}</span></p>
<p><b>Is Login Required :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->is_login_required }}</span></p>
<p><b>Skills :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->skills }}</span></p>
<p><b>Experience :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->experience }}</span></p>
<p><b>Permanent Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->permanent_address }}</span></p>
<p><b>Permanent City :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->permanent_city }}</span></p>
<p><b>Temporary Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->temporary_address }}</span></p>
<p><b>Temporary City :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->temporary_city }}</span></p>
<p><b>Old System Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->old_system_address }}</span></p>
<p><b>Education :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->education }}</span></p>
<p><b>Castes Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->castes_id }}</span></p>
<p><b>Ethnicities Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->ethnicities_id }}</span></p>
<p><b>Dags Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->dags_id }}</span></p>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,17 +1,24 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Ethnicities') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('ethnicities.index')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,182 +1,190 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -184,28 +192,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -213,28 +222,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -242,27 +252,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

@ -1,29 +1,36 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('ethnicities.index')); ?>
@extends('layouts.app')
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,17 +1,24 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Genders') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('genders.index')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,182 +1,189 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -184,28 +191,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -213,28 +221,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -242,27 +251,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

@ -1,29 +1,36 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('genders.index')); ?>
@extends('layouts.app')
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,17 +0,0 @@
@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

View File

@ -1,271 +0,0 @@
@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

View File

@ -1,29 +0,0 @@
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><p><b>Leavetypes Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->leavetypes_id}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,17 +0,0 @@
@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

View File

@ -1,268 +0,0 @@
@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

View File

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

View File

@ -1,17 +1,24 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Nationalities') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('nationalities.index')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,182 +1,190 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -184,28 +192,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -213,28 +222,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -242,27 +252,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

@ -1,29 +1,36 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('nationalities.index')); ?>
@extends('layouts.app')
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,58 +1,93 @@
@extends('backend.template')
@extends('layouts.app')
@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 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='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>
<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 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('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
</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

View File

@ -1,205 +1,215 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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>
<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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -207,28 +217,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -236,28 +247,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -265,27 +277,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

@ -1,29 +1,45 @@
@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')); ?>
@extends('layouts.app')
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->doj}}</span></p><p><b>Designations Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->designations_id}}</span></p><p><b>Position Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->position_status}}</span></p><p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->departments_id}}</span></p><p><b>Shifts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->shifts_id}}</span></p><p><b>Agreement :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->agreement}}</span></p><p><b>Nda :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->nda}}</span></p><p><b>Terms :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->terms}}</span></p><p><b>Workoptions :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->workoptions}}</span></p><p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Doj :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->doj }}</span></p>
<p><b>Designations Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->designations_id }}</span></p>
<p><b>Position Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->position_status }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<p><b>Shifts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->shifts_id }}</span></p>
<p><b>Agreement :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->agreement }}</span></p>
<p><b>Nda :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->nda }}</span></p>
<p><b>Terms :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->terms }}</span></p>
<p><b>Workoptions :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->workoptions }}</span></p>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,18 +0,0 @@
@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

View File

@ -1,272 +0,0 @@
@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

View File

@ -1,29 +0,0 @@
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Modal :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->modal}}</span></p><p><b>Command :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->command}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</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>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,18 +1,30 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,324 +1,315 @@
@extends('backend.template')
@extends('layouts.app')
@section('content')
<div class="row">
<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>
<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='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 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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection
@push("css")
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
@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>
@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>
<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
};
$('.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'
$.ajax({
url: ajaxUrl,
type: 'POST',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
});
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;
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');
}
});
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');
}
});
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');
}
});
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
</script>
@endpush

View File

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

View File

@ -1,16 +0,0 @@
@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

View File

@ -1,189 +0,0 @@
@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

View File

@ -1,29 +0,0 @@
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->roles_id}}</span></p><p><b>Permissions Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->permissions_id}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</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>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,25 +0,0 @@
@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

View File

@ -1,301 +0,0 @@
@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

View File

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

View File

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

View File

@ -1,154 +1,168 @@
@extends('backend.template')
@extends('layouts.app')
@section('content')
<!-- start page title -->
<div class="row">
<!-- 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 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>
<!-- 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 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>
</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 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 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>
<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 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>
<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="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 class="col-lg-12 pb-2">{{ createPlainTextArea('og_tags', '', 'Og Tags', $data->og_tags) }}</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 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="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 class="col-lg-12">
{{ createText('smtp_security', 'smtp_security', 'SMTP Security (TSL/SSL/Empty for none)', '', $data->smtp_security) }}
</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 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="mb-3 border border-dashed"></div>
<div class="col-lg-12 pb-2">
{{ createImageInput('secondary_logo', 'Secondary Logo', '', $data->secondary_logo) }}</div>
<div class="mb-3 border border-dashed"></div>
<div class="col-lg-12 pb-2">{{ createImageInput('thumb', 'Thumb', '', $data->thumb) }}</div>
<div class="mb-3 border border-dashed"></div>
<div class="col-lg-12 pb-2">{{ createImageInput('icon', 'Icon', '', $data->icon) }}</div>
<div class="mb-3 border border-dashed"></div>
<div class="col-lg-12 pb-2">{{ createImageInput('og_image', 'Og Image', '', $data->og_image) }}</div>
<div class="mb-3 border 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
</form>
@endsection

View File

@ -1,209 +1,211 @@
@extends('backend.template')
@extends('layouts.app')
@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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
<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>
</tbody>
</table>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
</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">
@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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -211,28 +213,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -240,27 +243,24 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.ajax({
url: url,
type: 'GET',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(response) {
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
location.reload();
},
error: function(xhr, status, error) {
Swal.fire('Error!', 'An error occurred.', 'error');
}
});
}
});
}
</script>
});
}
</script>
@endpush

View File

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

View File

@ -1,17 +1,24 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Shifts') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('shifts.index')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,182 +1,189 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -184,28 +191,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -213,28 +221,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -242,27 +251,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

@ -1,29 +1,36 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('shifts.index')); ?>
@extends('layouts.app')
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,45 +1,50 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<!-- 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>
<!-- 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>
<!-- 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
</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

View File

@ -1,37 +1,37 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<!-- 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>
<!-- 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>
</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 class="col-md-12">
<?php createButton("btn-primary btn-store","","Submit"); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('users.index')); ?>
</div>
</form>
@endsection
</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

View File

@ -1,44 +1,82 @@
@extends('backend.template')
@extends('layouts.app')
@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 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
</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

View File

@ -1,273 +1,304 @@
@extends('backend.template')
@extends('layouts.app')
@section('content')
<div class="row">
<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 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 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="dataTable table" 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 text-muted me-2 align-bottom"></i>
{{ label('View') }}</a></li>
<li><a href="{{ route('users.edit', [$item->id]) }}" class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
{{ label('Edit') }}</a></li>
<li>
<a href="{{ route('users.toggle', [$item->id]) }}" class="dropdown-item toggle-item-btn"
onclick="confirmToggle(this.href)">
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
</li>
<li>
<a href="{{ route('users.destroy', [$item->id]) }}" class="dropdown-item remove-item-btn"
onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</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">
@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>
@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');
}
});
}
});
$('.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');
}
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');
}
});
}
});
});
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
});
});
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: url,
type: 'DELETE',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(response) {
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
location.reload();
},
error: function(xhr, status, error) {
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
}
});
}
});
}
function confirmToggle(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: url,
type: 'GET',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(response) {
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
location.reload();
},
error: function(xhr, status, error) {
Swal.fire('Error!', 'An error occurred.', 'error');
}
});
}
});
}
</script>
@endpush

View File

@ -1,29 +1,39 @@
@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')); ?>
@extends('layouts.app')
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->name}}</span></p><p><b>Email :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->email}}</span></p><p><b>Username :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->username}}</span></p><p><b>Email Verified At :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->email_verified_at}}</span></p><p><b>Password :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->password}}</span></p><p><b>Remember Token :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remember_token}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Name :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->name }}</span></p>
<p><b>Email :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->email }}</span></p>
<p><b>Username :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->username }}</span></p>
<p><b>Email Verified At :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->email_verified_at }}</span></p>
<p><b>Password :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->password }}</span></p>
<p><b>Remember Token :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remember_token }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,18 +1,30 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,185 +1,193 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -187,28 +195,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -216,28 +225,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -245,27 +255,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

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

View File

@ -1,18 +1,27 @@
@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')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,182 +1,190 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -184,28 +192,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -213,28 +222,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -242,27 +252,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

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

View File

@ -1,17 +1,24 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Workoptions') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('workoptions.index')); ?>
@extends('layouts.app')
@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
</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

View File

@ -1,182 +1,190 @@
@extends('backend.template')
@extends('layouts.app')
@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>
<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="dataTable table" 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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></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 text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a>
@endforeach
</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 text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a>
</tbody>
</table>
</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 text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a>
</div>
</div>
</li>
</ul>
</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">
</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>
@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() {
<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);
}
});
// 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');
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
var mytable = $(".dataTable").DataTable({
});
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
//selector: 'tr'
},
});
});
var isRowReorderComplete = false;
var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) {
mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true;
});
});
mytable.on('draw', function() {
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();
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;
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({
function confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
@ -184,28 +192,29 @@ function confirmDelete(url) {
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -213,28 +222,29 @@ function confirmToggle(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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({
});
}
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',
@ -242,27 +252,24 @@ function confirmClone(url) {
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
}).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');
}
});
$.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>
});
}
</script>
@endpush

View File

@ -1,29 +1,36 @@
@extends('backend.template')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('workoptions.index')); ?>
@extends('layouts.app')
@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 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p>
</div>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
@endSection
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection