This commit is contained in:
tanch0
2024-06-18 11:31:51 +05:45
parent fcbaa0f679
commit 613dfd1834
116 changed files with 4829 additions and 1558 deletions

View File

@ -1,245 +1,251 @@
@extends('backend.template')
@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">Website Settings</h4>
<div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0">Website Settings</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">Website Settings</li>
</ol>
</div>
<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">Website Settings</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<!-- New Design -->
<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="chat-wrapper d-lg-flex mx-n4 mt-n4 gap-1 p-1">
<div class="file-manager-sidebar">
<div class="d-flex flex-column h-100 p-3">
<div class="nav nav-pills flex-column nav-pills-tab custom-verti-nav-pills text-center" role="tablist"
aria-orientation="vertical">
<a class="nav-link active show" id="settings" data-bs-toggle="pill" href="#custom-v-pills-home"
role="tab" aria-controls="custom-v-pills-home" aria-selected="true">
<i class="ri-home-4-line d-block fs-20 mb-1"></i> Settings
</a>
<a class="nav-link" id="address" data-bs-toggle="pill" href="#custom-v-pills-address" role="tab"
aria-controls="custom-v-pills-address" aria-selected="false">
<i class="ri-map-pin-2-line d-block fs-20 mb-1"></i> Address
</a>
<a class="nav-link" id="logo" data-bs-toggle="pill" href="#custom-v-pills-logo" role="tab"
aria-controls="custom-v-pills-logo" aria-selected="false">
<i class="ri-image-2-line d-block fs-20 mb-1"></i> Logo/Images
</a>
<a class="nav-link" id="socialmedia" data-bs-toggle="pill" href="#custom-v-pills-social" role="tab"
aria-controls="custom-v-pills-social" aria-selected="false">
<i class="ri-apps-2-line d-block fs-20 mb-1"></i> Social Media
</a>
<a class="nav-link" id="seo" data-bs-toggle="pill" href="#custom-v-pills-seo" role="tab"
aria-controls="custom-v-pills-seo" aria-selected="false">
<i class="ri-global-line d-block fs-20 mb-1"></i> SEO
</a>
<a class="nav-link" id="seo" data-bs-toggle="pill" href="#custom-v-pills-security" role="tab"
aria-controls="custom-v-pills-seo" aria-selected="false">
<i class="ri-global-line d-block fs-20 mb-1"></i> Security
</a>
</div>
</div>
</div>
<div class="file-manager-content w-100 p-3 py-0">
<div class="mx-n3 file-manager-content-scroll px-4 pt-4" data-simplebar>
<div>
<div class="d-flex align-items-center border-bottom border-bottom-dashed mb-3">
<h5 class="flex-grow-1 fs-16 mb-0" id="filetype-title"></h5>
<div class="flex-shrink-0">
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('settings.index')); ?>
</div>
</div>
<div class="tab-content text-muted mt-lg-0 mt-3">
<div class="tab-pane fade active show" id="custom-v-pills-home" role="tabpanel"
aria-labelledby="custom-v-pills-home-tab">
</div>
</div>
<!-- end page title -->
<!-- New Design -->
<div>
{{ createText('title', 'title', 'Page Title', '', $data->title) }}
<h5 class="fs-14 text-muted mb-3 mt-2">Parmalink: <a href="<?php echo env('APP_URL'); ?>"
target="_blank"><?php echo env('APP_URL'); ?></a> </h5>
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextarea('description', 'description', 'Description', $data->description) }}
</div>
<div class="row">
<div class="col-lg-6">
{{ createText('working_days', 'working_days', 'Working days', '', $data->working_days) }}
</div>
<div class="col-lg-6">
{{ createText('working_hours', 'working_hours', 'Working Hours', '', $data->working_hours) }}
</div>
</div>
<div class="col-lg-6">
{{ createText('leave_days', 'leave_days', 'Leave Days', '', $data->leave_days) }}
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextarea('content1', 'content1', 'Content1', $data->content1) }}
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextarea('content2', 'content2', 'Content2', $data->content2) }}
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextarea('content3', 'content3', 'Content3', $data->content3) }}
</div>
<div class="col-lg-12">
{{ createText('copyright_text', 'copyright_text', 'Copyright', '', $data->copyright_text) }}
</div>
<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="chat-wrapper d-lg-flex mx-n4 mt-n4 gap-1 p-1">
<div class="file-manager-sidebar">
<div class="d-flex flex-column h-100 p-3">
</div>
<!--end tab-pane-->
<div class="tab-pane fade" id="custom-v-pills-address" role="tabpanel"
aria-labelledby="custom-v-pills-address-tab">
<div class="d-flex mb-4">
<div class="row">
<div class="col-lg-6">{{ createText('url1', 'url1', 'Url 1', '', $data->url1) }}
</div>
<div class="col-lg-6">{{ createText('url2', 'url2', 'Url 2', '', $data->url2) }}
</div>
<div class="col-lg-6">{{ createText('email', 'email', 'Email', '', $data->email) }}
</div>
<div class="col-lg-6">{{ createText('phone', 'phone', 'Phone', '', $data->phone) }}
</div>
<div class="col-lg-6">
{{ createText('secondary_phone', 'secondary_phone', 'Secondary Phone', '', $data->secondary_phone) }}
</div>
<div class="col-lg-6">
{{ createText('location', 'location', 'Office Location', '', $data->location) }}
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextArea('google_map', '', 'Google Map', $data->google_map) }}
</div>
</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane fade" id="custom-v-pills-logo" role="tabpanel"
aria-labelledby="custom-v-pills-logo-tab">
<div class="d-flex mb-4">
<div class="row">
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('primary_logo', 'Primary Logo', '', $data->primary_logo) }}
</div>
<div class="nav nav-pills flex-column nav-pills-tab custom-verti-nav-pills text-center" role="tablist"
aria-orientation="vertical">
<a class="nav-link active show" id="settings" data-bs-toggle="pill" href="#custom-v-pills-home"
role="tab" aria-controls="custom-v-pills-home" aria-selected="true">
<i class="ri-home-4-line d-block fs-20 mb-1"></i> Settings
</a>
<a class="nav-link" id="address" data-bs-toggle="pill" href="#custom-v-pills-address"
role="tab" aria-controls="custom-v-pills-address" aria-selected="false">
<i class="ri-map-pin-2-line d-block fs-20 mb-1"></i> Address
</a>
<a class="nav-link" id="logo" data-bs-toggle="pill" href="#custom-v-pills-logo" role="tab"
aria-controls="custom-v-pills-logo" aria-selected="false">
<i class="ri-image-2-line d-block fs-20 mb-1"></i> Logo/Images
</a>
<a class="nav-link" id="socialmedia" data-bs-toggle="pill" href="#custom-v-pills-social"
role="tab" aria-controls="custom-v-pills-social" aria-selected="false">
<i class="ri-apps-2-line d-block fs-20 mb-1"></i> Social Media
</a>
<a class="nav-link" id="seo" data-bs-toggle="pill" href="#custom-v-pills-seo" role="tab"
aria-controls="custom-v-pills-seo" aria-selected="false">
<i class="ri-global-line d-block fs-20 mb-1"></i> SEO
</a>
<a class="nav-link" id="seo" data-bs-toggle="pill" href="#custom-v-pills-security"
role="tab" aria-controls="custom-v-pills-seo" aria-selected="false">
<i class="ri-global-line d-block fs-20 mb-1"></i> Security
</a>
</div>
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('secondary_logo', 'Secondary Logo', '', $data->secondary_logo) }}
</div>
</div>
</div>
<div class="file-manager-content w-100 p-3 py-0">
<div class="mx-n3 file-manager-content-scroll px-4 pt-4" data-simplebar>
<div>
<div class="d-flex align-items-center border-bottom border-bottom-dashed mb-3">
<h5 class="flex-grow-1 fs-16 mb-0" id="filetype-title"></h5>
<div class="flex-shrink-0">
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('settings.index')); ?>
</div>
</div>
<div class="tab-content text-muted mt-lg-0 mt-3">
<div class="tab-pane fade active show" id="custom-v-pills-home" role="tabpanel"
aria-labelledby="custom-v-pills-home-tab">
<div>
{{ createText('title', 'title', 'Page Title', '', $data->title) }}
<h5 class="fs-14 text-muted mb-3 mt-2">Parmalink: <a href="<?php echo env('APP_URL'); ?>"
target="_blank"><?php echo env('APP_URL'); ?></a> </h5>
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextarea('description', 'description', 'Description', $data->description) }}
</div>
<div class="row">
<div class="col-lg-6">
{{ createText('working_days', 'working_days', 'Working days', '', $data->working_days) }}
</div>
<div class="col-lg-6">
{{ createText('working_hours', 'working_hours', 'Working Hours', '', $data->working_hours) }}
</div>
</div>
<div class="col-lg-6">
{{ createText('leave_days', 'leave_days', 'Leave Days', '', $data->leave_days) }}
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextarea('content1', 'content1', 'Content1', $data->content1) }}
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextarea('content2', 'content2', 'Content2', $data->content2) }}
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextarea('content3', 'content3', 'Content3', $data->content3) }}
</div>
<div class="col-lg-12">
{{ createText('copyright_text', 'copyright_text', 'Copyright', '', $data->copyright_text) }}
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane fade" id="custom-v-pills-address" role="tabpanel"
aria-labelledby="custom-v-pills-address-tab">
<div class="d-flex mb-4">
<div class="row">
<div class="col-lg-6">{{ createText('url1', 'url1', 'Url 1', '', $data->url1) }}
</div>
<div class="col-lg-6">{{ createText('url2', 'url2', 'Url 2', '', $data->url2) }}
</div>
<div class="col-lg-6">{{ createText('email', 'email', 'Email', '', $data->email) }}
</div>
<div class="col-lg-6">
{{ createText('phone', 'phone', 'Phone', '', $data->phone) }}
</div>
<div class="col-lg-6">
{{ createText('secondary_phone', 'secondary_phone', 'Secondary Phone', '', $data->secondary_phone) }}
</div>
<div class="col-lg-6">
{{ createText('location', 'location', 'Office Location', '', $data->location) }}
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextArea('google_map', '', 'Google Map', $data->google_map) }}
</div>
</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane fade" id="custom-v-pills-logo" role="tabpanel"
aria-labelledby="custom-v-pills-logo-tab">
<div class="d-flex mb-4">
<div class="row">
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('primary_logo', 'Primary Logo', '', $data->primary_logo) }}
</div>
</div>
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('secondary_logo', 'Secondary Logo', '', $data->secondary_logo) }}
</div>
</div>
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('thumb', 'Thumb', '', $data->thumb) }}
</div>
</div>
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('icon', 'Icon', '', $data->icon) }}
</div>
</div>
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('og_image', 'Og Image', '', $data->og_image) }}
</div>
</div>
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('no_image', 'No Image', '', $data->no_image) }}
</div>
</div>
</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane fade" id="custom-v-pills-social" role="tabpanel"
aria-labelledby="custom-v-pills-social-tab">
<div class="row">
<div class="col-lg-4">{{ createText('fb', 'fb', 'Facebook', '', $data->fb) }}
</div>
<div class="col-lg-4">
{{ createText('insta', 'insta', 'Instagram', '', $data->insta) }}
</div>
<div class="col-lg-4">
{{ createText('twitter', 'twitter', 'Twitter', '', $data->twitter) }}
</div>
<div class="col-lg-4">
{{ createText('tiktok', 'tiktok', 'Tiktok', '', $data->tiktok) }}
</div>
<div class="col-lg-4">
{{ createText('youtube', 'youtube', 'Youtube', '', $data->youtube) }}
</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane fade" id="custom-v-pills-seo" role="tabpanel"
aria-labelledby="custom-v-pills-seo-tab">
<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>
<!--end tab-pane-->
<!--end tab-pane-->
<div class="tab-pane fade" id="custom-v-pills-security" role="tabpanel"
aria-labelledby="custom-v-pills-security-tab">
<div class="col-lg-12 text-danger pb-2">
First of all, add Site at V2 Bibhuti Solutions.
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextArea('recaptcha_site_key', '', 'RECAPTCHA_SITE_KEY', $data->recaptcha_site_key) }}
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextArea('recaptcha_secret_key', '', 'RECAPTCHA_SECRET_KEY', $data->recaptcha_secret_key) }}
</div>
</div>
<!--end tab-pane-->
</div>
</div>
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('thumb', 'Thumb', '', $data->thumb) }}
</div>
</div>
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('icon', 'Icon', '', $data->icon) }}
</div>
</div>
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('og_image', 'Og Image', '', $data->og_image) }}
</div>
</div>
<div class="col-lg-12 border-bottom border-bottom-dashed pb-2">
<div class="card card-height-100 border-primary bg-opacity-10 pb-2 shadow">
{{ createImageInput('no_image', 'No Image', '', $data->no_image) }}
</div>
</div>
</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane fade" id="custom-v-pills-social" role="tabpanel"
aria-labelledby="custom-v-pills-social-tab">
<div class="row">
<div class="col-lg-4">{{ createText('fb', 'fb', 'Facebook', '', $data->fb) }}
</div>
<div class="col-lg-4"> {{ createText('insta', 'insta', 'Instagram', '', $data->insta) }}
</div>
<div class="col-lg-4"> {{ createText('twitter', 'twitter', 'Twitter', '', $data->twitter) }}
</div>
<div class="col-lg-4"> {{ createText('tiktok', 'tiktok', 'Tiktok', '', $data->tiktok) }}
</div>
<div class="col-lg-4"> {{ createText('youtube', 'youtube', 'Youtube', '', $data->youtube) }}
</div>
</div>
</div>
<!--end tab-pane-->
<div class="tab-pane fade" id="custom-v-pills-seo" role="tabpanel"
aria-labelledby="custom-v-pills-seo-tab">
<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>
<!--end tab-pane-->
<!--end tab-pane-->
<div class="tab-pane fade" id="custom-v-pills-security" role="tabpanel"
aria-labelledby="custom-v-pills-security-tab">
<div class="col-lg-12 text-danger pb-2">
First of all, add Site at V2 Bibhuti Solutions.
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextArea('recaptcha_site_key', '', 'RECAPTCHA_SITE_KEY', $data->recaptcha_site_key) }}
</div>
<div class="col-lg-12 pb-2">
{{ createPlainTextArea('recaptcha_secret_key', '', 'RECAPTCHA_SECRET_KEY', $data->recaptcha_secret_key) }}
</div>
</div>
<!--end tab-pane-->
</div>
</div>
</div>
</div>
</div>
</form>
</form>
<!-- /New Design -->
<!-- /New Design -->
@endsection

View File

@ -1,263 +1,263 @@
@extends('backend.template')
@section('content')
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Settings List") }}</h2>
<a href="{{ route('settings.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
</div>
<div class="card-body">
<table class="table dataTable" id="tbl_settings" data-url="{{ route('settings.sort') }}">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("url1") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("url2") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("email") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("phone") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("secondary_phone") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("fb") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("insta") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("twitter") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("tiktok") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("primary_logo") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("secondary_logo") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("thumb") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("icon") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("og_image") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("no_image") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("copyright_text") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("content1") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("content2") }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("content3") }}</span></th>
<th class="tb-col" data-sortable="false"><span
class="overline-title">{{ label("Action") }}</span>
</th>
</tr>
</thead>
<tbody>
@php
$i = 1;
@endphp
@foreach ($data as $item)
<tr data-id="{{$item->setting_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>">
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">{{ $item->url1 }}</td>
<td class="tb-col">{{ $item->url2 }}</td>
<td class="tb-col">{{ $item->email }}</td>
<td class="tb-col">{{ $item->phone }}</td>
<td class="tb-col">{{ $item->secondary_phone }}</td>
<td class="tb-col">{{ $item->fb }}</td>
<td class="tb-col">{{ $item->insta }}</td>
<td class="tb-col">{{ $item->twitter }}</td>
<td class="tb-col">{{ $item->tiktok }}</td>
<td class="tb-col">{{ showImageThumb($item->primary_logo) }}</td>
<td class="tb-col">{{ showImageThumb($item->secondary_logo) }}</td>
<td class="tb-col">{{ showImageThumb($item->thumb) }}</td>
<td class="tb-col">{{ showImageThumb($item->icon) }}</td>
<td class="tb-col">{{ showImageThumb($item->og_image) }}</td>
<td class="tb-col">{{ showImageThumb($item->no_image) }}</td>
<td class="tb-col">{{ $item->copyright_text }}</td>
<td class="tb-col">{{ $item->content1 }}</td>
<td class="tb-col">{{ $item->content2 }}</td>
<td class="tb-col">{{ $item->content3 }}</td>
<td class="tb-col">
<div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="ri-more-fill align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{route('settings.show',[$item->setting_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
<li><a href="{{route('settings.edit',[$item->setting_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li>
<li>
<a href="{{route('settings.toggle',[$item->setting_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }}
</a>
</li>
<li>
<a href="{{route('settings.destroy',[$item->setting_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
</a>
</li>
</ul>
</div>
</td>
</tr>
<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.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>
@endforeach
</li>
</ul>
</div>
</tbody>
</table>
</div>
</div>
</td>
</tr>
@endforeach
@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">
</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() {
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);
<script>
$(document).ready(function(e) {
$('.change-alias-badge').on('click', function() {
var aliasWrapper = $(this).prev('.alias-wrapper');
var aliasSpan = aliasWrapper.find('.alias');
var aliasInput = aliasWrapper.find('.alias-input');
var isEditing = $(this).hasClass('editing');
aliasInput.toggleClass("d-none");
if (isEditing) {
// Update alias text and switch to non-editing state
var newAlias = aliasInput.val();
aliasSpan.text(newAlias);
aliasSpan.show();
aliasInput.hide();
$(this).removeClass('editing').text('Change Alias');
var articleId = $(aliasWrapper).data('id');
var ajaxUrl = "{{ route('settings.updatealias') }}";
var data = {
articleId: articleId,
newAlias: newAlias
};
$.ajax({
url: ajaxUrl,
type: 'POST',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: data,
success: function(response) {
console.log(response);
},
error: function(xhr, status, error) {
console.error(error);
}
});
} else {
// Switch to editing state
aliasSpan.hide();
aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias');
}
});
} 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')
var mytable = $(".dataTable").DataTable({
ordering: true,
rowReorder: {
//selector: 'tr'
},
data: {
id_order: ids
},
success: function(response) {
console.log(response);
},
error: function(xhr, status, error) {
console.error(error);
});
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;
}
});
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 confirmDelete(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this item!',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: url,
type: 'DELETE',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(response) {
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
location.reload();
},
error: function(xhr, status, error) {
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
}
});
}
});
}
});
}
function confirmToggle(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: url,
type: 'GET',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(response) {
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
location.reload();
},
error: function(xhr, status, error) {
Swal.fire('Error!', 'An error occurred.', 'error');
function confirmToggle(url) {
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
reverseButtons: true
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: url,
type: 'GET',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(response) {
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
location.reload();
},
error: function(xhr, status, error) {
Swal.fire('Error!', 'An error occurred.', 'error');
}
});
}
});
}
});
}
</script>
</script>
@endpush