first commit
This commit is contained in:
107
resources/views/crud/generated/contacts/create.blade.php
Normal file
107
resources/views/crud/generated/contacts/create.blade.php
Normal file
@ -0,0 +1,107 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">Add Contact</h4>
|
||||
|
||||
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">Add Contact</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('contacts.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('name', 'name', 'Title') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_branches', 'title', 'branch_id', '', 'Branches Id','branches_id', 'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{ createText('tagline', 'tagline', 'Tagline') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_forms', 'title', 'form_id', '', 'Forms Id (if needed)','forms_id', 'form-control select2','status<>-1')}}</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Address
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{ createText('address', 'address', 'Address') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('tel', 'tel', 'Phone Number') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('fax', 'fax', 'Fax Number') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('hp1', 'hp1', 'Helpline 1') }}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('hp2', 'hp2', 'Helpline 2') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">{{ createText('email1', 'email1', 'Email Address') }}
|
||||
</div>
|
||||
<div class="col-lg-4">{{ createText('email2', 'email2', 'Alternate Email') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">{{ createText('website', 'website', 'Website') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('google_map', 'google_map', 'Google Map') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Social Media
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('facebook', 'facebook', 'Facebook') }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('twitter', 'twitter', 'Twitter') }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('instagram', 'instagram', 'Instagram') }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('tiktok', 'tiktok', 'Tiktok') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', 'remarks', 'Remarks') }}
|
||||
</div>
|
||||
<div class="col-md-12 mb-3 mt-3"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('contacts.index')); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
110
resources/views/crud/generated/contacts/edit.blade.php
Normal file
110
resources/views/crud/generated/contacts/edit.blade.php
Normal file
@ -0,0 +1,110 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">Edit Contact</h4>
|
||||
|
||||
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">Edit Contact</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{route('contacts.update',[$data->contact_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='contact_id' value='{{$data->contact_id}}'/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{createText("name","name","Name",'',$data->name)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_branches', 'title', 'branch_id', $data->branches_id, 'Branches Id','branches_id', 'form-control select2','status<>-1')}}</div>
|
||||
<div class="col-lg-6">{{createText("tagline","tagline","Tagline",'',$data->tagline)}}
|
||||
</div>
|
||||
<div class="col-lg-6">{{createCustomSelect('tbl_forms', 'title', 'form_id', $data->forms_id, 'Forms Id','forms_id', 'form-control select2','status<>-1')}}</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Address
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{createText("address","address","Address",'',$data->address)}}
|
||||
</div>
|
||||
<div class="col-lg-3">{{createText("tel","tel","Tel",'',$data->tel)}}
|
||||
</div>
|
||||
<div class="col-lg-3">{{createText("fax","fax","Fax",'',$data->fax)}}
|
||||
</div>
|
||||
<div class="col-lg-3">{{createText("hp1","hp1","Helpline 1",'',$data->hp1)}}
|
||||
</div>
|
||||
<div class="col-lg-3">{{ createText('hp2', 'hp2', 'Helpline 2','',$data->hp2)}}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">{{ createText('email1', 'email1', 'Email Address' ,'',$data->email1)}}
|
||||
</div>
|
||||
<div class="col-lg-4">{{ createText('email2', 'email2', 'Alternate Email','',$data->email2)}}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">{{ createText('website', 'website', 'Website','',$data->website)}}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('google_map', 'google_map', 'Google Map',$data->google_map)}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Social Media
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('facebook', 'facebook', 'Facebook','',$data->facebook)}}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('twitter', 'twitter', 'Twitter','',$data->twitter) }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('instagram', 'instagram', 'Instagram','',$data->instagram) }}
|
||||
</div>
|
||||
<div class="col-lg-12">{{ createText('tiktok', 'tiktok', 'Tiktok','',$data->tiktok) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', 'remarks', 'Remarks',$data->remarks)}}
|
||||
</div>
|
||||
<div class="col-md-12 mb-3 mt-3"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('contacts.index')); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
@endsection
|
216
resources/views/crud/generated/contacts/index.blade.php
Normal file
216
resources/views/crud/generated/contacts/index.blade.php
Normal file
@ -0,0 +1,216 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Contacts List") }}</h2>
|
||||
<a href="{{ route('contacts.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_contacts" data-url="{{ route('contacts.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Branches") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Name") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Address") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Tel") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Email 1") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Helpline 1") }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span
|
||||
class="overline-title">{{ label("Action") }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
<tr data-id="{{$item->contact_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_branches", "title", "branch_id", $item->branches_id) !!}
|
||||
</td><td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->address }}</td>
|
||||
<td class="tb-col">{{ $item->tel }}</td>
|
||||
<td class="tb-col">{{ $item->email1 }}</td>
|
||||
<td class="tb-col">{{ $item->hp1 }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<!-- <li><a href="{{route('contacts.show',[$item->contact_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li> -->
|
||||
<li><a href="{{route('contacts.edit',[$item->contact_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li>
|
||||
<li>
|
||||
<a href="{{route('contacts.toggle',[$item->contact_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('contacts.destroy',[$item->contact_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('contacts.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
var isRowReorderComplete = false;
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete=false;
|
||||
}
|
||||
});
|
||||
});
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
29
resources/views/crud/generated/contacts/show.blade.php
Normal file
29
resources/views/crud/generated/contacts/show.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('contacts.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Forms Id : </b> <span>{{$data->forms_id}}</span></p><p><b>Branches Id : </b> <span>{{$data->branches_id}}</span></p><p><b>Name : </b> <span>{{$data->name}}</span></p><p><b>Tagline : </b> <span>{{$data->tagline}}</span></p><p><b>Address : </b> <span>{{$data->address}}</span></p><p><b>Tel : </b> <span>{{$data->tel}}</span></p><p><b>Fax : </b> <span>{{$data->fax}}</span></p><p><b>Email1 : </b> <span>{{$data->email1}}</span></p><p><b>Email2 : </b> <span>{{$data->email2}}</span></p><p><b>Website : </b> <span>{{$data->website}}</span></p><p><b>Google Map : </b> <span>{{$data->google_map}}</span></p><p><b>Facebook : </b> <span>{{$data->facebook}}</span></p><p><b>Hp1 : </b> <span>{{$data->hp1}}</span></p><p><b>Hp2 : </b> <span>{{$data->hp2}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks : </b> <span>{{$data->remarks}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
Reference in New Issue
Block a user