classify admin
This commit is contained in:
12968
resources/countries.json
Normal file
12968
resources/countries.json
Normal file
File diff suppressed because it is too large
Load Diff
0
resources/css/app.css
Normal file
0
resources/css/app.css
Normal file
132
resources/css/table-enhancements.css
Normal file
132
resources/css/table-enhancements.css
Normal file
@@ -0,0 +1,132 @@
|
||||
/* Table Enhancement Styles - Just include this CSS file */
|
||||
/* Enhanced table styling */
|
||||
.translatable-table {
|
||||
/* Add any custom table styles here */
|
||||
}
|
||||
|
||||
/* Custom search wrapper */
|
||||
.table-search-wrapper {
|
||||
background: #f8f9fa;
|
||||
padding: 15px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/* Custom toolbar styling */
|
||||
.table-toolbar {
|
||||
background: #f8f9fa;
|
||||
padding: 15px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/* Enhanced button styling */
|
||||
.table-toolbar .btn {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
/* Custom search input styling */
|
||||
.table-search-wrapper .input-group {
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
/* Enhanced table header */
|
||||
.translatable-table thead th {
|
||||
background-color: #343a40 !important;
|
||||
color: white !important;
|
||||
border: none !important;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Enhanced table rows */
|
||||
.translatable-table tbody tr {
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.translatable-table tbody tr:hover {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
/* Enhanced pagination */
|
||||
.bootstrap-table .pagination {
|
||||
justify-content: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* Enhanced search */
|
||||
.bootstrap-table .fixed-table-toolbar .search {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/* Responsive table improvements */
|
||||
@media (max-width: 768px) {
|
||||
.table-toolbar .btn-group {
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table-toolbar .btn {
|
||||
margin-bottom: 5px;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.table-search-wrapper .input-group {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Alert enhancements */
|
||||
.alert {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.alert-success {
|
||||
background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
|
||||
border-left: 4px solid #28a745;
|
||||
}
|
||||
|
||||
.alert-danger {
|
||||
background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
|
||||
border-left: 4px solid #dc3545;
|
||||
}
|
||||
|
||||
.alert-warning {
|
||||
background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
|
||||
border-left: 4px solid #ffc107;
|
||||
}
|
||||
|
||||
.alert-info {
|
||||
background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
|
||||
border-left: 4px solid #17a2b8;
|
||||
}
|
||||
|
||||
/* Badge enhancements */
|
||||
.badge {
|
||||
font-size: 0.75em;
|
||||
padding: 0.5em 0.75em;
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
|
||||
/* Image thumbnail enhancements */
|
||||
.img-thumbnail {
|
||||
border: 2px solid #dee2e6;
|
||||
border-radius: 0.375rem;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.img-thumbnail:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
/* Tooltip enhancements */
|
||||
.tooltip {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
background-color: #343a40;
|
||||
border-radius: 0.375rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
}
|
||||
1
resources/js/app.js
Normal file
1
resources/js/app.js
Normal file
@@ -0,0 +1 @@
|
||||
import './bootstrap';
|
||||
167
resources/js/bootstrap-table-helpers.js
vendored
Normal file
167
resources/js/bootstrap-table-helpers.js
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
/**
|
||||
* Bootstrap Table Helper Functions
|
||||
* Reusable JavaScript functions for Bootstrap Table functionality
|
||||
*/
|
||||
|
||||
// Global formatters that can be used across all tables
|
||||
window.BootstrapTableFormatters = {
|
||||
// Truncate text with tooltip
|
||||
truncateText: function(value, row, index, field) {
|
||||
if (!value) return '<span class="text-muted">' + window.trans('No data') + '</span>';
|
||||
|
||||
const maxLength = field && field.maxLength ? field.maxLength : 100;
|
||||
if (value.length > maxLength) {
|
||||
return '<span title="' + value + '">' + value.substring(0, maxLength) + '...</span>';
|
||||
}
|
||||
return value;
|
||||
},
|
||||
|
||||
// Image formatter with thumbnail
|
||||
imageFormatter: function(value, row, index) {
|
||||
if (value) {
|
||||
return '<img src="' + value + '" class="img-thumbnail" style="width: 50px; height: 50px; object-fit: cover;" alt="' + window.trans('Image') + '">';
|
||||
}
|
||||
return '<span class="text-muted">' + window.trans('No image') + '</span>';
|
||||
},
|
||||
|
||||
// Status formatter with badges
|
||||
statusFormatter: function(value, row, index) {
|
||||
const statusMap = {
|
||||
'active': { class: 'success', text: window.trans('Active') },
|
||||
'inactive': { class: 'secondary', text: window.trans('Inactive') },
|
||||
'pending': { class: 'warning', text: window.trans('Pending') },
|
||||
'approved': { class: 'success', text: window.trans('Approved') },
|
||||
'rejected': { class: 'danger', text: window.trans('Rejected') },
|
||||
'published': { class: 'success', text: window.trans('Published') },
|
||||
'draft': { class: 'secondary', text: window.trans('Draft') },
|
||||
'deleted': { class: 'danger', text: window.trans('Deleted') }
|
||||
};
|
||||
|
||||
const status = statusMap[value] || { class: 'secondary', text: value };
|
||||
return '<span class="badge bg-' + status.class + '">' + status.text + '</span>';
|
||||
},
|
||||
|
||||
// Date formatter
|
||||
dateFormatter: function(value, row, index) {
|
||||
if (!value) return '<span class="text-muted">' + window.trans('No date') + '</span>';
|
||||
|
||||
const date = new Date(value);
|
||||
return date.toLocaleDateString() + ' ' + date.toLocaleTimeString();
|
||||
},
|
||||
|
||||
// Price formatter
|
||||
priceFormatter: function(value, row, index) {
|
||||
if (!value) return '<span class="text-muted">' + window.trans('No price') + '</span>';
|
||||
|
||||
const currency = window.currency || '$';
|
||||
return currency + parseFloat(value).toFixed(2);
|
||||
},
|
||||
|
||||
// Action buttons formatter
|
||||
actionFormatter: function(value, row, index) {
|
||||
let actions = '';
|
||||
|
||||
// Edit button
|
||||
if (window.canEdit !== false) {
|
||||
actions += '<a href="' + (row.edit_url || '#') + '" class="btn btn-sm btn-outline-primary me-1" title="' + window.trans('Edit') + '">';
|
||||
actions += '<i class="fas fa-edit"></i>';
|
||||
actions += '</a>';
|
||||
}
|
||||
|
||||
// Delete button
|
||||
if (window.canDelete !== false) {
|
||||
actions += '<button class="btn btn-sm btn-outline-danger" onclick="deleteItem(' + row.id + ')" title="' + window.trans('Delete') + '">';
|
||||
actions += '<i class="fas fa-trash"></i>';
|
||||
actions += '</button>';
|
||||
}
|
||||
|
||||
// View button
|
||||
if (row.view_url) {
|
||||
actions += '<a href="' + row.view_url + '" class="btn btn-sm btn-outline-info me-1" title="' + window.trans('View') + '">';
|
||||
actions += '<i class="fas fa-eye"></i>';
|
||||
actions += '</a>';
|
||||
}
|
||||
|
||||
return actions || '<span class="text-muted">' + window.trans('No actions') + '</span>';
|
||||
},
|
||||
|
||||
// Checkbox formatter
|
||||
checkboxFormatter: function(value, row, index) {
|
||||
return '<input type="checkbox" class="form-check-input" value="' + row.id + '">';
|
||||
},
|
||||
|
||||
// Link formatter
|
||||
linkFormatter: function(value, row, index, field) {
|
||||
if (!value) return '<span class="text-muted">' + window.trans('No link') + '</span>';
|
||||
|
||||
const url = field && field.url ? field.url : value;
|
||||
const target = field && field.target ? field.target : '_blank';
|
||||
const text = field && field.text ? field.text : value;
|
||||
|
||||
return '<a href="' + url + '" target="' + target + '" class="text-decoration-none">' + text + '</a>';
|
||||
}
|
||||
};
|
||||
|
||||
// Global query parameters function
|
||||
window.queryParams = function(params) {
|
||||
return {
|
||||
limit: params.limit,
|
||||
offset: params.offset,
|
||||
order: params.order,
|
||||
search: params.search,
|
||||
sort: params.sort,
|
||||
// Add any additional parameters
|
||||
...window.tableParams
|
||||
};
|
||||
};
|
||||
|
||||
// Global delete function
|
||||
window.deleteItem = function(id) {
|
||||
if (confirm(window.trans('Are you sure you want to delete this item?'))) {
|
||||
// This should be overridden in each view
|
||||
console.log('Delete item with ID:', id);
|
||||
}
|
||||
};
|
||||
|
||||
// Global table refresh function
|
||||
window.refreshTable = function(tableId = 'table_list') {
|
||||
$('#' + tableId).bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
// Global search function
|
||||
window.searchTable = function(tableId = 'table_list', searchText) {
|
||||
$('#' + tableId).bootstrapTable('filterBy', {
|
||||
// This will be overridden by the actual search functionality
|
||||
});
|
||||
};
|
||||
|
||||
// Initialize all tables on page load
|
||||
$(document).ready(function() {
|
||||
// Initialize tooltips
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
|
||||
// Initialize all bootstrap tables
|
||||
$('[data-toggle="table"]').each(function() {
|
||||
const tableId = $(this).attr('id');
|
||||
if (tableId) {
|
||||
// Add search functionality if search input exists
|
||||
const searchInput = $('#searchInput_' + tableId);
|
||||
if (searchInput.length) {
|
||||
searchInput.on('keyup', function() {
|
||||
const value = $(this).val();
|
||||
$('#' + tableId).bootstrapTable('filterBy', {
|
||||
// This will be overridden by the actual search functionality
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Translation helper (if not already defined)
|
||||
if (typeof window.trans === 'undefined') {
|
||||
window.trans = function(key) {
|
||||
// This should be replaced with actual translation function
|
||||
return key;
|
||||
};
|
||||
}
|
||||
36
resources/js/bootstrap.js
vendored
Normal file
36
resources/js/bootstrap.js
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import _ from 'lodash';
|
||||
window._ = _;
|
||||
|
||||
import 'bootstrap';
|
||||
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
window.axios = axios;
|
||||
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
||||
/**
|
||||
* Echo exposes an expressive API for subscribing to channels and listening
|
||||
* for events that are broadcast by Laravel. Echo and event broadcasting
|
||||
* allows your team to easily build robust real-time web applications.
|
||||
*/
|
||||
|
||||
// import Echo from 'laravel-echo';
|
||||
|
||||
// import Pusher from 'pusher-js';
|
||||
// window.Pusher = Pusher;
|
||||
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'pusher',
|
||||
// key: import.meta.env.VITE_PUSHER_APP_KEY,
|
||||
// wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
|
||||
// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
|
||||
// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
|
||||
// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
|
||||
// enabledTransports: ['ws', 'wss'],
|
||||
// });
|
||||
7
resources/sass/_variables.scss
Normal file
7
resources/sass/_variables.scss
Normal file
@@ -0,0 +1,7 @@
|
||||
// Body
|
||||
$body-bg: #f8fafc;
|
||||
|
||||
// Typography
|
||||
$font-family-sans-serif: 'Nunito', sans-serif;
|
||||
$font-size-base: 0.9rem;
|
||||
$line-height-base: 1.6;
|
||||
8
resources/sass/app.scss
Normal file
8
resources/sass/app.scss
Normal file
@@ -0,0 +1,8 @@
|
||||
// Fonts
|
||||
@import url('https://fonts.bunny.net/css?family=Nunito');
|
||||
|
||||
// Variables
|
||||
@import 'variables';
|
||||
|
||||
// Bootstrap
|
||||
@import 'bootstrap/scss/bootstrap';
|
||||
125
resources/views/auth/login.blade.php
Normal file
125
resources/views/auth/login.blade.php
Normal file
@@ -0,0 +1,125 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="shortcut icon" href="{{ $favicon ?? url('assets/images/logo/logo.png') }}" type="image/x-icon">
|
||||
<title>Login</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/main/app.css') }}">
|
||||
<link rel="stylesheet" href=" {{ asset('assets/css/pages/auth.css') }}">
|
||||
<script src="{{asset('assets/js/jquery.min.js')}}"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="auth" class="login_bg" style="background-image: url('{{$login_bg_image??''}}');">
|
||||
<img src="{{$login_bg_image ?? ''}}" data-custom-image="{{asset('assets/images/bg/login.jpg')}}" alt="" style="display: none" id="bg_image">
|
||||
<div class="justify-content-md-end justify-content-sm-center login-box d-flex align-items-center">
|
||||
<div class="col-lg-3 col-12 card" id="auth-box">
|
||||
<div class="auth-logo mb-5 d-block">
|
||||
<img id="company_logo" src="{{ $company_logo ?? '' }}" data-custom-image="{{asset('assets/images/logo/sidebar_logo.png')}}" alt="Logo">
|
||||
</div>
|
||||
<div class="center mtop-75">
|
||||
<div class='login_heading'>
|
||||
<h3>{{__("Hi, Welcome Back!") }}</h3>
|
||||
<p>{{__("Enter your details to sign in to your account.") }}</p>
|
||||
</div>
|
||||
|
||||
<div class="pt-4">
|
||||
<form method="POST" action="{{ route('login') }}" id="frmLogin">
|
||||
@csrf
|
||||
<div class="form-group position-relative form-floating mb-4">
|
||||
<input id="email" type="email" placeholder="{{__("Email")}}" class="form-control login-border form-input @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
|
||||
<label for="email">{{__("Email address")}}</label>
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group position-relative form-floating has-icon-right mb-4"
|
||||
id="pwd">
|
||||
<input id="password" type="password" placeholder="Password" class="form-control login-border form-input @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
|
||||
<label for="password">{{__("Password") }}</label>
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
|
||||
@enderror
|
||||
<div class="form-control-icon icon-right">
|
||||
<i class="bi bi-eye" id='toggle_pass'></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary btn-block btn-sm shadow-lg mt-3 login_btn">{{__("Log in") }}</button>
|
||||
@if (config('app.demo_mode'))
|
||||
<div class="text-danger text-center mt-2" role="alert">
|
||||
{{__("If you cannot login, then Click Here.") }}
|
||||
<br><a class="text-decoration-underline" target="_blank" href="{{Request::root()}}">{{Request::root()}}</a>
|
||||
</div>
|
||||
@endif
|
||||
@if (config('app.demo_mode'))
|
||||
<div class="row mt-3">
|
||||
<hr class="w-100">
|
||||
<div class="col-12 text-center text-black-50">{{__("Demo Credentials") }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<button class="btn w-100 btn-info mt-2" id="admin_btn">{{__("Admin") }}</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<button class="btn w-100 btn-info mt-2" id="staff_btn">{{__("Staff") }}</button>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$("#toggle_pass").on('click', function () {
|
||||
$(this).toggleClass("bi bi-eye bi-eye-slash");
|
||||
let input = $('[name="password"]');
|
||||
if (input.attr("type") == "password") {
|
||||
input.attr("type", "text");
|
||||
} else {
|
||||
input.attr("type", "password");
|
||||
}
|
||||
});
|
||||
|
||||
$('#bg_image').on('error', function () {
|
||||
this.src = $(this).data('custom-image');
|
||||
$('.login_bg').css('background-image', "url(" + $(this).data('custom-image') + ")");
|
||||
});
|
||||
$('#company_logo').on('error', function () {
|
||||
this.src = $(this).data('custom-image');
|
||||
});
|
||||
|
||||
@if (config('app.demo_mode'))
|
||||
// Super admin panel
|
||||
$('#admin_btn').on('click', function () {
|
||||
$('#email').val('admin@gmail.com');
|
||||
$('#password').val('admin123');
|
||||
$('.login_btn').attr('disabled', true);
|
||||
$(this).attr('disabled', true);
|
||||
$('#frmLogin').submit();
|
||||
})
|
||||
|
||||
$('#staff_btn').on('click', function () {
|
||||
$('#email').val('staff@gmail.com');
|
||||
$('#password').val('Staff@123');
|
||||
$('.login_btn').attr('disabled', true);
|
||||
$(this).attr('disabled', true);
|
||||
$('#frmLogin').submit();
|
||||
})
|
||||
|
||||
@endif
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
49
resources/views/auth/passwords/confirm.blade.php
Normal file
49
resources/views/auth/passwords/confirm.blade.php
Normal file
@@ -0,0 +1,49 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Confirm Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ __('Please confirm your password before continuing.') }}
|
||||
|
||||
<form method="POST" action="{{ route('password.confirm') }}">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-8 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Confirm Password') }}
|
||||
</button>
|
||||
|
||||
@if (Route::has('password.request'))
|
||||
<a class="btn btn-link" href="{{ route('password.request') }}">
|
||||
{{ __('Forgot Your Password?') }}
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
47
resources/views/auth/passwords/email.blade.php
Normal file
47
resources/views/auth/passwords/email.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Reset Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('password.email') }}">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Send Password Reset Link') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
65
resources/views/auth/passwords/reset.blade.php
Normal file
65
resources/views/auth/passwords/reset.blade.php
Normal file
@@ -0,0 +1,65 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Reset Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('password.update') }}">
|
||||
@csrf
|
||||
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus>
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password-confirm" class="col-md-4 col-form-label text-md-end">{{ __('Confirm Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Reset Password') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
66
resources/views/auth/register.blade.php
Normal file
66
resources/views/auth/register.blade.php
Normal file
@@ -0,0 +1,66 @@
|
||||
{{--@extends('layouts.app')--}}
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Register') }}</div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('register') }}">
|
||||
@csrf
|
||||
<div class="row mb-3">
|
||||
<label for="name" class="col-md-4 col-form-label text-md-end">{{ __('Name') }}</label>
|
||||
<div class="col-md-6">
|
||||
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus>
|
||||
@error('name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email">
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password-confirm" class="col-md-4 col-form-label text-md-end">{{ __('Confirm Password') }}</label>
|
||||
<div class="col-md-6">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">{{ __('Register') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
27
resources/views/auth/verify.blade.php
Normal file
27
resources/views/auth/verify.blade.php
Normal file
@@ -0,0 +1,27 @@
|
||||
{{--@extends('layouts.app')--}}
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Verify Your Email Address') }}</div>
|
||||
<div class="card-body">
|
||||
@if (session('resent'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('A fresh verification link has been sent to your email address.') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{ __('Before proceeding, please check your email for a verification link.') }}
|
||||
{{ __('If you did not receive the email') }},
|
||||
<form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link p-0 m-0 align-baseline">{{ __('click here to request another') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
127
resources/views/blog/create.blade.php
Normal file
127
resources/views/blog/create.blade.php
Normal file
@@ -0,0 +1,127 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Create Blogs")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('blog.index') }}">< {{__("Back to Blogs")}} </a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<form action="{{ route('blog.store') }}" class="form-redirection" data-parsley-validate method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Add Blog")}}</div>
|
||||
<div class="card-body mt-3">
|
||||
<ul class="nav nav-tabs" id="languageTabs" role="tablist">
|
||||
@foreach($languages as $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link {{ $loop->first ? 'active' : '' }}" id="tab-{{ $lang->id }}" data-bs-toggle="tab" href="#lang-{{ $lang->id }}" role="tab">
|
||||
{{ $lang->name }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $lang)
|
||||
<div class="tab-pane fade {{ $loop->first ? 'show active' : '' }}" id="lang-{{ $lang->id }}" role="tabpanel">
|
||||
<div class="row">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>{{ __("Title") }} ({{ $lang->name }})</label>
|
||||
<input type="text" name="title[{{ $lang->id }}]" class="form-control" data-parsley-required="true">
|
||||
</div>
|
||||
</div>
|
||||
@if($lang->id == 1)
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>{{ __("Slug") }}</label>
|
||||
<input type="text" name="slug" class="form-control" data-parsley-required="true">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>{{ __("Image") }}</label>
|
||||
<input type="file" name="image" class="form-control" data-parsley-required="true" accept=".jpg,.jpeg,.png">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>{{ __("Tags") }} ({{ $lang->name }})</label>
|
||||
<select id="tags[{{ $lang->id }}][]" name="tags[{{ $lang->id }}][]" data-tags="true" data-placeholder="{{__("Tags")}}" data-allow-clear="true" class="select2 col-12 w-100" multiple="multiple" data-parsley-required="true"></select>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>{{ __("Description") }} ({{ $lang->name }})</label>
|
||||
<textarea name="blog_description[{{ $lang->id }}]" id="tinymce_editor_{{ $lang->id }}" class="tinymce_editor form-control" rows="5"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{__("Save and Back")}}">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor',
|
||||
height: 400,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist autolink lists link charmap print preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
'insertdatetime table paste code help wordcount'
|
||||
],
|
||||
toolbar: 'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | removeformat | code',
|
||||
setup: function (editor) {
|
||||
editor.on("change keyup", function () {
|
||||
editor.save(); // Ensure textarea is updated
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// If using Bootstrap 5 tabs, re-init TinyMCE when tab is shown (optional)
|
||||
const tabs = document.querySelectorAll('a[data-bs-toggle="tab"]');
|
||||
tabs.forEach(tab => {
|
||||
tab.addEventListener('shown.bs.tab', () => {
|
||||
tinymce.execCommand('mceRemoveEditor', false, null);
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor',
|
||||
height: 400,
|
||||
menubar: false,
|
||||
plugins: 'lists link image table code',
|
||||
toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | bullist numlist | code'
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
192
resources/views/blog/edit.blade.php
Normal file
192
resources/views/blog/edit.blade.php
Normal file
@@ -0,0 +1,192 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Edit Blogs")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('blog.index') }}">< {{__("Back to All Blogs")}} </a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<form action="{{ route('blog.update', $blog->id) }}" method="POST" data-parsley-validate enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<input type="hidden" name="edit_data" value={{ $blog->id }}>
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Edit Blogs")}}</div>
|
||||
<div class="card-body mt-3">
|
||||
{{-- <div class="row">
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group mandatory">
|
||||
<label for="title" class="mandatory form-label">{{ __('Title') }}</label>
|
||||
<input type="text" name="title" id="title" class="form-control" data-parsley-required="true" value="{{ $blog->title }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group mandatory">
|
||||
<label for="slug" class="form-label">{{ __('Slug') }} <small>{{__('(English Only)')}}</small></label>
|
||||
<input type="text" name="slug" id="slug" class="form-control" data-parsley-required="true" value="{{$blog->slug}}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group mandatory">
|
||||
<label for="Field Name" class="mandatory form-label">{{ __('Image') }}</label>
|
||||
<div class="cs_field_img ">
|
||||
<input type="file" name="image" class="image" style="display: none" accept=" .jpg, .jpeg, .png, .svg">
|
||||
<img src="{{ empty($blog->image) ? asset('assets/img_placeholder.jpeg') : $blog->image }}" alt="" class="img preview-image" id="">
|
||||
<div class='img_input'>{{__("Browse File")}}</div>
|
||||
</div>
|
||||
<div class="input_hint"> {{__("Icon (use 256 x 256 size for better view)")}}</div>
|
||||
<div class="img_error" style="color:#DC3545;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-12">
|
||||
<div class="form-group mandatory">
|
||||
<label for="tags" class="mandatory form-label">{{ __('Tags') }}</label>
|
||||
<select id="tags" name="tags[]" data-tags="true" data-placeholder="{{__("Tags")}}" data-allow-clear="true" class="select2 col-12 w-100" multiple="multiple" data-parsley-required="true">
|
||||
@foreach ($blog->tags as $tag)
|
||||
<option value="{{ $tag }}" selected>{{ $tag }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-12">
|
||||
<label for="tinymce_editor" class="mandatory form-label">{{ __('Description') }}</label>
|
||||
<textarea name="blog_description" id="tinymce_editor" class="form-control" cols="10" rows="4">{{ $blog->description }}</textarea>
|
||||
</div>
|
||||
|
||||
</div> --}}
|
||||
<ul class="nav nav-tabs" id="languageTabs" role="tablist">
|
||||
@foreach($languages as $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link {{ $loop->first ? 'active' : '' }}" data-bs-toggle="tab" href="#lang-{{ $lang->id }}">
|
||||
{{ $lang->name }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $lang)
|
||||
@php
|
||||
$isEnglish = $lang->id == 1;
|
||||
$trans = isset($translations) ? ($translations[$lang->id] ?? null) : null;
|
||||
@endphp
|
||||
<div class="tab-pane fade {{ $loop->first ? 'show active' : '' }}" id="lang-{{ $lang->id }}">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label>{{ __("Title") }} ({{ $lang->name }})</label>
|
||||
<input type="text" name="title[{{ $lang->id }}]" class="form-control"
|
||||
value="{{ $isEnglish ? ($blog->title ?? '') : ($trans->title ?? '') }}">
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label>{{ __("Slug") }}</label>
|
||||
<input type="text" name="slug" class="form-control"
|
||||
value="{{ $isEnglish ? ($blog->slug ?? '') : '' }}" {{ !$isEnglish ? 'disabled' : '' }}>
|
||||
@if(!$isEnglish)
|
||||
<small class="text-danger">{{ __("This field can be added in English only.") }}</small>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label>{{ __("Image") }}</label>
|
||||
@if($isEnglish && isset($blog))
|
||||
<img src="{{ $blog->image }}" alt="Image" style="max-height: 100px;" class="mb-2 d-block">
|
||||
@endif
|
||||
<input type="file" name="image" class="form-control" {{ !$isEnglish ? 'disabled' : '' }} accept=".jpg,.jpeg,.png">
|
||||
@if(!$isEnglish)
|
||||
<small class="text-danger">{{ __("This field can be added in English only.") }}</small>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label>{{ __("Tags") }}</label>
|
||||
<select name="tags[{{ $lang->id }}][]" data-tags="true" data-placeholder="{{__("Tags")}}" data-allow-clear="true"
|
||||
class="select2 col-12 w-100" multiple="multiple">
|
||||
@php
|
||||
$selectedTags = old("tags.$lang->id", $isEnglish ? ($blog->tags ?? []) : ($trans->tags ?? []));
|
||||
@endphp
|
||||
|
||||
@foreach($selectedTags as $tag)
|
||||
<option selected value="{{ $tag }}">{{ $tag }}</option>
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<label>{{ __("Description") }}</label>
|
||||
<textarea name="blog_description[{{ $lang->id }}]" id="tinymce_editor_{{ $lang->id }}" class="tinymce_editor form-control" rows="5">{{ old("description.$lang->id", $isEnglish ? ($blog->description ?? '') : ($trans->description ?? '')) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{__("Save and Back")}}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('js')
|
||||
<script !src="">
|
||||
$('#category_id').val("{{$blog->category_id}}")
|
||||
</script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor',
|
||||
height: 400,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist autolink lists link charmap print preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
'insertdatetime table paste code help wordcount'
|
||||
],
|
||||
toolbar: 'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | removeformat | code',
|
||||
setup: function (editor) {
|
||||
editor.on("change keyup", function () {
|
||||
editor.save(); // Ensure textarea is updated
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// If using Bootstrap 5 tabs, re-init TinyMCE when tab is shown (optional)
|
||||
const tabs = document.querySelectorAll('a[data-bs-toggle="tab"]');
|
||||
tabs.forEach(tab => {
|
||||
tab.addEventListener('shown.bs.tab', () => {
|
||||
tinymce.execCommand('mceRemoveEditor', false, null);
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor',
|
||||
height: 400,
|
||||
menubar: false,
|
||||
plugins: 'lists link image table code',
|
||||
toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | bullist numlist | code'
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
57
resources/views/blog/index.blade.php
Normal file
57
resources/views/blog/index.blade.php
Normal file
@@ -0,0 +1,57 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Blogs")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4 class="mb-0">@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 d-flex justify-content-end">
|
||||
@can('blog-create')
|
||||
<a class="btn btn-primary" href="{{ route('blog.create') }}">+ {{__("Add blog")}} </a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<table class="table table-borderless table-striped translatable-table" aria-describedby="mydesc"
|
||||
id="table_list" data-toggle="table" data-url="{{ route('blog.show', $category->id ?? 0) }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200,500,2000]" data-search="true" data-search-align="right"
|
||||
data-toolbar="#toolbar" data-show-columns="true" data-show-refresh="true"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="id"
|
||||
data-sort-order="desc" data-pagination-successively-size="3" data-query-params="queryParams"
|
||||
data-table="blogs" data-use-row-attr-func="true" data-mobile-responsive="true"
|
||||
data-escape="true"
|
||||
data-show-export="false" data-export-options='{"fileName": "blog-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="title" data-align="center" data-sortable="true">{{ __('Title') }}</th>
|
||||
<th scope="col" data-field="slug" data-align="center" data-sortable="true">{{ __('Slug') }}</th>
|
||||
<th scope="col" data-field="description" data-align="center" data-escape="false" data-formatter="truncateDescription">{{ __('Description') }}</th>
|
||||
<th scope="col" data-field="image" data-align="center" data-formatter="imageFormatter">{{ __('Image') }}</th>
|
||||
<th scope="col" data-field="tags" data-align="center">{{ __('Tags') }}</th>
|
||||
<th scope="col" data-field="created_at" data-align="center">{{ __('Date') }}</th>
|
||||
@can(['blog-update', 'blog-delete'])
|
||||
<th scope="col" data-escape="false" data-field="operate">{{ __('Action') }}</th>
|
||||
@endcan
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
57
resources/views/category/categories-order.blade.php
Normal file
57
resources/views/category/categories-order.blade.php
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Change Categories Order")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('category.index') }}">< {{__("Back to All Categories")}} </a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 grid-margin stretch-card">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form class="pt-3" id="update-team-member-rank-form" action="{{ route('category.order.change')}}" novalidate="novalidate">
|
||||
<ul class="sortable row col-12 d-flex justify-content-center">
|
||||
<div class="row bg-light pt-2 rounded mb-2 col-12 d-flex justify-content-center">
|
||||
@foreach( $categories as $row)
|
||||
<li id="{{$row->id}}" class="ui-state-default draggable col-md-12 col-lg-5 mr-2 col-xl-3" style="cursor:grab">
|
||||
<div class="bg-light pt-2 rounded mb-2 col-12 d-flex justify-content-center">
|
||||
<div class="row">
|
||||
<div class="col-6" style="padding-left: 15px; padding-right:5px;">
|
||||
<img src="{{$row->image}}" alt="image" class="order-change"/>
|
||||
</div>
|
||||
<div class="col-6 d-flex flex-column justify-content-center align-items-center" style="padding-left: 5px; padding-right:5px;">
|
||||
<strong> {{$row->name}} </strong>
|
||||
<div>
|
||||
<span style="font-size: 12px;">{{$row->designation}} </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@endforeach
|
||||
</div>
|
||||
</ul>
|
||||
<input class="btn btn-primary" type="submit" value="{{ __("Update")}}"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
|
||||
156
resources/views/category/create.blade.php
Normal file
156
resources/views/category/create.blade.php
Normal file
@@ -0,0 +1,156 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Create Categories")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('category.index') }}">< {{__("Back to All Categories")}} </a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<form action="{{ route('category.store') }}" method="POST" data-parsley-validate enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Add Category")}}</div>
|
||||
|
||||
<div class="card-body mt-2">
|
||||
<ul class="nav nav-tabs" id="langTabs" role="tablist">
|
||||
@foreach($languages as $key => $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($key == 0) active @endif" id="tab-{{ $lang->id }}" data-bs-toggle="tab" data-bs-target="#lang-{{ $lang->id }}" type="button" role="tab">
|
||||
{{ $lang->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $key => $lang)
|
||||
<div class="tab-pane fade @if($key == 0) show active @endif" id="lang-{{ $lang->id }}" role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Name') }} ({{ $lang->name }})</label>
|
||||
<input type="text"
|
||||
name="name[{{ $lang->id }}]"
|
||||
class="form-control"
|
||||
value=""
|
||||
data-parsley-maxlength="30"
|
||||
maxlength="30"
|
||||
data-parsley-maxlength-message="{{ __('Name cannot exceed 30 characters.') }}"
|
||||
@if($lang->id == 1) data-parsley-required="true" @endif>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Description') }} ({{ $lang->name }})</label>
|
||||
<textarea name="description[{{ $lang->id }}]" class="form-control" cols="10" rows="5"></textarea>
|
||||
</div>
|
||||
|
||||
@if($lang->id == 1)
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="category_slug" class="form-label">{{ __('Slug') }} <small>{{__('(English Only)')}}</small></label>
|
||||
<input type="text" name="slug" id="category_slug" class="form-control" data-parsley-pattern="^[a-zA-Z0-9\-_]+$"
|
||||
data-parsley-pattern-message="{{ __('Slug must be only English letters, numbers, hyphens (-) or underscores (_).') }}" placeholder="auto-generated if blank">
|
||||
<label>
|
||||
<small class="text-danger">{{ __('Note: Slug must be in English letters, numbers, hyphens (-) or underscores (_). No spaces or special characters.') }}</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12 form-group">
|
||||
<label for="p_category" class="form-label">{{ __('Parent Category') }}</label>
|
||||
<select name="parent_category_id" id="p_category" class="form-select form-control select2" data-placeholder="{{__('Select Category')}}">
|
||||
<option value="">{{__('Select a Category')}}</option>
|
||||
@include('category.dropdowntree', ['categories' => $categories])
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="Field Name" class="mandatory form-label">{{ __('Image') }}</label>
|
||||
<input type="file" name="image" id="image" class="form-control" data-parsley-required="true" accept=".jpg,.jpeg,.png">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4">
|
||||
<div class="form-check form-switch">
|
||||
<input type="hidden" name="status" id="status" value="0">
|
||||
<input class="form-check-input status-switch" type="checkbox" role="switch" id="statusSwitch">
|
||||
<label class="form-check-label" for="statusSwitch">{{ __('Active') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check form-switch">
|
||||
<input type="hidden" name="is_job_category" id="is_job_category" value="0">
|
||||
<input class="form-check-input status-switch" type="checkbox" role="switch" id="jobCategorySwitch">
|
||||
<label class="form-check-label" for="jobCategorySwitch">{{ __('Job Category') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check form-switch">
|
||||
<input type="hidden" name="price_optional" id="price_optional" value="0">
|
||||
<input class="form-check-input status-switch" type="checkbox" role="switch" id="priceOptionalSwitch">
|
||||
<label class="form-check-label" for="priceOptionalSwitch">{{ __('Price Optional') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{__("Save and Back")}}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const form = document.querySelector('form[data-parsley-validate]');
|
||||
if (!form) return;
|
||||
|
||||
const submitBtn = form.querySelector('input[type="submit"], button[type="submit"]');
|
||||
form.addEventListener('submit', function(e) {
|
||||
// Use Parsley to check validity if initialized
|
||||
if (typeof $(form).parsley === 'function') {
|
||||
if (!$(form).parsley().isValid()) {
|
||||
// If invalid, do NOT disable the button, allow user to correct form
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Disable submit button on valid submission
|
||||
if (submitBtn) {
|
||||
submitBtn.disabled = true;
|
||||
submitBtn.value = '{{ __("Saving...") }}';
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
54
resources/views/category/custom-fields.blade.php
Normal file
54
resources/views/category/custom-fields.blade.php
Normal file
@@ -0,0 +1,54 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{__("Custom Fields")}} / {{__("Sub Category")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="buttons text-start">
|
||||
<a href="{{ route('category.index', $p_id) }}" class="btn btn-primary">< {{__("Back To Category")}} </a>
|
||||
<a href="{{ route('custom-fields.create', ['id' => $cat_id]) }}" class="btn btn-primary">+ {{__("Create Custom Field")}} / {{ $category_name }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<table class="table table-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('category.custom-fields.show', $cat_id) }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true" data-search-align="right"
|
||||
data-escape="true"
|
||||
data-toolbar="#toolbar" data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false" data-responsive="true"
|
||||
data-sort-name="id" data-sort-order="desc" data-pagination-successively-size="3"
|
||||
data-query-params="queryParams" data-mobile-responsive="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="state" data-checkbox="true"></th>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="image" data-align="center" data-formatter='imageFormatter'>{{ __('Image') }}</th>
|
||||
<th scope="col" data-field="name" data-align="center" data-sortable="true">{{ __('Custom Field') }}</th>
|
||||
<th scope="col" data-field="operate" data-escape="false" data-sortable="false">{{ __('Action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
3
resources/views/category/dropdowntree.blade.php
Normal file
3
resources/views/category/dropdowntree.blade.php
Normal file
@@ -0,0 +1,3 @@
|
||||
@foreach ($categories as $category)
|
||||
{!! \App\Services\HelperService::childCategoryRendering($categories,0,$category->parent_category_id) !!}
|
||||
@endforeach
|
||||
159
resources/views/category/edit.blade.php
Normal file
159
resources/views/category/edit.blade.php
Normal file
@@ -0,0 +1,159 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Edit Categories")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('category.index') }}">< {{__("Back to All Categories")}} </a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<form action="{{ route('category.update', $category_data->id) }}" method="POST" data-parsley-validate enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<input type="hidden" name="edit_data" value={{ $category_data->id }}>
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Edit Categories")}}</div>
|
||||
<div class="card-body mt-2">
|
||||
<ul class="nav nav-tabs" id="langTabs" role="tablist">
|
||||
@foreach($languages as $key => $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($key == 0) active @endif" id="tab-{{ $lang->id }}" data-bs-toggle="tab" data-bs-target="#lang-{{ $lang->id }}" type="button" role="tab">
|
||||
{{ $lang->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $key => $lang)
|
||||
<div class="tab-pane fade @if($key == 0) show active @endif" id="lang-{{ $lang->id }}" role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Name') }} ({{ $lang->name }})</label>
|
||||
<input type="text"
|
||||
name="name[{{ $lang->id }}]"
|
||||
class="form-control"
|
||||
value="{{ $translations[$lang->id]['name'] ?? '' }}"
|
||||
data-parsley-maxlength="30"
|
||||
maxlength="30"
|
||||
data-parsley-maxlength-message="{{ __('Name cannot exceed 30 characters.') }}"
|
||||
@if($lang->id == 1) data-parsley-required="true" @endif>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Description') }} ({{ $lang->name }})</label>
|
||||
<textarea name="description[{{ $lang->id }}]" class="form-control" cols="10" rows="5">{{ $translations[$lang->id]['description'] ?? '' }}</textarea>
|
||||
</div>
|
||||
|
||||
@if($lang->id == 1)
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="category_slug" class="form-label">{{ __('Slug') }} <small>{{__('(English Only)')}}</small></label>
|
||||
<input type="text" name="slug" id="category_slug" class="form-control" data-parsley-pattern="^[a-zA-Z0-9\-_]+$"
|
||||
data-parsley-pattern-message="{{ __('Slug must be only English letters, numbers, hyphens (-) or underscores (_).') }}" value="{{ $category_data->slug }}">
|
||||
<label>
|
||||
<small class="text-danger">{{ __('Note: Slug must be in English letters, numbers, hyphens (-) or underscores (_). No spaces or special characters.') }}</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="p_category" class="mandatory form-label">{{ __('Parent Category') }}</label>
|
||||
<select name="parent_category_id" class="form-select form-control select2" id="p_category" data-placeholder="{{ __('Select Category') }}">
|
||||
@if(isset($parent_category_data) && $parent_category_data->id)
|
||||
<option value="{{ $parent_category_data->id }}" id="default_opt" selected>
|
||||
{{ $parent_category == '' ? 'Root' : $parent_category }}
|
||||
</option>
|
||||
@else
|
||||
<option value="">{{ __('Select Category') }}</option>
|
||||
@endif
|
||||
@include('category.dropdowntree', ['categories' => $categories])
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="Field Name" class="mandatory form-label">{{ __('Image') }}</label>
|
||||
<div class="cs_field_img">
|
||||
<input type="file" name="image" class="image" style="display: none" accept=" .jpg, .jpeg, .png, .svg">
|
||||
<img src="{{ empty($category_data->image) ? asset('assets/img_placeholder.jpeg') : $category_data->image }}" alt="" class="img preview-image" id="">
|
||||
<div class='img_input'>{{__("Browse File")}}</div>
|
||||
</div>
|
||||
<div class="input_hint"> {{__("Icon (use 256 x 256 size for better view)")}}</div>
|
||||
<div class="img_error" style="color:#DC3545;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4">
|
||||
<div class="form-check form-switch">
|
||||
<input type="hidden" name="status" id="status" value="{{ $category_data->status }}">
|
||||
<input class="form-check-input status-switch" type="checkbox" role="switch" aria-label="status" {{ $category_data->status == 1 ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="status">{{ __('Active') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check form-switch">
|
||||
<input type="hidden" name="is_job_category" value="0">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
role="switch"
|
||||
name="is_job_category"
|
||||
id="job_category_switch"
|
||||
value="1"
|
||||
{{ $category_data->is_job_category == 1 ? 'checked' : '' }}
|
||||
>
|
||||
<label class="form-check-label" for="job_category_switch">{{ __('Job Category') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check form-switch">
|
||||
<input type="hidden" name="price_optional" value="0">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
role="switch"
|
||||
name="price_optional"
|
||||
id="price_optional_switch"
|
||||
value="1"
|
||||
{{ $category_data->price_optional == 1 ? 'checked' : '' }}
|
||||
>
|
||||
<label class="form-check-label" for="price_optional_switch">{{ __('Price Optional') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{__("Save and Back")}}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
73
resources/views/category/index.blade.php
Normal file
73
resources/views/category/index.blade.php
Normal file
@@ -0,0 +1,73 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Categories")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4 class="mb-0">@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 d-flex justify-content-end">
|
||||
@if (!empty($category))
|
||||
<a class="btn btn-primary me-2" href="{{ route('category.index') }}">< {{__("Back to All Categories")}} </a>
|
||||
@can('category-create')
|
||||
<a class="btn btn-primary me-2" href="{{ route('category.create', ['id' => $category->id]) }}">+ {{__("Add Subcategory")}} - /{{ $category->name }} </a>
|
||||
@endcanany
|
||||
@else
|
||||
@can('category-create')
|
||||
<a class="btn btn-primary" href="{{ route('category.create') }}">+ {{__("Add Category")}} </a>
|
||||
@endcan
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="text-right col-md-12">
|
||||
<a href="{{ route('category.order') }}">+ {{__("Set Order of Categories")}} </a>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-borderless table-striped" aria-describedby="mydesc"
|
||||
id="table_list" data-toggle="table" data-url="{{ route('category.show', $category->id ?? 0) }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200,500,2000]" data-search="true" data-search-align="right"
|
||||
data-toolbar="#toolbar" data-show-columns="true" data-show-refresh="true"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="sequence"
|
||||
data-sort-order="asc" data-pagination-successively-size="3" data-query-params="queryParams"
|
||||
data-escape="true"
|
||||
data-table="categories" data-use-row-attr-func="true" data-mobile-responsive="false"
|
||||
data-show-export="true" data-export-options='{"fileName": "category-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="true" data-formatter="categoryNameFormatter">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="image" data-align="center" data-formatter="imageFormatter">{{ __('Image') }}</th>
|
||||
<th scope="col" data-field="subcategories_count" data-align="center" data-sortable="false">{{ __('Subcategories') }}</th>
|
||||
<th scope="col" data-field="custom_fields_count" data-align="center" data-sortable="false">{{ __('Custom Fields') }}</th>
|
||||
<th scope="col" data-field="advertisements_count" data-sortable="true" data-align="center" data-formatter="">{{ __('Advertisement Count') }}</th>
|
||||
@can('category-update')
|
||||
<th scope="col" data-field="status" data-width="5" data-sortable="true" data-formatter="statusSwitchFormatter">{{ __('Active') }}</th>
|
||||
@endcan
|
||||
@canany(['category-update', 'category-delete'])
|
||||
<th scope="col" data-field="operate" data-escape="false" data-sortable="false">{{ __('Action') }}</th>
|
||||
@endcanany
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
57
resources/views/category/sub-categories-order.blade.php
Normal file
57
resources/views/category/sub-categories-order.blade.php
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Change Categories Order")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('category.index') }}">< {{__("Back to All Categories")}} </a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 grid-margin stretch-card">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form class="pt-3" id="update-team-member-rank-form" action="{{ route('category.order.change')}}" novalidate="novalidate">
|
||||
<ul class="sortable row col-12 d-flex justify-content-center">
|
||||
<div class="row bg-light pt-2 rounded mb-2 col-12 d-flex justify-content-center">
|
||||
@foreach( $categories as $row)
|
||||
<li id="{{$row->id}}" class="ui-state-default draggable col-md-12 col-lg-5 mr-2 col-xl-3" style="cursor:grab">
|
||||
<div class="bg-light pt-2 rounded mb-2 col-12 d-flex justify-content-center">
|
||||
<div class="row">
|
||||
<div class="col-6" style="padding-left:15px; padding-right:5px;">
|
||||
<img src="{{$row->image}}" alt="image" class="order-change"/>
|
||||
</div>
|
||||
<div class="col-6 d-flex flex-column justify-content-center align-items-center" style="padding-left: 5px; padding-right:5px;">
|
||||
<strong> {{$row->name}} </strong>
|
||||
<div>
|
||||
<span style="font-size: 12px;">{{$row->designation}} </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@endforeach
|
||||
</div>
|
||||
</ul>
|
||||
<input class="btn btn-primary" type="submit" value="{{ __("Update")}}"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
|
||||
52
resources/views/category/treeview.blade.php
Normal file
52
resources/views/category/treeview.blade.php
Normal file
@@ -0,0 +1,52 @@
|
||||
@foreach ($categories as $category)
|
||||
<div class="category">
|
||||
<div class="category-header">
|
||||
<label>
|
||||
<input type="checkbox"
|
||||
name="selected_categories[]"
|
||||
value="{{ $category->id }}"
|
||||
class="category-checkbox"
|
||||
{{ in_array($category->id, $selected_categories) ? "checked" : "" }}>
|
||||
{{ $category->name }}
|
||||
</label>
|
||||
@if (!empty($category->subcategories))
|
||||
@php
|
||||
// Get current language from Session
|
||||
$currentLang = Session::get('language');
|
||||
// Check RTL: use accessor which returns boolean (rtl != 0)
|
||||
$isRtl = false;
|
||||
if (!empty($currentLang)) {
|
||||
try {
|
||||
// Try to get raw attribute first, fallback to accessor
|
||||
$rtlRaw = method_exists($currentLang, 'getRawOriginal') ? $currentLang->getRawOriginal('rtl') : null;
|
||||
if ($rtlRaw !== null) {
|
||||
$isRtl = ($rtlRaw == 1 || $rtlRaw === true);
|
||||
} else {
|
||||
$isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1);
|
||||
}
|
||||
}
|
||||
$arrowIcon = $isRtl ? '' : ''; // fa-caret-left for RTL, fa-caret-right for LTR
|
||||
@endphp
|
||||
<i style="font-size:24px"
|
||||
class="fas toggle-button {{ in_array($category->id, $selected_all_categories) ? 'open' : '' }}">
|
||||
{!! $arrowIcon !!}
|
||||
</i>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- ✅ Same open/close logic applies recursively --}}
|
||||
<div class="subcategories"
|
||||
style="display: {{ in_array($category->id, $selected_all_categories) ? 'block' : 'none' }};">
|
||||
@if (!empty($category->subcategories))
|
||||
@include('category.treeview', [
|
||||
'categories' => $category->subcategories,
|
||||
'selected_categories' => $selected_categories,
|
||||
'selected_all_categories' => $selected_all_categories
|
||||
])
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
52
resources/views/change_password/index.blade.php
Normal file
52
resources/views/change_password/index.blade.php
Normal file
@@ -0,0 +1,52 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Change Password') }}
|
||||
@endsection
|
||||
@section('content')
|
||||
<section class="section col-sm-6 col-xs-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="divider">
|
||||
<div class="divider-text">
|
||||
<h4 class="mb-0">{{ __('Change Password') }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
{!! Form::open(['url' => route('change-password.update'),'data-parsley-validate','class' => 'create-form','data-parsley-validate']) !!}
|
||||
<div class="row mt-1">
|
||||
<div class="card-body">
|
||||
<label for="old_password" class="form-label">{{ __('Current Password')}}</label>
|
||||
<div class="form-group position-relative has-icon-right mb-4 mandatory">
|
||||
<input type="password" name="old_password" id="old_password" class="form-control form-control-solid mb-2" value="" placeholder="{{__("Current Password")}}" required/>
|
||||
<div class="form-control-icon lh-1 top-0 mt-2">
|
||||
<i class="bi bi-eye toggle-password"></i>
|
||||
</div>
|
||||
</div>
|
||||
<label for="new_password" class="form-label">{{ __('New Password')}}</label>
|
||||
<div class="form-group position-relative has-icon-right mb-4 mandatory">
|
||||
<input type="password" name="new_password" id="new_password" class="form-control form-control-solid" value="" placeholder="{{__("New Password")}}" data-parsley-minlength="8" data-parsley-uppercase="1" data-parsley-lowercase="1" data-parsley-number="1" data-parsley-special="1" data-parsley-required/>
|
||||
<div class="form-control-icon lh-1 top-0 mt-2">
|
||||
<i class="bi bi-eye toggle-password"></i>
|
||||
</div>
|
||||
</div>
|
||||
<label for="confirm_password" class="form-label">{{ __('Confirm Password')}}</label>
|
||||
<div class="form-group position-relative has-icon-right mb-4 mandatory">
|
||||
<input type="password" id="confirm_password" name="confirm_password" class="form-control form-control-solid" value="" placeholder="{{__("Confirm Password")}}" data-parsley-equalto="#new_password" required/>
|
||||
<div class="form-control-icon lh-1 top-0 mt-2">
|
||||
<i class="bi bi-eye toggle-password"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12 text-end">
|
||||
<button type="submit" class="btn btn-primary float-right">{{ __('Change') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
54
resources/views/change_profile/index.blade.php
Normal file
54
resources/views/change_profile/index.blade.php
Normal file
@@ -0,0 +1,54 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Change Profile') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="divider">
|
||||
<h4>{{ __('Change Profile') }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::open(['url' => route('change-profile.update'), 'class' => 'create-form-without-reset', 'files' => true]) }}
|
||||
<div class="row mt-1">
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label text-alert text-center">{{ __('Profile') }}</label>
|
||||
<div class="col-sm-4 cs_field_img ">
|
||||
<input type="file" name="profile" class="image" style="display: none" accept=" .jpg, .jpeg, .png, .svg">
|
||||
<img src="{{ empty(Auth::user()->profile) ? asset('assets/images/faces/2.jpg') : Auth::user()->profile }}" alt="" class="img preview-image">
|
||||
<div class='img_input'>{{__("Browse File")}}</div>
|
||||
</div>
|
||||
<div class="img_error" style="color:#DC3545;"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="name" class="col-sm-4 col-form-label text-alert text-center">{{ __('Name') }}</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="name" id="name" class="form-control form-control-lg form-control-solid mb-2" placeholder={{ __('Name') }} value="{{ Auth::user()->name }}" required/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="{{ __('email') }}" class="col-sm-4 col-form-label text-alert text-center">{{ __('Email') }}</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="email" name="{{ __('email') }}" id="{{ __('email') }}" class="form-control form-control-lg form-control-solid mb-2" placeholder="{{__("Email")}}" value="{{ Auth::user()->email }}" required/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label text-alert"> </label>
|
||||
<div class="col-sm-12 text-end">
|
||||
<button type="submit" name="btnadd" value="btnadd" class="btn btn-primary float-right">{{ __('Change') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
48
resources/views/contact-us.blade.php
Normal file
48
resources/views/contact-us.blade.php
Normal file
@@ -0,0 +1,48 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("User Queries")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4 class="mb-0">@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
<table class="table table-borderless table-striped" aria-describedby="mydesc"
|
||||
id="table_list" data-toggle="table" data-url="{{ route('contact-us.show') }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200,500,2000]" data-search="true" data-search-align="right"
|
||||
data-toolbar="#toolbar" data-show-columns="true" data-show-refresh="true"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="id"
|
||||
data-sort-order="desc" data-pagination-successively-size="3" data-query-params="queryParams"
|
||||
data-escape="true"
|
||||
data-use-row-attr-func="true" data-mobile-responsive="true"
|
||||
data-show-export="true" data-export-options='{"fileName": "category-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="name" data-align="center" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="email" data-align="center">{{ __('Email') }}</th>
|
||||
<th scope="col" data-field="subject" data-align="center" data-sortable="true">{{ __('Subject') }}</th>
|
||||
<th scope="col" data-field="message" data-align="center" data-sortable="true" data-formatter="descriptionFormatter" >{{ __('Message') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
132
resources/views/currency/create.blade.php
Normal file
132
resources/views/currency/create.blade.php
Normal file
@@ -0,0 +1,132 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{ __('Create Currency') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('currency.index') }}">
|
||||
< {{ __('Back to Currencies') }} </a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<form action="{{ route('currency.store') }}" class="create-form" data-parsley-validate method="POST"
|
||||
data-success-function="afterCustomFieldCreationSuccess" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Create Currency') }}</div>
|
||||
<div class="card-body mt-3">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group mb-3 mandatory">
|
||||
<label for="iso_code">{{ __('ISO Code') }}</label>
|
||||
<input type="text" name="iso_code" id="iso_code" class="form-control"
|
||||
placeholder="e.g. USD, INR" maxlength="3" required pattern="[A-Z]{3}"
|
||||
oninput="this.value = this.value.toUpperCase().replace(/[^A-Z]/g, '')">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3 mandatory">
|
||||
<label for="name">{{ __('Name') }}</label>
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
data-parsley-required="true" placeholder="Enter the Currency Name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3 mandatory">
|
||||
<label for="code">{{ __('Symbol') }}</label>
|
||||
<input type="text" name="symbol" id="code" class="form-control"
|
||||
data-parsley-required="true" placeholder="Currency Symbol" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3 mandatory">
|
||||
<label for="country" class="form-label">{{ __('Country') }}</label>
|
||||
<select class="form-control" id="country_item" name="country_id"
|
||||
data-parsley-required="true">
|
||||
<option value="">--Select Country--</option>
|
||||
@foreach ($countries as $country)
|
||||
<option value="{{ $country->id }}">
|
||||
{{ $country->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3">
|
||||
<label for="symbol_position"
|
||||
class="form-label">{{ __('Currency Symbol Position') }}</label>
|
||||
<div class="mt-2 d-flex align-items-center">
|
||||
<div class="form-check me-3">
|
||||
<input type="radio" id="currency_symbol_left" name="symbol_position"
|
||||
value="left" class="form-check-input" checked>
|
||||
<label for="currency_symbol_left"
|
||||
class="form-check-label">{{ __('Left') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="radio" id="currency_symbol_right" name="symbol_position"
|
||||
value="right" class="form-check-input">
|
||||
<label for="currency_symbol_right"
|
||||
class="form-check-label">{{ __('Right') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group mb-3">
|
||||
<label for="decimal_places" class="form-label">{{ __('Decimal Places') }}</label>
|
||||
<input type="number" name="decimal_places" id="decimal_places" class="form-control"
|
||||
min="0" max="6" placeholder="Ex. 2">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group mb-3">
|
||||
<label for="thousand_separator"
|
||||
class="form-label">{{ __('Thousand Separator') }}</label>
|
||||
<input type="text" name="thousand_separator" id="thousand_separator"
|
||||
class="form-control" maxlength="1" placeholder="Ex. ,">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group mb-3">
|
||||
<label for="decimal_separator"
|
||||
class="form-label">{{ __('Decimal Separator') }}</label>
|
||||
<input type="text" name="decimal_separator" id="decimal_separator"
|
||||
class="form-control" maxlength="1" placeholder="Ex. .">
|
||||
</div>
|
||||
</div>
|
||||
{{-- </div>
|
||||
@endforeach --}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{ __('Save and Back') }}">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
function afterCustomFieldCreationSuccess() {
|
||||
setTimeout(function () {
|
||||
window.location.href = "{{ route('currency.index') }}";
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
143
resources/views/currency/edit.blade.php
Normal file
143
resources/views/currency/edit.blade.php
Normal file
@@ -0,0 +1,143 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{ __('Edit Currency') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('currency.index') }}">
|
||||
< {{ __('Back to All Currencies') }} </a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<form action="{{ route('currency.update', $currency->id) }}" method="POST" data-parsley-validate
|
||||
enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<input type="hidden" name="edit_data" value={{ $currency->id }}>
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Edit Currency') }}</div>
|
||||
<div class="card-body mt-2">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group mb-3 mandatory">
|
||||
<label for="iso_code">{{ __('ISO Code') }}</label>
|
||||
<input type="text" value="{{ $currency->iso_code }}" name="iso_code"
|
||||
id="iso_code" class="form-control" data-parsley-required="true"
|
||||
placeholder="e.g. USD, INR" maxlength="3" required pattern="[A-Z]{3}"
|
||||
oninput="this.value = this.value.toUpperCase().replace(/[^A-Z]/g, '')" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3 mandatory">
|
||||
<label for="name">{{ __('Name') }}</label>
|
||||
<input type="text" value="{{ $currency->name }}" name="name" id="name"
|
||||
class="form-control" data-parsley-required="true"
|
||||
placeholder="Enter the Currency Name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3 mandatory">
|
||||
<label for="code">{{ __('Symbol') }}</label>
|
||||
<input type="text" value="{{ $currency->symbol }}" name="symbol" id="code"
|
||||
class="form-control" data-parsley-required="true" placeholder="Currency Symbol"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3 mandatory">
|
||||
<label for="country" class="form-label">{{ __('Country') }}</label>
|
||||
<select class="form-control select2" id="country_item" name="country_id"
|
||||
data-parsley-required="true" required>
|
||||
<option value="">--Select Country--</option>
|
||||
@foreach ($countries as $country)
|
||||
<option value="{{ $country->id }}"
|
||||
{{ $currency->country_id == $country->id ? 'selected' : '' }}>
|
||||
{{ $country->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3">
|
||||
<label for="currency_symbol_position"
|
||||
class="form-label">{{ __('Currency Symbol Position') }}</label>
|
||||
<div class="mt-2 d-flex align-items-center">
|
||||
<div class="form-check me-3">
|
||||
<input type="radio" id="currency_symbol_left" name="symbol_position"
|
||||
value="left" class="form-check-input"
|
||||
{{ $currency->symbol_position == 'left' ? 'checked' : '' }}>
|
||||
<label for="currency_symbol_left"
|
||||
class="form-check-label">{{ __('Left') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="radio" id="currency_symbol_right" name="symbol_position"
|
||||
value="right" class="form-check-input"
|
||||
{{ $currency->symbol_position == 'right' ? 'checked' : '' }}>
|
||||
<label for="currency_symbol_right"
|
||||
class="form-check-label">{{ __('Right') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group mb-3">
|
||||
<label for="decimal_places" class="form-label">{{ __('Decimal Places') }}</label>
|
||||
<input type="number" name="decimal_places" id="decimal_places" class="form-control"
|
||||
value="{{ $currency->decimal_places ?? 2 }}" min="0" max="6">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group mb-3">
|
||||
<label for="thousand_separator"
|
||||
class="form-label">{{ __('Thousand Separator') }}</label>
|
||||
<input type="text" name="thousand_separator" id="thousand_separator"
|
||||
class="form-control" value="{{ $currency->thousand_separator ?? ',' }}"
|
||||
maxlength="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group mb-3">
|
||||
<label for="decimal_separator"
|
||||
class="form-label">{{ __('Decimal Separator') }}</label>
|
||||
<input type="text" name="decimal_separator" id="decimal_separator"
|
||||
class="form-control" value="{{ $currency->decimal_separator ?? '.' }}"
|
||||
maxlength="1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{ __('Save and Back') }}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
function afterCustomFieldUpdate() {
|
||||
setTimeout(function () {
|
||||
window.location.href = "{{ route('currency.index') }}";
|
||||
}, 1000)
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
67
resources/views/currency/index.blade.php
Normal file
67
resources/views/currency/index.blade.php
Normal file
@@ -0,0 +1,67 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Currency') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 d-flex justify-content-end">
|
||||
<a class="btn btn-primary" href="{{ route('currency.create') }}">{{ __('Create Currency') }}</a>
|
||||
{{-- <div class="col-12 col-md-6 d-flex justify-content-end">
|
||||
<a class="btn btn-primary me-2" href="{{ route('currency.create') }}">{{ __('Create Currency') }}</a>
|
||||
</div> --}}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
{{-- <div class="buttons d-flex justify-content-end">
|
||||
|
||||
</div> --}}
|
||||
|
||||
{{-- {{ print_r($currencies) }} --}}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('currency.show', 1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]"
|
||||
data-search="true" data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3" data-table="currencies" data-status-column="deleted_at"
|
||||
data-escape="true" data-show-export="true"
|
||||
data-export-options='{"fileName": "currency-list","ignoreColumn": ["operate"]}'
|
||||
data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true" data-filter-control="true"
|
||||
data-filter-control-container="#filters" data-toolbar="#filters">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="iso_code" data-sortable="true">{{ __('ISO Code') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="symbol" data-sortable="true">{{ __('Symbol') }}</th>
|
||||
<th scope="col" data-field="symbol_position" data-sortable="true">
|
||||
{{ __('Symbol Position') }}</th>
|
||||
<th scope="col" data-field="country.name" data-sort-name="country_name"
|
||||
data-sortable="true">{{ __('Country') }}
|
||||
</th>
|
||||
@can(['blog-update', 'blog-delete'])
|
||||
<th scope="col" data-escape="false" data-field="operate">{{ __('Action') }}</th>
|
||||
@endcan
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
627
resources/views/custom-fields/bulk-update.blade.php
Normal file
627
resources/views/custom-fields/bulk-update.blade.php
Normal file
@@ -0,0 +1,627 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{__("Bulk Update Custom Fields")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4 class="mb-0">@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 text-end">
|
||||
<a href="{{ route('custom-fields.index') }}" class="btn btn-secondary mb-0">
|
||||
<i class="fas fa-arrow-left"></i> {{__("Back")}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-12 mb-2">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-warning text-dark">
|
||||
<h5 class="mb-0 fw-bold">
|
||||
<i class="fas fa-info-circle me-2"></i> {{__("Instructions & Reference Guide")}}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body p-4">
|
||||
<div class="row g-4">
|
||||
{{-- Section 1: Important Instructions --}}
|
||||
<div class="col-md-4">
|
||||
<div class="h-100 p-3 border rounded">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="bg-warning text-dark rounded-circle d-flex align-items-center justify-content-center" style="width: 40px; height: 40px;">
|
||||
<i class="fas fa-exclamation-circle"></i>
|
||||
</div>
|
||||
<h6 class="mb-0 ms-3 fw-bold">{{__("Important Instructions")}}</h6>
|
||||
</div>
|
||||
<ul class="list-unstyled mb-0">
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("Download current custom fields to get the existing data")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("Do NOT modify the ID column - it's required for updates")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("Edit the fields you want to update in the downloaded file")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("For image paths, use the gallery section to upload new images")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("Category IDs should be comma-separated if multiple categories")}}</span>
|
||||
</li>
|
||||
<li class="mb-0 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("Values for radio, dropdown, and checkbox types should be pipe-separated (|)")}}</span>
|
||||
</li>
|
||||
<li class="mb-0 d-flex align-items-start mt-3">
|
||||
<i class="fas fa-info-circle text-info me-2 mt-1"></i>
|
||||
<span><strong>{{__("Note:")}}</strong> {{__("You can open the CSV file in Excel, edit it, and save it. Excel will maintain the CSV format.")}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="h-100 p-3 border rounded">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="bg-success text-white rounded-circle d-flex align-items-center justify-content-center" style="width: 40px; height: 40px;">
|
||||
<i class="fas fa-book"></i>
|
||||
</div>
|
||||
<h6 class="mb-0 ms-3 fw-bold">{{__("Quick Reference")}}</h6>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<strong class="d-block mb-2">{{__("Field Types:")}}</strong>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
<span class="badge bg-primary">Number</span>
|
||||
<span class="badge bg-secondary">Textbox</span>
|
||||
<span class="badge bg-info text-dark">Fileinput</span>
|
||||
<span class="badge bg-warning text-dark">Radio</span>
|
||||
<span class="badge bg-success">Dropdown</span>
|
||||
<span class="badge bg-danger">Checkbox</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong class="d-block mb-2">{{__("Data Format:")}}</strong>
|
||||
<ul class="list-unstyled mb-0 small">
|
||||
<li class="mb-2">
|
||||
<i class="fas fa-dot-circle text-primary me-2"></i>
|
||||
<strong>{{__("Required:")}}</strong> 0 = {{__("Optional")}}, 1 = {{__("Required")}}
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<i class="fas fa-dot-circle text-primary me-2"></i>
|
||||
<strong>{{__("Status:")}}</strong> 0 = {{__("Inactive")}}, 1 = {{__("Active")}}
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<i class="fas fa-dot-circle text-primary me-2"></i>
|
||||
<strong>{{__("Values:")}}</strong> {{__("Use pipe (|) to separate options")}}
|
||||
</li>
|
||||
<li class="mb-0">
|
||||
<i class="fas fa-dot-circle text-primary me-2"></i>
|
||||
<strong>{{__("Categories:")}}</strong> {{__("Use comma (,) to separate IDs")}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Section 3: Gallery Instructions --}}
|
||||
<div class="col-md-4">
|
||||
<div class="h-100 p-3 border rounded">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="bg-info text-white rounded-circle d-flex align-items-center justify-content-center" style="width: 40px; height: 40px;">
|
||||
<i class="fas fa-images"></i>
|
||||
</div>
|
||||
<h6 class="mb-0 ms-3 fw-bold">{{__("Image Gallery Guide")}}</h6>
|
||||
</div>
|
||||
<ul class="list-unstyled mb-0">
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-arrow-right text-info me-2 mt-1"></i>
|
||||
<span>{{__("Click 'Open Image Gallery' button to upload images")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-arrow-right text-info me-2 mt-1"></i>
|
||||
<span>{{__("Upload multiple images at once (JPG, PNG, SVG)")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-arrow-right text-info me-2 mt-1"></i>
|
||||
<span>{{__("Click on image or 'Copy Path' button to copy image path")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-arrow-right text-info me-2 mt-1"></i>
|
||||
<span>{{__("Paste the copied path in CSV file's Image column")}}</span>
|
||||
</li>
|
||||
<li class="mb-0 d-flex align-items-start">
|
||||
<i class="fas fa-arrow-right text-info me-2 mt-1"></i>
|
||||
<span><strong>{{__("Format:")}}</strong> custom-fields/filename.jpg</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-warning text-dark">
|
||||
<h5 class="mb-0 fw-bold">
|
||||
<i class="fas fa-download me-2"></i> {{__("Download Current Custom Fields & Image Gallery")}}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body p-4">
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<div class="p-3 border rounded h-100">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<i class="fas fa-file-download text-warning me-2 fs-5"></i>
|
||||
<h6 class="mb-0 fw-bold">{{__("Download Current Data")}}</h6>
|
||||
</div>
|
||||
<p class="text-muted small mb-3">{{__("Download all existing custom fields to edit and update them")}}</p>
|
||||
<div class="d-grid gap-2">
|
||||
<a href="{{ route('custom-fields.bulk-update.download') }}" class="btn btn-warning">
|
||||
<i class="fas fa-file-csv me-2"></i> <span class="d-none d-sm-inline">{{__("Download Current Custom Fields")}}</span><span class="d-sm-none">{{__("Download CSV")}}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="p-3 border rounded h-100">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<i class="fas fa-images text-info me-2 fs-5"></i>
|
||||
<h6 class="mb-0 fw-bold">{{__("Image Gallery")}}</h6>
|
||||
</div>
|
||||
<p class="text-muted small mb-3">{{__("Upload images and copy their paths to use in your CSV file. The gallery allows you to manage all custom field images in one place.")}}</p>
|
||||
<button type="button" class="btn btn-info w-100" data-bs-toggle="modal" data-bs-target="#editModal">
|
||||
<i class="fas fa-images me-2"></i> <span class="d-none d-sm-inline">{{__("Open Image Gallery")}}</span><span class="d-sm-none">{{__("Gallery")}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h5 class="mb-0 fw-bold text-white">
|
||||
<i class="fas fa-file-upload me-2"></i> {{__("Upload & Process Updated CSV File")}}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body p-4">
|
||||
<form action="{{ route('custom-fields.bulk-update.process') }}" method="POST" enctype="multipart/form-data" id="bulkUpdateForm">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group mb-3">
|
||||
<label for="excel_file" class="form-label fw-bold">
|
||||
{{__("SelectFile")}} <span class="text-danger">*</span>
|
||||
</label>
|
||||
<input type="file" name="excel_file" id="excel_file" class="form-control form-control-lg" accept=".xlsx,.xls,.csv" required style="touch-action: manipulation; -webkit-touch-callout: none;">
|
||||
<div class="form-text">
|
||||
<i class="fas fa-info-circle me-1"></i>
|
||||
{{__("Supported formats: CSV, XLSX, XLS")}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-light border d-flex align-items-start mb-3">
|
||||
<i class="fas fa-lightbulb text-warning me-2 mt-1"></i>
|
||||
<div>
|
||||
<strong class="d-block mb-1">{{__("Important:")}}</strong>
|
||||
<p class="mb-0 small">{{__("Make sure your CSV file includes the ID column and follows the exact format from the downloaded file. You can open CSV in Excel, edit it, and save. Invalid data will be skipped during processing.")}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 d-flex align-items-end">
|
||||
<button type="submit" class="btn btn-primary w-100 w-md-auto">
|
||||
<i class="fas fa-upload"></i> <span class="d-none d-sm-inline">{{__("Upload and Update")}}</span><span class="d-sm-none">{{__("Upload")}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="galleryModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content shadow-lg">
|
||||
<div class="modal-header bg-info text-white">
|
||||
<h5 class="modal-title fw-bold" id="galleryModalLabel">
|
||||
<i class="fas fa-images me-2"></i> {{__("Image Gallery")}}
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body p-4">
|
||||
<div class="card mb-4">
|
||||
<div class="card-body">
|
||||
<h6 class="fw-bold mb-3">
|
||||
<i class="fas fa-upload text-primary me-2"></i> {{__("Upload New Images")}}
|
||||
</h6>
|
||||
<form id="galleryUploadForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="d-flex flex-column flex-sm-row gap-2">
|
||||
|
||||
<div class="flex-grow-1">
|
||||
<input type="file" name="image" id="galleryImageInput"
|
||||
class="form-control form-control-lg"
|
||||
accept=".jpg,.jpeg,.png,.svg" multiple
|
||||
style="min-height: 48px;">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-lg" id="galleryUploadBtn">
|
||||
<i class="fas fa-upload me-2"></i>
|
||||
<span class="d-none d-sm-inline">{{__("Upload Images")}}</span>
|
||||
<span class="d-sm-none">{{__("Upload")}}</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-text mt-2">
|
||||
<i class="fas fa-info-circle me-1"></i>
|
||||
{{__("You can select multiple images at once. Supported formats: JPG, JPEG, PNG, SVG (Maximum size: 5MB per image)")}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<h6 class="fw-bold mb-3">
|
||||
<i class="fas fa-images text-success me-2"></i> {{__("Uploaded Images")}}
|
||||
</h6>
|
||||
</div>
|
||||
<div id="galleryImagesList" class="row g-3" style="max-height: 500px; overflow-y: auto; padding: 10px;">
|
||||
{{-- Gallery images will be loaded here via AJAX --}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
||||
<i class="fas fa-times me-2"></i> {{__("Close")}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Error Details Modal --}}
|
||||
<div class="modal fade" id="errorDetailsModal" tabindex="-1" role="dialog" aria-labelledby="errorModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content shadow-lg">
|
||||
<div class="modal-header bg-danger text-white">
|
||||
<h5 class="modal-title fw-bold" id="errorModalLabel">
|
||||
<i class="fas fa-exclamation-triangle me-2"></i> {{__("Bulk Update Errors")}}
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body p-4">
|
||||
<div class="alert alert-info d-flex align-items-center mb-3">
|
||||
<i class="fas fa-info-circle me-2"></i>
|
||||
<div>
|
||||
<strong>{{__("Summary:")}}</strong>
|
||||
<span id="errorSummary"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive" style="max-height: 500px;">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-dark sticky-top">
|
||||
<tr>
|
||||
<th style="width: 100px;">{{__("Row #")}}</th>
|
||||
<th>{{__("Error Message")}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="errorTableBody">
|
||||
{{-- Errors will be populated here --}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="moreErrorsNotice" class="alert alert-warning mt-3" style="display: none;">
|
||||
<i class="fas fa-exclamation-triangle me-2"></i>
|
||||
<strong>{{__("Note:")}}</strong> {{__("Only the first 100 errors are displayed. There may be more errors in your file.")}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
||||
<i class="fas fa-times me-2"></i> {{__("Close")}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
let isUploading = false; // Flag to prevent multiple simultaneous uploads
|
||||
|
||||
// Handle gallery image upload
|
||||
$('#galleryUploadForm').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Prevent multiple simultaneous uploads
|
||||
if (isUploading) {
|
||||
showErrorToast('{{__("Please wait for the current upload to complete")}}');
|
||||
return false;
|
||||
}
|
||||
|
||||
const formData = new FormData(this);
|
||||
const files = $('#galleryImageInput')[0].files;
|
||||
const submitBtn = $('#galleryUploadBtn');
|
||||
const originalBtnHtml = submitBtn.html();
|
||||
|
||||
if (files.length === 0) {
|
||||
showErrorToast('{{__("Please select at least one image")}}');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set uploading flag and disable button
|
||||
isUploading = true;
|
||||
submitBtn.prop('disabled', true).html('<i class="fas fa-spinner fa-spin me-2"></i> <span class="d-none d-sm-inline">{{__("Uploading...")}}</span><span class="d-sm-none">{{__("Uploading")}}</span>');
|
||||
|
||||
// Add all files to FormData
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
formData.append('images[]', files[i]);
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '{{ route("custom-fields.bulk-upload.gallery.upload") }}',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
showSuccessToast(response.message || '{{__("Images uploaded successfully")}}');
|
||||
// Clear file input to prevent duplicate uploads
|
||||
$('#galleryImageInput').val('');
|
||||
// Reset form to clear any cached file data
|
||||
$('#galleryUploadForm')[0].reset();
|
||||
loadGalleryImages();
|
||||
} else {
|
||||
showErrorToast(response.message || '{{__("Error uploading images")}}');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
const errorMsg = xhr.responseJSON?.message || '{{__("Error uploading images")}}';
|
||||
showErrorToast(errorMsg);
|
||||
},
|
||||
complete: function() {
|
||||
// Reset uploading flag and re-enable button
|
||||
isUploading = false;
|
||||
submitBtn.prop('disabled', false).html(originalBtnHtml);
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function loadGalleryImages() {
|
||||
$.ajax({
|
||||
url: '{{ route("custom-fields.bulk-upload.gallery.list") }}',
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
if (response.status === 'success' && response.images) {
|
||||
let html = '';
|
||||
if (response.images.length === 0) {
|
||||
html = `
|
||||
<div class="col-12">
|
||||
<div class="text-center py-5">
|
||||
<i class="fas fa-images text-muted" style="font-size: 48px;"></i>
|
||||
<p class="text-muted mt-3 mb-0">{{__("No images uploaded yet. Upload images using the form above.")}}</p>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
response.images.forEach(function(image) {
|
||||
html += `
|
||||
<div class="col-6 col-md-4 col-lg-3 mb-3">
|
||||
<div class="card h-100 shadow-sm border">
|
||||
<div class="position-relative">
|
||||
<img src="${image.url}" class="card-img-top" alt="Gallery Image" style="height: 200px; object-fit: cover; cursor: pointer; width: 100%;" onclick="copyImagePath('${image.path}')">
|
||||
<div class="position-absolute top-0 end-0 m-2">
|
||||
<span class="badge bg-dark opacity-75">
|
||||
<i class="fas fa-image"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-2 p-md-3">
|
||||
<label class="form-label small fw-bold mb-2 d-block">{{__("Image Path:")}}</label>
|
||||
<input type="text" class="form-control form-control-sm mb-2 image-path-input" value="${image.path}" readonly onclick="this.select();" style="font-size: 11px;">
|
||||
<button type="button" class="btn btn-sm btn-primary w-100 copy-path-btn" data-path="${image.path}">
|
||||
<i class="fas fa-copy me-1"></i> <span class="d-none d-sm-inline">{{__("Copy Path")}}</span><span class="d-sm-none">{{__("Copy")}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
}
|
||||
$('#galleryImagesList').html(html);
|
||||
} else {
|
||||
$('#galleryImagesList').html(`
|
||||
<div class="col-12">
|
||||
<div class="text-center py-5">
|
||||
<i class="fas fa-images text-muted" style="font-size: 48px;"></i>
|
||||
<p class="text-muted mt-3 mb-0">{{__("No images uploaded yet. Upload images using the form above.")}}</p>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$('#galleryImagesList').html(`
|
||||
<div class="col-12">
|
||||
<div class="alert alert-danger text-center">
|
||||
<i class="fas fa-exclamation-triangle me-2"></i>
|
||||
{{__("Error loading images. Please try again.")}}
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Helper function to copy image path
|
||||
async function copyImagePath(path) {
|
||||
try {
|
||||
// Try modern Clipboard API first
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
await navigator.clipboard.writeText(path);
|
||||
} else {
|
||||
// Fallback for older browsers
|
||||
const input = document.createElement('input');
|
||||
input.value = path;
|
||||
input.style.position = 'fixed';
|
||||
input.style.opacity = '0';
|
||||
document.body.appendChild(input);
|
||||
input.select();
|
||||
input.setSelectionRange(0, 99999); // For mobile devices
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(input);
|
||||
}
|
||||
|
||||
// Show feedback
|
||||
const btn = $(`.copy-path-btn[data-path="${path}"]`);
|
||||
const originalHtml = btn.html();
|
||||
btn.html('<i class="fas fa-check me-1"></i> {{__("Copied!")}}').removeClass('btn-primary').addClass('btn-success');
|
||||
setTimeout(() => {
|
||||
btn.html(originalHtml).removeClass('btn-success').addClass('btn-primary');
|
||||
}, 2000);
|
||||
} catch (err) {
|
||||
console.error('Failed to copy:', err);
|
||||
showErrorToast('{{__("Failed to copy path to clipboard")}}');
|
||||
}
|
||||
}
|
||||
|
||||
// Copy path to clipboard
|
||||
$(document).on('click', '.copy-path-btn', function() {
|
||||
const path = $(this).data('path');
|
||||
copyImagePath(path);
|
||||
});
|
||||
|
||||
// Also handle click on image to copy path
|
||||
$(document).on('click', '.card-img-top', function() {
|
||||
const pathInput = $(this).closest('.card').find('.image-path-input');
|
||||
if (pathInput.length) {
|
||||
const path = pathInput.val();
|
||||
copyImagePath(path);
|
||||
}
|
||||
});
|
||||
|
||||
// Load gallery when modal is opened
|
||||
$('#editModal').on('show.bs.modal', function() {
|
||||
loadGalleryImages();
|
||||
});
|
||||
|
||||
// Unbind default create-form handler to prevent duplicate messages
|
||||
$('#bulkUpdateForm').off('submit');
|
||||
|
||||
// Handle bulk update form submission
|
||||
$('#bulkUpdateForm').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
const formData = new FormData(this);
|
||||
const submitBtn = $(this).find('button[type="submit"]');
|
||||
const originalBtnText = submitBtn.html();
|
||||
|
||||
submitBtn.html('<i class="fas fa-spinner fa-spin me-2"></i> {{__("Processing...")}}').attr('disabled', true);
|
||||
|
||||
$.ajax({
|
||||
url: $(this).attr('action'),
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
submitBtn.html(originalBtnText).attr('disabled', false);
|
||||
|
||||
if (response.error) {
|
||||
showErrorToast(response.message || '{{__("Error processing file")}}');
|
||||
if (response.data && response.data.errors && response.data.errors.length > 0) {
|
||||
displayErrors(response.data);
|
||||
}
|
||||
} else {
|
||||
if (response.warning) {
|
||||
showWarningToast(response.message || '{{__("Update completed with errors")}}');
|
||||
} else {
|
||||
showSuccessToast(response.message || '{{__("Update completed successfully")}}');
|
||||
}
|
||||
|
||||
// Show errors if any
|
||||
if (response.data && response.data.errors && response.data.errors.length > 0) {
|
||||
displayErrors(response.data);
|
||||
}
|
||||
|
||||
// Reset form on complete success
|
||||
if (response.data && response.data.error_count === 0) {
|
||||
$('#bulkUpdateForm')[0].reset();
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
submitBtn.html(originalBtnText).attr('disabled', false);
|
||||
const errorMsg = xhr.responseJSON?.message || '{{__("Error uploading file")}}';
|
||||
showErrorToast(errorMsg);
|
||||
|
||||
if (xhr.responseJSON?.data && xhr.responseJSON.data.errors && xhr.responseJSON.data.errors.length > 0) {
|
||||
displayErrors(xhr.responseJSON.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function displayErrors(data) {
|
||||
const errorCount = data.error_count || 0;
|
||||
const successCount = data.success_count || 0;
|
||||
const totalProcessed = data.total_processed || 0;
|
||||
const errors = data.errors || [];
|
||||
const hasMoreErrors = data.has_more_errors || false;
|
||||
|
||||
// Update summary
|
||||
let summaryText = '';
|
||||
if (successCount > 0 && errorCount > 0) {
|
||||
summaryText = `{{__("Successfully updated")}} ${successCount} {{__("row(s)")}}, ${errorCount} {{__("error(s) found")}}`;
|
||||
} else if (errorCount > 0) {
|
||||
summaryText = `${errorCount} {{__("error(s) found")}}`;
|
||||
}
|
||||
$('#errorSummary').text(summaryText);
|
||||
|
||||
// Populate error table
|
||||
const tbody = $('#errorTableBody');
|
||||
tbody.empty();
|
||||
|
||||
if (errors.length === 0) {
|
||||
tbody.html('<tr><td colspan="2" class="text-center text-muted">{{__("No errors to display")}}</td></tr>');
|
||||
} else {
|
||||
errors.forEach(function(error) {
|
||||
const row = $('<tr>');
|
||||
row.append($('<td>').text(error.row || '-'));
|
||||
row.append($('<td>').text(error.message || '-'));
|
||||
tbody.append(row);
|
||||
});
|
||||
}
|
||||
|
||||
// Show/hide more errors notice
|
||||
if (hasMoreErrors) {
|
||||
$('#moreErrorsNotice').show();
|
||||
} else {
|
||||
$('#moreErrorsNotice').hide();
|
||||
}
|
||||
|
||||
// Show modal
|
||||
$('#errorDetailsModal').modal('show');
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
488
resources/views/custom-fields/bulk-upload.blade.php
Normal file
488
resources/views/custom-fields/bulk-upload.blade.php
Normal file
@@ -0,0 +1,488 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{__("Bulk Upload Custom Fields")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4 class="mb-0">@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 text-end">
|
||||
<a href="{{ route('custom-fields.index') }}" class="btn btn-secondary mb-0">
|
||||
<i class="fas fa-arrow-left"></i> {{__("Back")}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-12 mb-2">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-info text-white">
|
||||
<h5 class="mb-0 fw-bold">
|
||||
<i class="fas fa-info-circle me-2"></i> {{__("Instructions & Reference Guide")}}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body p-4">
|
||||
<div class="row g-4">
|
||||
{{-- Section 1: Important Instructions --}}
|
||||
<div class="col-md-4">
|
||||
<div class="h-100 p-3 border rounded">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="bg-primary text-white rounded-circle d-flex align-items-center justify-content-center" style="width: 40px; height: 40px;">
|
||||
<i class="fas fa-exclamation-circle"></i>
|
||||
</div>
|
||||
<h6 class="mb-0 ms-3 fw-bold">{{__("Important Instructions")}}</h6>
|
||||
</div>
|
||||
<ul class="list-unstyled mb-0">
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("Download the detailed instructions PDF for complete guide")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("Download the example CSV file to see the correct format")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("Fill in all required fields according to the field type")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("For image paths, use the gallery section to upload images")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("Category IDs should be comma-separated if multiple categories")}}</span>
|
||||
</li>
|
||||
<li class="mb-0 d-flex align-items-start">
|
||||
<i class="fas fa-check-circle text-success me-2 mt-1"></i>
|
||||
<span>{{__("Values for radio, dropdown, and checkbox types should be pipe-separated (|)")}}</span>
|
||||
</li>
|
||||
<li class="mb-0 d-flex align-items-start mt-3">
|
||||
<i class="fas fa-info-circle text-info me-2 mt-1"></i>
|
||||
<span><strong>{{__("Note:")}}</strong> {{__("You can open the CSV file in Excel, edit it, and save it. Excel will maintain the CSV format.")}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="h-100 p-3 border rounded">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="bg-success text-white rounded-circle d-flex align-items-center justify-content-center" style="width: 40px; height: 40px;">
|
||||
<i class="fas fa-book"></i>
|
||||
</div>
|
||||
<h6 class="mb-0 ms-3 fw-bold">{{__("Quick Reference")}}</h6>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<strong class="d-block mb-2">{{__("Field Types:")}}</strong>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
<span class="badge bg-primary">Number</span>
|
||||
<span class="badge bg-secondary">Textbox</span>
|
||||
<span class="badge bg-info text-dark">Fileinput</span>
|
||||
<span class="badge bg-warning text-dark">Radio</span>
|
||||
<span class="badge bg-success">Dropdown</span>
|
||||
<span class="badge bg-danger">Checkbox</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong class="d-block mb-2">{{__("Data Format:")}}</strong>
|
||||
<ul class="list-unstyled mb-0 small">
|
||||
<li class="mb-2">
|
||||
<i class="fas fa-dot-circle text-primary me-2"></i>
|
||||
<strong>{{__("Required:")}}</strong> 0 = {{__("Optional")}}, 1 = {{__("Required")}}
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<i class="fas fa-dot-circle text-primary me-2"></i>
|
||||
<strong>{{__("Status:")}}</strong> 0 = {{__("Inactive")}}, 1 = {{__("Active")}}
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<i class="fas fa-dot-circle text-primary me-2"></i>
|
||||
<strong>{{__("Values:")}}</strong> {{__("Use pipe (|) to separate options")}}
|
||||
</li>
|
||||
<li class="mb-0">
|
||||
<i class="fas fa-dot-circle text-primary me-2"></i>
|
||||
<strong>{{__("Categories:")}}</strong> {{__("Use comma (,) to separate IDs")}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Section 3: Gallery Instructions --}}
|
||||
<div class="col-md-4">
|
||||
<div class="h-100 p-3 border rounded">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="bg-info text-white rounded-circle d-flex align-items-center justify-content-center" style="width: 40px; height: 40px;">
|
||||
<i class="fas fa-images"></i>
|
||||
</div>
|
||||
<h6 class="mb-0 ms-3 fw-bold">{{__("Image Gallery Guide")}}</h6>
|
||||
</div>
|
||||
<ul class="list-unstyled mb-0">
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-arrow-right text-info me-2 mt-1"></i>
|
||||
<span>{{__("Click 'Open Image Gallery' button to upload images")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-arrow-right text-info me-2 mt-1"></i>
|
||||
<span>{{__("Upload multiple images at once (JPG, PNG, SVG)")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-arrow-right text-info me-2 mt-1"></i>
|
||||
<span>{{__("Click on image or 'Copy Path' button to copy image path")}}</span>
|
||||
</li>
|
||||
<li class="mb-3 d-flex align-items-start">
|
||||
<i class="fas fa-arrow-right text-info me-2 mt-1"></i>
|
||||
<span>{{__("Paste the copied path in CSV file's Image column")}}</span>
|
||||
</li>
|
||||
<li class="mb-0 d-flex align-items-start">
|
||||
<i class="fas fa-arrow-right text-info me-2 mt-1"></i>
|
||||
<span><strong>{{__("Format:")}}</strong> custom-fields/filename.jpg</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h5 class="mb-0 fw-bold text-white">
|
||||
<i class="fas fa-download me-2"></i> {{__("Download Files & Image Gallery")}}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body p-4">
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<div class="p-3 border rounded h-100">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<i class="fas fa-file-download text-success me-2 fs-5"></i>
|
||||
<h6 class="mb-0 fw-bold">{{__("Download Required Files")}}</h6>
|
||||
</div>
|
||||
<p class="text-muted small mb-3">{{__("Download these files before starting the bulk upload process")}}</p>
|
||||
<div class="d-grid gap-2">
|
||||
<a href="{{ route('custom-fields.bulk-upload.instructions-pdf') }}" class="btn btn-primary">
|
||||
<i class="fas fa-file-pdf me-2"></i> <span class="d-none d-sm-inline">{{__("Download Instructions PDF")}}</span><span class="d-sm-none">{{__("PDF Guide")}}</span>
|
||||
</a>
|
||||
<a href="{{ route('custom-fields.bulk-upload.example') }}" class="btn btn-success">
|
||||
<i class="fas fa-file-csv me-2"></i> <span class="d-none d-sm-inline">{{__("Download Example CSV File")}}</span><span class="d-sm-none">{{__("Example CSV")}}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="p-3 border rounded h-100">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<i class="fas fa-images text-info me-2 fs-5"></i>
|
||||
<h6 class="mb-0 fw-bold">{{__("Image Gallery")}}</h6>
|
||||
</div>
|
||||
<p class="text-muted small mb-3">{{__("Upload images and copy their paths to use in your CSV file. The gallery allows you to manage all custom field images in one place.")}}</p>
|
||||
<button type="button" class="btn btn-info w-100" data-bs-toggle="modal" data-bs-target="#editModal">
|
||||
<i class="fas fa-images me-2"></i> <span class="d-none d-sm-inline">{{__("Open Image Gallery")}}</span><span class="d-sm-none">{{__("Gallery")}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-success text-white">
|
||||
<h5 class="mb-0 fw-bold text-white">
|
||||
<i class="fas fa-file-upload me-2"></i> {{__("Upload & Process CSV File")}}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body p-4">
|
||||
<form action="{{ route('custom-fields.bulk-upload.process') }}" method="POST" class="create-form" enctype="multipart/form-data" id="bulkUploadForm">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group mb-3">
|
||||
<label for="excel_file" class="form-label fw-bold">
|
||||
{{__("SelectFile")}} <span class="text-danger">*</span>
|
||||
</label>
|
||||
<input type="file" name="excel_file" id="excel_file" class="form-control form-control-lg" accept=".xlsx,.xls,.csv" required style="touch-action: manipulation; -webkit-touch-callout: none;">
|
||||
<div class="form-text">
|
||||
<i class="fas fa-info-circle me-1"></i>
|
||||
{{__("Supported formats: CSV, XLSX, XLS")}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-light border d-flex align-items-start mb-3">
|
||||
<i class="fas fa-lightbulb text-warning me-2 mt-1"></i>
|
||||
<div>
|
||||
<strong class="d-block mb-1">{{__("Important:")}}</strong>
|
||||
<p class="mb-0 small">{{__("Make sure your CSV file follows the exact format from the example file. You can open CSV in Excel, edit it, and save. Invalid data will be skipped during processing.")}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 d-flex align-items-end">
|
||||
<button type="submit" class="btn btn-primary w-100 w-md-auto">
|
||||
<i class="fas fa-upload"></i> <span class="d-none d-sm-inline">{{__("Upload and Process")}}</span><span class="d-sm-none">{{__("Upload")}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div id="editModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true"> --}}
|
||||
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="galleryModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content shadow-lg">
|
||||
<div class="modal-header bg-info text-white">
|
||||
<h5 class="modal-title fw-bold" id="galleryModalLabel">
|
||||
<i class="fas fa-images me-2"></i> {{__("Image Gallery")}}
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body p-4">
|
||||
<div class="card mb-4">
|
||||
<div class="card-body">
|
||||
<h6 class="fw-bold mb-3">
|
||||
<i class="fas fa-upload text-primary me-2"></i> {{__("Upload New Images")}}
|
||||
</h6>
|
||||
<form id="galleryUploadForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="d-flex flex-column flex-sm-row gap-2">
|
||||
|
||||
<div class="flex-grow-1">
|
||||
<input type="file" name="image" id="galleryImageInput"
|
||||
class="form-control form-control-lg"
|
||||
accept=".jpg,.jpeg,.png,.svg" multiple
|
||||
style="min-height: 48px;">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-lg" id="galleryUploadBtn">
|
||||
<i class="fas fa-upload me-2"></i>
|
||||
<span class="d-none d-sm-inline">{{__("Upload Images")}}</span>
|
||||
<span class="d-sm-none">{{__("Upload")}}</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-text mt-2">
|
||||
<i class="fas fa-info-circle me-1"></i>
|
||||
{{__("You can select multiple images at once. Supported formats: JPG, JPEG, PNG, SVG (Max: 5MB)")}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<h6 class="fw-bold mb-3">
|
||||
<i class="fas fa-images text-success me-2"></i> {{__("Uploaded Images")}}
|
||||
</h6>
|
||||
</div>
|
||||
<div id="galleryImagesList" class="row g-3" style="max-height: 500px; overflow-y: auto; padding: 10px;">
|
||||
{{-- Gallery images will be loaded here via AJAX --}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
||||
<i class="fas fa-times me-2"></i> {{__("Close")}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
let isUploading = false; // Flag to prevent multiple simultaneous uploads
|
||||
|
||||
// Handle gallery image upload
|
||||
$('#galleryUploadForm').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Prevent multiple simultaneous uploads
|
||||
if (isUploading) {
|
||||
showErrorToast('{{__("Please wait for the current upload to complete")}}');
|
||||
return false;
|
||||
}
|
||||
|
||||
const formData = new FormData(this);
|
||||
const files = $('#galleryImageInput')[0].files;
|
||||
const submitBtn = $('#galleryUploadBtn');
|
||||
const originalBtnHtml = submitBtn.html();
|
||||
|
||||
if (files.length === 0) {
|
||||
showErrorToast('{{__("Please select at least one image")}}');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set uploading flag and disable button
|
||||
isUploading = true;
|
||||
submitBtn.prop('disabled', true).html('<i class="fas fa-spinner fa-spin me-2"></i> <span class="d-none d-sm-inline">{{__("Uploading...")}}</span><span class="d-sm-none">{{__("Uploading")}}</span>');
|
||||
|
||||
// Add all files to FormData
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
formData.append('images[]', files[i]);
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '{{ route("custom-fields.bulk-upload.gallery.upload") }}',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
showSuccessToast(response.message || '{{__("Images uploaded successfully")}}');
|
||||
// Clear file input to prevent duplicate uploads
|
||||
$('#galleryImageInput').val('');
|
||||
// Reset form to clear any cached file data
|
||||
$('#galleryUploadForm')[0].reset();
|
||||
loadGalleryImages();
|
||||
} else {
|
||||
showErrorToast(response.message || '{{__("Error uploading images")}}');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
const errorMsg = xhr.responseJSON?.message || '{{__("Error uploading images")}}';
|
||||
showErrorToast(errorMsg);
|
||||
},
|
||||
complete: function() {
|
||||
// Reset uploading flag and re-enable button
|
||||
isUploading = false;
|
||||
submitBtn.prop('disabled', false).html(originalBtnHtml);
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function loadGalleryImages() {
|
||||
$.ajax({
|
||||
url: '{{ route("custom-fields.bulk-upload.gallery.list") }}',
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
if (response.status === 'success' && response.images) {
|
||||
let html = '';
|
||||
if (response.images.length === 0) {
|
||||
html = `
|
||||
<div class="col-12">
|
||||
<div class="text-center py-5">
|
||||
<i class="fas fa-images text-muted" style="font-size: 48px;"></i>
|
||||
<p class="text-muted mt-3 mb-0">{{__("No images uploaded yet. Upload images using the form above.")}}</p>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
response.images.forEach(function(image) {
|
||||
html += `
|
||||
<div class="col-6 col-md-4 col-lg-3 mb-3">
|
||||
<div class="card h-100 shadow-sm border">
|
||||
<div class="position-relative">
|
||||
<img src="${image.url}" class="card-img-top" alt="Gallery Image" style="height: 200px; object-fit: cover; cursor: pointer; width: 100%;" onclick="copyImagePath('${image.path}')">
|
||||
<div class="position-absolute top-0 end-0 m-2">
|
||||
<span class="badge bg-dark opacity-75">
|
||||
<i class="fas fa-image"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-2 p-md-3">
|
||||
<label class="form-label small fw-bold mb-2 d-block">{{__("Image Path:")}}</label>
|
||||
<input type="text" class="form-control form-control-sm mb-2 image-path-input" value="${image.path}" readonly onclick="this.select();" style="font-size: 11px;">
|
||||
<button type="button" class="btn btn-sm btn-primary w-100 copy-path-btn" data-path="${image.path}">
|
||||
<i class="fas fa-copy me-1"></i> <span class="d-none d-sm-inline">{{__("Copy Path")}}</span><span class="d-sm-none">{{__("Copy")}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
}
|
||||
$('#galleryImagesList').html(html);
|
||||
} else {
|
||||
$('#galleryImagesList').html(`
|
||||
<div class="col-12">
|
||||
<div class="text-center py-5">
|
||||
<i class="fas fa-images text-muted" style="font-size: 48px;"></i>
|
||||
<p class="text-muted mt-3 mb-0">{{__("No images uploaded yet. Upload images using the form above.")}}</p>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$('#galleryImagesList').html(`
|
||||
<div class="col-12">
|
||||
<div class="alert alert-danger text-center">
|
||||
<i class="fas fa-exclamation-triangle me-2"></i>
|
||||
{{__("Error loading images. Please try again.")}}
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Helper function to copy image path
|
||||
async function copyImagePath(path) {
|
||||
try {
|
||||
// Try modern Clipboard API first
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
await navigator.clipboard.writeText(path);
|
||||
} else {
|
||||
// Fallback for older browsers
|
||||
const input = document.createElement('input');
|
||||
input.value = path;
|
||||
input.style.position = 'fixed';
|
||||
input.style.opacity = '0';
|
||||
document.body.appendChild(input);
|
||||
input.select();
|
||||
input.setSelectionRange(0, 99999); // For mobile devices
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(input);
|
||||
}
|
||||
|
||||
// Show feedback
|
||||
const btn = $(`.copy-path-btn[data-path="${path}"]`);
|
||||
const originalHtml = btn.html();
|
||||
btn.html('<i class="fas fa-check me-1"></i> {{__("Copied!")}}').removeClass('btn-primary').addClass('btn-success');
|
||||
setTimeout(() => {
|
||||
btn.html(originalHtml).removeClass('btn-success').addClass('btn-primary');
|
||||
}, 2000);
|
||||
} catch (err) {
|
||||
console.error('Failed to copy:', err);
|
||||
showErrorToast('{{__("Failed to copy path to clipboard")}}');
|
||||
}
|
||||
}
|
||||
|
||||
// Copy path to clipboard
|
||||
$(document).on('click', '.copy-path-btn', function() {
|
||||
const path = $(this).data('path');
|
||||
copyImagePath(path);
|
||||
});
|
||||
|
||||
// Also handle click on image to copy path
|
||||
$(document).on('click', '.card-img-top', function() {
|
||||
const pathInput = $(this).closest('.card').find('.image-path-input');
|
||||
if (pathInput.length) {
|
||||
const path = pathInput.val();
|
||||
copyImagePath(path);
|
||||
}
|
||||
});
|
||||
|
||||
// Load gallery when modal is opened
|
||||
$('#editModal').on('show.bs.modal', function() {
|
||||
loadGalleryImages();
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
216
resources/views/custom-fields/create.blade.php
Normal file
216
resources/views/custom-fields/create.blade.php
Normal file
@@ -0,0 +1,216 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{__("Custom Fields")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form action="{{ route('custom-fields.store') }}" method="POST" class="create-form" data-success-function="afterCustomFieldCreationSuccess" data-parsley-validate enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Create Custom Field")}}</div>
|
||||
<div class="card-body mt-2">
|
||||
|
||||
<ul class="nav nav-tabs" id="langTabs" role="tablist">
|
||||
@foreach($languages as $key => $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($key == 0) active @endif" id="tab-{{ $lang->id }}" data-bs-toggle="tab" data-bs-target="#lang-{{ $lang->id }}" type="button" role="tab">
|
||||
{{ $lang->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $key => $lang)
|
||||
<div class="tab-pane fade @if($key == 0) show active @endif" id="lang-{{ $lang->id }}" role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Field Name') }} ({{ $lang->name }})</label>
|
||||
<input type="text" name="name[{{ $lang->id }}]" class="form-control" @if($lang->id != 1)@endif>
|
||||
</div>
|
||||
|
||||
@if($lang->id == 1)
|
||||
{{-- Type (Only in English) --}}
|
||||
<div class="form-group">
|
||||
<label>{{ __('Field Type') }}</label>
|
||||
<select name="type" class="form-control" required>
|
||||
<option value="number">{{ __("Number Input") }}</option>
|
||||
<option value="textbox">{{ __("Text Input") }}</option>
|
||||
<option value="fileinput">{{ __("File Input") }}</option>
|
||||
<option value="radio">{{ __("Radio") }}</option>
|
||||
<option value="dropdown">{{ __("Dropdown") }}</option>
|
||||
<option value="checkbox">{{ __("Checkboxes") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group min-max-fields">
|
||||
<label>{{ __('Field Length (Min)') }}</label>
|
||||
<input type="number" name="min_length" class="form-control" min="0">
|
||||
</div>
|
||||
<div class="col-md-6 form-group min-max-fields">
|
||||
<label>{{ __('Field Length (Max)') }}</label>
|
||||
<input type="number" name="max_length" class="form-control" min="0">
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-info mt-2">
|
||||
{{ __('Field type, min/max length, and status can only be set in English.') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Field Values') }} ({{ $lang->name }})</label>
|
||||
<select name="values[{{ $lang->id }}][]" data-tags="true" data-placeholder="{{ __("Select an option") }}" data-allow-clear="true" data-token-separators="[',']" class="select2 w-100 full-width-select2" multiple="multiple" @if($lang->id == 1) required @endif></select>
|
||||
@if($lang->id != 1)
|
||||
<small class="text-muted">{{ __('Used for translatable field types.') }}</small>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="image" class="form-label">{{ __('Icon ') }}</label>
|
||||
<input type="file" name="image" id="image" class="form-control" data-parsley-required="true" accept=" .jpg, .jpeg, .png, .svg">
|
||||
{{__("(use 256 x 256 size for better view)")}}
|
||||
<div class="img_error" style="color:#DC3545;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group mandatory">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="required" id="required" value="0">
|
||||
<input class="form-check-input status-switch" type="checkbox" role="switch" aria-label="required">{{ __('Required') }}
|
||||
<label class="form-check-label" for="required"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group mandatory">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="status" id="status" value="0">
|
||||
<input class="form-check-input status-switch" type="checkbox" role="switch" aria-label="status">{{ __('Active') }}
|
||||
<label class="form-check-label" for="status"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if ($cat_id == 0)
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Category")}}</div>
|
||||
<div class="card-body mt-2">
|
||||
<div class="sub_category_lit">
|
||||
@foreach ($categories as $category)
|
||||
<div class="category">
|
||||
<div class="category-header">
|
||||
<label>
|
||||
<input type="checkbox" name="selected_categories[]" value="{{ $category->id }}"> {{ $category->name }}
|
||||
</label>
|
||||
@if (!empty($category->subcategories))
|
||||
@php
|
||||
// Get current language from Session (not from foreach loop)
|
||||
$currentLang = Session::get('language');
|
||||
// Check RTL: use accessor which returns boolean (rtl != 0)
|
||||
$isRtl = false;
|
||||
if (!empty($currentLang)) {
|
||||
try {
|
||||
// Try to get raw attribute first, fallback to accessor
|
||||
$rtlRaw = method_exists($currentLang, 'getRawOriginal') ? $currentLang->getRawOriginal('rtl') : null;
|
||||
if ($rtlRaw !== null) {
|
||||
$isRtl = ($rtlRaw == 1 || $rtlRaw === true);
|
||||
} else {
|
||||
$isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1);
|
||||
}
|
||||
}
|
||||
$arrowIcon = $isRtl ? '' : ''; // fa-caret-left for RTL, fa-caret-right for LTR
|
||||
@endphp
|
||||
<i style='font-size:24px' class='fas toggle-button'>{!! $arrowIcon !!}</i>
|
||||
@endif
|
||||
</div>
|
||||
<div class="subcategories" style="display: none;">
|
||||
@if (!empty($category->subcategories))
|
||||
@include('category.treeview', ['categories' => $category->subcategories])
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<input type="hidden" name="selected_categories[]" value="{{ $cat_id }}">
|
||||
@endif
|
||||
<div class="col-md-12 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{__("Save and Back")}}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
@section('js')
|
||||
<script>
|
||||
function updateCustomFieldUI() {
|
||||
const type = $('select[name="type"]').val();
|
||||
const valuesTypes = ['radio', 'dropdown', 'checkbox'];
|
||||
|
||||
$('.tab-pane').each(function () {
|
||||
const $tab = $(this);
|
||||
|
||||
const $fieldValues = $tab.find('select[name^="values"]')
|
||||
.closest('.form-group');
|
||||
|
||||
const $minMaxGroup = $tab.find('.min-max-fields');
|
||||
|
||||
if (valuesTypes.includes(type)) {
|
||||
$fieldValues.show();
|
||||
$minMaxGroup.hide();
|
||||
} else if (type === 'fileinput') {
|
||||
$fieldValues.hide();
|
||||
$minMaxGroup.hide();
|
||||
} else {
|
||||
$fieldValues.hide();
|
||||
$minMaxGroup.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
updateCustomFieldUI();
|
||||
|
||||
$(document).on('change', 'select[name="type"]', function () {
|
||||
updateCustomFieldUI();
|
||||
});
|
||||
});
|
||||
|
||||
function afterCustomFieldCreationSuccess() {
|
||||
setTimeout(function () {
|
||||
window.location.href = "{{ route('custom-fields.index') }}";
|
||||
}, 1000)
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
519
resources/views/custom-fields/edit.blade.php
Normal file
519
resources/views/custom-fields/edit.blade.php
Normal file
@@ -0,0 +1,519 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Custom Fields') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ url('custom-fields') }}">
|
||||
< {{ __('Back to Custom Fields') }} </a>
|
||||
@if (in_array($custom_field->type, ['radio', 'checkbox', 'dropdown']))
|
||||
<a class="btn btn-primary" data-bs-toggle="modal" data-bs-target='#addModal'>+
|
||||
{{ __('Add Options') }}</a>
|
||||
@endif
|
||||
</div>
|
||||
<form action="{{ route('custom-fields.update', $custom_field->id) }}" class="edit-form"
|
||||
data-success-function="afterCustomFieldUpdate" method="POST" data-parsley-validate
|
||||
enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Edit Custom Field') }}</div>
|
||||
<div class="card-body mt-2">
|
||||
|
||||
<ul class="nav nav-tabs" id="langTabs" role="tablist">
|
||||
@foreach ($languages as $key => $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if ($key == 0) active @endif"
|
||||
id="tab-{{ $lang->id }}" data-bs-toggle="tab"
|
||||
data-bs-target="#lang-{{ $lang->id }}" type="button" role="tab">
|
||||
{{ $lang->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach ($languages as $key => $lang)
|
||||
<div class="tab-pane fade @if ($key == 0) show active @endif"
|
||||
id="lang-{{ $lang->id }}" role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Field Name') }} ({{ $lang->name }})</label>
|
||||
<input type="text" name="name[{{ $lang->id }}]" class="form-control"
|
||||
value="{{ $translations[$lang->id]['name'] ?? '' }}"
|
||||
@if ($lang->id == 1) @endif>
|
||||
</div>
|
||||
|
||||
@if ($lang->id == 1)
|
||||
{{-- Type (Only in English) - Read Only --}}
|
||||
<div class="form-group">
|
||||
<label>{{ __('Field Type') }}</label>
|
||||
<select name="type" id="type" class="form-control" required
|
||||
disabled>
|
||||
<option value="number"
|
||||
{{ $custom_field->type == 'number' ? 'selected' : '' }}>
|
||||
{{ __('Number Input') }}</option>
|
||||
<option value="textbox"
|
||||
{{ $custom_field->type == 'textbox' ? 'selected' : '' }}>
|
||||
{{ __('Text Input') }}</option>
|
||||
<option value="fileinput"
|
||||
{{ $custom_field->type == 'fileinput' ? 'selected' : '' }}>
|
||||
{{ __('File Input') }}</option>
|
||||
<option value="radio"
|
||||
{{ $custom_field->type == 'radio' ? 'selected' : '' }}>
|
||||
{{ __('Radio') }}</option>
|
||||
<option value="dropdown"
|
||||
{{ $custom_field->type == 'dropdown' ? 'selected' : '' }}>
|
||||
{{ __('Dropdown') }}</option>
|
||||
<option value="checkbox"
|
||||
{{ $custom_field->type == 'checkbox' ? 'selected' : '' }}>
|
||||
{{ __('Checkboxes') }}</option>
|
||||
</select>
|
||||
<input type="hidden" name="type" value="{{ $custom_field->type }}">
|
||||
<small
|
||||
class="text-muted">{{ __('Field type cannot be changed after creation.') }}</small>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group min-max-fields">
|
||||
<label>{{ __('Field Length (Min)') }}</label>
|
||||
<input type="number" name="min_length" class="form-control"
|
||||
value="{{ $custom_field->min_length !== null ? $custom_field->min_length : '' }}" min="0">
|
||||
</div>
|
||||
<div class="col-md-6 form-group min-max-fields">
|
||||
<label>{{ __('Field Length (Max)') }}</label>
|
||||
<input type="number" name="max_length" class="form-control"
|
||||
value="{{ $custom_field->max_length !== null ? $custom_field->max_length : '' }}" min="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12 form-group">
|
||||
<label for="image"
|
||||
class="form-label">{{ __('Icon ') }}</label>
|
||||
<input type="file" name="image" id="image"
|
||||
class="form-control" accept=" .jpg, .jpeg, .png, .svg">
|
||||
{{ __('(use 256 x 256 size for better view)') }}
|
||||
<div class="field_img mt-2">
|
||||
<img src="{{ empty($custom_field->image) ? asset('assets/img_placeholder.jpeg') : $custom_field->image }}"
|
||||
alt="" id="blah"
|
||||
class="preview-image img w-25">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group mandatory">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="required" id="required"
|
||||
value="{{ $custom_field->required ? '1' : '0' }}">
|
||||
<input class="form-check-input status-switch" type="checkbox"
|
||||
role="switch" aria-label="required"
|
||||
{{ $custom_field->required ? 'checked' : '' }}>{{ __('Required') }}
|
||||
<label class="form-check-label" for="required"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group mandatory">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="status" id="status"
|
||||
value="{{ $custom_field->status ? '1' : '0' }}">
|
||||
<input class="form-check-input status-switch" type="checkbox"
|
||||
role="switch" aria-label="status"
|
||||
{{ $custom_field->status ? 'checked' : '' }}>{{ __('Active') }}
|
||||
<label class="form-check-label" for="status"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Field Values') }} ({{ $lang->name }})</label>
|
||||
{{-- <select name="values[{{ $lang->id }}][]" data-tags="true"
|
||||
data-placeholder="{{ __('Select an option') }}" data-allow-clear="true"
|
||||
data-token-separators="[',']" class="select2 w-100 full-width-select2"
|
||||
multiple="multiple" @if ($lang->id == 1) @endif>
|
||||
@php
|
||||
$fieldValues = [];
|
||||
if ($lang->id == 1) {
|
||||
$fieldValues = is_array($custom_field->values)
|
||||
? $custom_field->values
|
||||
: [];
|
||||
} elseif (
|
||||
isset($translations[$lang->id]['value']) &&
|
||||
is_array($translations[$lang->id]['value'])
|
||||
) {
|
||||
$fieldValues = $translations[$lang->id]['value'];
|
||||
}
|
||||
@endphp
|
||||
@foreach ($fieldValues as $value)
|
||||
<option value="{{ $value }}" selected>{{ $value }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select> --}}
|
||||
@php
|
||||
$fieldValues = [];
|
||||
|
||||
if ($lang->id == 1) {
|
||||
$fieldValues = is_array($custom_field->values)
|
||||
? $custom_field->values
|
||||
: [];
|
||||
} elseif (
|
||||
isset($translations[$lang->id]['value']) &&
|
||||
is_array($translations[$lang->id]['value'])
|
||||
) {
|
||||
$fieldValues = $translations[$lang->id]['value'];
|
||||
}
|
||||
|
||||
if (is_string($fieldValues)) {
|
||||
$fieldValues = json_decode($fieldValues, true);
|
||||
}
|
||||
|
||||
if (!is_array($fieldValues)) {
|
||||
$fieldValues = [];
|
||||
}
|
||||
|
||||
// Ensure all values including 0 are preserved as strings for Tagify
|
||||
$fieldValues = array_map(function($v) {
|
||||
return $v !== null && $v !== '' ? (string)$v : '';
|
||||
}, $fieldValues);
|
||||
@endphp
|
||||
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="values[{{ $lang->id }}]"
|
||||
class="tagify-input w-100"
|
||||
value='@json($fieldValues ?? [])'
|
||||
data-field-values='@json($fieldValues ?? [])'
|
||||
>
|
||||
|
||||
|
||||
|
||||
@if ($lang->id != 1)
|
||||
<small
|
||||
class="text-muted">{{ __('Used for translatable field types.') }}</small>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Category') }}</div>
|
||||
<div class="card-body mt-2">
|
||||
<div class="sub_category_lit">
|
||||
@foreach ($categories as $category)
|
||||
<div class="category">
|
||||
<div class="category-header">
|
||||
<label>
|
||||
<input type="checkbox" name="selected_categories[]"
|
||||
value="{{ $category->id }}"
|
||||
{{ in_array($category->id, $selected_categories) ? 'checked' : '' }}>
|
||||
{{ $category->name }}
|
||||
</label>
|
||||
@if (!empty($category->subcategories))
|
||||
@php
|
||||
// Get current language from Session (not from foreach loop)
|
||||
$currentLang = Session::get('language');
|
||||
// Check RTL: use accessor which returns boolean (rtl != 0)
|
||||
$isRtl = false;
|
||||
if (!empty($currentLang)) {
|
||||
try {
|
||||
// Try to get raw attribute first, fallback to accessor
|
||||
$rtlRaw = method_exists($currentLang, 'getRawOriginal') ? $currentLang->getRawOriginal('rtl') : null;
|
||||
if ($rtlRaw !== null) {
|
||||
$isRtl = ($rtlRaw == 1 || $rtlRaw === true);
|
||||
} else {
|
||||
$isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1);
|
||||
}
|
||||
}
|
||||
$arrowIcon = $isRtl ? '' : ''; // fa-caret-left for RTL, fa-caret-right for LTR
|
||||
@endphp
|
||||
<i style="font-size:24px"
|
||||
class="fas toggle-button {{ in_array($category->id, $selected_all_categories) ? 'open' : '' }}">
|
||||
{!! $arrowIcon !!}
|
||||
</i>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- ✅ Show children open if parent or child is selected --}}
|
||||
<div class="subcategories"
|
||||
style="display: {{ in_array($category->id, $selected_all_categories) ? 'block' : 'none' }};">
|
||||
@if (!empty($category->subcategories))
|
||||
@include('category.treeview', [
|
||||
'categories' => $category->subcategories,
|
||||
'selected_categories' => $selected_categories,
|
||||
'selected_all_categories' => $selected_all_categories,
|
||||
])
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-end mb-3">
|
||||
<input type="submit" class="btn btn-primary" value="{{ __('Save and Back') }}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- @if (in_array($custom_field->type, ['radio', 'checkbox', 'dropdown']))
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<table class="table table-borderless table-striped" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('custom-fields.value.show', $custom_field->id) }}"
|
||||
data-click-to-select="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true" data-search-align="right"
|
||||
data-toolbar="#toolbar" data-show-columns="true" data-show-refresh="true"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="id"
|
||||
data-escape="true"
|
||||
data-sort-order="desc" data-query-params="queryParams"
|
||||
data-table="custom_fields" data-use-row-attr-func="true" data-mobile-responsive="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="value" data-align="center" data-sortable="true">{{ __('Value') }}</th>
|
||||
<th scope="col" data-field="operate"data-escape="false" data-align="center" data-sortable="false" data-events="customFieldValueEvents">{{ __('Action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif -->
|
||||
{{-- add modal --}}
|
||||
@if (in_array($custom_field->type, ['radio', 'checkbox', 'dropdown']))
|
||||
<div id="addModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Add Values') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('custom-fields.value.add', $custom_field->id) }}"
|
||||
class="create-form form-horizontal" enctype="multipart/form-data" method="POST"
|
||||
data-parsley-validate>
|
||||
@csrf
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="values" class="mandatory form-label">{{ __('Field Values') }}</label>
|
||||
<input type="text" name="values" id="values" class="form-control"
|
||||
value="{{ old('values') }}" data-parsley-required="true">
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="field_id" id="field_id" value="{{ $custom_field->id }}">
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary waves-effect"
|
||||
data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit"
|
||||
class="btn btn-primary waves-effect waves-light">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
{{-- edit modal --}}
|
||||
<div id="editModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Edit Custome Field Values') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('custom-fields.value.update', $custom_field->id) }}"
|
||||
class="edit-form form-horizontal" enctype="multipart/form-data" method="POST"
|
||||
data-parsley-validate>
|
||||
@csrf
|
||||
<input type="hidden" name="old_custom_field_value" id="old_custom_field_value" />
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="new_custom_field_value"
|
||||
class="mandatory form-label">{{ __('Name') }}</label>
|
||||
<input type="text" name="new_custom_field_value" id="new_custom_field_value"
|
||||
class="form-control" value="" data-parsley-required="true">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary waves-effect"
|
||||
data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit"
|
||||
class="btn btn-primary waves-effect waves-light">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
@endif
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('js')
|
||||
<script>
|
||||
window.existingTranslations = @json($translations ?? []);
|
||||
// console.log('Loaded Translations:', window.existingTranslations);
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function updateCustomFieldUI() {
|
||||
const type = $('select[name="type"]').val();
|
||||
const valuesTypes = ['radio', 'dropdown', 'checkbox'];
|
||||
|
||||
$('.tab-pane').each(function() {
|
||||
const $tab = $(this);
|
||||
|
||||
const $fieldValues = $tab.find('select[name^="values"]')
|
||||
.closest('.form-group');
|
||||
|
||||
const $minMaxGroup = $tab.find('.min-max-fields');
|
||||
|
||||
if (valuesTypes.includes(type)) {
|
||||
$fieldValues.show();
|
||||
$minMaxGroup.hide();
|
||||
} else if (type === 'fileinput') {
|
||||
$fieldValues.hide();
|
||||
$minMaxGroup.hide();
|
||||
} else {
|
||||
$fieldValues.hide();
|
||||
$minMaxGroup.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
updateCustomFieldUI();
|
||||
|
||||
$(document).on('change', 'select[name="type"]', function() {
|
||||
updateCustomFieldUI();
|
||||
});
|
||||
|
||||
// Initialize select2 for all value selects
|
||||
$('select[name^="values"]').each(function() {
|
||||
if (!$(this).hasClass('select2-hidden-accessible')) {
|
||||
$(this).select2({
|
||||
tags: true,
|
||||
tokenSeparators: [','],
|
||||
placeholder: "{{ __('Select an option') }}",
|
||||
allowClear: true
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Image preview functionality
|
||||
$('#image').on('change', function() {
|
||||
const [file] = this.files;
|
||||
if (file) {
|
||||
$('#blah').attr('src', URL.createObjectURL(file));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function afterCustomFieldUpdate() {
|
||||
setTimeout(function() {
|
||||
window.location.href = "{{ route('custom-fields.index') }}"
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
// document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
// const input = document.querySelector('.tagify-input');
|
||||
|
||||
// new Tagify(input, {
|
||||
// delimiters: ",",
|
||||
// editTags: true,
|
||||
// duplicate: false,
|
||||
// dropdown: {
|
||||
// enabled: 0
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.querySelectorAll('.tagify-input').forEach((input) => {
|
||||
if (!input.tagify) {
|
||||
// Get initial values from data attribute or value attribute
|
||||
let initialValues = [];
|
||||
try {
|
||||
const dataValues = input.getAttribute('data-field-values');
|
||||
if (dataValues) {
|
||||
initialValues = JSON.parse(dataValues);
|
||||
} else if (input.value) {
|
||||
initialValues = JSON.parse(input.value);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Error parsing initial values:', e);
|
||||
}
|
||||
|
||||
// Ensure all values including 0 are converted to strings
|
||||
initialValues = initialValues.map(v => {
|
||||
// Preserve 0, false, empty string, etc. as strings
|
||||
return v !== null && v !== undefined ? String(v) : '';
|
||||
}).filter(v => v !== ''); // Only filter out truly empty strings
|
||||
|
||||
// Initialize Tagify with proper configuration
|
||||
const tagify = new Tagify(input, {
|
||||
delimiters: ",",
|
||||
editTags: true,
|
||||
duplicate: false,
|
||||
dropdown: {
|
||||
enabled: 0
|
||||
},
|
||||
// Ensure 0 and other falsy values are preserved
|
||||
transformTag: function(tagData) {
|
||||
// Convert tag value to string to preserve 0
|
||||
if (tagData.value !== null && tagData.value !== undefined) {
|
||||
tagData.value = String(tagData.value);
|
||||
}
|
||||
return tagData;
|
||||
},
|
||||
// Ensure all values including 0 are kept
|
||||
whitelist: [],
|
||||
enforceWhitelist: false,
|
||||
// Don't trim values to preserve spaces if needed
|
||||
trim: false
|
||||
});
|
||||
|
||||
// Set initial values after initialization
|
||||
if (initialValues.length > 0) {
|
||||
tagify.addTags(initialValues);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
92
resources/views/custom-fields/index.blade.php
Normal file
92
resources/views/custom-fields/index.blade.php
Normal file
@@ -0,0 +1,92 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Custom Fields")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4 class="mb-0">@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 text-end mt-2 mt-md-0">
|
||||
<div class="d-flex flex-wrap gap-2 justify-content-end">
|
||||
@can('custom-field-create')
|
||||
<a href="{{ route('custom-fields.create', ['id' => 0]) }}" class="btn btn-primary mb-0">
|
||||
<span class="d-none d-sm-inline">+ {{__("Create Custom Field")}}</span>
|
||||
<span class="d-sm-none">+ {{__("Create")}}</span>
|
||||
</a>
|
||||
<a href="{{ route('custom-fields.bulk-upload') }}" class="btn btn-success mb-0">
|
||||
<i class="fas fa-upload"></i> <span class="d-none d-sm-inline">{{__("Bulk Upload")}}</span><span class="d-sm-none">{{__("Upload")}}</span>
|
||||
</a>
|
||||
@endcan
|
||||
@can('custom-field-update')
|
||||
<a href="{{ route('custom-fields.bulk-update') }}" class="btn btn-warning mb-0">
|
||||
<i class="fas fa-edit"></i> <span class="d-none d-sm-inline">{{__("Bulk Update")}}</span><span class="d-sm-none">{{__("Update")}}</span>
|
||||
</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="filters">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<label for="filter">{{ __("Category") }}</label>
|
||||
<select name="category" class="form-control bootstrap-table-filter-control-category_names" aria-label="category">
|
||||
<option value="">{{ __("All") }}</option>
|
||||
@include('category.dropdowntree', ['categories' => $categories])
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<label for="type">{{ __("Type") }}</label>
|
||||
<select name="type" class="form-select form-control bootstrap-table-filter-control-type" id="type">
|
||||
<option value="">{{ __("All") }}</option>
|
||||
<option value="number">{{ __("Number Input") }}</option>
|
||||
<option value="textbox">{{ __("Text Input") }}</option>
|
||||
<option value="fileinput">{{ __("File Input") }}</option>
|
||||
<option value="radio">{{ __("Radio") }}</option>
|
||||
<option value="dropdown">{{ __("Dropdown") }}</option>
|
||||
<option value="checkbox">{{ __("Checkboxes") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="stable-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('custom-fields.show',1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]"
|
||||
data-search="true" data-search-align="right" data-toolbar="#filters" data-show-columns="true"
|
||||
data-show-refresh="true" data-fixed-columns="true" data-fixed-number="1" data-fixed-right-number="1"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3"
|
||||
data-escape="true"
|
||||
data-show-export="true" data-export-options='{"fileName": "custom-field-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true" data-filter-control="true" data-filter-control-container="#filters">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="state" data-checkbox="true"></th>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="image" data-align="center" data-formatter="imageFormatter">{{ __('Image') }}</th>
|
||||
<th scope="col" data-field="name" data-align="center" data-escape="true" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="category_names" data-align="center" data-filter-name="category_id" data-filter-control="select" data-filter-data="">{{ __('Category') }}</th>
|
||||
<th scope="col" data-field="type" data-align="center" data-sortable="true" data-filter-name="type" data-filter-control="select" data-filter-data="">{{ __('Type') }}</th>
|
||||
@canany(['custom-field-update','custom-field-delete'])
|
||||
<th scope="col" data-field="operate" data-escape="false" data-sortable="false">{{ __('Action') }}</th>
|
||||
@endcanany
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
359
resources/views/customer/index.blade.php
Normal file
359
resources/views/customer/index.blade.php
Normal file
@@ -0,0 +1,359 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Users') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('customer.show',1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true" data-toolbar="#toolbar"
|
||||
data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-escape="true"
|
||||
data-pagination-successively-size="3" data-query-params="queryParams" data-table="users" data-status-column="deleted_at"
|
||||
data-show-export="true" data-export-options='{"fileName": "customer-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="profile" data-formatter="imageFormatter">{{ __('Profile') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="email" data-sortable="true">{{ __('Email') }}</th>
|
||||
<th scope="col" data-field="mobile" data-sortable="true">{{ __('Mobile') }}</th>
|
||||
<th scope="col" data-field="type" data-sortable="true">{{ __('Type') }}</th>
|
||||
<th scope="col" data-field="address" data-sortable="true">{{ __('Address') }}</th>
|
||||
<th scope="col" data-field="items_count" data-sortable="true">{{ __('Total Post') }}</th>
|
||||
<th scope="col" data-field="status" data-formatter="statusSwitchFormatter" data-sortable="false">{{ __('Status') }}</th>
|
||||
@can('customer-update')
|
||||
<th scope="col" data-field="auto_approve_advertisement" data-formatter="autoApproveItemSwitchFormatter" data-sortable="false">{{ __('Auto Approve Advertisement') }}</th>
|
||||
@endcan
|
||||
<th scope="col" data-field="operate" data-escape="false" data-align="center" data-sortable="false" data-events="userEvents">{{ __('Action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="assignPackageModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Assign Packages') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="resetModal()"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="create-form" action="{{ route('customer.assign.package') }}" method="POST" data-parsley-validate data-success-function="assignApprovalSuccess">
|
||||
@csrf
|
||||
<input type="hidden" name="user_id" id='user_id'>
|
||||
<div id="currency-settings" data-symbol="{{ $currency_symbol }}" data-position="{{ $currency_symbol_position }}" data-free-ad-listing="{{ $free_ad_listing }}"></div>
|
||||
@if($free_ad_listing != 1)
|
||||
<div class="form-group row select-package">
|
||||
<div class="col-md-6">
|
||||
<input type="radio" id="item_package" class="package_type form-check-input" name="package_type" value="item_listing" required>
|
||||
<label for="item_package">{{ __('Item Listing Package') }}</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="radio" id="advertisement_package" class="package_type form-check-input" name="package_type" value="advertisement" required>
|
||||
<label for="advertisement_package">{{ __('Advertisement Package') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row mt-3" id="item-listing-package-div" style="display: none;">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="package">{{__("Select Item Listing Package")}}</label>
|
||||
<select name="package_id" class="form-select package" id="item-listing-package" aria-label="Package">
|
||||
<option value="" disabled selected>{{__("Select Option")}}</option>
|
||||
@foreach($itemListingPackage as $package)
|
||||
<option value="{{$package->id}}" data-details="{{json_encode($package)}}">{{$package->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3" id="advertisement-package-div" style="{{ $free_ad_listing == '1' ? 'display: block;' : 'display: none;' }}">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="package">{{__("Select Advertisement Package")}}</label>
|
||||
<select name="package_id" class="form-select package" id="advertisement-package" aria-label="Package">
|
||||
<option value="" disabled selected>{{__("Select Option")}}</option>
|
||||
@foreach($advertisementPackage as $package)
|
||||
<option value="{{$package->id}}" data-details="{{json_encode($package)}}">{{$package->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="package_details" class="mt-3" style="display: none;">
|
||||
<p><strong>{{__("Name")}}:</strong> <span id="package_name"></span></p>
|
||||
<p><strong>{{__("Price")}}:</strong> <span id="package_price"></span></p>
|
||||
<p><strong>{{__("Final Price")}}:</strong> <span id="package_final_price"></span></p>
|
||||
<p><strong>{{__("Limitation")}}:</strong> <span id="package_duration"></span></p>
|
||||
</div>
|
||||
<div class="form-group row payment" style="display: none">
|
||||
<div class="col-md-6">
|
||||
<input type="radio" id="cash_payment" class="payment_gateway form-check-input" name="payment_gateway" value="cash" required>
|
||||
<label for="cash_payment">{{ __('Cash') }}</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="radio" id="cheque_payment" class="payment_gateway form-check-input" name="payment_gateway" value="cheque" required>
|
||||
<label for="cheque_payment">{{ __('Cheque') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group cheque mt-3" style="display: none">
|
||||
<label for="cheque">{{ __('Add cheque number') }}</label>
|
||||
<input type="text" id="cheque" class="form-control" name="cheque_number" data-parsley-required="true">
|
||||
</div>
|
||||
<input type="submit" value="{{__("Save")}}" class="btn btn-primary mt-3">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Manage Packages Modal (View Active Packages Only) -->
|
||||
<div id="managePackagesModal" class="modal fade modal-lg" tabindex="-1" role="dialog" aria-labelledby="managePackagesModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="managePackagesModalLabel">{{ __('Active Packages') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="resetManagePackagesModal()"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" id="manage_user_id" name="user_id">
|
||||
|
||||
<div id="active-packages-list">
|
||||
<div class="text-center">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">{{ __('Loading...') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="refreshManagePackages()">{{ __('Refresh') }}</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Cancel Subscription Modal -->
|
||||
<div id="cancelSubscriptionModal" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{{ __('Cancel Subscription') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form id="cancel-subscription-form" class="create-form" action="{{ route('customer.cancel.package') }}" method="POST" data-success-function="cancelPackageSuccess">
|
||||
@csrf
|
||||
<input type="hidden" id="cancel-package-id" name="package_id" value="">
|
||||
|
||||
<div class="modal-body">
|
||||
<p class="mb-3">{{ __('Are you sure you want to cancel this package subscription?') }}</p>
|
||||
|
||||
<div id="cancel-package-details" class="mt-3 p-3 bg-light rounded">
|
||||
<p class="mb-2"><strong>{{ __('Package Name') }}:</strong> <span id="cancel-package-name" class="text-primary"></span></p>
|
||||
<p class="mb-2"><strong>{{ __('Type') }}:</strong> <span id="cancel-package-type" class="badge bg-info"></span></p>
|
||||
<p class="mb-2"><strong>{{ __('Start Date') }}:</strong> <span id="cancel-start-date"></span></p>
|
||||
<p class="mb-0"><strong>{{ __('End Date') }}:</strong> <span id="cancel-end-date"></span></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit" class="btn btn-danger" id="cancel-submit-btn">{{ __('Cancel Subscription') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
@endsection
|
||||
@section('js')
|
||||
<script>
|
||||
function assignApprovalSuccess() {
|
||||
$('#assignPackageModal').modal('hide');
|
||||
refreshTable();
|
||||
}
|
||||
|
||||
function resetModal() {
|
||||
const modal = $('#assignPackageModal');
|
||||
const form = modal.find('form');
|
||||
form[0].reset();
|
||||
$('#package_details').hide();
|
||||
$('.payment').hide();
|
||||
$('.cheque').hide();
|
||||
}
|
||||
|
||||
function resetManagePackagesModal() {
|
||||
$('#manage_user_id').val('');
|
||||
$('#active-packages-list').html('<div class="text-center"><div class="spinner-border" role="status"><span class="visually-hidden">{{ __('Loading...') }}</span></div></div>');
|
||||
}
|
||||
|
||||
function refreshTable() {
|
||||
if (typeof $('#table_list').bootstrapTable === 'function') {
|
||||
$('#table_list').bootstrapTable('refresh');
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
function loadActivePackages(userId) {
|
||||
$.ajax({
|
||||
url: "{{ route('customer.active.packages') }}",
|
||||
type: 'GET',
|
||||
data: { user_id: userId },
|
||||
success: function(response) {
|
||||
if (response.error === false && response.data) {
|
||||
let html = '';
|
||||
if (response.data.length === 0) {
|
||||
html = '<p class="text-muted text-center">{{ __("No active packages found.") }}</p>';
|
||||
} else {
|
||||
html = '<div class="table-responsive"><table class="table table-bordered">';
|
||||
html += '<thead><tr><th>{{ __("Package Name") }}</th><th>{{ __("Type") }}</th><th>{{ __("Start Date") }}</th><th>{{ __("End Date") }}</th><th>{{ __("Used/Total Limit") }}</th><th>{{ __("Remaining Days") }}</th><th>{{ __("Action") }}</th></tr></thead><tbody>';
|
||||
|
||||
response.data.forEach(function(pkg) {
|
||||
html += '<tr>';
|
||||
html += '<td>' + (pkg.package_name || '-') + '</td>';
|
||||
html += '<td><span class="badge bg-info">' + (pkg.package_type === 'item_listing' ? '{{ __("Item Listing") }}' : '{{ __("Advertisement") }}') + '</span></td>';
|
||||
html += '<td>' + pkg.start_date + '</td>';
|
||||
html += '<td>' + pkg.end_date + '</td>';
|
||||
html += '<td>' + pkg.used_limit + ' / ' + (pkg.total_limit === 'Unlimited' || pkg.total_limit === null ? '{{ __("Unlimited") }}' : pkg.total_limit) + '</td>';
|
||||
html += '<td>' + (pkg.remaining_days === 'unlimited' || pkg.remaining_days === 'Unlimited' ? '{{ __("Unlimited") }}' : pkg.remaining_days + ' {{ __("days") }}') + '</td>';
|
||||
html += '<td><button class="btn btn-sm btn-danger cancel-package-btn" data-package-id="' + pkg.id + '">{{ __("Cancel") }}</button></td>';
|
||||
html += '</tr>';
|
||||
});
|
||||
|
||||
html += '</tbody></table></div>';
|
||||
}
|
||||
$('#active-packages-list').html(html);
|
||||
} else {
|
||||
$('#active-packages-list').html('<p class="text-danger text-center">{{ __("Error loading packages.") }}</p>');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error loading packages:', error);
|
||||
$('#active-packages-list').html('<p class="text-danger text-center">{{ __("Error loading packages.") }}</p>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Handle manage packages button click
|
||||
$(document).on('click', '.manage_packages', function() {
|
||||
const userId = $(this).data('user-id');
|
||||
$('#manage_user_id').val(userId);
|
||||
$('#manage_user_id_form').val(userId);
|
||||
loadActivePackages(userId);
|
||||
});
|
||||
|
||||
// Handle cancel package button click - Show cancel modal
|
||||
$(document).on('click', '.cancel-package-btn', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const row = $(this).closest('tr');
|
||||
const packageId = $(this).data('package-id');
|
||||
|
||||
if (!packageId) {
|
||||
alert('{{ __("Package ID is missing") }}');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Populate cancel modal with package details
|
||||
$('#cancel-package-id').val(packageId);
|
||||
|
||||
const packageName = row.find('td:eq(0)').text().trim();
|
||||
const packageType = row.find('td:eq(1)').text().trim();
|
||||
const startDate = row.find('td:eq(2)').text().trim();
|
||||
const endDate = row.find('td:eq(3)').text().trim();
|
||||
|
||||
$('#cancel-package-name').text(packageName || '-');
|
||||
$('#cancel-package-type').text(packageType || '-');
|
||||
$('#cancel-start-date').text(startDate || '-');
|
||||
$('#cancel-end-date').text(endDate || '-');
|
||||
|
||||
// Show cancel modal
|
||||
$('#cancelSubscriptionModal').modal('show');
|
||||
return false;
|
||||
});
|
||||
|
||||
// Success callback for cancel subscription form
|
||||
function cancelPackageSuccess(response) {
|
||||
// Close cancel subscription modal
|
||||
$('#cancelSubscriptionModal').modal('hide');
|
||||
|
||||
// Reset cancel modal fields
|
||||
resetCancelModal();
|
||||
|
||||
// Refresh packages inside manage modal if it's open
|
||||
const userId = $('#manage_user_id').val();
|
||||
if (userId) {
|
||||
setTimeout(function() {
|
||||
loadActivePackages(userId);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
// Refresh main table
|
||||
setTimeout(function() {
|
||||
refreshTable();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
// Function to refresh manage packages list
|
||||
function refreshManagePackages() {
|
||||
const userId = $('#manage_user_id').val();
|
||||
if (userId) {
|
||||
loadActivePackages(userId);
|
||||
} else {
|
||||
alert('{{ __("Please select a user first") }}');
|
||||
}
|
||||
}
|
||||
|
||||
// Function to reset cancel modal
|
||||
function resetCancelModal() {
|
||||
$('#cancel-package-id').val('');
|
||||
$('#cancel-package-name').text('');
|
||||
$('#cancel-package-type').text('');
|
||||
$('#cancel-start-date').text('');
|
||||
$('#cancel-end-date').text('');
|
||||
$('#cancel-submit-btn').prop('disabled', false);
|
||||
}
|
||||
|
||||
// Reset cancel modal when closed
|
||||
$('#cancelSubscriptionModal').on('hidden.bs.modal', function () {
|
||||
resetCancelModal();
|
||||
});
|
||||
|
||||
// Prevent form submission if package ID is missing
|
||||
$('#cancel-subscription-form').on('submit', function(e) {
|
||||
const packageId = $('#cancel-package-id').val();
|
||||
if (!packageId) {
|
||||
e.preventDefault();
|
||||
alert('{{ __("Package ID is missing. Please try again.") }}');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
60
resources/views/deep-link/deep_link.blade.php
Normal file
60
resources/views/deep-link/deep_link.blade.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Open in App</title>
|
||||
@include('layouts.include')
|
||||
<style>
|
||||
.bottom-sheet {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: #fff;
|
||||
border-top-left-radius: 15px;
|
||||
border-top-right-radius: 15px;
|
||||
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
|
||||
transform: translateY(100%);
|
||||
transition: transform 0.3s ease-out;
|
||||
z-index: 1050;
|
||||
}
|
||||
|
||||
.bottom-sheet.show {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
/* @media (min-width: 1025px) {
|
||||
.bottom-sheet {
|
||||
display: none;
|
||||
}
|
||||
} */
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@include('layouts.footer_script')
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
let appScheme = '{{ $scheme }}://' + window.location.host + window.location.pathname;
|
||||
let androidAppStoreLink = '{{ $playStoreLink }}';
|
||||
let iosAppStoreLink = '{{ $appStoreLink }}';
|
||||
let userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
||||
let isAndroid = /android/i.test(userAgent);
|
||||
let isIOS = /iPad|iPhone|iPod/.test(userAgent) && !window.MSStream;
|
||||
let appStoreLink = isAndroid ? androidAppStoreLink : (isIOS ? iosAppStoreLink : androidAppStoreLink);
|
||||
|
||||
window.location.href = appScheme;
|
||||
|
||||
setTimeout(function () {
|
||||
if (!document.hidden && !document.webkitHidden) {
|
||||
if (confirm("{{$appName}} app is not installed. Would you like to download it from the app store?")) {
|
||||
window.location.href = appStoreLink;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
161
resources/views/faq/create.blade.php
Normal file
161
resources/views/faq/create.blade.php
Normal file
@@ -0,0 +1,161 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("FAQ")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
@can('faq-create')
|
||||
<div class="row">
|
||||
<form class="create-form" action="{{ route('faq.store') }}" method="POST" data-parsley-validate enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Add FAQ")}}</div>
|
||||
|
||||
<div class="card-body mt-3">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
@foreach($languages as $index => $language)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($index === 0) active @endif" data-bs-toggle="tab"
|
||||
data-bs-target="#lang-{{ $language->id }}" type="button" role="tab">
|
||||
{{ $language->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $index => $language)
|
||||
<div class="tab-pane fade @if($index === 0) show active @endif"
|
||||
id="lang-{{ $language->id }}" role="tabpanel">
|
||||
<div class="form-group">
|
||||
<label>{{ __('Question') }} ({{ $language->name }})</label>
|
||||
<input type="text" name="question[{{ $language->id }}]" class="form-control"
|
||||
{{ $language->code === 'en' ? 'required' : '' }}>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label>{{ __('Answer') }} ({{ $language->name }})</label>
|
||||
<textarea name="answer[{{ $language->id }}]" class="form-control" rows="4"
|
||||
{{ $language->code === 'en' ? 'required' : '' }}></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-md-12 m-2 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{__("Create")}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table-light table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('faq.show',1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-toolbar="#toolbar" data-show-columns="true" data-show-refresh="true"
|
||||
data-fixed-columns="true" data-fixed-number="1" data-fixed-right-number="1"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="id"
|
||||
data-sort-order="desc" data-pagination-successively-size="3"
|
||||
data-escape="true"
|
||||
data-query-params="queryParams" data-mobile-responsive="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="question" data-sortable="false">{{ __('Questions') }}</th>
|
||||
<th scope="col" data-field="answer" data-sortable="false" data-formatter="descriptionFormatter">{{__('Answers')}}</th>
|
||||
<th scope="col" data-field="operate" data-sortable="false" data-escape="false" data-events="faqEvents">{{ __('Action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('faq-update')
|
||||
<!-- EDIT MODEL MODEL -->
|
||||
<div id="editModal" class="modal fade modal-lg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="" class="form-horizontal edit-form" enctype="multipart/form-data" method="POST" novalidate>
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<input type="hidden" name="faq_id" id="edit_faq_id">
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{{ __('Edit FAQ') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
{{-- Language Tabs --}}
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
@foreach($languages as $index => $language)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($index === 0) active @endif" data-bs-toggle="tab"
|
||||
data-bs-target="#edit-lang-{{ $language->id }}" type="button" role="tab">
|
||||
{{ $language->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
{{-- Language Tab Panes --}}
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $index => $language)
|
||||
<div class="tab-pane fade @if($index === 0) show active @endif"
|
||||
id="edit-lang-{{ $language->id }}" role="tabpanel">
|
||||
<div class="form-group">
|
||||
<label>{{ __('Question') }} ({{ $language->name }})</label>
|
||||
<input type="text"
|
||||
name="question[{{ $language->id }}]"
|
||||
id="edit_question_{{ $language->id }}"
|
||||
class="form-control"
|
||||
{{ $language->code === 'en' ? 'required' : '' }}>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label>{{ __('Answer') }} ({{ $language->name }})</label>
|
||||
<textarea name="answer[{{ $language->id }}]"
|
||||
id="edit_answer_{{ $language->id }}"
|
||||
class="form-control"
|
||||
rows="4"
|
||||
{{ $language->code === 'en' ? 'required' : '' }}></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary waves-effect" data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endcan
|
||||
</section>
|
||||
@endsection
|
||||
328
resources/views/feature_section/index.blade.php
Normal file
328
resources/views/feature_section/index.blade.php
Normal file
@@ -0,0 +1,328 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Create Feature Section")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('content')
|
||||
<section class="section">
|
||||
@can('feature-section-create')
|
||||
<div class="row">
|
||||
<form action="{{ route('feature-section.store') }}" class="create-form" method="POST" enctype="multipart/form-data" data-parsley-validate>
|
||||
@csrf
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Add Feature Section")}}</div>
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-tabs" id="langTabs" role="tablist">
|
||||
@foreach($languages as $key => $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($key == 0) active @endif" id="tab-{{ $lang->id }}" data-bs-toggle="tab" data-bs-target="#lang-{{ $lang->id }}" type="button" role="tab">
|
||||
{{ $lang->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $key => $lang)
|
||||
<div class="tab-pane fade @if($key == 0) show active @endif" id="lang-{{ $lang->id }}" role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Title') }} ({{ $lang->name }})</label>
|
||||
<input type="text"
|
||||
name="title[{{ $lang->id }}]"
|
||||
class="form-control @if($lang->id == 1) feature-section-name @endif"
|
||||
placeholder="{{ __('Title') }}"
|
||||
value=""
|
||||
@if($lang->id == 1) data-parsley-required="true" @endif>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Description') }} ({{ $lang->name }})</label>
|
||||
<textarea name="description[{{ $lang->id }}]" class="form-control" cols="10" rows="5"></textarea>
|
||||
</div>
|
||||
|
||||
@if($lang->id == 1)
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="slug" class="mandatory form-label">{{ __('Slug') }}</label>
|
||||
<input type="text" name="slug" id="slug" class="form-control feature-section-slug" data-parsley-required="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group mandatory">
|
||||
<label for="filter" class=" form-label">{{ __('Filters') }}</label>
|
||||
<select id="filter" name="filter" class="form-control select2">
|
||||
<option value="most_liked">{{__("Most Liked")}}</option>
|
||||
<option value="most_viewed">{{__("Most Viewed")}}</option>
|
||||
<option value="price_criteria">{{__("Price Criteria")}}</option>
|
||||
<option value="category_criteria">{{__("Category Criteria")}}</option>
|
||||
<option value="featured_ads">{{__("Featured Ads")}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div id="category_criteria" class="form-group mandatory" style="display: none;">
|
||||
<label for="category_id" class=" form-label">{{ __('Category') }}</label>
|
||||
<br>
|
||||
<select name="category_id[]" class="select2" multiple id="category_id" data-placeholder="{{__("Select Category")}}" style="width : 100%" required>
|
||||
@include('category.dropdowntree', ['categories' => $categories])
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="price_criteria" style="display:none;">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="min_price" class=" form-label">{{ __('Minimum Price') }}</label>
|
||||
<input type="number" name="min_price" id="min_price" class="form-control" required min="1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="max_price" class=" form-label">{{ __('Maximum Price') }}</label>
|
||||
<input type="number" name="max_price" id="max_price" class="form-control" required min="1" data-parsley-gt="#min_price" data-parsley-error-message="Max Price should be Greater than Min Price">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group mandatory mt-3">
|
||||
<label for="Field Name" class=" form-label">{{ __('Select Style for APP Section') }}</label>
|
||||
<div class="col-md-2 col-sm-2">
|
||||
<label class="radio-img">
|
||||
<input type="radio" name="style" value="style_1" required/>
|
||||
<img src="{{asset('/images/app_styles/style_1.png')}}" height="115px" width="130px" alt="style_1" class="style_image">
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-2 col-sm-2">
|
||||
<label class="radio-img">
|
||||
<input type="radio" name="style" value="style_2"/>
|
||||
<img src="{{asset('/images/app_styles/style_2.png')}}" height="115px" width="130px" alt="style_2" class="style_image">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 col-sm-2">
|
||||
<label class="radio-img">
|
||||
<input type="radio" name="style" value="style_3"/>
|
||||
<img src="{{asset('/images/app_styles/style_3.png')}}" height="115px" width="130px" alt="style_3" class="style_image">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 col-sm-2">
|
||||
<label class="radio-img">
|
||||
<input type="radio" name="style" value="style_4"/>
|
||||
<img src="{{asset('/images/app_styles/style_4.png')}}" height="115px" width="130px" alt="style_4" class="style_image">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-md-12 d-flex justify-content-end">
|
||||
<button class="btn btn-primary" type="submit" name="submit">{{ __('Submit') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<small class="text-danger">* {{__("To change the order, Drag the Table column Up & Down")}}</small>
|
||||
<table class="table table-borderless table-striped" aria-describedby="mydesc"
|
||||
id="table_list" data-toggle="table" data-url="{{ route('feature-section.show',1) }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true" data-search-align="right"
|
||||
data-toolbar="#toolbar" data-show-columns="true" data-show-refresh="true"
|
||||
data-fixed-columns="true" data-fixed-number="1" data-fixed-right-number="1"
|
||||
data-trim-on-search="false" data-responsive="true"
|
||||
data-pagination-successively-size="3" data-query-params="queryParams"
|
||||
data-escape="true"
|
||||
data-reorderable-rows="true"
|
||||
data-use-row-attr-func="true" data-table="feature_sections"
|
||||
data-show-export="true" data-export-options='{"fileName": "featured-section-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="style" data-formatter="styleImageFormatter">{{ __('Style') }}</th>
|
||||
<th scope="col" data-field="title" data-sortable="true">{{ __('Title') }}</th>
|
||||
<th scope="col" data-field="description" data-sortable="true">{{ __('Description') }}</th>
|
||||
<th scope="col" data-field="filter" data-sortable="true" data-formatter="filterTextFormatter">{{ __('Filters') }}</th>
|
||||
<th scope="col" data-field="sequence" data-sortable="true">{{ __('Sequence') }}</th>
|
||||
<th scope="col" data-field="min_price" data-sortable="true" data-visible="false">{{ __('Min Price') }}</th>
|
||||
<th scope="col" data-field="max_price" data-sortable="true" data-visible="false">{{ __('Max price') }}</th>
|
||||
<th scope="col" data-field="values_text" data-sortable="false" data-visible="false">{{ __('Value') }}</th>
|
||||
@canany(['feature-section-update', 'feature-section-delete'])
|
||||
<th scope="col" data-field="operate" data-escape="false" data-sortable="false" data-events="featuredSectionEvents">{{ __('Action') }}</th>
|
||||
@endcanany
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@can('feature-section-update')
|
||||
<!-- EDIT MODEL MODEL -->
|
||||
<div id="editModal" class="modal fade modal-lg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="" class="form-horizontal edit-form" enctype="multipart/form-data" method="POST" novalidate>
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Edit feature Section') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<ul class="nav nav-tabs" id="editLangTabs" role="tablist">
|
||||
@foreach($languages as $key => $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($key == 0) active @endif" id="edit-tab-{{ $lang->id }}" data-bs-toggle="tab" data-bs-target="#edit-lang-{{ $lang->id }}" type="button" role="tab">
|
||||
{{ $lang->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $key => $lang)
|
||||
<div class="tab-pane fade @if($key == 0) show active @endif" id="edit-lang-{{ $lang->id }}" role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Title') }} ({{ $lang->name }})</label>
|
||||
<input type="text"
|
||||
name="title[{{ $lang->id }}]"
|
||||
class="form-control @if($lang->id == 1) edit-feature-section-name @endif"
|
||||
placeholder="{{ __('Title') }}"
|
||||
id="edit_title_{{$lang->id}}"
|
||||
value=""
|
||||
@if($lang->id == 1) data-parsley-required="true" @endif>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Description') }} ({{ $lang->name }})</label>
|
||||
<textarea name="description[{{ $lang->id }}]"
|
||||
class="form-control"
|
||||
cols="10"
|
||||
rows="5"
|
||||
id="edit_description_{{$lang->id}}"
|
||||
@if($lang->id == 1) data-parsley-required="true" @endif></textarea>
|
||||
</div>
|
||||
|
||||
@if($lang->id == 1)
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="slug" class="mandatory form-label">{{ __('Slug') }}</label>
|
||||
<input type="text" name="slug" id="edit_slug" class="form-control edit-feature-section-slug" data-parsley-required="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 form-group mandatory">
|
||||
<label for="edit_filter" class="form-label">{{ __('Filters') }}</label>
|
||||
<select id="edit_filter" name="filter" class="form-control select2">
|
||||
<option value="most_liked">{{__("Most Liked")}}</option>
|
||||
<option value="most_viewed">{{__("Most Viewed")}}</option>
|
||||
<option value="price_criteria">{{__("Price Criteria")}}</option>
|
||||
<option value="category_criteria">{{__("Category Criteria")}}</option>
|
||||
<option value="featured_ads">{{__("Featured Ads")}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="edit_price_criteria" class="row" style="display: none;">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="edit_min_price" class="form-label">{{ __('Minimum Price') }}</label>
|
||||
<input type="number" name="min_price" id="edit_min_price" class="form-control" required min="1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="edit_max_price" class="form-label">{{ __('Maximum Price') }}</label>
|
||||
<input type="number" name="max_price" id="edit_max_price" class="form-control" required min="1" data-parsley-gt="#edit_min_price" data-parsley-error-message="Max Price should be Greater than Min Price">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div id="edit_category_criteria" class="col-md-12 form-group mandatory" style="display: none;">
|
||||
<label for="edit_category_id" class="form-label">{{ __('Category') }}</label>
|
||||
<select name="category_id[]" class="select2" id="edit_category_id" data-placeholder="{{__("Select Category")}}" multiple>
|
||||
@include('category.dropdowntree', ['categories' => $categories])
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group mandatory mt-3">
|
||||
<label for="Field Name" class=" form-label">{{ __('Select Style for APP Section') }}</label>
|
||||
<div class="col-md-3 col-sm-2">
|
||||
<label class="radio-img">
|
||||
<input type="radio" name="style" value="style_1" required/>
|
||||
<img src="{{asset('/images/app_styles/style_1.png')}}" height="115px" width="130px" alt="style_1" class="style_image">
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-2">
|
||||
<label class="radio-img">
|
||||
<input type="radio" name="style" value="style_2" required/>
|
||||
<img src="{{asset('/images/app_styles/style_2.png')}}" height="115px" width="130px" alt="style_2" class="style_image">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 col-sm-2">
|
||||
<label class="radio-img">
|
||||
<input type="radio" name="style" value="style_3" required/>
|
||||
<img src="{{asset('/images/app_styles/style_3.png')}}" height="115px" width="130px" alt="style_3" class="style_image">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 col-sm-2">
|
||||
<label class="radio-img">
|
||||
<input type="radio" name="style" value="style_4" required/>
|
||||
<img src="{{asset('/images/app_styles/style_4.png')}}" height="115px" width="130px" alt="style_4" class="style_image">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary waves-effect" data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</section>
|
||||
@endsection
|
||||
@section('js')
|
||||
<script>
|
||||
{{--TODO: @include was not loading data 2nd time. So added this temporary solution here--}}
|
||||
let category_options = $('#category_id option').clone();
|
||||
$('#edit_category_id').append(category_options);
|
||||
</script>
|
||||
@endsection
|
||||
306
resources/views/home.blade.php
Normal file
306
resources/views/home.blade.php
Normal file
@@ -0,0 +1,306 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__('Home')}}
|
||||
@endsection
|
||||
@section('content')
|
||||
<style>
|
||||
.card_title {
|
||||
white-space: normal;
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
<section class="section">
|
||||
<div class="dashboard_title mb-3">{{__("Hi, Admin")}}</div>
|
||||
<div class="row mb-3 d-flex">
|
||||
<div class="col-lg-4 col-md-6 col-sm-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-12 mb-3">
|
||||
<a href="{{ url('customer') }}">
|
||||
<div class="card h-100" style="width: 100%;">
|
||||
<div class="total_customer d-flex">
|
||||
<div class="curtain"></div>
|
||||
<div class="row">
|
||||
<div class="col-4 col-md-12 ">
|
||||
<div class="svg_icon align-items-center d-flex justify-content-center me-3">
|
||||
<span class="fa fa-users text-white fa-2x"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 col-md-12">
|
||||
<div class="total_number">{{$user_count}}</div>
|
||||
<div class="card_title">{{ __('Total Customers') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-12 mb-3">
|
||||
<a href="{{ url('advertisement') }}">
|
||||
<div class="card h-100" style="width: 100%;">
|
||||
<div class="total_items d-flex">
|
||||
<div class="curtain"></div>
|
||||
<div class="row">
|
||||
<div class="col-4 col-md-12 ">
|
||||
<div class="svg_icon align-items-center d-flex justify-content-center me-3">
|
||||
<span class="fa fa-box text-white fa-2x"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 col-md-12">
|
||||
<div class="total_number">{{$item_count}}</div>
|
||||
<div class="card_title">{{ __('Total Advertisements') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-12 mb-3">
|
||||
<a href="{{ route('category.index') }}">
|
||||
<div class="card h-100" style="width: 100%;">
|
||||
<div class="item_for_sale d-flex">
|
||||
<div class="curtain"></div>
|
||||
<div class="row">
|
||||
<div class="col-4 col-md-12 ">
|
||||
<div class="svg_icon align-items-center d-flex justify-content-center me-3">
|
||||
<span class="fa fa-layer-group text-white fa-2x"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 col-md-12">
|
||||
<div class="total_number">{{$categories_count}}</div>
|
||||
<div class="card_title">{{ __('Total Categories') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-12 mb-3">
|
||||
<a href="{{ route('custom-fields.index') }}">
|
||||
<div class="card h-100" style="width: 100%;">
|
||||
<div class="properties_for_rent d-flex">
|
||||
<div class="curtain"></div>
|
||||
<div class="row">
|
||||
<div class="col-4 col-md-12 ">
|
||||
<div class="svg_icon align-items-center d-flex justify-content-center me-3">
|
||||
<span class="fab fa-wpforms text-white fa-2x"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 col-md-12">
|
||||
<div class="total_number">{{$custom_field_count}}</div>
|
||||
<div class="card_title">{{ __('Total Custom Fields') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-8 col-md-6 col-sm-12">
|
||||
<div class="card h-100" style="width: 100%;">
|
||||
<div class="card-header border-0 pb-0">
|
||||
<h3 style="font-weight: 600">{{__("Featured Sections")}}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc"
|
||||
id="table_list" data-toggle="table" data-url="{{ route('feature-section.show',1) }}"
|
||||
data-click-to-select="true" data-search="true" data-toolbar="#toolbar"
|
||||
data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-trim-on-search="false" data-responsive="true"
|
||||
data-escape="true"
|
||||
data-sort-name="id" data-sort-order="desc" data-query-params="queryParams" data-mobile-responsive="true"
|
||||
data-side-pagination="server" data-pagination="true" data-page-size="3">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="style" data-formatter="styleImageFormatter">{{ __('Style') }}</th>
|
||||
<th scope="col" data-field="title" data-sortable="false">{{ __('Title') }}</th>
|
||||
<th scope="col" data-field="filter" data-sortable="false" data-formatter="filterTextFormatter">{{ __('Filters') }}</th>
|
||||
<th scope="col" data-field="min_price" data-sortable="true" data-visible="false">{{ __('Min Price') }}</th>
|
||||
<th scope="col" data-field="max_price" data-sortable="true" data-visible="false">{{ __('Max price') }}</th>
|
||||
<th scope="col" data-field="values_text" data-sortable="true" data-visible="false">{{ __('Value') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header border-0 pb-0">
|
||||
<h3 style="font-weight: 600">{{__("Recent Advertisements")}}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('advertisement.show',1) }}" data-click-to-select="true"
|
||||
data-search="true" data-toolbar="#toolbar" data-show-columns="true" data-show-refresh="true"
|
||||
data-fixed-columns="true" data-fixed-number="1" data-trim-on-search="false"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-escape="true"
|
||||
data-query-params="queryParams" data-mobile-responsive="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="category.name" data-sortable="true">{{ __('Category') }}</th>
|
||||
<th scope="col" data-field="user.name" data-sortable="true">{{ __('Added By') }}</th>
|
||||
<th scope="col" data-field="price" data-sortable="true">{{ __('Price') }}</th>
|
||||
<th scope="col" data-field="status" data-sortable="true" data-formatter="itemStatusFormatter">{{ __('Status') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="map_data" id="map_data" value="{{ $items }}">
|
||||
{{-- <div class="row"> --}}
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<div class="card map_title h-100">
|
||||
<div class="card-header border-0 pb-0">
|
||||
<h3 style="font-weight: 600">{{ __('Most Viewed') }}</h3>
|
||||
</div>
|
||||
<div class="card-body h-50">
|
||||
<div id="world-map" style="width: 100%; height:400px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- </div> --}}
|
||||
<div class="row mb-10">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card h-100">
|
||||
<div class="card-header">
|
||||
<div class="recent_list_heading">{{ __("Total Categories") }}</div>
|
||||
</div>
|
||||
<div class="card-body mt-5">
|
||||
<div class="card-body mt-5">
|
||||
@if(!empty($category_item_count) && count($category_item_count) > 0)
|
||||
<div id="pie_chart"></div>
|
||||
@else
|
||||
<div class="text-center py-5">
|
||||
<h5>{{ __('No categories available to display') }}</h5>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<script>
|
||||
let seriesData = {!! json_encode(array_values($category_item_count)) !!};
|
||||
let hasData = Array.isArray(seriesData) && seriesData.length > 0 && seriesData.some(count => count > 0);
|
||||
|
||||
if (hasData) {
|
||||
let options = {
|
||||
series: seriesData,
|
||||
chart: {
|
||||
type: 'donut',
|
||||
height: "700px"
|
||||
},
|
||||
labels: {!! json_encode($category_name) !!},
|
||||
responsive: [{
|
||||
breakpoint: 480,
|
||||
options: {
|
||||
chart: {
|
||||
width: '100%',
|
||||
height: '300px',
|
||||
},
|
||||
}
|
||||
}],
|
||||
legend: {
|
||||
show: true,
|
||||
showForSingleSeries: false,
|
||||
showForNullSeries: true,
|
||||
showForZeroSeries: true,
|
||||
position: 'bottom',
|
||||
horizontalAlign: 'center',
|
||||
fontSize: '18px',
|
||||
fontFamily: 'Helvetica, Arial',
|
||||
fontWeight: 400,
|
||||
itemMargin: {
|
||||
horizontal: 30,
|
||||
vertical: 10
|
||||
}
|
||||
}
|
||||
};
|
||||
let chart1 = new ApexCharts(document.querySelector("#pie_chart"), options);
|
||||
chart1.render();
|
||||
} else {
|
||||
document.getElementById('pie_chart').style.display = 'none';
|
||||
document.getElementById('no_data_msg').style.display = 'block';
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<!-- Existing JS for chart rendering -->
|
||||
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
var mapData = JSON.parse($('#map_data').val());
|
||||
// var currency_symbol = $('#currency_symbol').val();
|
||||
// var featured='<div class="featured_tag"><div class="featured_lable">Featured</div>';
|
||||
var markerValues = mapData.map(function(item, index) {
|
||||
return {
|
||||
latLng: [parseFloat(item.latitude), parseFloat(item.longitude)],
|
||||
name: item.city,
|
||||
label: item.city,
|
||||
style: {
|
||||
fill: '#00B2CA',
|
||||
stroke: '#00000'
|
||||
},
|
||||
card: {
|
||||
content: '<div class="card_map">' +
|
||||
'<div class="image-container">' +
|
||||
'<img src="' + item.image + '" alt="' + item.name + '" class="object-fit-cover">' +
|
||||
'</div>' +
|
||||
'<div class="title mt-3">' + item.name + '</div>' +
|
||||
'<div class="price mt-2">' + item.price + '</div>' +
|
||||
'<div class="city mt-2">' +
|
||||
'<i class="bi bi-geo-alt"></i> ' + item.city +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
$('#world-map').vectorMap({
|
||||
map: 'world_mill',
|
||||
// scaleColors: ['#116D6E', '#116D6E'],
|
||||
backgroundColor: '#fffff',
|
||||
markerStyle: {
|
||||
initial: {
|
||||
strokeWidth: 1,
|
||||
stroke: '#383F47',
|
||||
fillOpacity: 1,
|
||||
r: 8,
|
||||
},
|
||||
onMarkerLabelShow: function(event, label, index) {
|
||||
// Add custom CSS classes to the label element
|
||||
label.addClass('custom-marker-label');
|
||||
},
|
||||
},
|
||||
markers: markerValues,
|
||||
series: {
|
||||
markers: [{
|
||||
// attribute: 'fill',
|
||||
scale: {}, // Empty scale object to be populated dynamically
|
||||
values: mapData.map(function(item) {
|
||||
return item.city;
|
||||
})
|
||||
}]
|
||||
},
|
||||
onMarkerTipShow: function(event, label, index) {
|
||||
var cardContent = markerValues[index].card.content;
|
||||
label.html(cardContent);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
1052
resources/views/items/create.blade.php
Normal file
1052
resources/views/items/create.blade.php
Normal file
File diff suppressed because it is too large
Load Diff
994
resources/views/items/index.blade.php
Normal file
994
resources/views/items/index.blade.php
Normal file
@@ -0,0 +1,994 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Advertisements') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 d-flex justify-content-end">
|
||||
<a class="btn btn-primary me-2"
|
||||
href="{{ route('advertisement.create') }}">{{ __('Create Advertisement') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-12 col-md-auto">
|
||||
<button type="button" class="btn btn-success w-100" id="btn-active-ads">
|
||||
{{ __('Active Advertisements') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<button type="button" class="btn btn-primary w-100" id="btn-requested-ads">
|
||||
{{ __('Requested Advertisements') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<button type="button" class="btn btn-secondary active w-100" id="btn-all-ads">
|
||||
{{ __('All Advertisements') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- <div class="d-flex gap-2 mb-3">
|
||||
<button type="button" class="btn btn-success" id="btn-active-ads">
|
||||
{{ __('Active Advertisements') }}
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" id="btn-requested-ads">
|
||||
{{ __('Requested Advertisements') }}
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary active" id="btn-all-ads">
|
||||
{{ __('All Advertisements') }}
|
||||
</button>
|
||||
</div> --}}
|
||||
|
||||
<div id="filters" class="d-flex flex-wrap align-items-end gap-2 mb-3">
|
||||
<div class="col-md-2">
|
||||
<label for="filter">{{ __('Status') }}</label>
|
||||
<select class="form-control" id="filter" data-field="status">
|
||||
<option value="">{{ __('All') }}</option>
|
||||
<option value="approved">{{ __('Approved') }}</option>
|
||||
<option value="review">{{ __('Under Review') }}</option>
|
||||
<option value="sold out">{{ __('Sold Out') }}</option>
|
||||
<option value="expired">{{ __('Expired') }}</option>
|
||||
<option value="inactive">{{ __('Inactive') }}</option>
|
||||
<option value="soft rejected">{{ __('Soft Rejected') }}</option>
|
||||
<option value="permanent rejected">{{ __('Permanent Rejected') }}</option>
|
||||
<option value="resubmitted">{{ __('Resubmitted') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="filter-featured-premium">{{ __('Featured') }}</label>
|
||||
<select class="form-control bootstrap-table-filter-control-featured_status"
|
||||
id="filter_featured_premium">
|
||||
<option value="">{{ __('All') }}</option>
|
||||
<option value="featured">{{ __('Featured') }}</option>
|
||||
{{-- <option value="premium">{{ __('Premium') }}</option> --}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="p_category">{{ __('Category') }}</label>
|
||||
<select name="category_id" id="p_category"
|
||||
class="form-control bootstrap-table-filter-control-category" aria-label="category"
|
||||
data-placeholder="{{ __('All') }}">
|
||||
<option value="">{{ __('All') }}</option>
|
||||
@include('category.dropdowntree', ['categories' => $categories])
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="filter_country">{{ __('Country') }}</label>
|
||||
<select class="form-control bootstrap-table-filter-control-country"
|
||||
id="filter_country_item_test">
|
||||
<option value="">{{ __('All') }}</option>
|
||||
@foreach ($countries as $country)
|
||||
<option value="{{ $country->name }}">{{ $country->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="filter_state">{{ __('State') }}</label>
|
||||
<select name="state_id" class="form-control bootstrap-table-filter-control-state"
|
||||
id="filter_state_item">
|
||||
<option value="">{{ __('All') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="filter_city">{{ __('City') }}</label>
|
||||
<select name="city_id" class="form-control bootstrap-table-filter-control-city"
|
||||
id="filter_city_item">
|
||||
<option value="">{{ __('All') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('advertisement.show', 'approved') }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true" data-show-columns="true"
|
||||
data-show-refresh="true" data-fixed-columns="true" data-fixed-number="1"
|
||||
data-fixed-right-number="1" data-trim-on-search="false" data-escape="true"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3" data-table="items" data-status-column="deleted_at"
|
||||
data-show-export="true"
|
||||
data-export-options='{"fileName": "item-list","ignoreColumn": ["operate"]}'
|
||||
data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="false" data-responsive="true"
|
||||
data-card-view="false"{{-- data-filter-control="true" --}} {{-- data-filter-control-container="#filters" --}} data-toolbar="#filters"
|
||||
data-query-params="itemListQueryParams">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="true">{{ __('Name') }}
|
||||
</th>
|
||||
<th scope="col" data-field="description" data-align="center"
|
||||
data-sortable="true" data-formatter="descriptionFormatter">
|
||||
{{ __('Description') }}</th>
|
||||
<th scope="col" data-field="user.profile" data-formatter="imageFormatter">
|
||||
{{ __('Profile') }}</th>
|
||||
<th scope="col" data-field="user.name" data-sort-name="user_name"
|
||||
data-sortable="true">{{ __('User') }}</th>
|
||||
<th scope="col" data-field="price" data-sortable="true">{{ __('Price') }}
|
||||
</th>
|
||||
<th scope="col" data-field="min_salary" data-sortable="true"
|
||||
data-visible="false">{{ __('Min Salary') }}
|
||||
</th>
|
||||
<th scope="col" data-field="max_salary" data-sortable="true"
|
||||
data-visible="false">{{ __('Max Salary') }}
|
||||
</th>
|
||||
<th scope="col" data-field="category.name" data-sortable="true">
|
||||
{{ __('Category') }}
|
||||
</th>
|
||||
<th scope="col" data-field="image" data-sortable="false" data-escape="false"
|
||||
data-formatter="imageFormatter">{{ __('Image') }}</th>
|
||||
<th scope="col" data-field="gallery_images" data-sortable="false"
|
||||
data-formatter="galleryImageFormatter" data-escape="false">
|
||||
{{ __('Other Images') }}</th>
|
||||
<th scope="col" data-field="latitude" data-sortable="true"
|
||||
data-visible="false" data-switchable="false">{{ __('Latitude') }}</th>
|
||||
<th scope="col" data-field="longitude" data-sortable="true"
|
||||
data-visible="false" data-switchable="false">{{ __('Longitude') }}</th>
|
||||
<th scope="col" data-field="address" data-sortable="true"
|
||||
data-visible="false" data-switchable="false">{{ __('Address') }}</th>
|
||||
<th scope="col" data-field="contact" data-sortable="true"
|
||||
data-visible="false" data-switchable="false">{{ __('Contact') }}</th>
|
||||
<th scope="col" data-field="country" data-sortable="true"
|
||||
data-filter-control="select" data-filter-data="" data-visible="true">
|
||||
{{ __('Country') }}</th>
|
||||
<th scope="col" data-field="state" data-sortable="true" data-visible="true">
|
||||
{{ __('State') }}</th>
|
||||
<th scope="col" data-field="city" data-sortable="true"
|
||||
data-filter-control="select" data-filter-data="" data-visible="true">
|
||||
{{ __('City') }}</th>
|
||||
<th scope="col" data-field="featured_status" data-sortable="false"
|
||||
data-filter-control="select" data-filter-data=""
|
||||
data-formatter="featuredItemStatusFormatter">{{ __('Featured/Not-Featured') }}
|
||||
</th>
|
||||
<th scope="col" data-field="status" data-sortable="false" data-escape="false"
|
||||
data-formatter="itemStatusFormatter">{{ __('Status') }}</th>
|
||||
@can('advertisement-update')
|
||||
<th scope="col" data-field="active_status" data-sortable="true"
|
||||
data-sort-name="deleted_at" data-visible="true" data-escape="false"
|
||||
data-formatter="statusSwitchFormatter">{{ __('Active') }}</th>
|
||||
@endcan
|
||||
<th scope="col" data-field="rejected_reason" data-sortable="true"
|
||||
data-visible="false" data-switchable="false">{{ __('Rejected Reason') }}</th>
|
||||
<th scope="col" data-field="expiry_date" data-sortable="true"
|
||||
data-visible="true">{{ __('Expiry Date') }}</th>
|
||||
<th scope="col" data-field="created_at" data-sortable="false"
|
||||
data-visible="true" data-switchable="false" data-formatter="dateFormatter">
|
||||
{{ __('Created At') }}
|
||||
</th>
|
||||
<th scope="col" data-field="updated_at" data-sortable="false"
|
||||
data-visible="false" data-switchable="false">{{ __('Updated At') }}</th>
|
||||
<th scope="col" data-field="user_id" data-sortable="false"
|
||||
data-visible="false" data-switchable="false">{{ __('User ID') }}</th>
|
||||
<th scope="col" data-field="category_id" data-sortable="true"
|
||||
data-visible="false" data-switchable="false">{{ __('Category ID') }}</th>
|
||||
<th scope="col" data-field="likes" data-sortable="true" data-visible="false"
|
||||
data-switchable="false">{{ __('Likes') }}</th>
|
||||
<th scope="col" data-field="clicks" data-sortable="true" data-visible="false"
|
||||
data-switchable="false">{{ __('Clicks') }}</th>
|
||||
@canany(['advertisement-update', 'advertisement-delete'])
|
||||
<th scope="col" data-field="operate" data-align="center"
|
||||
data-sortable="false" data-events="itemEvents" data-escape="false">
|
||||
{{ __('Action') }}</th>
|
||||
@endcanany
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="editModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Advertisement Details') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="center" id="custom_fields"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<div id="editStatusModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Status') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="edit-form" action="" method="POST"
|
||||
data-success-function="updateApprovalSuccess">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<select name="status" class="form-select" id="status" aria-label="status">
|
||||
<option value="review">{{ __('Under Review') }}</option>
|
||||
<option value="approved">{{ __('Approve') }}</option>
|
||||
<option value="soft rejected">{{ __('Soft Rejected') }}</option>
|
||||
<option value="permanent rejected">{{ __('Permanent Rejected') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="rejected_reason_container" class="col-md-12" style="display: none;">
|
||||
<label for="rejected_reason" class="mandatory form-label">{{ __('Reason') }}</label>
|
||||
<textarea name="rejected_reason" id="rejected_reason" class="form-control" placeholder={{ __('Reason') }}></textarea>
|
||||
{{-- <input type="text" name="rejected_reason" id="rejected_reason" class="form-control"> --}}
|
||||
</div>
|
||||
<input type="submit" value="{{ __('Save') }}" class="btn btn-primary mt-3">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
function updateApprovalSuccess() {
|
||||
$('#editStatusModal').modal('hide');
|
||||
}
|
||||
|
||||
// Custom queryParams function for items table to preserve filters during pagination
|
||||
function itemListQueryParams(params) {
|
||||
// Get current filter values from filter controls
|
||||
const currentFilters = {};
|
||||
|
||||
// Get status filter based on button mode and dropdown selection
|
||||
const statusFilterValue = $('#filter').val();
|
||||
|
||||
if (window.itemStatusFilterMode === 'active') {
|
||||
// Active mode: always show approved (ignore dropdown)
|
||||
currentFilters.status = 'approved';
|
||||
} else if (window.itemStatusFilterMode === 'requested') {
|
||||
// Requested mode: if dropdown has a value, use it (it's already not approved)
|
||||
// Otherwise, use status_not: 'approved'
|
||||
if (statusFilterValue) {
|
||||
currentFilters.status = statusFilterValue;
|
||||
} else {
|
||||
currentFilters.status_not = 'approved';
|
||||
}
|
||||
} else {
|
||||
// All mode: use dropdown value if selected
|
||||
if (statusFilterValue) {
|
||||
currentFilters.status = statusFilterValue;
|
||||
}
|
||||
}
|
||||
|
||||
// FIRST: Get all non-status filters (country, state, city, featured_status)
|
||||
// These should ALWAYS be preserved regardless of button mode
|
||||
|
||||
// Get featured/premium filter - try multiple selectors
|
||||
let featuredStatus = $('#filter_featured_premium').val() ||
|
||||
$('.bootstrap-table-filter-control-featured_status').val() ||
|
||||
$('select[data-field="featured_status"]').val() ||
|
||||
$('select.bootstrap-table-filter-control-featured_status').val() || '';
|
||||
|
||||
// Get category filter
|
||||
let category = $('#p_category').val() ||
|
||||
$('.bootstrap-table-filter-control-category').val() ||
|
||||
$('select[data-field="category"]').val() || '';
|
||||
|
||||
if (category && category.trim() !== '') {
|
||||
currentFilters.category_id = category.trim();
|
||||
}
|
||||
|
||||
|
||||
// Get country filter - try multiple selectors
|
||||
let country = $('#filter_country_item_test').val() ||
|
||||
$('.bootstrap-table-filter-control-country').val() ||
|
||||
$('select[data-field="country"]').val() ||
|
||||
$('select.bootstrap-table-filter-control-country').val() || '';
|
||||
|
||||
// Get state filter - try multiple selectors
|
||||
let state = $('#filter_state_item').val() ||
|
||||
$('.bootstrap-table-filter-control-state').val() ||
|
||||
$('select[data-field="state"]').val() ||
|
||||
$('select.bootstrap-table-filter-control-state').val() || '';
|
||||
|
||||
// Get city filter - try multiple selectors
|
||||
let city = $('#filter_city_item').val() ||
|
||||
$('.bootstrap-table-filter-control-city').val() ||
|
||||
$('select[data-field="city"]').val() ||
|
||||
$('select.bootstrap-table-filter-control-city').val() || '';
|
||||
|
||||
// Add non-status filters if they have values (always preserve these)
|
||||
if (featuredStatus && featuredStatus.trim() !== '') {
|
||||
currentFilters.featured_status = featuredStatus.trim();
|
||||
}
|
||||
if (country && country.trim() !== '') {
|
||||
currentFilters.country = country.trim();
|
||||
}
|
||||
if (state && state.trim() !== '') {
|
||||
currentFilters.state = state.trim();
|
||||
}
|
||||
if (city && city.trim() !== '') {
|
||||
currentFilters.city = city.trim();
|
||||
}
|
||||
|
||||
// Build query params
|
||||
const queryParams = {
|
||||
limit: params.limit,
|
||||
offset: params.offset,
|
||||
order: params.order,
|
||||
search: params.search,
|
||||
sort: params.sort
|
||||
};
|
||||
|
||||
// Add filter if we have any filters
|
||||
if (Object.keys(currentFilters).length > 0) {
|
||||
queryParams.filter = JSON.stringify(currentFilters);
|
||||
}
|
||||
|
||||
return queryParams;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// Global variable to track status filter mode
|
||||
window.itemStatusFilterMode = 'all'; // 'all', 'active', 'requested' - default to 'all'
|
||||
|
||||
// Global object to track intended filter values (to prevent Bootstrap Table from resetting them)
|
||||
window.intendedFilters = {
|
||||
country: '',
|
||||
state: '',
|
||||
city: '',
|
||||
featuredStatus: '',
|
||||
status: '',
|
||||
category: ''
|
||||
};
|
||||
|
||||
// Function to get current filters from filter controls and merge with status filter
|
||||
function getMergedFilters() {
|
||||
// Get current filter values from filter controls
|
||||
const currentFilters = {};
|
||||
|
||||
// FIRST: Get all non-status filters (country, state, city, featured_status)
|
||||
// These should ALWAYS be preserved regardless of button mode
|
||||
|
||||
// Get featured/premium filter - try multiple selectors, fallback to intended filter
|
||||
let featuredStatus = $('#filter_featured_premium').val() ||
|
||||
$('.bootstrap-table-filter-control-featured_status').val() ||
|
||||
$('select[data-field="featured_status"]').val() ||
|
||||
$('select.bootstrap-table-filter-control-featured_status').val() ||
|
||||
(window.intendedFilters ? window.intendedFilters.featuredStatus : '') || '';
|
||||
|
||||
// Get category filter
|
||||
let category = $('#p_category').val() ||
|
||||
$('.bootstrap-table-filter-control-category').val() ||
|
||||
(window.intendedFilters ? window.intendedFilters.category : '') || '';
|
||||
|
||||
if (category && category.trim() !== '') {
|
||||
currentFilters.category_id = category.trim();
|
||||
}
|
||||
|
||||
// Get country filter - try multiple selectors, fallback to intended filter
|
||||
let country = $('#filter_country_item_test').val() ||
|
||||
$('.bootstrap-table-filter-control-country').val() ||
|
||||
$('select[data-field="country"]').val() ||
|
||||
$('select.bootstrap-table-filter-control-country').val() ||
|
||||
(window.intendedFilters ? window.intendedFilters.country : '') || '';
|
||||
|
||||
// Get state filter - try multiple selectors, fallback to intended filter
|
||||
let state = $('#filter_state_item').val() ||
|
||||
$('.bootstrap-table-filter-control-state').val() ||
|
||||
$('select[data-field="state"]').val() ||
|
||||
$('select.bootstrap-table-filter-control-state').val() ||
|
||||
(window.intendedFilters ? window.intendedFilters.state : '') || '';
|
||||
|
||||
// Get city filter - try multiple selectors, fallback to intended filter
|
||||
let city = $('#filter_city_item').val() ||
|
||||
$('.bootstrap-table-filter-control-city').val() ||
|
||||
$('select[data-field="city"]').val() ||
|
||||
$('select.bootstrap-table-filter-control-city').val() ||
|
||||
(window.intendedFilters ? window.intendedFilters.city : '') || '';
|
||||
|
||||
// Add non-status filters if they have values (always preserve these)
|
||||
if (featuredStatus && featuredStatus.trim() !== '') {
|
||||
currentFilters.featured_status = featuredStatus.trim();
|
||||
}
|
||||
if (country && country.trim() !== '') {
|
||||
currentFilters.country = country.trim();
|
||||
}
|
||||
if (state && state.trim() !== '') {
|
||||
currentFilters.state = state.trim();
|
||||
}
|
||||
if (city && city.trim() !== '') {
|
||||
currentFilters.city = city.trim();
|
||||
}
|
||||
|
||||
// SECOND: Build status filter based on button mode and dropdown
|
||||
const statusFilterValue = $('#filter').val() || '';
|
||||
|
||||
if (window.itemStatusFilterMode === 'active') {
|
||||
// Active mode: always show approved (ignore dropdown)
|
||||
currentFilters.status = 'approved';
|
||||
} else if (window.itemStatusFilterMode === 'requested') {
|
||||
// Requested mode: if dropdown has a value, use it (it's already not approved)
|
||||
// Otherwise, use status_not: 'approved'
|
||||
if (statusFilterValue && statusFilterValue.trim() !== '') {
|
||||
currentFilters.status = statusFilterValue.trim();
|
||||
} else {
|
||||
currentFilters.status_not = 'approved';
|
||||
}
|
||||
} else {
|
||||
// All mode: use dropdown value if selected
|
||||
if (statusFilterValue && statusFilterValue.trim() !== '') {
|
||||
currentFilters.status = statusFilterValue.trim();
|
||||
}
|
||||
}
|
||||
|
||||
return Object.keys(currentFilters).length > 0 ? currentFilters : null;
|
||||
}
|
||||
|
||||
// Function to update button active states
|
||||
function updateButtonStates(activeButton) {
|
||||
$('#btn-active-ads, #btn-requested-ads, #btn-all-ads').removeClass('active');
|
||||
$(activeButton).addClass('active');
|
||||
}
|
||||
|
||||
// Function to store current filter values
|
||||
function storeFilterValues() {
|
||||
// Try to get values from multiple sources (direct IDs and Bootstrap Table controls)
|
||||
// Also check global intendedFilters as fallback
|
||||
const stored = {
|
||||
featuredStatus: $('#filter_featured_premium').val() ||
|
||||
$('.bootstrap-table-filter-control-featured_status').val() ||
|
||||
window.intendedFilters.featuredStatus || '',
|
||||
country: $('#filter_country_item_test').val() ||
|
||||
$('.bootstrap-table-filter-control-country').val() ||
|
||||
window.intendedFilters.country || '',
|
||||
state: $('#filter_state_item').val() ||
|
||||
$('.bootstrap-table-filter-control-state').val() ||
|
||||
window.intendedFilters.state || '',
|
||||
city: $('#filter_city_item').val() ||
|
||||
$('.bootstrap-table-filter-control-city').val() ||
|
||||
window.intendedFilters.city || '',
|
||||
status: $('#filter').val() || window.intendedFilters.status || ''
|
||||
};
|
||||
|
||||
// Update global intended filters
|
||||
window.intendedFilters = {
|
||||
country: stored.country,
|
||||
state: stored.state,
|
||||
city: stored.city,
|
||||
featuredStatus: stored.featuredStatus,
|
||||
status: stored.status
|
||||
};
|
||||
|
||||
return stored;
|
||||
}
|
||||
|
||||
// Function to restore filter values (without triggering change events to prevent loops)
|
||||
function restoreFilterValues(storedValues, skipChangeEvent) {
|
||||
if (storedValues) {
|
||||
// Only restore if value exists and is not empty
|
||||
if (storedValues.featuredStatus && storedValues.featuredStatus.trim() !== '') {
|
||||
const currentVal = $('#filter_featured_premium').val();
|
||||
if (currentVal !== storedValues.featuredStatus) {
|
||||
$('#filter_featured_premium').val(storedValues.featuredStatus);
|
||||
}
|
||||
$('.bootstrap-table-filter-control-featured_status').val(storedValues.featuredStatus);
|
||||
$('select[data-field="featured_status"]').val(storedValues.featuredStatus);
|
||||
}
|
||||
if (storedValues.country && storedValues.country.trim() !== '') {
|
||||
// Restore to all possible selectors (only if value is different to prevent loops)
|
||||
const currentCountry = $('#filter_country_item_test').val();
|
||||
if (currentCountry !== storedValues.country) {
|
||||
$('#filter_country_item_test').val(storedValues.country).prop('selected', true);
|
||||
}
|
||||
$('.bootstrap-table-filter-control-country').val(storedValues.country).prop('selected',
|
||||
true);
|
||||
$('select[data-field="country"]').val(storedValues.country).prop('selected', true);
|
||||
// Also try to find Bootstrap Table's generated filter control
|
||||
$('th[data-field="country"]').find('select').val(storedValues.country).prop('selected',
|
||||
true);
|
||||
}
|
||||
if (storedValues.state && storedValues.state.trim() !== '') {
|
||||
const currentState = $('#filter_state_item').val();
|
||||
if (currentState !== storedValues.state) {
|
||||
$('#filter_state_item').val(storedValues.state).prop('selected', true);
|
||||
}
|
||||
$('.bootstrap-table-filter-control-state').val(storedValues.state).prop('selected', true);
|
||||
$('select[data-field="state"]').val(storedValues.state).prop('selected', true);
|
||||
$('th[data-field="state"]').find('select').val(storedValues.state).prop('selected', true);
|
||||
}
|
||||
if (storedValues.city && storedValues.city.trim() !== '') {
|
||||
const currentCity = $('#filter_city_item').val();
|
||||
if (currentCity !== storedValues.city) {
|
||||
$('#filter_city_item').val(storedValues.city).prop('selected', true);
|
||||
}
|
||||
$('.bootstrap-table-filter-control-city').val(storedValues.city).prop('selected', true);
|
||||
$('select[data-field="city"]').val(storedValues.city).prop('selected', true);
|
||||
$('th[data-field="city"]').find('select').val(storedValues.city).prop('selected', true);
|
||||
}
|
||||
// Status is handled separately by updateStatusDropdown
|
||||
}
|
||||
}
|
||||
|
||||
// Function to update status dropdown based on button mode
|
||||
function updateStatusDropdown() {
|
||||
if (typeof window.itemStatusFilterMode === 'undefined') {
|
||||
window.itemStatusFilterMode = 'all';
|
||||
}
|
||||
const $statusDropdown = $('#filter');
|
||||
const currentValue = $statusDropdown.val();
|
||||
|
||||
// Store all options
|
||||
const allOptions = [{
|
||||
value: '',
|
||||
text: '{{ __('All') }}'
|
||||
},
|
||||
{
|
||||
value: 'approved',
|
||||
text: '{{ __('Approved') }}'
|
||||
},
|
||||
{
|
||||
value: 'review',
|
||||
text: '{{ __('Under Review') }}'
|
||||
},
|
||||
{
|
||||
value: 'sold out',
|
||||
text: '{{ __('Sold Out') }}'
|
||||
},
|
||||
{
|
||||
value: 'expired',
|
||||
text: '{{ __('Expired') }}'
|
||||
},
|
||||
{
|
||||
value: 'inactive',
|
||||
text: '{{ __('Inactive') }}'
|
||||
},
|
||||
{
|
||||
value: 'soft rejected',
|
||||
text: '{{ __('Soft Rejected') }}'
|
||||
},
|
||||
{
|
||||
value: 'permanent rejected',
|
||||
text: '{{ __('Permanent Rejected') }}'
|
||||
},
|
||||
{
|
||||
value: 'resubmitted',
|
||||
text: '{{ __('Resubmitted') }}'
|
||||
}
|
||||
];
|
||||
|
||||
if (window.itemStatusFilterMode === 'active') {
|
||||
// Active mode: Disable dropdown and show only approved (but it's handled by button)
|
||||
$statusDropdown.prop('disabled', true);
|
||||
$statusDropdown.html('<option value="">{{ __('All') }}</option>');
|
||||
} else if (window.itemStatusFilterMode === 'requested') {
|
||||
// Requested mode: Remove approved option, enable dropdown
|
||||
$statusDropdown.prop('disabled', false);
|
||||
let html = '<option value="">{{ __('All') }}</option>';
|
||||
allOptions.forEach(option => {
|
||||
if (option.value !== 'approved' && option.value !== '') {
|
||||
html += `<option value="${option.value}">${option.text}</option>`;
|
||||
}
|
||||
});
|
||||
$statusDropdown.html(html);
|
||||
// Restore previous value if it wasn't 'approved'
|
||||
if (currentValue && currentValue !== 'approved') {
|
||||
$statusDropdown.val(currentValue);
|
||||
}
|
||||
} else {
|
||||
// All mode: Show all options, enable dropdown
|
||||
$statusDropdown.prop('disabled', false);
|
||||
let html = '';
|
||||
allOptions.forEach(option => {
|
||||
html += `<option value="${option.value}">${option.text}</option>`;
|
||||
});
|
||||
$statusDropdown.html(html);
|
||||
// Restore previous value
|
||||
if (currentValue) {
|
||||
$statusDropdown.val(currentValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Active Ads - only show approved, remove status filter from dropdown
|
||||
$('#btn-active-ads').on('click', function() {
|
||||
// Store current filter values BEFORE changing mode
|
||||
const storedFilters = storeFilterValues();
|
||||
|
||||
window.itemStatusFilterMode = 'active';
|
||||
updateButtonStates(this);
|
||||
updateStatusDropdown();
|
||||
// Clear status dropdown filter since we're using button filter
|
||||
$('#filter').val('');
|
||||
|
||||
// Restore non-status filter values
|
||||
restoreFilterValues(storedFilters);
|
||||
|
||||
// Get filters - read them fresh from DOM (after restoring)
|
||||
const mergedFilters = getMergedFilters();
|
||||
const filterString = mergedFilters ? JSON.stringify(mergedFilters) : JSON.stringify({
|
||||
status: 'approved'
|
||||
});
|
||||
|
||||
$('#table_list').bootstrapTable('refresh', {
|
||||
query: {
|
||||
filter: filterString
|
||||
}
|
||||
});
|
||||
|
||||
// Restore filter values after refresh (Bootstrap Table might reset them)
|
||||
// Use multiple timeouts to ensure values are restored even if Bootstrap Table resets them
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(storedFilters);
|
||||
}, 100);
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(storedFilters);
|
||||
}, 500);
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(storedFilters);
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
// Requested Ads - exclude approved, allow status filter from dropdown
|
||||
$('#btn-requested-ads').on('click', function() {
|
||||
// Store current filter values BEFORE changing mode
|
||||
const storedFilters = storeFilterValues();
|
||||
|
||||
window.itemStatusFilterMode = 'requested';
|
||||
updateButtonStates(this);
|
||||
updateStatusDropdown();
|
||||
// Don't clear status dropdown - user can still filter by specific status
|
||||
|
||||
// Restore non-status filter values
|
||||
restoreFilterValues(storedFilters);
|
||||
|
||||
// Get filters - read them fresh from DOM (after restoring)
|
||||
const mergedFilters = getMergedFilters();
|
||||
const filterString = mergedFilters ? JSON.stringify(mergedFilters) : JSON.stringify({
|
||||
status_not: 'approved'
|
||||
});
|
||||
|
||||
$('#table_list').bootstrapTable('refresh', {
|
||||
query: {
|
||||
filter: filterString
|
||||
}
|
||||
});
|
||||
|
||||
// Restore filter values after refresh (Bootstrap Table might reset them)
|
||||
// Use multiple timeouts to ensure values are restored even if Bootstrap Table resets them
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(storedFilters);
|
||||
}, 100);
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(storedFilters);
|
||||
}, 500);
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(storedFilters);
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
// Show All - show all statuses, allow status filter from dropdown
|
||||
$('#btn-all-ads').on('click', function() {
|
||||
// Store current filter values BEFORE changing mode
|
||||
const storedFilters = storeFilterValues();
|
||||
|
||||
window.itemStatusFilterMode = 'all';
|
||||
updateButtonStates(this);
|
||||
updateStatusDropdown();
|
||||
// Don't clear status dropdown - user can filter by status
|
||||
|
||||
// Restore non-status filter values
|
||||
restoreFilterValues(storedFilters);
|
||||
|
||||
// Get filters - read them fresh from DOM (after restoring)
|
||||
const mergedFilters = getMergedFilters();
|
||||
const filterString = mergedFilters ? JSON.stringify(mergedFilters) : '';
|
||||
|
||||
$('#table_list').bootstrapTable('refresh', {
|
||||
query: {
|
||||
filter: filterString
|
||||
}
|
||||
});
|
||||
|
||||
// Restore filter values after refresh (Bootstrap Table might reset them)
|
||||
// Use multiple timeouts to ensure values are restored even if Bootstrap Table resets them
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(storedFilters);
|
||||
}, 100);
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(storedFilters);
|
||||
}, 500);
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(storedFilters);
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
// Helper function to refresh table with current filters
|
||||
let filterChangeTimeout = null;
|
||||
let isRefreshing = false;
|
||||
|
||||
function refreshTableWithFilters() {
|
||||
// Prevent multiple simultaneous refreshes
|
||||
if (isRefreshing) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear any pending timeout
|
||||
if (filterChangeTimeout) {
|
||||
clearTimeout(filterChangeTimeout);
|
||||
}
|
||||
|
||||
// Store current filter values before refresh
|
||||
const currentFilters = storeFilterValues();
|
||||
|
||||
// Debounce the refresh to prevent duplicate calls
|
||||
filterChangeTimeout = setTimeout(function() {
|
||||
isRefreshing = true;
|
||||
|
||||
const mergedFilters = getMergedFilters();
|
||||
const filterString = mergedFilters ? JSON.stringify(mergedFilters) : '';
|
||||
|
||||
$('#table_list').bootstrapTable('refresh', {
|
||||
query: {
|
||||
filter: filterString
|
||||
}
|
||||
});
|
||||
|
||||
// Mark as not refreshing after a delay
|
||||
setTimeout(function() {
|
||||
isRefreshing = false;
|
||||
}, 1000);
|
||||
|
||||
// Restore filter values after refresh (without triggering change events)
|
||||
setTimeout(function() {
|
||||
if (currentFilters) {
|
||||
restoreFilterValues(currentFilters, true);
|
||||
}
|
||||
}, 100);
|
||||
setTimeout(function() {
|
||||
if (currentFilters) {
|
||||
restoreFilterValues(currentFilters, true);
|
||||
}
|
||||
}, 300);
|
||||
setTimeout(function() {
|
||||
if (currentFilters) {
|
||||
restoreFilterValues(currentFilters, true);
|
||||
}
|
||||
}, 600);
|
||||
}, 150);
|
||||
}
|
||||
|
||||
// When status filter dropdown changes, update based on current mode
|
||||
$('#filter').on('change', function() {
|
||||
refreshTableWithFilters();
|
||||
});
|
||||
|
||||
// When country filter changes, refresh table and preserve status filter mode
|
||||
// Note: custom.js will handle loading states, we just need to refresh the table
|
||||
$(document).on('change',
|
||||
'#filter_country_item_test, .bootstrap-table-filter-control-country, select[data-field="country"], th[data-field="country"] select',
|
||||
function(e) {
|
||||
// Get the selected country value from the element that triggered the event
|
||||
const selectedCountry = $(this).val() || '';
|
||||
|
||||
// Skip if empty (user selected "All")
|
||||
if (!selectedCountry) {
|
||||
window.intendedFilters.country = '';
|
||||
refreshTableWithFilters();
|
||||
return;
|
||||
}
|
||||
|
||||
// Update global intended filter IMMEDIATELY
|
||||
window.intendedFilters.country = selectedCountry;
|
||||
|
||||
// Clear city when country changes (states will be reloaded by custom.js)
|
||||
$('#filter_city_item').val('');
|
||||
$('.bootstrap-table-filter-control-city').val('');
|
||||
$('select[data-field="city"]').val('');
|
||||
window.intendedFilters.city = '';
|
||||
|
||||
// Sync country value to ALL possible selectors IMMEDIATELY
|
||||
const syncCountryValue = function() {
|
||||
if (selectedCountry) {
|
||||
$('#filter_country_item_test').val(selectedCountry).prop('selected', true);
|
||||
$('.bootstrap-table-filter-control-country').val(selectedCountry).prop(
|
||||
'selected', true);
|
||||
$('select[data-field="country"]').val(selectedCountry).prop('selected', true);
|
||||
$('th[data-field="country"]').find('select').val(selectedCountry).prop(
|
||||
'selected', true);
|
||||
}
|
||||
};
|
||||
|
||||
// Sync immediately
|
||||
syncCountryValue();
|
||||
|
||||
// Refresh table after a short delay to allow states to load
|
||||
setTimeout(function() {
|
||||
// Re-sync before refresh
|
||||
syncCountryValue();
|
||||
refreshTableWithFilters();
|
||||
|
||||
// Aggressively restore country value after refresh
|
||||
setTimeout(syncCountryValue, 50);
|
||||
setTimeout(syncCountryValue, 150);
|
||||
setTimeout(syncCountryValue, 300);
|
||||
setTimeout(syncCountryValue, 500);
|
||||
setTimeout(syncCountryValue, 1000);
|
||||
setTimeout(syncCountryValue, 2000);
|
||||
}, 300);
|
||||
});
|
||||
|
||||
// When state filter changes, refresh table and preserve status filter mode
|
||||
// Note: custom.js will handle loading cities, we just need to refresh the table
|
||||
$('#filter_state_item, .bootstrap-table-filter-control-state').on('change', function() {
|
||||
// Store the selected state value immediately to prevent loss
|
||||
const selectedState = $(this).val() || '';
|
||||
|
||||
// Update global intended filter
|
||||
window.intendedFilters.state = selectedState;
|
||||
|
||||
// Ensure state value is set in both selectors
|
||||
if (selectedState) {
|
||||
$('#filter_state_item').val(selectedState);
|
||||
$('.bootstrap-table-filter-control-state').val(selectedState);
|
||||
}
|
||||
|
||||
// Refresh table after a short delay to allow cities to load
|
||||
setTimeout(function() {
|
||||
// Re-ensure state value is still set before refresh
|
||||
if (selectedState) {
|
||||
$('#filter_state_item').val(selectedState);
|
||||
$('.bootstrap-table-filter-control-state').val(selectedState);
|
||||
}
|
||||
refreshTableWithFilters();
|
||||
|
||||
// Restore state value after refresh in case Bootstrap Table reset it
|
||||
setTimeout(function() {
|
||||
if (selectedState) {
|
||||
$('#filter_state_item').val(selectedState);
|
||||
$('.bootstrap-table-filter-control-state').val(selectedState);
|
||||
}
|
||||
}, 100);
|
||||
}, 300);
|
||||
});
|
||||
|
||||
// When city filter changes, refresh table and preserve status filter mode
|
||||
$('#filter_city_item, .bootstrap-table-filter-control-city').on('change', function() {
|
||||
// Store the selected city value immediately to prevent loss
|
||||
const selectedCity = $(this).val() || '';
|
||||
|
||||
// Update global intended filter
|
||||
window.intendedFilters.city = selectedCity;
|
||||
|
||||
// Ensure city value is set in both selectors
|
||||
if (selectedCity) {
|
||||
$('#filter_city_item').val(selectedCity);
|
||||
$('.bootstrap-table-filter-control-city').val(selectedCity);
|
||||
}
|
||||
|
||||
refreshTableWithFilters();
|
||||
|
||||
// Restore city value after refresh in case Bootstrap Table reset it
|
||||
setTimeout(function() {
|
||||
if (selectedCity) {
|
||||
$('#filter_city_item').val(selectedCity);
|
||||
$('.bootstrap-table-filter-control-city').val(selectedCity);
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
|
||||
$('#filter_category, .bootstrap-table-filter-control-category').on('change', function() {
|
||||
const selectedCategory = $(this).val() || '';
|
||||
|
||||
window.intendedFilters.category = selectedCategory;
|
||||
|
||||
refreshTableWithFilters();
|
||||
});
|
||||
|
||||
|
||||
// When featured/premium filter changes, refresh table and preserve status filter mode
|
||||
let featuredFilterChanging = false;
|
||||
$('#filter_featured_premium, .bootstrap-table-filter-control-featured_status, select[data-field="featured_status"]')
|
||||
.on('change', function(e) {
|
||||
// Prevent infinite loops - if we're already processing a change, skip
|
||||
if (featuredFilterChanging) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the selected featured status value
|
||||
const selectedFeatured = $(this).val() || '';
|
||||
|
||||
// Check if value actually changed
|
||||
const currentIntended = window.intendedFilters.featuredStatus || '';
|
||||
if (selectedFeatured === currentIntended && selectedFeatured !== '') {
|
||||
// Value hasn't changed, don't refresh
|
||||
return;
|
||||
}
|
||||
|
||||
// Set flag to prevent loops
|
||||
featuredFilterChanging = true;
|
||||
|
||||
// Update global intended filter
|
||||
window.intendedFilters.featuredStatus = selectedFeatured;
|
||||
|
||||
// Ensure featured status value is set in all selectors (without triggering change)
|
||||
if (selectedFeatured) {
|
||||
$('#filter_featured_premium').val(selectedFeatured);
|
||||
$('.bootstrap-table-filter-control-featured_status').val(selectedFeatured);
|
||||
$('select[data-field="featured_status"]').val(selectedFeatured);
|
||||
}
|
||||
|
||||
// Refresh table
|
||||
refreshTableWithFilters();
|
||||
|
||||
// Clear flag after a delay
|
||||
setTimeout(function() {
|
||||
featuredFilterChanging = false;
|
||||
}, 500);
|
||||
});
|
||||
|
||||
// Initialize status dropdown on page load
|
||||
updateStatusDropdown();
|
||||
|
||||
// Listen to Bootstrap Table refresh events to restore filter values
|
||||
$('#table_list').on('refresh.bs.table', function() {
|
||||
// Restore all intended filter values after Bootstrap Table refreshes (without triggering change events)
|
||||
if (window.intendedFilters) {
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(window.intendedFilters, true);
|
||||
}, 50);
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(window.intendedFilters, true);
|
||||
}, 200);
|
||||
setTimeout(function() {
|
||||
restoreFilterValues(window.intendedFilters, true);
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
|
||||
// Also listen to post-body event (after table body is updated)
|
||||
$('#table_list').on('post-body.bs.table', function() {
|
||||
if (window.intendedFilters) {
|
||||
restoreFilterValues(window.intendedFilters, true);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
36
resources/views/items/treeview.blade.php
Normal file
36
resources/views/items/treeview.blade.php
Normal file
@@ -0,0 +1,36 @@
|
||||
@foreach ($categories as $category)
|
||||
<div class="category">
|
||||
<label>
|
||||
<input type="radio" name="selected_category" value="{{ $category->id }}"
|
||||
@if($selected_category == $category->id) checked @endif
|
||||
@if($category->subcategories->isNotEmpty()) disabled @endif>
|
||||
{{ $category->name }}
|
||||
</label>
|
||||
@if ($category->subcategories->isNotEmpty())
|
||||
@php
|
||||
// Get current language from Session
|
||||
$currentLang = Session::get('language');
|
||||
// Check RTL: use accessor which returns boolean (rtl != 0)
|
||||
$isRtl = false;
|
||||
if (!empty($currentLang)) {
|
||||
try {
|
||||
// Try to get raw attribute first, fallback to accessor
|
||||
$rtlRaw = method_exists($currentLang, 'getRawOriginal') ? $currentLang->getRawOriginal('rtl') : null;
|
||||
if ($rtlRaw !== null) {
|
||||
$isRtl = ($rtlRaw == 1 || $rtlRaw === true);
|
||||
} else {
|
||||
$isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1);
|
||||
}
|
||||
}
|
||||
$arrowIcon = $isRtl ? '' : ''; // fa-caret-left for RTL, fa-caret-right for LTR
|
||||
@endphp
|
||||
<i class="fas toggle-button" style="font-size: 24px">{!! $arrowIcon !!}</i>
|
||||
<div class="subcategories" style="display: none;">
|
||||
@include('items.treeview', ['categories' => $category->subcategories, 'selected_category' => $selected_category])
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
587
resources/views/items/update.blade.php
Normal file
587
resources/views/items/update.blade.php
Normal file
@@ -0,0 +1,587 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Update Advertisements') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('advertisement.update', $item->id) }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<input type="hidden" name="id" value="{{ $item->id }}">
|
||||
|
||||
|
||||
|
||||
<ul class="nav nav-tabs" id="editItemTabs" role="tablist">
|
||||
<li class="nav-item"><a class="nav-link active" data-bs-toggle="tab"
|
||||
href="#listing">{{ __('Listing Details') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab"
|
||||
href="#custom">{{ __('Other Details') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab"
|
||||
href="#images">{{ __('Product Images') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab"
|
||||
href="#address">{{ __('Address') }}</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<div class="tab-content pt-3">
|
||||
{{-- Listing Details --}}
|
||||
<div class="tab-pane fade show active" id="listing">
|
||||
<div class="row">
|
||||
<div class="col-6 mb-3">
|
||||
<label>{{ __('Name') }}</label>
|
||||
<input type="text" name="name" value="{{ $item->name }}" class="form-control">
|
||||
</div>
|
||||
<div class="col-6 mb-3">
|
||||
<label>{{ __('Slug') }}</label>
|
||||
<input type="text" name="slug" value="{{ $item->slug }}" class="form-control"
|
||||
disabled>
|
||||
</div>
|
||||
<div class="col-6 mb-3">
|
||||
<label>{{ __('Category') }}</label>
|
||||
<select name="category_id" class="form-control" id="category-select">
|
||||
@if ($item->category)
|
||||
<option value="{{ $item->category->id }}" selected>{{ $item->category->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="">{{ __('Select Category') }}</option>
|
||||
@endif
|
||||
</select>
|
||||
|
||||
<button type="button" class="btn btn-primary mt-2" data-bs-toggle="modal"
|
||||
data-bs-target="#subcategory-modal">
|
||||
{{ __('Change') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-6 mb-3">
|
||||
<label>{{ __('Select Currency') }}</label>
|
||||
<select class="form-control select2" id="currency" name="currency_id">
|
||||
@foreach ($currencies as $currency)
|
||||
<option value="{{ $currency->id }}"
|
||||
{{ $item->currency_id == $currency->id ? 'selected' : '' }}>
|
||||
{{ $currency->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
@php
|
||||
$isJobCategory = $item->category && $item->category->is_job_category;
|
||||
$isPriceOptional = $item->category && $item->category->price_optional;
|
||||
@endphp
|
||||
|
||||
<div class="col-6 mb-3" id="price-field"
|
||||
style="{{ $isJobCategory || $isPriceOptional ? 'display: none;' : '' }}">
|
||||
<label>{{ __('Price') }}</label>
|
||||
<input type="number" name="price" value="{{ $item->price }}" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="col-6 mb-3" id="salary-fields"
|
||||
style="{{ $isJobCategory || $isPriceOptional ? '' : 'display: none;' }}">
|
||||
<label>{{ __('Min Salary') }}</label>
|
||||
<input type="number" name="min_salary"
|
||||
value="{{ old('min_salary', $item->min_salary ?? '') }}" class="form-control mb-2">
|
||||
<label>{{ __('Max Salary') }}</label>
|
||||
<input type="number" name="max_salary"
|
||||
value="{{ old('max_salary', $item->max_salary ?? '') }}" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="col-6 mb-3">
|
||||
<label>{{ __('Phone Number') }}</label>
|
||||
<input type="text" name="contact" value="{{ $item->contact }}" class="form-control"
|
||||
readonly>
|
||||
</div>
|
||||
<div class="col-12 mb-3">
|
||||
<label>{{ __('Description') }}</label>
|
||||
<textarea name="description" class="form-control">{{ $item->description }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{-- Other Details - Custom Fields --}}
|
||||
<div class="tab-pane fade" id="custom">
|
||||
<div class="row">
|
||||
@forelse($custom_fields as $field)
|
||||
<div class="col-md-6 mb-3">
|
||||
<label>{{ $field->name }} @if ($field->required)
|
||||
<span class="text-danger">*</span>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
@php
|
||||
$isRequired = '';
|
||||
@endphp
|
||||
|
||||
@if ($field->type === 'textbox')
|
||||
<input type="text" name="custom_fields[{{ $field->id }}]"
|
||||
class="form-control" value="{{ $field->value ?? '' }}"
|
||||
{{ $isRequired }}>
|
||||
@elseif($field->type === 'number')
|
||||
<input type="number" name="custom_fields[{{ $field->id }}]"
|
||||
class="form-control" value="{{ $field->value ?? '' }}"
|
||||
{{ $isRequired }}>
|
||||
@elseif($field->type === 'fileinput')
|
||||
<input type="file" name="custom_field_files[{{ $field->id }}]"
|
||||
class="form-control" {{ $isRequired }}>
|
||||
@if (!empty($field->value))
|
||||
<img src="{{ $field->value[0] ?? '' }}" alt="" width="100">
|
||||
@endif
|
||||
@elseif($field->type === 'dropdown' || $field->type === 'radio')
|
||||
@php $options = is_array($field->values) ? $field->values : json_decode($field->values, true); @endphp
|
||||
<select name="custom_fields[{{ $field->id }}]" class="form-select"
|
||||
{{ $isRequired }}>
|
||||
<option value="">{{ __('Select') }}</option>
|
||||
@foreach ($options as $option)
|
||||
<option value="{{ $option }}"
|
||||
{{ $field->value == $option ? 'selected' : '' }}>
|
||||
{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@elseif($field->type === 'checkbox')
|
||||
@php $options = is_array($field->values) ? $field->values : json_decode($field->values, true); @endphp
|
||||
@foreach ($options as $option)
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox"
|
||||
name="custom_fields[{{ $field->id }}][]"
|
||||
value="{{ $option }}"
|
||||
{{ is_array($field->value) && in_array($option, $field->value) ? 'checked' : '' }}
|
||||
{{ $isRequired }}>
|
||||
<label class="form-check-label">{{ $option }}</label>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@empty
|
||||
<p class="text-muted">{{ __('No custom fields for this category.') }}</p>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{{-- Product Images --}}
|
||||
<div class="tab-pane fade" id="images">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<label>{{ __('Main Image') }}</label>
|
||||
<input type="file" name="image" class="form-control"
|
||||
accept="image/png,image/jpeg,image/jpg">
|
||||
<img src={{ $item->image }} width="80" class="mb-2">
|
||||
</div>
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<label>{{ __('Other Images') }}</label>
|
||||
<input type="file" name="gallery_images[]" class="form-control" multiple
|
||||
accept="image/png,image/jpeg,image/jpg">
|
||||
@foreach ($item->gallery_images as $img)
|
||||
<div class="mb-2">
|
||||
<img src={{ $img->image }} width="80">
|
||||
<input type="checkbox" name="delete_item_image_id[]"
|
||||
value="{{ $img->id }}"> Remove
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-12 mb-3">
|
||||
<label for="video_link">{{ __('Video Link') }}</label>
|
||||
<input type="url" name="video_link" id="video_link" class="form-control"
|
||||
value="{{ old('video_link', $item->video_link ?? '') }}"
|
||||
placeholder="https://www.youtube.com/watch?v=...">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{-- Address --}}
|
||||
<div class="tab-pane fade" id="address">
|
||||
<div class="row">
|
||||
<!-- LEFT SIDE: Manual Input -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3">
|
||||
<label for="country" class="form-label">{{ __('Country') }}</label>
|
||||
<select class="form-control select2" id="country_item" name="country">
|
||||
<option value="">--Select Country--</option>
|
||||
@foreach ($countries as $country)
|
||||
<option value="{{ $country->id }}"
|
||||
{{ $item->country == $country->name ? 'selected' : '' }}>
|
||||
{{ $country->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" id="item_state" value="{{ $item->state }}">
|
||||
<div class="form-group mb-3">
|
||||
<label for="state" class="form-label">{{ __('State') }}</label>
|
||||
<select class="form-control select2" id="state_item" name="state">
|
||||
<option value="">--Select State--</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" id="item_city" value="{{ $item->city }}">
|
||||
<div class="form-group mb-3">
|
||||
<label for="city" class="form-label">{{ __('City') }}</label>
|
||||
<select class="form-control select2" id="city" name="city">
|
||||
<option value="">--Select City--</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="manual_address" class="form-label">{{ __('Add Address') }}</label>
|
||||
<input type="text" id="manual_address" name="manual_address"
|
||||
class="form-control" placeholder="{{ __('Type manual address') }}">
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="latitude-input" name="latitude" />
|
||||
<input type="hidden" id="longitude-input" name="longitude" />
|
||||
<input type="hidden" name="country_input" id="country-input">
|
||||
<input type="hidden" name="state_input" id="state-input">
|
||||
<input type="hidden" name="city_input" id="city-input">
|
||||
|
||||
</div>
|
||||
|
||||
<!-- RIGHT SIDE: Map -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-2">
|
||||
<label class="form-label">{{ __('Address From Map') }}</label>
|
||||
<input type="text" class="form-control" id="address-input" readonly>
|
||||
</div>
|
||||
<label class="form-label">{{ __('Select Location on Map') }}</label>
|
||||
<div id="map" style="height: 400px; border: 1px solid #ddd;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</hr>
|
||||
<div class="row mt-1">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="admin_edit_reason">{{ __('Reason for Admin Edit') }} <span
|
||||
class="text-danger">*</span></label>
|
||||
<textarea name="admin_edit_reason" id="admin_edit_reason" class="form-control" rows="3" required></textarea>
|
||||
|
||||
@error('admin_edit_reason')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<button type="submit" class="btn btn-primary">{{ __('Update Item') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="subcategory-modal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="subcategory-modal-label" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="subcategory-modal-label">{{ __('Select Category or Subcategory') }}
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="current-category mb-3">
|
||||
<label>{{ __('Current Category:') }}</label>
|
||||
@if ($item->category)
|
||||
<input type="text" class="form-control" value="{{ $item->category->name }}" readonly>
|
||||
@else
|
||||
<input type="text" class="form-control" value="Select Category" readonly>
|
||||
@endif
|
||||
</div>
|
||||
<div class="categories-list">
|
||||
@include('items.treeview', [
|
||||
'categories' => $categories,
|
||||
'selected_category' => $item->category?->id ?? '',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary"
|
||||
data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
id="save-subcategory">{{ __('Save changes') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#category-select').on('change', function() {
|
||||
let categoryId = $(this).val();
|
||||
$.ajax({
|
||||
url: `/get-custom-fields/${categoryId}`,
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
let html = '';
|
||||
html += `<div class="row">`;
|
||||
response.fields.forEach(function(field) {
|
||||
const isRequired = '';
|
||||
html += `<div class="col-md-6 mb-3">`;
|
||||
html +=
|
||||
`<label>${field.name}${field.required ? ' <span class="text-danger">*</span>' : ''}</label>`;
|
||||
|
||||
if (field.type === 'textbox') {
|
||||
html +=
|
||||
`<input type="text" name="custom_fields[${field.id}]" class="form-control" ${isRequired} value="${field.value ?? ''}">`;
|
||||
} else if (field.type === 'number') {
|
||||
html +=
|
||||
`<input type="number" name="custom_fields[${field.id}]" class="form-control" ${isRequired} value="${field.value ?? ''}">`;
|
||||
} else if (field.type === 'fileinput') {
|
||||
if (field.value) {
|
||||
html +=
|
||||
`<img src="${field.value[0] ?? ''}" alt="" width="100">`;
|
||||
}
|
||||
html +=
|
||||
`<input type="file" name="custom_field_files[${field.id}]" class="form-control" ${isRequired}>`;
|
||||
} else if (field.type === 'dropdown' || field.type ===
|
||||
'radio') {
|
||||
const options = Array.isArray(field.values) ? field
|
||||
.values : JSON.parse(field.values ?? '[]');
|
||||
html +=
|
||||
`<select name="custom_fields[${field.id}]" class="form-select" ${isRequired}>`;
|
||||
html += `<option value="">Select</option>`;
|
||||
options.forEach(option => {
|
||||
const selected = (field.value === option) ?
|
||||
'selected' : '';
|
||||
html +=
|
||||
`<option value="${option}" ${selected}>${option}</option>`;
|
||||
});
|
||||
html += `</select>`;
|
||||
} else if (field.type === 'checkbox') {
|
||||
const options = Array.isArray(field.values) ? field
|
||||
.values : JSON.parse(field.values ?? '[]');
|
||||
options.forEach(option => {
|
||||
const checked = Array.isArray(field
|
||||
.value) && field.value.includes(
|
||||
option) ? 'checked' : '';
|
||||
html += `
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="custom_fields[${field.id}][]" value="${option}" ${checked} ${isRequired}>
|
||||
<label class="form-check-label">${option}</label>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
}
|
||||
|
||||
html += `</div>`;
|
||||
});
|
||||
|
||||
|
||||
if (!html) {
|
||||
html =
|
||||
`<p class="text-muted">No custom fields for this category.</p>`;
|
||||
}
|
||||
html += `</div>`;
|
||||
$('#custom').html(html);
|
||||
|
||||
if (response.is_job_category || response.price_optional) {
|
||||
$('#price-field').hide();
|
||||
$('#salary-fields').show();
|
||||
} else {
|
||||
$('#price-field').show();
|
||||
$('#salary-fields').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Toggle subcategories on click
|
||||
$('.toggle-button').on('click', function() {
|
||||
$(this).siblings('.subcategories').toggle();
|
||||
$(this).toggleClass('open');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.querySelectorAll('input[name="selected_category"]').forEach(radio => {
|
||||
radio.addEventListener('change', function() {
|
||||
const selectedName = this.closest('label').innerText.trim();
|
||||
document.querySelector('.current-category input').value = selectedName;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.getElementById('save-subcategory').addEventListener('click', function() {
|
||||
const selectedRadio = document.querySelector('input[name="selected_category"]:checked');
|
||||
if (selectedRadio) {
|
||||
const selectedId = selectedRadio.value;
|
||||
const selectedName = selectedRadio.closest('label').innerText.trim();
|
||||
|
||||
const categorySelect = document.getElementById('category-select');
|
||||
|
||||
// Clear current options
|
||||
categorySelect.innerHTML = '';
|
||||
|
||||
// Add the newly selected category
|
||||
const option = document.createElement('option');
|
||||
option.value = selectedId;
|
||||
option.text = selectedName;
|
||||
option.selected = true;
|
||||
|
||||
categorySelect.appendChild(option);
|
||||
|
||||
$('#category-select').trigger('change');
|
||||
|
||||
// Close the modal
|
||||
const modal = bootstrap.Modal.getInstance(document.getElementById('subcategory-modal'));
|
||||
modal.hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
let map, marker;
|
||||
|
||||
function initMap() {
|
||||
const defaultLat = parseFloat('{{ $item->latitude ?? '0' }}') || 20.5937;
|
||||
const defaultLng = parseFloat('{{ $item->longitude ?? '0' }}') || 78.9629;
|
||||
|
||||
|
||||
map = L.map('map').setView([defaultLat, defaultLng], 6);
|
||||
|
||||
// Load tiles
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© OpenStreetMap contributors',
|
||||
maxZoom: 19
|
||||
}).addTo(map);
|
||||
|
||||
// Add marker
|
||||
marker = L.marker([defaultLat, defaultLng], {
|
||||
draggable: true
|
||||
}).addTo(map);
|
||||
|
||||
updateLatLngInputs(defaultLat, defaultLng);
|
||||
fetchAddressFromCoords(defaultLat, defaultLng);
|
||||
|
||||
marker.on('dragend', function(e) {
|
||||
const pos = marker.getLatLng();
|
||||
updateLatLngInputs(pos.lat, pos.lng);
|
||||
fetchAddressFromCoords(pos.lat, pos.lng);
|
||||
});
|
||||
|
||||
const provider = new GeoSearch.OpenStreetMapProvider();
|
||||
const search = new GeoSearch.GeoSearchControl({
|
||||
provider: provider,
|
||||
style: 'bar',
|
||||
autoComplete: true,
|
||||
searchLabel: 'Enter address',
|
||||
showMarker: false,
|
||||
});
|
||||
map.addControl(search);
|
||||
|
||||
map.on('geosearch/showlocation', function(result) {
|
||||
const {
|
||||
x: lng,
|
||||
y: lat,
|
||||
label
|
||||
} = result.location;
|
||||
marker.setLatLng([lat, lng]);
|
||||
map.setView([lat, lng], 15);
|
||||
updateLatLngInputs(lat, lng);
|
||||
document.getElementById("address-input").value = label;
|
||||
fetchAddressFromCoords(lat, lng); // Optional, if label lacks full info
|
||||
});
|
||||
}
|
||||
|
||||
function updateLatLngInputs(lat, lng) {
|
||||
document.getElementById("latitude-input").value = lat;
|
||||
document.getElementById("longitude-input").value = lng;
|
||||
}
|
||||
|
||||
// Reverse geocoding using Nominatim
|
||||
function fetchAddressFromCoords(lat, lng) {
|
||||
fetch(`https://nominatim.openstreetmap.org/reverse?lat=${lat}&lon=${lng}&format=json`)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const address = data.address;
|
||||
|
||||
const fullAddress = data.display_name || '';
|
||||
|
||||
// Fill hidden inputs
|
||||
document.getElementById("address-input").value = fullAddress;
|
||||
document.getElementById("country-input").value = address.country || '';
|
||||
document.getElementById("state-input").value = address.state || '';
|
||||
document.getElementById("city-input").value = address.city || address.town || address.village ||
|
||||
address.state_district || '';
|
||||
|
||||
// ✅ Select dropdowns (country, then load states, then load cities)
|
||||
let countryName = address.country || '';
|
||||
let stateName = address.state || '';
|
||||
let cityName = address.city || address.town || address.village || address.state_district || '';
|
||||
|
||||
// --- COUNTRY ---
|
||||
let countryOption = $(`#country_item option`).filter(function() {
|
||||
return $(this).text().trim().toLowerCase() === countryName.toLowerCase();
|
||||
});
|
||||
if (countryOption.length) {
|
||||
$('#country_item').val(countryOption.val()).trigger('change');
|
||||
}
|
||||
|
||||
// --- STATE ---
|
||||
// wait a little because states load after country change
|
||||
setTimeout(function() {
|
||||
let stateOption = $(`#state_item option`).filter(function() {
|
||||
return $(this).text().trim().toLowerCase() === stateName.toLowerCase();
|
||||
});
|
||||
if (stateOption.length) {
|
||||
$('#state_item').val(stateOption.val()).trigger('change');
|
||||
}
|
||||
}, 1500);
|
||||
|
||||
// --- CITY ---
|
||||
// wait a little because cities load after state change
|
||||
setTimeout(function() {
|
||||
let cityOption = $(`#city option`).filter(function() {
|
||||
return $(this).text().trim().toLowerCase() === cityName.toLowerCase();
|
||||
});
|
||||
if (cityOption.length) {
|
||||
$('#city').val(cityOption.val()).trigger('change');
|
||||
}
|
||||
}, 3500);
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize when tab is opened
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const tab = document.querySelector('[href="#address"]');
|
||||
if (tab) {
|
||||
tab.addEventListener("click", () => {
|
||||
setTimeout(() => initMap(), 300); // Delay for hidden tab
|
||||
});
|
||||
} else {
|
||||
// fallback if map is visible by default
|
||||
initMap();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
13
resources/views/layouts/footer.blade.php
Normal file
13
resources/views/layouts/footer.blade.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<!----- THIS FORM USE FOR DELETE ---->
|
||||
<footer class="footer mt-3">
|
||||
<div class="container-fluid">
|
||||
<div class="foot_text text-end">
|
||||
©
|
||||
<script>
|
||||
document.write(new Date().getFullYear())
|
||||
</script>
|
||||
|{{ config('app.name') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</footer>
|
||||
316
resources/views/layouts/footer_script.blade.php
Normal file
316
resources/views/layouts/footer_script.blade.php
Normal file
@@ -0,0 +1,316 @@
|
||||
<script type="text/javascript" src="{{ asset('assets/js/apexcharts.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/js/jquery.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/js/popper.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/js/bootstrap.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/js/app.js') }}"></script>
|
||||
|
||||
{{-- Firebasejs 8.10.0--}}
|
||||
{{--<script type="text/javascript" src="{{ asset('assets/js/firebase-app.js')}}"></script>--}}
|
||||
{{--<script type="text/javascript" src="{{ asset('assets/js/firebase-messaging.js')}}"></script>--}}
|
||||
|
||||
|
||||
{{--Sweet Alert --}}
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/sweetalert2/sweetalert2.min.js') }}"></script>
|
||||
|
||||
{{--Tiny MCE--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/tinymce/tinymce.min.js') }}"></script>
|
||||
|
||||
{{--Jquery Vector Map--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/jquery-vector-map/jquery-jvectormap-2.0.5.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/jquery-vector-map/jquery-jvectormap-asia-merc.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/jquery-vector-map/jquery-jvectormap-world-mill-en.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/jquery-vector-map/jquery-jvectormap-world-mill.js') }}"></script>
|
||||
|
||||
{{--Toastify--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/toastify-js/toastify.js') }}"></script>
|
||||
|
||||
{{--Parsley--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/js/parsley.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/js/pages/parsley.js') }}"></script>
|
||||
|
||||
|
||||
{{--Magnific Popup--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/magnific-popup/jquery.magnific-popup.min.js') }}"></script>
|
||||
|
||||
{{--Select2--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/select2/select2.min.js') }}"></script>
|
||||
|
||||
{{--Tagify--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/tagify/tagify.js') }}"></script>
|
||||
|
||||
{{--Jquery UI--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/jquery-ui/jquery-ui.min.js') }}"></script>
|
||||
|
||||
{{--Clipboard JS--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/js/clipboard.min.js') }}"></script>
|
||||
|
||||
{{--Filepond--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/filepond/filepond.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/filepond/filepond.jquery.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/filepond/filepond-plugin-image-preview.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/filepond/filepond-plugin-pdf-preview.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/filepond/filepond-plugin-file-validate-size.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/filepond/filepond-plugin-file-validate-type.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/filepond/filepond-plugin-image-validate-size.min.js') }}"></script>
|
||||
|
||||
{{--JS Tree--}}
|
||||
<script src="{{asset("assets/extensions/jstree/jstree.min.js")}}"></script>
|
||||
|
||||
|
||||
{{-- Custom JS --}}
|
||||
<script type="text/javascript" src="{{ asset('assets/js/custom/common.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/js/custom/custom.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/js/custom/function.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/js/custom/bootstrap-table/formatter.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/js/custom/bootstrap-table/queryParams.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/js/custom/bootstrap-table/actionEvents.js') }}"></script>
|
||||
|
||||
|
||||
{{--Bootstrap Table--}}
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/bootstrap-table/bootstrap-table.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/bootstrap-table/fixed-columns/bootstrap-table-fixed-columns.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/bootstrap-table/mobile/bootstrap-table-mobile.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/bootstrap-table/jquery.tablednd.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/bootstrap-table/bootstrap-table.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{ asset('assets/extensions/bootstrap-table/bootstrap-table-reorder-rows.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{asset('assets/extensions/bootstrap-table/export/bootstrap-table-export.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{asset('assets/extensions/bootstrap-table/export/tableExport.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{asset('assets/extensions/bootstrap-table/export/jspdf.umd.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{asset('assets/extensions/bootstrap-table/mobile/bootstrap-table-mobile.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{asset('assets/extensions/bootstrap-table/filter/bootstrap-table-filter-control.min.js')}}"></script>
|
||||
|
||||
{{--Language Translation--}}
|
||||
<script src="{{route('common.language.read')}}"></script>
|
||||
|
||||
<script src="{{ asset('assets/js/leaflet.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/map.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/bundle.min.js') }}"></script>
|
||||
{{-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> --}}
|
||||
{{--<script src="https://harvesthq.github.io/chosen/chosen.jquery.js"></script>--}}
|
||||
{{--<script src="https://bevacqua.github.io/dragula/dist/dragula.js"></script>--}}
|
||||
<script type="text/javascript">
|
||||
window.baseurl = "{{ URL::to('/') }}/";
|
||||
@if (Session::has('success'))
|
||||
showSuccessToast("{{ Session::get('success') }}")
|
||||
@endif
|
||||
|
||||
{{-- @if (Session::has('errors'))--}}
|
||||
{{-- @if(is_array(Session::get('errors')))--}}
|
||||
{{-- @foreach ($errors->all() as $error)--}}
|
||||
|
||||
{{-- showErrorToast("{{ $error }}")--}}
|
||||
{{-- @endforeach--}}
|
||||
{{-- @else--}}
|
||||
{{-- @dd(Session::get('errors'))--}}
|
||||
{{-- console.log("{{ Session::get('errors') }}")--}}
|
||||
{{-- showErrorToast("{{ Session::get('errors')->message }}")--}}
|
||||
{{-- @endif--}}
|
||||
{{-- @endif--}}
|
||||
|
||||
@if ($errors->any())
|
||||
@foreach ($errors->all() as $error)
|
||||
showErrorToast("{!! $error !!}");
|
||||
@endforeach
|
||||
@endif
|
||||
@if (Session::has('error'))
|
||||
showErrorToast('{!! Session::get('error') !!}')
|
||||
@endif
|
||||
|
||||
</script>
|
||||
<script>
|
||||
// Dynamic translation loading function
|
||||
function loadTableTranslations() {
|
||||
@php
|
||||
$tableKeys = [
|
||||
"Search...",
|
||||
"Refresh",
|
||||
"Toggle",
|
||||
"Columns",
|
||||
"Detail",
|
||||
"Detail Formatter",
|
||||
"Previous",
|
||||
"Next",
|
||||
"First",
|
||||
"Last",
|
||||
"Showing {ctx.start} to {ctx.end} of {ctx.total} entries",
|
||||
"Export Data",
|
||||
"Toggle Columns",
|
||||
"No description",
|
||||
"No image",
|
||||
"No date",
|
||||
"No price",
|
||||
"Active",
|
||||
"Inactive",
|
||||
"Pending",
|
||||
"Approved",
|
||||
"Rejected",
|
||||
"Published",
|
||||
"Draft",
|
||||
"No matching records found",
|
||||
"rows per page" // Add this new key
|
||||
];
|
||||
|
||||
// Get current language from session or default
|
||||
$currentLang = session('locale', config('app.locale', 'en'));
|
||||
|
||||
// Load translations for current language
|
||||
$translations = [];
|
||||
foreach ($tableKeys as $key) {
|
||||
$translations[$key] = __($key);
|
||||
}
|
||||
@endphp
|
||||
|
||||
window.tableTranslations = @json($translations);
|
||||
|
||||
// Force update all translatable tables
|
||||
$('.translatable-table').each(function() {
|
||||
const $table = $(this);
|
||||
const tableId = $table.attr('id');
|
||||
|
||||
// Update table attributes with new translations
|
||||
$table.attr({
|
||||
'data-search-placeholder': window.trans('Search...'),
|
||||
'data-refresh-text': window.trans('Refresh'),
|
||||
'data-toggle-text': window.trans('Toggle'),
|
||||
'data-columns-text': window.trans('Columns'),
|
||||
'data-detail-view-text': window.trans('Detail'),
|
||||
'data-detail-formatter-text': window.trans('Detail Formatter'),
|
||||
'data-pagination-pre-text': window.trans('Previous'),
|
||||
'data-pagination-next-text': window.trans('Next'),
|
||||
'data-pagination-first-text': window.trans('First'),
|
||||
'data-pagination-last-text': window.trans('Last'),
|
||||
'data-pagination-info-text': window.trans('Showing {ctx.start} to {ctx.end} of {ctx.total} entries'),
|
||||
'data-pagination-info-formatted': window.trans('Showing {ctx.start} to {ctx.end} of {ctx.total} entries')
|
||||
});
|
||||
|
||||
// Force complete table refresh
|
||||
if ($table.hasClass('bootstrap-table')) {
|
||||
// Get current table options
|
||||
const tableOptions = $table.bootstrapTable('getOptions');
|
||||
|
||||
// Destroy the table
|
||||
$table.bootstrapTable('destroy');
|
||||
|
||||
// Re-initialize with new translations
|
||||
$table.bootstrapTable(tableOptions);
|
||||
}
|
||||
});
|
||||
|
||||
// Manually update search placeholder, pagination text, and no records message
|
||||
setTimeout(function() {
|
||||
updateSearchAndPagination();
|
||||
updateNoRecordsMessage();
|
||||
updateRowsPerPageText(); // Add this new function call
|
||||
}, 500);
|
||||
}
|
||||
|
||||
// Function to manually update search and pagination
|
||||
function updateSearchAndPagination() {
|
||||
// Update search placeholder
|
||||
$('.search-input').attr('placeholder', window.trans('Search...'));
|
||||
|
||||
// Update pagination info text
|
||||
$('.pagination-info').each(function() {
|
||||
const $info = $(this);
|
||||
const currentText = $info.text();
|
||||
|
||||
// Extract numbers from current text (e.g., "Showing 1 to 4 of 4 rows")
|
||||
const match = currentText.match(/Showing (\d+) to (\d+) of (\d+) rows/);
|
||||
if (match) {
|
||||
const start = match[1];
|
||||
const end = match[2];
|
||||
const total = match[3];
|
||||
|
||||
// Replace with translated text
|
||||
const translatedText = window.trans('Showing {ctx.start} to {ctx.end} of {ctx.total} entries')
|
||||
.replace('{ctx.start}', start)
|
||||
.replace('{ctx.end}', end)
|
||||
.replace('{ctx.total}', total);
|
||||
|
||||
$info.text(translatedText);
|
||||
}
|
||||
});
|
||||
|
||||
// Update refresh button title
|
||||
$('button[name="refresh"]').attr('title', window.trans('Refresh'));
|
||||
|
||||
// Update columns button title
|
||||
$('button[aria-label="Columns"]').attr('title', window.trans('Columns'));
|
||||
|
||||
// Update export button title
|
||||
$('button[aria-label="Export data"]').attr('title', window.trans('Export Data'));
|
||||
}
|
||||
|
||||
// Function to update "No matching records found" message
|
||||
function updateNoRecordsMessage() {
|
||||
$('.no-records-found td').each(function() {
|
||||
const $cell = $(this);
|
||||
const currentText = $cell.text();
|
||||
|
||||
if (currentText === 'No matching records found') {
|
||||
$cell.text(window.trans('No matching records found'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Add this new function to handle "rows per page" text
|
||||
// function updateRowsPerPageText() {
|
||||
// $('.page-list').each(function() {
|
||||
// const $pageList = $(this);
|
||||
// const currentText = $pageList.text();
|
||||
|
||||
// if (currentText.includes('rows per page')) {
|
||||
// const translatedText = currentText.replace('rows per page', window.trans('rows per page'));
|
||||
// $pageList.text(translatedText);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
function updateRowsPerPageText() {
|
||||
$('.page-list').each(function() {
|
||||
const $pageList = $(this);
|
||||
|
||||
// Use a more specific selector to find the text after the dropdown
|
||||
const $dropdown = $pageList.find('.btn-group');
|
||||
if ($dropdown.length) {
|
||||
// Get all text nodes after the dropdown
|
||||
let found = false;
|
||||
$pageList.contents().each(function() {
|
||||
if (this.nodeType === 3 && !found) { // Text node
|
||||
const text = this.textContent.trim();
|
||||
if (text === 'rows per page') {
|
||||
this.textContent = window.trans('rows per page');
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// Translation helper
|
||||
window.trans = function(key) {
|
||||
return window.tableTranslations && window.tableTranslations[key] ? window.tableTranslations[key] : key;
|
||||
};
|
||||
|
||||
// Load translations on page load
|
||||
loadTableTranslations();
|
||||
|
||||
// Also update when table is refreshed
|
||||
$(document).on('post-body.bs.table', function() {
|
||||
setTimeout(function() {
|
||||
updateSearchAndPagination();
|
||||
updateNoRecordsMessage();
|
||||
updateRowsPerPageText(); // Add this new function call
|
||||
}, 100);
|
||||
});
|
||||
|
||||
// Also update when table data is loaded
|
||||
$(document).on('load-success.bs.table', function() {
|
||||
setTimeout(function() {
|
||||
updateSearchAndPagination();
|
||||
updateNoRecordsMessage();
|
||||
updateRowsPerPageText(); // Add this new function call
|
||||
}, 100);
|
||||
});
|
||||
</script>
|
||||
<script src="{{ asset('assets/js/custom/table-translations.js') }}"></script>
|
||||
|
||||
115
resources/views/layouts/include.blade.php
Normal file
115
resources/views/layouts/include.blade.php
Normal file
@@ -0,0 +1,115 @@
|
||||
@php
|
||||
// $lang = Session::get('language');
|
||||
// dd($lang);
|
||||
|
||||
@endphp
|
||||
|
||||
@if (empty($lang) || !$lang->rtl)
|
||||
{{-- NON RTL CSS --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/main/app.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/pages/otherpages.css') }}" />
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/custom.css') }}" />
|
||||
@else
|
||||
{{-- RTL CSS --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/main/rtl.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/pages/otherpages_rtl.css') }}" />
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/custom.css') }}" />
|
||||
@endif
|
||||
{{-- Bootstrap Switch --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-switch-button.min.css') }}">
|
||||
|
||||
{{-- Toastify --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/toastify-js/toastify.css') }}">
|
||||
|
||||
{{-- Bootstrap Table --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/bootstrap-table/bootstrap-table.min.css') }}"
|
||||
type="text/css" />
|
||||
<link rel="stylesheet"
|
||||
href="{{ asset('assets/extensions/bootstrap-table/fixed-columns/bootstrap-table-fixed-columns.min.css') }}"
|
||||
type="text/css" />
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/bootstrap-table/bootstrap-table-reorder-rows.css') }}">
|
||||
|
||||
|
||||
{{-- Font Awesome --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/@fortawesome/fontawesome-free/css/all.min.css') }}"
|
||||
type="text/css" />
|
||||
|
||||
{{-- Magnific Popup --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/magnific-popup/magnific-popup.css') }}">
|
||||
|
||||
{{-- Select2 --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/select2/select2.min.css') }}" />
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/select2/select2-bootstrap-5-theme.min.css') }}" />
|
||||
|
||||
{{-- Tagify --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/tagify/tagify.css') }}" type="text/css" />
|
||||
|
||||
{{-- Sweet Alert --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/sweetalert2/sweetalert2.min.css') }}" />
|
||||
|
||||
{{-- Filepond --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/filepond/filepond.min.css') }}" type="text/css" />
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/filepond/filepond-plugin-image-preview.min.css') }}"
|
||||
type="text/css" />
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/filepond/filepond-plugin-pdf-preview.min.css') }}"
|
||||
type="text/css" />
|
||||
|
||||
{{-- Jquery Vectormap --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/pages/jquery-jvectormap-2.0.5.css') }}" type="text/css" />
|
||||
|
||||
{{-- JS Tree --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/extensions/jstree/jstree.min.css') }}" />
|
||||
|
||||
{{-- <link href="https://cdn.datatables.net/1.13.2/css/dataTables.bootstrap5.min.css" rel="stylesheet"/> --}}
|
||||
{{-- <link rel="stylesheet" href="{{ url('assets/extensions/chosen.css') }}"/> --}}
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/leaflet.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/map.css') }}">
|
||||
@yield('css')
|
||||
|
||||
<script>
|
||||
// Function to handle image errors
|
||||
function handleImageError(image) {
|
||||
image.classList.contains('custom-default-image')
|
||||
if (image.getAttribute('data-custom-image') != null) {
|
||||
image.src = image.getAttribute('data-custom-image');
|
||||
} else {
|
||||
image.src = "{{ asset('/assets/images/no_image_available.png') }}";
|
||||
}
|
||||
// console.log('Image failed to load: ' + image.src);
|
||||
}
|
||||
|
||||
// Create a MutationObserver to watch for DOM changes
|
||||
const observer = new MutationObserver((mutationsList) => {
|
||||
mutationsList.forEach((mutation) => {
|
||||
if (mutation.addedNodes) {
|
||||
mutation.addedNodes.forEach((node) => {
|
||||
// Check if the added node is an image element
|
||||
if (node instanceof HTMLImageElement) {
|
||||
node.addEventListener('error', () => {
|
||||
handleImageError(node);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Start observing changes in the DOM
|
||||
observer.observe(document, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
|
||||
const onErrorImage = (e) => {
|
||||
if (!e.target.src.includes('no_image_available.png')) {
|
||||
e.target.src = "{{ asset('/assets/images/no_image_available.png') }}";
|
||||
}
|
||||
};
|
||||
|
||||
{{-- const onErrorImageSidebarHorizontalLogo = (e) => { --}}
|
||||
{{-- if (!e.target.src.includes('no_image_available.jpg')) { --}}
|
||||
{{-- e.target.src = "{{asset('/assets/vertical-logo.svg')}}"; --}}
|
||||
{{-- } --}}
|
||||
{{-- }; --}}
|
||||
</script>
|
||||
34
resources/views/layouts/main.blade.php
Normal file
34
resources/views/layouts/main.blade.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="shortcut icon" href="{{ $favicon ?? url('assets/images/logo/favicon.png') }}" type="image/x-icon">
|
||||
<title>@yield('title') || {{ config('app.name') }}</title>
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}"/>
|
||||
@include('layouts.include')
|
||||
@yield('css')
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
@include('layouts.sidebar')
|
||||
<div id="main" class='layout-navbar'>
|
||||
@include('layouts.topbar')
|
||||
<div id="main-content">
|
||||
<div class="page-heading">
|
||||
@yield('page-title')
|
||||
</div>
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper mt-5">
|
||||
<div class="content">
|
||||
@include('layouts.footer')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layouts.footer_script')
|
||||
@yield('js')
|
||||
@yield('script')
|
||||
</body>
|
||||
</html>
|
||||
341
resources/views/layouts/sidebar.blade.php
Normal file
341
resources/views/layouts/sidebar.blade.php
Normal file
@@ -0,0 +1,341 @@
|
||||
<div id="sidebar" class="active">
|
||||
<div class="sidebar-wrapper active">
|
||||
<div class="sidebar-header position-relative">
|
||||
<div class="d-block">
|
||||
<div class="logo text-center">
|
||||
<a href="{{ url('home') }}">
|
||||
<img src="{{ $company_logo ?? '' }}"
|
||||
data-custom-image="{{ url('assets/images/logo/sidebar_logo.png') }}" alt="Logo"
|
||||
srcset="">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sidebar-menu">
|
||||
<ul class="menu">
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ url('home') }}" class='sidebar-link'>
|
||||
<i class="bi bi-house"></i>
|
||||
<span class="menu-item">{{ __('Dashboard') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@canany(['category-list', 'category-create', 'category-update', 'category-delete', 'custom-field-list',
|
||||
'custom-field-create', 'custom-field-update', 'custom-field-delete'])
|
||||
<div class="sidebar-new-title">{{ __('Ads Listing') }}</div>
|
||||
@canany(['category-list', 'category-create', 'category-update', 'category-delete'])
|
||||
<li class="sidebar-item sidebar-submenus">
|
||||
<a href="{{ route('category.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-list-task"></i>
|
||||
<span class="menu-item">{{ __('Categories') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['custom-field-list', 'custom-field-create', 'custom-field-update', 'custom-field-delete'])
|
||||
<li class="sidebar-item sidebar-submenus">
|
||||
<a href="{{ route('custom-fields.index') }} " class='sidebar-link'>
|
||||
<i class="bi bi-columns-gap"></i>
|
||||
<span class="menu-item">{{ __('Custom Fields') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@endcanany
|
||||
|
||||
@canany(['item-list', 'item-create', 'item-update', 'item-delete', 'tip-list', 'tip-create',
|
||||
'tip-update', 'tip-delete'])
|
||||
|
||||
<div class="sidebar-new-title">{{ __('Advertisement Management') }}</div>
|
||||
@canany(['item-list', 'item-create', 'item-update', 'item-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('advertisement.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-ui-radios-grid"></i>
|
||||
<span class="menu-item">{{ __('Advertisement') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['tip-list', 'tip-create', 'tip-update', 'tip-delete'])
|
||||
<li class="sidebar-item sidebar-submenus">
|
||||
<a href="{{ route('tips.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-info-circle"></i>
|
||||
<span class="menu-item">{{ __('Tips') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@endcanany
|
||||
|
||||
@canany(['advertisement-listing-package-list', 'advertisement-listing-package-create',
|
||||
'advertisement-listing-package-update', 'advertisement-listing-package-delete',
|
||||
'featured-advertisement-package-list', 'featured-advertisement-package-create',
|
||||
'featured-advertisement-package-update', 'featured-advertisement-package-delete', 'user-package-list',
|
||||
'payment-transactions-list'])
|
||||
|
||||
<div class="sidebar-new-title">{{ __('Package Management') }}</div>
|
||||
@canany(['advertisement-listing-package-list', 'advertisement-listing-package-create',
|
||||
'advertisement-listing-package-update', 'advertisement-listing-package-delete',
|
||||
'featured-advertisement-package-list', 'featured-advertisement-package-create',
|
||||
'featured-advertisement-package-update', 'featured-advertisement-package-delete'])
|
||||
<li class="sidebar-item sidebar-submenus">
|
||||
<a href="{{ route('package.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-box-seam"></i>
|
||||
<span class="menu-item">{{ __('Subscription Packages') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@can('user-package-list')
|
||||
<li class="sidebar-item sidebar-submenus">
|
||||
<a href="{{ route('package.users.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-person-badge-fill"></i>
|
||||
<span class="menu-item">{{ __('User Packages') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
@can('payment-transactions-list')
|
||||
<li class="sidebar-item sidebar-submenus">
|
||||
<a href="{{ route('package.payment-transactions.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-cash-coin"></i>
|
||||
<span class="menu-item">{{ __('Payment Transactions') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('payment-transactions-list')
|
||||
<li class="sidebar-item sidebar-submenus">
|
||||
<a href="{{ route('package.bank-transfer.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-bank"></i>
|
||||
<span class="menu-item">{{ __('Bank Transfer') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@endcanany
|
||||
|
||||
@canany(['seller-verification-field-list', 'seller-verification-field-create',
|
||||
'seller-verification-field-update', 'seller-verification-field-delete',
|
||||
'seller-verification-request-list', 'seller-verification-request-create',
|
||||
'seller-verification-request-update', 'seller-verification-request-delete', 'seller-review-list',
|
||||
'seller-review-update', 'seller-review-delete'])
|
||||
<div class="sidebar-new-title">{{ __('Seller Management') }}</div>
|
||||
@canany(['seller-verification-field-list', 'seller-verification-field-create',
|
||||
'seller-verification-field-update', 'seller-verification-field-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('seller-verification.verification-field') }}" class='sidebar-link'>
|
||||
<i class="bi bi-grid-1x2"></i>
|
||||
<span class="menu-item">{{ __('Verification Fields') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@canany(['seller-verification-request-list', 'seller-verification-request-create',
|
||||
'seller-verification-request-update', 'seller-verification-request-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('seller-verification.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-person-check"></i>
|
||||
<span class="menu-item">{{ __('Seller Verification') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@canany(['seller-review-list', 'seller-review-update', 'seller-review-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('seller-review.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-star-half"></i>
|
||||
<span class="menu-item">{{ __('Seller Review') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@canany(['seller-review-list', 'seller-review-update', 'seller-review-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('seller-review.create') }}" class='sidebar-link'>
|
||||
<i class="bi bi-list-stars"></i>
|
||||
<span class="menu-item">{{ __('Seller Review Report') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@endcanany
|
||||
@canany(['slider-list', 'slider-create', 'slider-update', 'slider-delete', 'feature-section-list',
|
||||
'feature-section-create', 'feature-section-update', 'feature-section-delete'])
|
||||
<div class="sidebar-new-title">{{ __('Home Screen Management') }}</div>
|
||||
@canany(['slider-list', 'slider-create', 'slider-update', 'slider-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ url('slider') }}" class='sidebar-link'>
|
||||
<i class="bi bi-sliders2"></i>
|
||||
<span class="menu-item">{{ __('Slider') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['feature-section-list', 'feature-section-create', 'feature-section-update',
|
||||
'feature-section-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('feature-section.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-grid-1x2"></i>
|
||||
<span class="menu-item">{{ __('Feature Section') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@endcanany
|
||||
|
||||
@canany(['currency-list', 'currency-create', 'currency-update', 'currency-delete', 'country-list',
|
||||
'country-create', 'country-update', 'country-delete', 'state-list', 'state-create', 'state-update',
|
||||
'state-delete', 'city-list', 'city-create', 'city-update', 'city-delete'])
|
||||
<div class="sidebar-new-title">{{ __('Place/Location Management') }}</div>
|
||||
@canany(['currency-list', 'currency-create', 'currency-update', 'currency-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('currency.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-cash-stack"></i>
|
||||
<span class="menu-item">{{ __('Currencies') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['country-list', 'country-create', 'country-update', 'country-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('countries.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-globe"></i>
|
||||
<span class="menu-item">{{ __('Countries') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['state-list', 'state-create', 'state-update', 'state-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('states.index') }}" class='sidebar-link'>
|
||||
<i class="fa fa-map-marked-alt"></i>
|
||||
<span class="menu-item">{{ __('States') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['city-list', 'city-create', 'city-update', 'city-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('cities.index') }}" class='sidebar-link'>
|
||||
<i class="fa fa-map-marker-alt"></i>
|
||||
<span class="menu-item">{{ __('Cities') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['area-list', 'area-create', 'area-update', 'area-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('area.index') }}" class='sidebar-link'>
|
||||
<i class="fa fa-map-marker"></i>
|
||||
<span class="menu-item">{{ __('Areas') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@endcanany
|
||||
|
||||
@canany(['report-reason-list', 'report-reason-create', 'report-reason-update', 'report-reason-delete',
|
||||
'user-reports-list'])
|
||||
<div class="sidebar-new-title">{{ __('Reports Management') }}</div>
|
||||
@canany(['report-reason-list', 'report-reason-create', 'report-reason-update', 'report-reason-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('report-reasons.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-flag"></i>
|
||||
<span class="menu-item">{{ __('Report Reasons') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['user-reports-list'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('report-reasons.user-reports.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-person"></i>
|
||||
<span class="menu-item">{{ __('User Reports') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@endcanany
|
||||
|
||||
|
||||
<div class="sidebar-new-title">{{ __('Promotional Management') }}</div>
|
||||
@canany(['notification-list', 'notification-create', 'notification-update', 'notification-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ url('notification') }}" class='sidebar-link'>
|
||||
<i class="bi bi-bell"></i>
|
||||
<span class="menu-item">{{ __('Send Notification') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['customer-list', 'customer-create', 'customer-update', 'customer-delete'])
|
||||
<div class="sidebar-new-title">{{ __('Customers') }}</div>
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ url('customer') }}" class='sidebar-link'>
|
||||
<i class="bi bi-people"></i>
|
||||
<span class="menu-item">{{ __('Customers') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['role-list', 'role-create', 'role-update', 'role-delete', 'staff-list', 'staff-create',
|
||||
'staff-update', 'staff-delete'])
|
||||
<div class="sidebar-new-title">{{ __('Staff Management') }}</div>
|
||||
@canany(['role-list', 'role-create', 'role-update', 'role-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('roles.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-person-bounding-box"></i>
|
||||
<span class="menu-item">{{ __('Role') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@canany(['staff-list', 'staff-create', 'staff-update', 'staff-delete'])
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('staff.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-person-badge"></i>
|
||||
<span class="menu-item">{{ __('Staff Management') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@endcanany
|
||||
@canany(['blog-ist', 'blog-create', 'blog-update', 'blog-delete'])
|
||||
<div class="sidebar-new-title">{{ __('Blog Management') }}</div>
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('blog.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-pencil"></i>
|
||||
<span class="menu-item">{{ __('Blogs') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['faq-create', 'faq-list', 'faq-update', 'faq-delete'])
|
||||
<div class="sidebar-new-title">{{ __('FAQ') }}</div>
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('faq.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-question-square-fill"></i>
|
||||
<span class="menu-item">{{ __('FAQs') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
|
||||
@canany(['user-queries-list'])
|
||||
<div class="sidebar-new-title">{{ __('Web') }}</div>
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('contact-us.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-person-bounding-box"></i>
|
||||
<span class="menu-item">{{ __('User Queries') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@canany(['settings-update'])
|
||||
<div class="sidebar-new-title">{{ __('System Settings') }}</div>
|
||||
@can('settings-update')
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('settings.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-gear"></i>
|
||||
<span class="menu-item">{{ __('Settings') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@if (\Illuminate\Support\Facades\Auth::user()->hasRole('Super Admin'))
|
||||
<li class="sidebar-item">
|
||||
<a href="{{ route('system-update.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-laptop"></i>
|
||||
<span class="menu-item">{{ __('System Update') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@endcanany
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
109
resources/views/layouts/topbar.blade.php
Normal file
109
resources/views/layouts/topbar.blade.php
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand navbar-light" style="background-color: white;">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="col-6 row d-flex align-items-center">
|
||||
<div class="col-1 me-3 me-md-2">
|
||||
<a href="#" class="burger-btn d-block">
|
||||
<i class="bi bi-justify fs-3"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@if (config('app.demo_mode'))
|
||||
<div class="col-2">
|
||||
<span class="badge alert-info primary-background-color">Demo Mode</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-6 justify-content-end d-flex">
|
||||
<div class="collapse navbar-collapse">
|
||||
|
||||
<div class="dropdown me-3">
|
||||
<a href="#" class="user-dropdown d-flex align-items-center dropdown-toggle"
|
||||
data-bs-toggle="dropdown">
|
||||
|
||||
<button class="dropdown-btn">
|
||||
|
||||
|
||||
<img src="{{ $currentLanguage?->image }}" class="flag">
|
||||
<span>{{ strtoupper($currentLanguage?->code) }}</span>
|
||||
<span class="arrow">▾</span>
|
||||
</button>
|
||||
</a>
|
||||
{{-- {{ print_r($currentLanguage) }} --}}
|
||||
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
|
||||
@foreach ($languages as $language)
|
||||
|
||||
<li class="d-flex justify-content-between align-items-center px-2 py-1">
|
||||
|
||||
<a class="dropdown-item d-flex align-items-center flex-grow-1"
|
||||
href="{{ route('language.set-current', $language->code) }}">
|
||||
<img src="{{ $language->image }}" class="flag me-2">
|
||||
{{ $language->name }}
|
||||
</a>
|
||||
<form action="{{ route('settings.set-default-language') }}" method="POST"
|
||||
class="ms-2">
|
||||
@csrf
|
||||
<input type="hidden" name="default_language" value="{{ $language->code }}">
|
||||
|
||||
<button type="submit" class="btn btn-sm btn-primary py-0 px-2"
|
||||
@if ($defaultLanguage && $defaultLanguage->code == $language->code) disabled @endif>
|
||||
{{ $defaultLanguage && $defaultLanguage->code == $language->code ? __('Default') : __('Set Default') }}
|
||||
</button>
|
||||
|
||||
</form>
|
||||
</li>
|
||||
@endforeach
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="dropdown">
|
||||
<a href="#" id="profileDropdown"
|
||||
class="user-dropdown d-flex align-items-center dropend dropdown-toggle"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
|
||||
<div class="avatar avatar-md2 flex-shrink-0">
|
||||
<img
|
||||
src="{{ Auth::user()->profile == '' ? url('assets/images/faces/2.jpg') : Auth::user()->profile }}"
|
||||
alt="Profile"
|
||||
class="img-fluid rounded-circle">
|
||||
</div>
|
||||
|
||||
<!-- Admin name visible on all screens -->
|
||||
<div class="text ms-2">
|
||||
<h6 class="user-dropdown-name mb-0 text-truncate" style="max-width:120px;">
|
||||
{{ Auth::user()->name }}
|
||||
</h6>
|
||||
</div>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end topbarUserDropdown"
|
||||
aria-labelledby="topbarUserDropdown">
|
||||
<li><a class="dropdown-item" href="{{ route('change-password.index') }}"><i
|
||||
class="icon-mid bi bi-gear me-2"></i>{{ __('Change Password') }}</a></li>
|
||||
<li><a class="dropdown-item" href="{{ route('change-profile.index') }}"><i
|
||||
class="icon-mid bi bi-person me-2"></i>{{ __('Change Profile') }}</a></li>
|
||||
<li><a class="dropdown-item" href="{{ route('logout') }} "
|
||||
onclick="event.preventDefault(); document.getElementById('logout-form').submit();"><i
|
||||
class="icon-mid bi bi-box-arrow-left me-2"></i> {{ __('Logout') }}</a></li>
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
</ul>
|
||||
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
||||
@csrf
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{{-- {{ print_r($currentLanguage) }} --}}
|
||||
</header>
|
||||
172
resources/views/notification/index.blade.php
Normal file
172
resources/views/notification/index.blade.php
Normal file
@@ -0,0 +1,172 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Send Notification') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<section class="section">
|
||||
@can('notification-create')
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<form action="{{ route('notification.store') }}" class="create-form needs-validation" method="post" data-parsley-validate enctype="multipart/form-data">
|
||||
<div class="card-body">
|
||||
<textarea id="user_id" name="user_id" style="visibility: hidden;position: absolute;" aria-label="user_id"></textarea>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label for="send_to" class="form-label">{{ __('Select User') }}</label> <span class="text-danger">*</span>
|
||||
<select id="send_to" name="send_to" class="form-control w-100 select2" required>
|
||||
<option value="all">{{ __('All') }}</option>
|
||||
<option value="selected">{{ __('Selected Only') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label for="title" class="form-label">{{ __('Title') }} </label> <span class="text-danger">*</span>
|
||||
<input name="title" id="title" type="text" class="form-control" placeholder={{ __('Title') }} required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12">
|
||||
<label for="message" class="form-label">{{ __('Message') }}</label> <span class="text-danger">*</span>
|
||||
<textarea id="message" name="message" class="form-control" placeholder={{ __('Message') }} required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<div class="form-check">
|
||||
<input id="include_image" name="include_image" type="checkbox" class="form-check-input">
|
||||
<label for="include_image" class="form-check-label">{{ __('Include Image') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row" id="show_image" style="display: none">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label class="form-label">{{ __('Image') }}</label>
|
||||
<input id="file" name="file" type="file" accept="image/*" class="form-control">
|
||||
<p style="display: none" id="img_error_msg" class="badge rounded-pill bg-danger"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label for="item_id" class="form-label">{{ __('Advertisement') }} </label>
|
||||
<select name="item_id" class="select2 form-select form-control-sm" data-parsley-minSelect='1' id="item_id">
|
||||
<option value=""> {{ __('Select Advertisement') }} </option>
|
||||
@foreach ($item_list as $row)
|
||||
<option value="{{ $row->id }}" data-parametertypes='{{ $row->name }}'>{{ $row->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 d-flex justify-content-end">
|
||||
<button class="btn btn-primary" type="submit" name="submit">{{ __('Submit') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-borderless table-striped" aria-describedby="mydesc"
|
||||
id="user_notification_list" data-toggle="table" data-url="{{ route('customer.show',1) }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-toolbar="#toolbar" data-show-columns="true" data-show-refresh="true"
|
||||
data-fixed-columns="true" data-fixed-number="1" data-fixed-right-number="1"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="id"
|
||||
data-sort-order="desc" data-pagination-successively-size="3"
|
||||
data-escape="true"
|
||||
data-query-params="notificationUserList"
|
||||
data-mobile-responsive="true">
|
||||
{{--data-response-handler="responseHandler"--}}
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="state" data-checkbox="true"></th>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="mobile" data-sortable="true">{{ __('Number') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="toolbar">
|
||||
@can('notification-delete')
|
||||
<a href="{{route('notification.batch.delete')}}" class="btn btn-danger btn-sm btn-icon text-white" id="delete_multiple" title="Delete Notification"><em class='fa fa-trash'></em></a>
|
||||
@endcan
|
||||
</div>
|
||||
<table aria-describedby="mydesc" class='table-striped' id="table_list" data-toggle="table"
|
||||
data-url="{{ route('notification.show',1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true" data-toolbar="#toolbar"
|
||||
data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false"
|
||||
data-escape="true"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3" data-show-export="true" data-export-options='{"fileName": "advertisement-package-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']">
|
||||
<thead>
|
||||
<tr>
|
||||
@can('notification-delete')
|
||||
<th scope="col" data-field="state" data-checkbox="true"></th>
|
||||
@endcan
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="title" data-sortable="true">{{ __('Title') }}</th>
|
||||
<th scope="col" data-field="message" data-sortable="true">{{ __('Message') }}</th>
|
||||
<th scope="col" data-field="image" data-formatter="imageFormatter">{{ __('Image') }}</th>
|
||||
<th scope="col" data-field="send_to" data-sortable="true">{{ __('Send To') }}</th>
|
||||
{{-- <th scope="col" data-field="user.name" data-sortable="true">{{ __('User') }}</th>--}}
|
||||
@can('notification-delete')
|
||||
<th scope="col" data-field="operate" data-escape="false">{{ __('Action') }}</th>
|
||||
@endcan
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
// function responseHandler(res) {
|
||||
// $.each(res.rows, function (i, row) {
|
||||
// row.state = $.inArray(row.id, selections) !== -1
|
||||
// })
|
||||
// return res;
|
||||
// }
|
||||
</script>
|
||||
@endsection
|
||||
86
resources/views/packages/bank-transfer.blade.php
Normal file
86
resources/views/packages/bank-transfer.blade.php
Normal file
@@ -0,0 +1,86 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Bank Transfers') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
{{-- <div class="row " id="toolbar"> --}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-borderless table-striped" aria-describedby="mydesc"
|
||||
id="table_list" data-toggle="table" data-url="{{ route('package.bank-transfer.show') }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-search-align="right" data-toolbar="#toolbar" data-show-columns="true"
|
||||
data-show-refresh="true" data-fixed-columns="true" data-fixed-number="1"
|
||||
data-fixed-right-number="1" data-trim-on-search="false" data-responsive="true"
|
||||
data-sort-name="id" data-sort-order="desc" data-pagination-successively-size="3"
|
||||
data-escape="true"
|
||||
data-query-params="queryParams" data-table="packages"
|
||||
data-show-export="true" data-export-options='{"fileName": "user-package-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="user.name" data-align="center" data-sortable="false">{{ __('User Name') }}</th>
|
||||
<th scope="col" data-field="amount" data-align="center" data-sortable="false">{{ __('Amount') }}</th>
|
||||
{{-- <th scope="col" data-field="payment_gateway" data-align="center">{{ __('Payment Gateway') }}</th> --}}
|
||||
<th scope="col" data-field="payment_status" data-align="center" data-sortable="true">{{ __('Payment Status') }}</th>
|
||||
<th scope="col" data-field="payment_receipt" data-align="center" data-sortable="false" data-formatter="imageFormatter">{{ __('Payment Reciept') }}</th>
|
||||
<th scope="col" data-field="created_at" data-align="center" data-sortable="true">{{ __('Created At') }}</th>
|
||||
<th scope="col" data-field="operate" data-escape="false" data-align="center" data-sortable="false">{{ __('Action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="editStatusModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Status') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="edit-form" action="" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<select name="payment_status" class="form-select" id="verification_status" aria-label="status">
|
||||
<option value="succeed">{{ __("Approved") }}</option>
|
||||
<option value="rejected">{{ __("Rejected") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" value="{{ __("Save") }}" class="btn btn-primary mt-3">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
617
resources/views/packages/create.blade.php
Normal file
617
resources/views/packages/create.blade.php
Normal file
@@ -0,0 +1,617 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Create Package') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('package.index') }}">
|
||||
< {{ __('Back to Packages') }} </a>
|
||||
</div>
|
||||
<form action="{{ route('package.store') }}" method="POST" class="create-form"
|
||||
data-success-function="afterPackageCreationSuccess" data-parsley-validate enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Create Package') }}</div>
|
||||
<div class="card-body mt-2">
|
||||
|
||||
<ul class="nav nav-tabs" id="langTabs" role="tablist">
|
||||
@foreach ($languages as $key => $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if ($key == 0) active @endif"
|
||||
id="tab-{{ $lang->id }}" data-bs-toggle="tab"
|
||||
data-bs-target="#lang-{{ $lang->id }}" type="button" role="tab">
|
||||
{{ $lang->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach ($languages as $key => $lang)
|
||||
<div class="tab-pane fade @if ($key == 0) show active @endif"
|
||||
id="lang-{{ $lang->id }}" role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
@if ($lang->id == 1)
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label>{{ __('Package Name') }} ({{ $lang->name }}) <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" name="name[{{ $lang->id }}]"
|
||||
class="form-control" data-parsley-required="true">
|
||||
</div>
|
||||
{{-- Row 1: IOS Product ID (Name already shown above) --}}
|
||||
<div class="col-md-6 form-group">
|
||||
<label>{{ __('IOS Product ID') }}</label>
|
||||
<input type="text" name="ios_product_id" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="form-group">
|
||||
<label>{{ __('Package Name') }} ({{ $lang->name }}) <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" name="name[{{ $lang->id }}]"
|
||||
class="form-control">
|
||||
</div>
|
||||
@endif
|
||||
@if ($lang->id == 1)
|
||||
{{-- Row 2: Price and Discount Percentage --}}
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label>{{ __('Price') }} ({{ $currency_symbol }}) <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="number" name="price" class="form-control"
|
||||
data-parsley-required="true" min="0" step="0.01">
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label>{{ __('Discount') }} (%) <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="number" name="discount_in_percentage" class="form-control"
|
||||
data-parsley-required="true" min="0" max="100"
|
||||
step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Row 3: Final Price --}}
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group">
|
||||
<label>{{ __('Final Price') }} ({{ $currency_symbol }}) <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="number" name="final_price" class="form-control"
|
||||
data-parsley-required="true" min="0" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Package Duration Type --}}
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label>{{ __('Package Duration Type') }} <span
|
||||
class="text-danger">*</span></label>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input package-duration-type" type="radio"
|
||||
name="package_duration_type" id="package_duration_limited"
|
||||
value="limited">
|
||||
<label class="form-check-label"
|
||||
for="package_duration_limited">{{ __('Limited') }}</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input package-duration-type" type="radio"
|
||||
name="package_duration_type" id="package_duration_unlimited"
|
||||
value="unlimited" checked>
|
||||
<label class="form-check-label"
|
||||
for="package_duration_unlimited">{{ __('Unlimited') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<div id="package_duration_input" style="display: none;" class="mt-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text myDivClass"
|
||||
style="height: 42px;">
|
||||
<span class="mySpanClass">{{ __('Days') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="number" name="duration" class="form-control"
|
||||
min="1"
|
||||
placeholder="{{ __('Enter duration in days') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Package Type Radio Buttons --}}
|
||||
<div class="row form-group">
|
||||
<label>{{ __('Package Type') }} <span class="text-danger">*</span></label>
|
||||
<div class="col-md-6">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input package-type-radio"
|
||||
type="radio" name="type" id="type_item_listing"
|
||||
value="item_listing" checked>
|
||||
<label class="form-check-label" for="type_item_listing">
|
||||
{{ __('Ad Listing Package') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input package-type-radio"
|
||||
type="radio" name="type"
|
||||
id="type_advertisement" value="advertisement">
|
||||
<label class="form-check-label" for="type_advertisement">
|
||||
{{ __('Featured Ads Package') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Ad Listing Package Section --}}
|
||||
<div id="ad_listing_section" style="display: none;"
|
||||
class="border rounded p-3 mb-3">
|
||||
<h6 class="mb-3">{{ __('Ad Listing Package Settings') }}</h6>
|
||||
|
||||
{{-- Item Limit --}}
|
||||
<div class="form-group mb-3">
|
||||
<label>{{ __('Item Limit') }}</label>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input ads-item-limit-type" type="radio"
|
||||
name="ads_item_limit_type" id="ads_limit_limited"
|
||||
value="limited">
|
||||
<label class="form-check-label"
|
||||
for="ads_limit_limited">{{ __('Limited') }}</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input ads-item-limit-type" type="radio"
|
||||
name="ads_item_limit_type" id="ads_limit_unlimited"
|
||||
value="unlimited" checked>
|
||||
<label class="form-check-label"
|
||||
for="ads_limit_unlimited">{{ __('Unlimited') }}</label>
|
||||
</div>
|
||||
<div id="ads_item_limit_input" style="display: none;" class="mt-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text myDivClass"
|
||||
style="height: 42px;">
|
||||
<span class="mySpanClass">{{ __('Number') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="number" name="ads_item_limit"
|
||||
class="form-control" min="1"
|
||||
placeholder="{{ __('Enter item limit') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Listing Duration Type --}}
|
||||
<div class="form-group mb-3">
|
||||
<label>{{ __('Listing Duration Type') }}</label>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input ads-listing-duration-type"
|
||||
type="radio" name="ads_listing_duration_type"
|
||||
id="ads_listing_standard" value="standard" checked>
|
||||
<label class="form-check-label"
|
||||
for="ads_listing_standard">{{ __('Standard (30 days)') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input ads-listing-duration-type"
|
||||
type="radio" name="ads_listing_duration_type"
|
||||
id="ads_listing_package" value="package">
|
||||
<label class="form-check-label"
|
||||
for="ads_listing_package">{{ __('Package') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input ads-listing-duration-type"
|
||||
type="radio" name="ads_listing_duration_type"
|
||||
id="ads_listing_custom" value="custom">
|
||||
<label class="form-check-label"
|
||||
for="ads_listing_custom">{{ __('Custom') }}</label>
|
||||
</div>
|
||||
<div id="ads_listing_duration_days_input" style="display: none;"
|
||||
class="mt-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text myDivClass"
|
||||
style="height: 42px;">
|
||||
<span class="mySpanClass">{{ __('Days') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="number" name="ads_listing_duration_days"
|
||||
class="form-control" min="1"
|
||||
placeholder="{{ __('Enter days') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Featured Ads Package Section --}}
|
||||
<div id="featured_ads_section" style="display: none;"
|
||||
class="border rounded p-3 mb-3">
|
||||
<h6 class="mb-3">{{ __('Featured Ads Package Settings') }}</h6>
|
||||
|
||||
{{-- Item Limit --}}
|
||||
<div class="form-group mb-3">
|
||||
<label>{{ __('Item Limit') }}</label>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input featured-item-limit-type"
|
||||
type="radio" name="featured_item_limit_type"
|
||||
id="featured_limit_limited" value="limited">
|
||||
<label class="form-check-label"
|
||||
for="featured_limit_limited">{{ __('Limited') }}</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input featured-item-limit-type"
|
||||
type="radio" name="featured_item_limit_type"
|
||||
id="featured_limit_unlimited" value="unlimited" checked>
|
||||
<label class="form-check-label"
|
||||
for="featured_limit_unlimited">{{ __('Unlimited') }}</label>
|
||||
</div>
|
||||
<div id="featured_item_limit_input" style="display: none;"
|
||||
class="mt-2">
|
||||
<input type="number" name="featured_item_limit"
|
||||
class="form-control" min="1"
|
||||
placeholder="{{ __('Enter item limit') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Featured Ads Duration Type --}}
|
||||
<div class="form-group mb-3">
|
||||
<label>{{ __('Featured Ads Duration Type') }}</label>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input featured-ads-duration-type"
|
||||
type="radio" name="featured_ads_duration_type"
|
||||
id="featured_ads_standard" value="standard" checked>
|
||||
<label class="form-check-label"
|
||||
for="featured_ads_standard">{{ __('Standard (30 days)') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input featured-ads-duration-type"
|
||||
type="radio" name="featured_ads_duration_type"
|
||||
id="featured_ads_package" value="package">
|
||||
<label class="form-check-label"
|
||||
for="featured_ads_package">{{ __('Package') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input featured-ads-duration-type"
|
||||
type="radio" name="featured_ads_duration_type"
|
||||
id="featured_ads_custom" value="custom">
|
||||
<label class="form-check-label"
|
||||
for="featured_ads_custom">{{ __('Custom') }}</label>
|
||||
</div>
|
||||
<div id="featured_ads_duration_days_input" style="display: none;"
|
||||
class="mt-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text myDivClass"
|
||||
style="height: 42px;">
|
||||
<span class="mySpanClass">{{ __('Days') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="number" name="featured_ads_duration_days"
|
||||
class="form-control" min="1"
|
||||
placeholder="{{ __('Enter days') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Key Points --}}
|
||||
<div class="form-group">
|
||||
<label>{{ __('Key Points') }} ({{ $lang->name }})</label>
|
||||
<div id="key_points_container_{{ $lang->id }}">
|
||||
<div class="form-group key-point-item">
|
||||
<div class="input-group">
|
||||
<input type="text"
|
||||
name="key_points[{{ $lang->id }}][]"
|
||||
class="form-control"
|
||||
placeholder="{{ __('Enter key point') }}">
|
||||
<button type="button" class="btn btn-danger remove-key-point"
|
||||
style="display: none;">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-sm btn-primary mt-2 add-key-point"
|
||||
data-lang-id="{{ $lang->id }}">
|
||||
<i class="fas fa-plus me-1"></i> {{ __('Add Key Point') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{-- Image --}}
|
||||
<div class="form-group">
|
||||
<label for="icon" class="form-label">{{ __('Icon') }} <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="file" name="icon" id="icon" class="form-control"
|
||||
data-parsley-required="true" accept=".jpg, .jpeg, .png">
|
||||
{{ __('(use 256 x 256 size for better view)') }}
|
||||
<div class="img_error" style="color:#DC3545;"></div>
|
||||
</div>
|
||||
@else
|
||||
{{-- Key Points for other languages --}}
|
||||
<div class="form-group">
|
||||
<label>{{ __('Key Points') }} ({{ $lang->name }})</label>
|
||||
<div id="key_points_container_{{ $lang->id }}">
|
||||
<div class="form-group key-point-item">
|
||||
<div class="input-group">
|
||||
<input type="text"
|
||||
name="key_points[{{ $lang->id }}][]"
|
||||
class="form-control"
|
||||
placeholder="{{ __('Enter key point') }}">
|
||||
<button type="button" class="btn btn-danger remove-key-point"
|
||||
style="display: none;">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-sm btn-primary mt-2 add-key-point"
|
||||
data-lang-id="{{ $lang->id }}">
|
||||
<i class="fas fa-plus me-1"></i> {{ __('Add Key Point') }}
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Category Selection') }}</div>
|
||||
<div class="card-body mt-2">
|
||||
{{-- Global Package Option --}}
|
||||
<div class="form-check mb-3">
|
||||
<input class="form-check-input" type="checkbox" name="is_global" id="is_global"
|
||||
value="1">
|
||||
<label class="form-check-label" for="is_global">
|
||||
<strong>{{ __('Global Package (Apply to All Categories)') }}</strong>
|
||||
</label>
|
||||
<small
|
||||
class="form-text text-muted d-block">{{ __('If checked, this package will be available for all categories.') }}</small>
|
||||
</div>
|
||||
|
||||
<div id="category_selection" class="sub_category_lit">
|
||||
@foreach ($categories as $category)
|
||||
<div class="category">
|
||||
<div class="category-header">
|
||||
<label>
|
||||
<input type="checkbox" name="selected_categories[]"
|
||||
value="{{ $category->id }}" class="category-checkbox">
|
||||
{{ $category->name }}
|
||||
</label>
|
||||
@if (!empty($category->subcategories))
|
||||
@php
|
||||
$currentLang = Session::get('language');
|
||||
$isRtl = false;
|
||||
if (!empty($currentLang)) {
|
||||
try {
|
||||
$rtlRaw = method_exists($currentLang, 'getRawOriginal')
|
||||
? $currentLang->getRawOriginal('rtl')
|
||||
: null;
|
||||
if ($rtlRaw !== null) {
|
||||
$isRtl = $rtlRaw == 1 || $rtlRaw === true;
|
||||
} else {
|
||||
$isRtl =
|
||||
$currentLang->rtl == true ||
|
||||
$currentLang->rtl === 1;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$isRtl =
|
||||
$currentLang->rtl == true || $currentLang->rtl === 1;
|
||||
}
|
||||
}
|
||||
$arrowIcon = $isRtl ? '' : '';
|
||||
@endphp
|
||||
<i style='font-size:24px'
|
||||
class='fas toggle-button'>{!! $arrowIcon !!}</i>
|
||||
@endif
|
||||
</div>
|
||||
<div class="subcategories" style="display: none;">
|
||||
@if (!empty($category->subcategories))
|
||||
@include('category.treeview', [
|
||||
'categories' => $category->subcategories,
|
||||
'selected_categories' => $selected_categories,
|
||||
'selected_all_categories' => $selected_all_categories,
|
||||
])
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{ __('Save and Back') }}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Package type radio buttons - only one can be selected
|
||||
$('.package-type-radio').on('change', function() {
|
||||
const selectedType = $(this).val();
|
||||
|
||||
if (selectedType === 'item_listing') {
|
||||
$('#ad_listing_section').show();
|
||||
$('#featured_ads_section').hide();
|
||||
// Enable category selection for item_listing
|
||||
// Uncheck and enable global package checkbox
|
||||
$('#is_global').prop('checked', false).prop('disabled', false);
|
||||
$('.category-checkbox').prop('disabled', false);
|
||||
$('#category_selection').show();
|
||||
} else if (selectedType === 'advertisement') {
|
||||
$('#ad_listing_section').hide();
|
||||
$('#featured_ads_section').show();
|
||||
// Disable category selection for advertisement (featured ads)
|
||||
// Set as global package for featured ads
|
||||
$('#is_global').prop('checked', true).prop('disabled', true);
|
||||
$('.category-checkbox').prop('checked', false).prop('disabled', true);
|
||||
$('#category_selection').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize on page load
|
||||
const initialType = $('.package-type-radio:checked').val();
|
||||
if (initialType) {
|
||||
$('.package-type-radio[value="' + initialType + '"]').trigger('change');
|
||||
}
|
||||
|
||||
// Ad listing item limit toggle
|
||||
$('.ads-item-limit-type').on('change', function() {
|
||||
if ($(this).val() === 'limited') {
|
||||
$('#ads_item_limit_input').show();
|
||||
} else {
|
||||
$('#ads_item_limit_input').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Ad listing duration type toggle
|
||||
$('.ads-listing-duration-type').on('change', function() {
|
||||
if ($(this).val() === 'custom') {
|
||||
$('#ads_listing_duration_days_input').show();
|
||||
} else {
|
||||
$('#ads_listing_duration_days_input').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Featured item limit toggle
|
||||
$('.featured-item-limit-type').on('change', function() {
|
||||
if ($(this).val() === 'limited') {
|
||||
$('#featured_item_limit_input').show();
|
||||
} else {
|
||||
$('#featured_item_limit_input').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Featured ads duration type toggle
|
||||
$('.featured-ads-duration-type').on('change', function() {
|
||||
if ($(this).val() === 'custom') {
|
||||
$('#featured_ads_duration_days_input').show();
|
||||
} else {
|
||||
$('#featured_ads_duration_days_input').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Package duration type toggle
|
||||
$('.package-duration-type').on('change', function() {
|
||||
if ($(this).val() === 'limited') {
|
||||
$('#package_duration_input').show();
|
||||
$('#package_duration_input input[name="duration"]').attr('data-parsley-required',
|
||||
'true');
|
||||
} else {
|
||||
$('#package_duration_input').hide();
|
||||
$('#package_duration_input input[name="duration"]').removeAttr('data-parsley-required');
|
||||
}
|
||||
});
|
||||
|
||||
// Add key point
|
||||
$(document).on('click', '.add-key-point', function() {
|
||||
const langId = $(this).data('lang-id');
|
||||
const container = $('#key_points_container_' + langId);
|
||||
const newPoint = container.find('.key-point-item').first().clone();
|
||||
newPoint.find('input').val('');
|
||||
newPoint.find('.remove-key-point').show();
|
||||
container.append(newPoint);
|
||||
updateRemoveButtons();
|
||||
});
|
||||
|
||||
// Remove key point
|
||||
$(document).on('click', '.remove-key-point', function() {
|
||||
const container = $(this).closest('#key_points_container_' + $(this).closest('.tab-pane')
|
||||
.find('input[name="languages[]"]').val());
|
||||
if ($(this).closest('.key-point-item').siblings('.key-point-item').length > 0) {
|
||||
$(this).closest('.key-point-item').remove();
|
||||
updateRemoveButtons();
|
||||
}
|
||||
});
|
||||
|
||||
function updateRemoveButtons() {
|
||||
$('.key-point-item').each(function() {
|
||||
const container = $(this).closest('#key_points_container_' + $(this).closest(
|
||||
'.tab-pane').find('input[name="languages[]"]').val());
|
||||
const count = container.find('.key-point-item').length;
|
||||
container.find('.remove-key-point').toggle(count > 1);
|
||||
});
|
||||
}
|
||||
|
||||
// Global package toggle
|
||||
$('#is_global').on('change', function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#category_selection').hide();
|
||||
$('.category-checkbox').prop('checked', false);
|
||||
} else {
|
||||
$('#category_selection').show();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.category-checkbox', function(e) {
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
});
|
||||
|
||||
$(document).on('click', '.category-header label', function(e) {
|
||||
|
||||
if ($(e.target).is('input[type="checkbox"]')) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
// Prevent category header from triggering toggle except when clicking the toggle button
|
||||
$(document).on('click', '.category-header', function(e) {
|
||||
// If clicking on toggle button, let it handle
|
||||
if ($(e.target).hasClass('toggle-button') || $(e.target).closest('.toggle-button').length) {
|
||||
return;
|
||||
}
|
||||
// If clicking on checkbox or label, let it handle
|
||||
if ($(e.target).is('input[type="checkbox"]') || $(e.target).is('label') || $(e.target).closest('label').length) {
|
||||
return;
|
||||
}
|
||||
// Otherwise, prevent any action
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
|
||||
function afterPackageCreationSuccess() {
|
||||
setTimeout(function() {
|
||||
window.location.href = "{{ route('package.index') }}";
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
// Auto-calculate final price based on price and discount
|
||||
function calculateFinalPrice() {
|
||||
const price = parseFloat($('input[name="price"]').val()) || 0;
|
||||
const discount = parseFloat($('input[name="discount_in_percentage"]').val()) || 0;
|
||||
|
||||
if (price > 0 && discount >= 0 && discount <= 100) {
|
||||
const discountAmount = (price * discount) / 100;
|
||||
const finalPrice = price - discountAmount;
|
||||
$('input[name="final_price"]').val(finalPrice.toFixed(2));
|
||||
}
|
||||
}
|
||||
|
||||
$('input[name="price"], input[name="discount_in_percentage"]').on('input', calculateFinalPrice);
|
||||
</script>
|
||||
@endsection
|
||||
754
resources/views/packages/edit.blade.php
Normal file
754
resources/views/packages/edit.blade.php
Normal file
@@ -0,0 +1,754 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Edit Package') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('package.index') }}">
|
||||
< {{ __('Back to Packages') }}
|
||||
</a>
|
||||
</div>
|
||||
<form action="{{ route('package.update', $package->id) }}" class="edit-form"
|
||||
data-success-function="afterPackageUpdate" method="POST" data-parsley-validate
|
||||
enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Edit Package') }}</div>
|
||||
<div class="card-body mt-2">
|
||||
|
||||
<ul class="nav nav-tabs" id="langTabs" role="tablist">
|
||||
@foreach ($languages as $key => $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if ($key == 0) active @endif"
|
||||
id="tab-{{ $lang->id }}" data-bs-toggle="tab"
|
||||
data-bs-target="#lang-{{ $lang->id }}" type="button" role="tab">
|
||||
{{ $lang->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach ($languages as $key => $lang)
|
||||
<div class="tab-pane fade @if ($key == 0) show active @endif"
|
||||
id="lang-{{ $lang->id }}" role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
@if ($lang->id == 1)
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label>{{ __('Package Name') }} ({{ $lang->name }}) <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" name="name[{{ $lang->id }}]" class="form-control"
|
||||
value="{{ $translations[$lang->id]['name'] ?? '' }}"
|
||||
data-parsley-required="true">
|
||||
</div>
|
||||
{{-- Row 1: IOS Product ID (Name already shown above) --}}
|
||||
<div class="col-md-6 form-group">
|
||||
<label>{{ __('IOS Product ID') }}</label>
|
||||
<input type="text" name="ios_product_id" class="form-control"
|
||||
value="{{ $package->ios_product_id }}">
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="form-group">
|
||||
<label>{{ __('Package Name') }} ({{ $lang->name }}) <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" name="name[{{ $lang->id }}]" class="form-control"
|
||||
value="{{ $translations[$lang->id]['name'] ?? '' }}">
|
||||
</div>
|
||||
@endif
|
||||
@if ($lang->id == 1)
|
||||
@php
|
||||
$packageDurationType = ($package->duration == 'unlimited') ? 'unlimited' : 'limited';
|
||||
$packageDurationValue = ($package->duration == 'unlimited') ? '' : $package->duration;
|
||||
|
||||
$adsItemLimitType = ($package->item_limit == 'unlimited') ? 'unlimited' : 'limited';
|
||||
$adsItemLimitValue = ($package->item_limit == 'unlimited') ? '' : $package->item_limit;
|
||||
|
||||
$adsListingDurationType = $package->listing_duration_type ?? 'standard';
|
||||
$adsListingDurationDays = $package->listing_duration_days ?? null;
|
||||
|
||||
$featuredItemLimitType = ($package->item_limit == 'unlimited') ? 'unlimited' : 'limited';
|
||||
$featuredItemLimitValue = ($package->item_limit == 'unlimited') ? '' : $package->item_limit;
|
||||
|
||||
$featuredAdsDurationType = $package->listing_duration_type ?? 'standard';
|
||||
$featuredAdsDurationDays = $package->listing_duration_days ?? null;
|
||||
|
||||
$keyPoints = [];
|
||||
if (!empty($package->key_points)) {
|
||||
$keyPoints = json_decode($package->key_points, true) ?? [];
|
||||
}
|
||||
@endphp
|
||||
{{-- Row 2: Price and Discount Percentage --}}
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label>{{ __('Price') }} ({{ $currency_symbol }}) <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="number" name="price" class="form-control"
|
||||
data-parsley-required="true" min="0" step="0.01"
|
||||
value="{{ $package->price }}">
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label>{{ __('Discount') }} (%) <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="number" name="discount_in_percentage" class="form-control"
|
||||
data-parsley-required="true" min="0" max="100"
|
||||
step="0.01" value="{{ $package->discount_in_percentage }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Row 3: Final Price --}}
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group">
|
||||
<label>{{ __('Final Price') }} ({{ $currency_symbol }}) <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="number" name="final_price" id="final_price" class="form-control"
|
||||
data-parsley-required="true" min="0" step="0.01"
|
||||
value="{{ $package->final_price }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Package Duration Type --}}
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label>{{ __('Package Duration Type') }} <span
|
||||
class="text-danger">*</span></label>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input package-duration-type" type="radio"
|
||||
name="package_duration_type" id="package_duration_limited"
|
||||
value="limited" {{ $packageDurationType == 'limited' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="package_duration_limited">{{ __('Limited') }}</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input package-duration-type" type="radio"
|
||||
name="package_duration_type" id="package_duration_unlimited"
|
||||
value="unlimited" {{ $packageDurationType == 'unlimited' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="package_duration_unlimited">{{ __('Unlimited') }}</label>
|
||||
</div>
|
||||
<div id="package_duration_input"
|
||||
style="display: {{ $packageDurationType == 'limited' ? 'block' : 'none' }};"
|
||||
class="mt-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text myDivClass"
|
||||
style="height: 42px;">
|
||||
<span class="mySpanClass">{{ __('Days') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="number" name="duration" class="form-control"
|
||||
min="1" placeholder="{{ __('Enter duration in days') }}"
|
||||
value="{{ $packageDurationValue }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Package Type Radio Buttons (Read-only) --}}
|
||||
<div class="row form-group">
|
||||
<label>{{ __('Package Type') }} <span class="text-danger">*</span></label>
|
||||
<small class="text-muted d-block mb-2">{{ __('Package type cannot be changed after creation.') }}</small>
|
||||
<div class="col-md-6">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input package-type-radio"
|
||||
type="radio" name="type" id="type_item_listing"
|
||||
value="item_listing" {{ $package->type == 'item_listing' ? 'checked' : '' }}
|
||||
disabled>
|
||||
<label class="form-check-label" for="type_item_listing">
|
||||
{{ __('Ad Listing Package') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input package-type-radio"
|
||||
type="radio" name="type" id="type_advertisement"
|
||||
value="advertisement" {{ $package->type == 'advertisement' ? 'checked' : '' }}
|
||||
disabled>
|
||||
<label class="form-check-label" for="type_advertisement">
|
||||
{{ __('Featured Ads Package') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="type" id="package_type"
|
||||
value="{{ $package->type }}">
|
||||
</div>
|
||||
|
||||
{{-- Ad Listing Package Section --}}
|
||||
<div id="ad_listing_section"
|
||||
style="display: {{ $package->type == 'item_listing' ? 'block' : 'none' }};"
|
||||
class="border rounded p-3 mb-3">
|
||||
<h6 class="mb-3">{{ __('Ad Listing Package Settings') }}</h6>
|
||||
|
||||
{{-- Item Limit --}}
|
||||
<div class="form-group mb-3">
|
||||
<label>{{ __('Item Limit') }}</label>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input ads-item-limit-type" type="radio"
|
||||
name="ads_item_limit_type" id="ads_limit_limited"
|
||||
value="limited" {{ $adsItemLimitType == 'limited' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="ads_limit_limited">{{ __('Limited') }}</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input ads-item-limit-type" type="radio"
|
||||
name="ads_item_limit_type" id="ads_limit_unlimited"
|
||||
value="unlimited" {{ $adsItemLimitType == 'unlimited' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="ads_limit_unlimited">{{ __('Unlimited') }}</label>
|
||||
</div>
|
||||
<div id="ads_item_limit_input"
|
||||
style="display: {{ $adsItemLimitType == 'limited' ? 'block' : 'none' }};"
|
||||
class="mt-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text myDivClass"
|
||||
style="height: 42px;">
|
||||
<span class="mySpanClass">{{ __('Number') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="number" name="ads_item_limit"
|
||||
class="form-control" min="1"
|
||||
placeholder="{{ __('Enter item limit') }}"
|
||||
value="{{ $adsItemLimitValue }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Listing Duration Type --}}
|
||||
<div class="form-group mb-3">
|
||||
<label>{{ __('Listing Duration Type') }}</label>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input ads-listing-duration-type"
|
||||
type="radio" name="ads_listing_duration_type"
|
||||
id="ads_listing_standard" value="standard"
|
||||
{{ $adsListingDurationType == 'standard' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="ads_listing_standard">{{ __('Standard (30 days)') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input ads-listing-duration-type"
|
||||
type="radio" name="ads_listing_duration_type"
|
||||
id="ads_listing_package" value="package"
|
||||
{{ $adsListingDurationType == 'package' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="ads_listing_package">{{ __('Package') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input ads-listing-duration-type"
|
||||
type="radio" name="ads_listing_duration_type"
|
||||
id="ads_listing_custom" value="custom"
|
||||
{{ $adsListingDurationType == 'custom' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="ads_listing_custom">{{ __('Custom') }}</label>
|
||||
</div>
|
||||
<div id="ads_listing_duration_days_input"
|
||||
style="display: {{ $adsListingDurationType == 'custom' ? 'block' : 'none' }};"
|
||||
class="mt-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text myDivClass"
|
||||
style="height: 42px;">
|
||||
<span class="mySpanClass">{{ __('Days') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="number" name="ads_listing_duration_days"
|
||||
class="form-control" min="1"
|
||||
placeholder="{{ __('Enter days') }}"
|
||||
value="{{ $adsListingDurationDays }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Featured Ads Package Section --}}
|
||||
<div id="featured_ads_section"
|
||||
style="display: {{ $package->type == 'advertisement' ? 'block' : 'none' }};"
|
||||
class="border rounded p-3 mb-3">
|
||||
<h6 class="mb-3">{{ __('Featured Ads Package Settings') }}</h6>
|
||||
|
||||
{{-- Item Limit --}}
|
||||
<div class="form-group mb-3">
|
||||
<label>{{ __('Item Limit') }}</label>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input featured-item-limit-type"
|
||||
type="radio" name="featured_item_limit_type"
|
||||
id="featured_limit_limited" value="limited"
|
||||
{{ $featuredItemLimitType == 'limited' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="featured_limit_limited">{{ __('Limited') }}</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input featured-item-limit-type"
|
||||
type="radio" name="featured_item_limit_type"
|
||||
id="featured_limit_unlimited" value="unlimited"
|
||||
{{ $featuredItemLimitType == 'unlimited' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="featured_limit_unlimited">{{ __('Unlimited') }}</label>
|
||||
</div>
|
||||
<div id="featured_item_limit_input"
|
||||
style="display: {{ $featuredItemLimitType == 'limited' ? 'block' : 'none' }};"
|
||||
class="mt-2">
|
||||
<input type="number" name="featured_item_limit"
|
||||
class="form-control" min="1"
|
||||
placeholder="{{ __('Enter item limit') }}"
|
||||
value="{{ $featuredItemLimitValue }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Featured Ads Duration Type --}}
|
||||
<div class="form-group mb-3">
|
||||
<label>{{ __('Featured Ads Duration Type') }}</label>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input featured-ads-duration-type"
|
||||
type="radio" name="featured_ads_duration_type"
|
||||
id="featured_ads_standard" value="standard"
|
||||
{{ $featuredAdsDurationType == 'standard' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="featured_ads_standard">{{ __('Standard (30 days)') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input featured-ads-duration-type"
|
||||
type="radio" name="featured_ads_duration_type"
|
||||
id="featured_ads_package" value="package"
|
||||
{{ $featuredAdsDurationType == 'package' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="featured_ads_package">{{ __('Package') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input featured-ads-duration-type"
|
||||
type="radio" name="featured_ads_duration_type"
|
||||
id="featured_ads_custom" value="custom"
|
||||
{{ $featuredAdsDurationType == 'custom' ? 'checked' : '' }}>
|
||||
<label class="form-check-label"
|
||||
for="featured_ads_custom">{{ __('Custom') }}</label>
|
||||
</div>
|
||||
<div id="featured_ads_duration_days_input"
|
||||
style="display: {{ $featuredAdsDurationType == 'custom' ? 'block' : 'none' }};"
|
||||
class="mt-2">
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text myDivClass" style="height: 42px;">
|
||||
<span class="mySpanClass">{{ __('Days') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="number"
|
||||
name="featured_ads_duration_days"
|
||||
class="form-control"
|
||||
min="1"
|
||||
placeholder="{{ __('Enter days') }}"
|
||||
value="{{ $featuredAdsDurationDays }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Key Points --}}
|
||||
<div class="form-group">
|
||||
<label>{{ __('Key Points') }} ({{ $lang->name }})</label>
|
||||
<div id="key_points_container_{{ $lang->id }}">
|
||||
@if (!empty($keyPoints) && count($keyPoints) > 0)
|
||||
@foreach ($keyPoints as $index => $keyPoint)
|
||||
<div class="form-group key-point-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="key_points[{{ $lang->id }}][]"
|
||||
class="form-control"
|
||||
placeholder="{{ __('Enter key point') }}"
|
||||
value="{{ $keyPoint }}">
|
||||
<button type="button"
|
||||
class="btn btn-danger remove-key-point"
|
||||
style="{{ count($keyPoints) > 1 ? '' : 'display: none;' }}">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="form-group key-point-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="key_points[{{ $lang->id }}][]"
|
||||
class="form-control"
|
||||
placeholder="{{ __('Enter key point') }}">
|
||||
<button type="button" class="btn btn-danger remove-key-point"
|
||||
style="display: none;">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<button type="button" class="btn btn-sm btn-primary mt-2 add-key-point"
|
||||
data-lang-id="{{ $lang->id }}">
|
||||
<i class="fas fa-plus me-1"></i> {{ __('Add Key Point') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{-- Image --}}
|
||||
<div class="form-group">
|
||||
<label for="icon" class="form-label">{{ __('Icon') }}</label>
|
||||
<input type="file" name="icon" id="icon" class="form-control"
|
||||
accept=".jpg, .jpeg, .png">
|
||||
{{ __('(Leave empty to keep current image)') }}
|
||||
<div class="field_img mt-2">
|
||||
<img src="{{ empty($package->icon) ? asset('assets/img_placeholder.jpeg') : $package->icon }}"
|
||||
alt="" id="blah"
|
||||
class="preview-image img w-25">
|
||||
</div>
|
||||
<div class="img_error" style="color:#DC3545;"></div>
|
||||
</div>
|
||||
@else
|
||||
@php
|
||||
$translatedKeyPoints = [];
|
||||
if (!empty($package->translations)) {
|
||||
$translation = $package->translations->where('language_id', $lang->id)->first();
|
||||
if ($translation && !empty($translation->key_points)) {
|
||||
$translatedKeyPoints = json_decode($translation->key_points, true) ?? [];
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
{{-- Key Points for other languages --}}
|
||||
<div class="form-group">
|
||||
<label>{{ __('Key Points') }} ({{ $lang->name }})</label>
|
||||
<div id="key_points_container_{{ $lang->id }}">
|
||||
@if (!empty($translatedKeyPoints) && count($translatedKeyPoints) > 0)
|
||||
@foreach ($translatedKeyPoints as $index => $keyPoint)
|
||||
<div class="form-group key-point-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="key_points[{{ $lang->id }}][]"
|
||||
class="form-control"
|
||||
placeholder="{{ __('Enter key point') }}"
|
||||
value="{{ $keyPoint }}">
|
||||
<button type="button"
|
||||
class="btn btn-danger remove-key-point"
|
||||
style="{{ count($translatedKeyPoints) > 1 ? '' : 'display: none;' }}">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="form-group key-point-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="key_points[{{ $lang->id }}][]"
|
||||
class="form-control"
|
||||
placeholder="{{ __('Enter key point') }}">
|
||||
<button type="button" class="btn btn-danger remove-key-point"
|
||||
style="display: none;">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<button type="button" class="btn btn-sm btn-primary mt-2 add-key-point"
|
||||
data-lang-id="{{ $lang->id }}">
|
||||
<i class="fas fa-plus me-1"></i> {{ __('Add Key Point') }}
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Category Selection') }}</div>
|
||||
<div class="card-body mt-2">
|
||||
{{-- Global Package Option --}}
|
||||
<div class="form-check mb-3">
|
||||
<input class="form-check-input" type="checkbox" name="is_global" id="is_global" value="1"
|
||||
{{ $package->is_global == 1 ? 'checked' : '' }}
|
||||
{{ $package->type == 'advertisement' ? 'disabled' : '' }}>
|
||||
<label class="form-check-label" for="is_global">
|
||||
<strong>{{ __('Global Package (Apply to All Categories)') }}</strong>
|
||||
</label>
|
||||
<small class="form-text text-muted d-block">{{ __('If checked, this package will be available for all categories.') }}</small>
|
||||
</div>
|
||||
|
||||
<div id="category_selection" class="sub_category_lit" style="display: {{ ($package->is_global == 1 || $package->type == 'advertisement') ? 'none' : 'block' }};">
|
||||
@foreach ($categories as $category)
|
||||
<div class="category">
|
||||
<div class="category-header">
|
||||
<label>
|
||||
<input type="checkbox" name="selected_categories[]"
|
||||
value="{{ $category->id }}" class="category-checkbox"
|
||||
{{ in_array($category->id, $selected_categories) ? 'checked' : '' }}
|
||||
{{ $package->type == 'advertisement' ? 'disabled' : '' }}>
|
||||
{{ $category->name }}
|
||||
</label>
|
||||
@if (!empty($category->subcategories))
|
||||
@php
|
||||
$currentLang = Session::get('language');
|
||||
$isRtl = false;
|
||||
if (!empty($currentLang)) {
|
||||
try {
|
||||
$rtlRaw = method_exists($currentLang, 'getRawOriginal') ? $currentLang->getRawOriginal('rtl') : null;
|
||||
if ($rtlRaw !== null) {
|
||||
$isRtl = ($rtlRaw == 1 || $rtlRaw === true);
|
||||
} else {
|
||||
$isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1);
|
||||
}
|
||||
}
|
||||
$arrowIcon = $isRtl ? '' : '';
|
||||
@endphp
|
||||
<i style="font-size:24px"
|
||||
class="fas toggle-button-package {{ in_array($category->id, $selected_all_categories) ? 'open' : '' }}">
|
||||
{!! $arrowIcon !!}
|
||||
</i>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="subcategories"
|
||||
style="display: {{ in_array($category->id, $selected_all_categories) ? 'block' : 'none' }};">
|
||||
@if (!empty($category->subcategories))
|
||||
@include('category.treeview', [
|
||||
'categories' => $category->subcategories,
|
||||
'selected_categories' => $selected_categories,
|
||||
'selected_all_categories' => $selected_all_categories,
|
||||
])
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-end mb-3">
|
||||
<input type="submit" class="btn btn-primary" value="{{ __('Save and Back') }}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Package type radio buttons - disabled in edit mode, but keep structure
|
||||
$('.package-type-radio').on('change', function() {
|
||||
// Prevent changes in edit mode (already disabled)
|
||||
const selectedType = $(this).val();
|
||||
|
||||
if (selectedType === 'item_listing') {
|
||||
$('#ad_listing_section').show();
|
||||
$('#featured_ads_section').hide();
|
||||
// Enable global/category selection for item_listing
|
||||
// IMPORTANT: don't force uncheck "Global" in edit mode; respect stored state.
|
||||
$('#is_global').prop('disabled', false);
|
||||
$('.category-checkbox').prop('disabled', false);
|
||||
// Show/hide category selection based on current global checkbox state
|
||||
if ($('#is_global').is(':checked')) {
|
||||
$('#category_selection').hide();
|
||||
} else {
|
||||
$('#category_selection').show();
|
||||
}
|
||||
} else if (selectedType === 'advertisement') {
|
||||
$('#ad_listing_section').hide();
|
||||
$('#featured_ads_section').show();
|
||||
// Disable category selection for advertisement (featured ads)
|
||||
// Set as global package for featured ads
|
||||
$('#is_global').prop('checked', true).prop('disabled', true);
|
||||
$('.category-checkbox').prop('checked', false).prop('disabled', true);
|
||||
$('#category_selection').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize on page load
|
||||
const currentPackageType = $('#package_type').val();
|
||||
if (currentPackageType) {
|
||||
$('.package-type-radio[value="' + currentPackageType + '"]').trigger('change');
|
||||
}
|
||||
// Sync category selection visibility based on is_global state after init
|
||||
$('#is_global').trigger('change');
|
||||
|
||||
// Ad listing item limit toggle
|
||||
$('.ads-item-limit-type').on('change', function() {
|
||||
if ($(this).val() === 'limited') {
|
||||
$('#ads_item_limit_input').show();
|
||||
} else {
|
||||
$('#ads_item_limit_input').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Ad listing duration type toggle
|
||||
$('.ads-listing-duration-type').on('change', function() {
|
||||
if ($(this).val() === 'custom') {
|
||||
$('#ads_listing_duration_days_input').show();
|
||||
} else {
|
||||
$('#ads_listing_duration_days_input').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Featured item limit toggle
|
||||
$('.featured-item-limit-type').on('change', function() {
|
||||
if ($(this).val() === 'limited') {
|
||||
$('#featured_item_limit_input').show();
|
||||
} else {
|
||||
$('#featured_item_limit_input').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Featured ads duration type toggle
|
||||
$('.featured-ads-duration-type').on('change', function() {
|
||||
if ($(this).val() === 'custom') {
|
||||
$('#featured_ads_duration_days_input').show();
|
||||
} else {
|
||||
$('#featured_ads_duration_days_input').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Package duration type toggle
|
||||
$('.package-duration-type').on('change', function() {
|
||||
if ($(this).val() === 'limited') {
|
||||
$('#package_duration_input').show();
|
||||
$('#package_duration_input input[name="duration"]').attr('data-parsley-required', 'true');
|
||||
} else {
|
||||
$('#package_duration_input').hide();
|
||||
$('#package_duration_input input[name="duration"]').removeAttr('data-parsley-required');
|
||||
}
|
||||
});
|
||||
|
||||
// Add key point
|
||||
$(document).on('click', '.add-key-point', function() {
|
||||
const langId = $(this).data('lang-id');
|
||||
const container = $('#key_points_container_' + langId);
|
||||
const newPoint = container.find('.key-point-item').first().clone();
|
||||
newPoint.find('input').val('');
|
||||
newPoint.find('.remove-key-point').show();
|
||||
container.append(newPoint);
|
||||
updateRemoveButtons();
|
||||
});
|
||||
|
||||
// Remove key point
|
||||
$(document).on('click', '.remove-key-point', function() {
|
||||
const container = $(this).closest('#key_points_container_' + $(this).closest('.tab-pane')
|
||||
.find('input[name="languages[]"]').val());
|
||||
if ($(this).closest('.key-point-item').siblings('.key-point-item').length > 0) {
|
||||
$(this).closest('.key-point-item').remove();
|
||||
updateRemoveButtons();
|
||||
}
|
||||
});
|
||||
|
||||
function updateRemoveButtons() {
|
||||
$('.key-point-item').each(function() {
|
||||
const container = $(this).closest('#key_points_container_' + $(this).closest(
|
||||
'.tab-pane').find('input[name="languages[]"]').val());
|
||||
const count = container.find('.key-point-item').length;
|
||||
container.find('.remove-key-point').toggle(count > 1);
|
||||
});
|
||||
}
|
||||
|
||||
// Global package toggle
|
||||
$('#is_global').on('change', function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#category_selection').hide();
|
||||
$('.category-checkbox').prop('checked', false);
|
||||
} else {
|
||||
$('#category_selection').show();
|
||||
}
|
||||
});
|
||||
|
||||
// Category toggle buttons - use event delegation to handle dynamically added elements
|
||||
$(document).on('click', '.toggle-button-package', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
$(this).toggleClass('open');
|
||||
$(this).closest('.category').find('.subcategories').stop(true, true).slideToggle();
|
||||
return false;
|
||||
});
|
||||
|
||||
// Prevent category checkbox and label from triggering toggle
|
||||
$(document).on('click', '.category-checkbox', function(e) {
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
});
|
||||
|
||||
// Prevent label click from triggering toggle when clicking on checkbox area
|
||||
$(document).on('click', '.category-header label', function(e) {
|
||||
// Only prevent if clicking on the label text, not the checkbox itself
|
||||
if ($(e.target).is('input[type="checkbox"]')) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
// Prevent category header from triggering toggle except when clicking the toggle button
|
||||
$(document).on('click', '.category-header', function(e) {
|
||||
// If clicking on toggle button, let it handle
|
||||
if ($(e.target).hasClass('toggle-button-package') || $(e.target).closest('.toggle-button-package').length) {
|
||||
return;
|
||||
}
|
||||
// If clicking on checkbox or label, let it handle
|
||||
if ($(e.target).is('input[type="checkbox"]') || $(e.target).is('label') || $(e.target).closest('label').length) {
|
||||
return;
|
||||
}
|
||||
// Otherwise, prevent any action
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
// Image preview functionality
|
||||
$('#icon').on('change', function() {
|
||||
const [file] = this.files;
|
||||
if (file) {
|
||||
$('#blah').attr('src', URL.createObjectURL(file));
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize category selection state based on current package type
|
||||
if (currentPackageType === 'advertisement') {
|
||||
// Disable all category checkboxes for featured ads
|
||||
$('.category-checkbox').prop('disabled', true);
|
||||
}
|
||||
|
||||
// Auto-calculate final price based on price and discount
|
||||
function calculateFinalPrice() {
|
||||
const price = parseFloat($('input[name="price"]').val()) || 0;
|
||||
const discount = parseFloat($('input[name="discount_in_percentage"]').val()) || 0;
|
||||
|
||||
if (price > 0 && discount >= 0 && discount <= 100) {
|
||||
const discountAmount = (price * discount) / 100;
|
||||
const finalPrice = price - discountAmount;
|
||||
$('#final_price').val(finalPrice.toFixed(2));
|
||||
}
|
||||
}
|
||||
|
||||
$('input[name="price"], input[name="discount_in_percentage"]').on('input', calculateFinalPrice);
|
||||
});
|
||||
|
||||
function afterPackageUpdate() {
|
||||
setTimeout(function() {
|
||||
window.location.href = "{{ route('package.index') }}";
|
||||
}, 1000)
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
74
resources/views/packages/index.blade.php
Normal file
74
resources/views/packages/index.blade.php
Normal file
@@ -0,0 +1,74 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{__("Subscription Packages")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4 class="mb-0">@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 text-end">
|
||||
@can('advertisement-listing-package-create')
|
||||
<a class="btn btn-primary me-2" href="{{ route('package.create')}}">{{ __('Create Subscription Package') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="filters">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<label for="type">{{ __("Package Type") }}</label>
|
||||
<select name="type" class="form-control bootstrap-table-filter-control-type" aria-label="type" id="type">
|
||||
<option value="">{{ __("All") }}</option>
|
||||
<option value="item_listing">{{ __("Item Listing (Ads)") }}</option>
|
||||
<option value="advertisement">{{ __("Advertisement (Featured Ads)") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="stable-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('package.show', 1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]"
|
||||
data-search="true" data-search-align="right" data-toolbar="#filters" data-show-columns="true"
|
||||
data-show-refresh="true" data-fixed-columns="true" data-fixed-number="1" data-fixed-right-number="1"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3"
|
||||
data-escape="true"
|
||||
data-show-export="true" data-export-options='{"fileName": "package-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true" data-filter-control="true" data-filter-control-container="#filters">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="icon" data-align="center" data-formatter="imageFormatter">{{ __('Image') }}</th>
|
||||
<th scope="col" data-field="name" data-align="center" data-escape="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="type" data-align="center" data-filter-name="type" data-filter-control="select" data-filter-data="" data-formatter="packageTypeFormatter">{{ __('Type') }}</th>
|
||||
<th scope="col" data-field="category_names" data-align="center" data-formatter="categoryNamesFormatter">{{ __('Categories') }}</th>
|
||||
<th scope="col" data-field="price" data-align="center" data-sortable="true">{{ __('Price') }}</th>
|
||||
<th scope="col" data-field="discount_in_percentage" data-align="center" data-sortable="true">{{ __('Discount (%)') }}</th>
|
||||
<th scope="col" data-field="final_price" data-align="center" data-sortable="true">{{ __('Final Price') }}</th>
|
||||
<th scope="col" data-field="duration" data-align="center" data-sortable="true">{{ __('Package Duration') }}</th>
|
||||
@canany(['advertisement-listing-package-update','advertisement-listing-package-delete'])
|
||||
<th scope="col" data-field="operate" data-escape="false" data-sortable="false">{{ __('Action') }}</th>
|
||||
@endcanany
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@endsection
|
||||
|
||||
58
resources/views/packages/payment-transactions.blade.php
Normal file
58
resources/views/packages/payment-transactions.blade.php
Normal file
@@ -0,0 +1,58 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Payment Transactions') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
{{-- <div class="row " id="toolbar"> --}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-borderless table-striped" aria-describedby="mydesc"
|
||||
id="table_list" data-toggle="table" data-url="{{ route('package.payment-transactions.show') }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-search-align="right" data-toolbar="#toolbar" data-show-columns="true"
|
||||
data-show-refresh="true" data-fixed-columns="true" data-fixed-number="1"
|
||||
data-fixed-right-number="1" data-trim-on-search="false" data-responsive="true"
|
||||
data-sort-name="id" data-sort-order="desc" data-pagination-successively-size="3"
|
||||
data-escape="true"
|
||||
data-query-params="queryParams" data-table="packages"
|
||||
data-show-export="true" data-export-options='{"fileName": "user-package-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="user.name" data-align="center" data-sortable="false">{{ __('User Name') }}</th>
|
||||
<th scope="col" data-field="amount" data-align="center" data-sortable="false">{{ __('Amount') }}</th>
|
||||
<th scope="col" data-field="payment_gateway" data-align="center">{{ __('Payment Gateway') }}</th>
|
||||
<th scope="col" data-field="payment_status" data-align="center" data-sortable="true">{{ __('Payment Status') }}</th>
|
||||
<th scope="col" data-field="created_at" data-align="center" data-sortable="true">{{ __('Created At') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
61
resources/views/packages/user.blade.php
Normal file
61
resources/views/packages/user.blade.php
Normal file
@@ -0,0 +1,61 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('User Packages') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
{{-- <div class="row " id="toolbar"> --}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc"
|
||||
id="table_list" data-toggle="table" data-url="{{ route('package.users.show') }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-search-align="right" data-toolbar="#toolbar" data-show-columns="true"
|
||||
data-show-refresh="true" data-fixed-columns="true" data-fixed-number="1"
|
||||
data-fixed-right-number="1" data-trim-on-search="false" data-responsive="true"
|
||||
data-sort-name="id" data-sort-order="desc" data-pagination-successively-size="3"
|
||||
data-escape="true"
|
||||
data-query-params="queryParams" data-table="packages"
|
||||
data-show-export="true" data-export-options='{"fileName": "user-package-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="user.name" data-align="center" data-sortable="false">{{ __('User Name') }}</th>
|
||||
<th scope="col" data-field="package.name" data-align="center" data-sortable="false">{{ __('Package Name') }}</th>
|
||||
<th scope="col" data-field="start_date" data-align="center">{{ __('Start Date') }}</th>
|
||||
<th scope="col" data-field="end_date" data-align="center" data-formatter="unlimitedBadgeFormatter" data-sortable="true">{{ __('End Date') }}</th>
|
||||
<th scope="col" data-field="status" data-align="center" data-formatter="userPackageStatusBadgeFormatter" data-sortable="true">{{ __('Status') }}</th>
|
||||
<th scope="col" data-field="total_limit" data-align="center" data-formatter="unlimitedBadgeFormatter" data-sortable="true">{{ __('Total Limit') }}</th>
|
||||
<th scope="col" data-field="used_limit" data-align="center" data-sortable="true">{{ __('Used Limit') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
14
resources/views/payment/flutterwave.blade.php
Normal file
14
resources/views/payment/flutterwave.blade.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<script>
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
const trxref = urlParams.get('trxref');
|
||||
const reference = urlParams.get('reference');
|
||||
|
||||
window.opener.postMessage({
|
||||
status: 'success',
|
||||
reference: reference || 'your-payment-reference',
|
||||
trxref: trxref
|
||||
}, '*');
|
||||
window.close();
|
||||
</script>
|
||||
|
||||
15
resources/views/payment/paypal.blade.php
Normal file
15
resources/views/payment/paypal.blade.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<script>
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
const trxref = @json($trxref);
|
||||
const reference = @json($reference);
|
||||
|
||||
|
||||
window.opener.postMessage({
|
||||
status: 'success',
|
||||
reference: reference || 'your-payment-reference', // Use extracted reference, fallback if missing
|
||||
trxref: trxref
|
||||
}, '*');
|
||||
window.close();
|
||||
</script>
|
||||
|
||||
15
resources/views/payment/paypalcancle.blade.php
Normal file
15
resources/views/payment/paypalcancle.blade.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<script>
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
const trxref = @json($trxref);
|
||||
const reference = @json($reference);
|
||||
|
||||
|
||||
window.opener.postMessage({
|
||||
status: 'cancel',
|
||||
reference: reference || 'your-payment-reference', // Use extracted reference, fallback if missing
|
||||
trxref: trxref
|
||||
}, '*');
|
||||
window.close();
|
||||
</script>
|
||||
|
||||
14
resources/views/payment/paystack.blade.php
Normal file
14
resources/views/payment/paystack.blade.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<script>
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
const trxref = urlParams.get('trxref');
|
||||
const reference = urlParams.get('reference');
|
||||
|
||||
window.opener.postMessage({
|
||||
status: 'success',
|
||||
reference: reference || 'your-payment-reference',
|
||||
trxref: trxref
|
||||
}, '*');
|
||||
window.close();
|
||||
</script>
|
||||
|
||||
14
resources/views/payment/phonepe.blade.php
Normal file
14
resources/views/payment/phonepe.blade.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<script>
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
const trxref = urlParams.get('trxref');
|
||||
const reference = urlParams.get('reference');
|
||||
|
||||
window.opener.postMessage({
|
||||
status: 'success',
|
||||
reference: reference || 'your-payment-reference', // Use extracted reference, fallback if missing
|
||||
trxref: trxref
|
||||
}, '*');
|
||||
window.close();
|
||||
</script>
|
||||
|
||||
264
resources/views/places/area.blade.php
Normal file
264
resources/views/places/area.blade.php
Normal file
@@ -0,0 +1,264 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Area")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
@can('area-create')
|
||||
<div class="row m-3">
|
||||
<div class="col-12 text-end">
|
||||
<a href="{{ route('areas.translation') }}" class="btn btn-primary">
|
||||
<i class="fa fa-language me-2"></i> {{ __('Translate Areas') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">{{ __('Add Area') }}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="create-form" action="{{route('area.create')}}" method="POST" data-parsley-validate enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="country" class="mandatory form-label">{{ __('Country') }}</label>
|
||||
<select class="form-control select2" id="country" name="country_id" required>
|
||||
<option value="">{{ __('--Select Country--') }}</option>
|
||||
@foreach($countries as $country)
|
||||
<option value="{{ $country->id }}">{{ $country->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="state" class="mandatory form-label">{{ __('State') }}</label>
|
||||
<select class="form-control select2" id="state" name="state_id" required>
|
||||
<option value="">{{ __('--Select State--') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="city" class="mandatory form-label">{{ __('City') }}</label>
|
||||
<select class="form-control select2" id="city" name="city_id" required>
|
||||
<option value="">{{ __('--Select City--') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="areas-container">
|
||||
<div class="row area-input-group mb-3">
|
||||
<div class="col-md-4 form-group">
|
||||
<label for="name" class="mandatory form-label mt-2">{{ __("Area Name") }}</label>
|
||||
<div class="d-flex">
|
||||
<input type="text" name="name[]" class="form-control me-2" placeholder="{{ __("Enter Area name") }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="latitude" class="mandatory form-label mt-2">{{ __("Latitude") }}</label>
|
||||
<div class="d-flex mb-2">
|
||||
<input type="text" name="latitude[]" class="form-control me-2" placeholder="{{ __("Enter Latitude") }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="longitude" class="mandatory form-label mt-2">{{ __("Longitude") }}</label>
|
||||
<div class="d-flex mb-2">
|
||||
<input type="text" name="longitude[]" class="form-control me-2" placeholder="{{ __("Enter Longitude") }}">
|
||||
<button type="button" class="btn btn-danger remove-area-button ms-2">-</button>
|
||||
<button type="button" class="btn btn-secondary add-area-button ms-2">+</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-12">
|
||||
<div class="alert alert-warning" role="alert">
|
||||
{{ __('Please select the correct location on the map. Do not place the marker for any other location.') }}
|
||||
</div>
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3 text-end">
|
||||
<button type="submit" class="btn btn-primary">{{ __('Submit') }}</button>
|
||||
<a href="{{ route('area.index') }}" class="btn btn-secondary">{{ __('Cancel') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="filters">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-4">
|
||||
<label for="filter_country">{{__("Country")}}</label>
|
||||
<select class="form-control bootstrap-table-filter-control-country.name" id="filter_country">
|
||||
<option value="">{{__("All")}}</option>
|
||||
@foreach($countries as $country)
|
||||
<option value="{{$country->id}}">{{$country->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<label for="filter_state">{{__("State")}}</label>
|
||||
<select class="form-control bootstrap-table-filter-control-state.name" id="filter_state">
|
||||
<option value="">{{__("All")}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<label for="filter_city">{{__("City")}}</label>
|
||||
<select name="city_id" class="form-control bootstrap-table-filter-control-city.name" id="filter_city">
|
||||
<option value="">{{__("All")}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table-light table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('area.show',1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-show-columns="true" data-show-refresh="true"
|
||||
data-fixed-columns="true" data-fixed-number="1" data-fixed-right-number="1"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="id"
|
||||
data-sort-order="desc" data-pagination-successively-size="3"
|
||||
data-escape="true" data-mobile-responsive="true"
|
||||
data-filter-control="true"
|
||||
data-toolbar="#filters"
|
||||
data-filter-control-container="#filters">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="false">{{'Name'}}</th>
|
||||
<th scope="col" data-field="country.name" data-sortable="false" data-filter-name="country_id" data-filter-control="select" data-filter-data="">{{ __('Country') }}</th>
|
||||
<th scope="col" data-field="state.name" data-sortable="false" data-filter-name="state_id" data-filter-control="select" data-filter-data="">{{ __('State') }}</th>
|
||||
<th scope="col" data-field="city.name" data-sortable="false" data-filter-name="city_id" data-filter-control="select" data-filter-data="">{{ __('City') }}</th>
|
||||
<th scope="col" data-field="longitude" data-sortable="false">{{ __('Longitude') }}</th>
|
||||
<th scope="col" data-field="latitude" data-sortable="false">{{ __('Latitude') }}</th>
|
||||
<th scope="col" data-field="operate" data-sortable="false" data-escape="false" data-events="areaEvents">{{ __('Action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('area-update')
|
||||
<!-- EDIT MODEL MODEL -->
|
||||
<div id="editModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Edit Area') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="edit-form" class="edit-form" action="" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-4 form-group">
|
||||
<label for="country" class="mandatory form-label">{{__("Country")}}</label>
|
||||
<select name="country_id" id="edit_country" class="form-control country form-select" data-placeholder="{{__("Select Country")}}">
|
||||
<option value="">Select Country</option>
|
||||
@foreach ($countries as $country)
|
||||
<option value="{{ $country->id }}">{{ $country->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 form-group">
|
||||
<label for="state" class="mandatory form-label">{{__("State")}}</label>
|
||||
<select name="state_id" id="edit_state" class="form-control form-select" data-placeholder="{{__("Select State")}}">
|
||||
@foreach ($states as $state)
|
||||
<option value="{{ $state->id }}">{{ $state->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 form-group">
|
||||
<label for="city" class="mandatory form-label">{{__("City")}}</label>
|
||||
<select name="city_id" id="edit_city" class="form-control form-select" data-placeholder="{{__("Select City")}}">
|
||||
@foreach ($cities as $city)
|
||||
<option value="{{ $city->id }}">{{ $city->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="edit_name" class="mandatory form-label">{{ __('Name') }}</label>
|
||||
<input type="text" name="name" id="edit_name" class="form-control" data-parsley-required="true">
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="latitude" class="mandatory form-label">Latitude</label>
|
||||
<div class="d-flex mb-2">
|
||||
<input type="text" name="latitude" id="edit_latitude" class="form-control me-2" placeholder="{{__("Enter Latitude")}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="longitude" class="mandatory form-label">Longitude</label>
|
||||
<div class="d-flex mb-2">
|
||||
<input type="text" name="longitude" id="edit_longitude" class="form-control me-2" placeholder="{{__("Enter Longitude")}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<div id="edit_map" style="height: 400px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary waves-effect" data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Initialize map with default coordinates
|
||||
const map = window.mapUtils.initializeMap('map', 0, 0);
|
||||
|
||||
// Function to update area coordinates
|
||||
window.updateAreaCoordinates = function(lat, lng) {
|
||||
// Get the last area input group (the one being edited)
|
||||
const $areaGroup = $('.area-input-group').last();
|
||||
|
||||
// Update latitude and longitude fields
|
||||
$areaGroup.find('input[name="latitude[]"]').val(lat);
|
||||
$areaGroup.find('input[name="longitude[]"]').val(lng);
|
||||
};
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
127
resources/views/places/area_translation.blade.php
Normal file
127
resources/views/places/area_translation.blade.php
Normal file
@@ -0,0 +1,127 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __("Translate Areas") }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form class="edit-form" action="{{ route('areas.translation.update') }}" method="POST" data-parsley-validate>
|
||||
@csrf
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>{{ __('Translate Area Names') }}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($countries->isNotEmpty())
|
||||
<div class="form-group mb-3">
|
||||
<label for="country_translation_area">{{ __('Select Country') }}</label>
|
||||
<select id="country_translation_area" class="form-control">
|
||||
<option value="">{{ __('Select Country') }}</option>
|
||||
@foreach($countries as $country)
|
||||
<option value="{{ $country->id }}">{{ $country->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="State_For_area">{{ __('Select State') }}</label>
|
||||
<select id="State_For_area" class="form-control" disabled>
|
||||
<option value="">{{ __('Select State') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="city_translation">{{ __('Select City') }}</label>
|
||||
<select id="city_translation" class="form-control" disabled>
|
||||
<option value="">{{ __('Select City') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="area_translations_container" class="mt-4"></div>
|
||||
|
||||
<div class="text-end">
|
||||
<button type="submit" class="btn btn-primary">{{ __("Save") }}</button>
|
||||
</div>
|
||||
@else
|
||||
<p>{{ __("No countries found.") }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
$('#country_translation_area').on('change', function () {
|
||||
console.log('here');
|
||||
let countryId = $(this).val();
|
||||
let url = window.baseurl + 'states/search?country_id=' + countryId;
|
||||
|
||||
$('#State_For_area').html("<option value=''>{{ __('Select State') }}</option>");
|
||||
$('#city_translation').html("<option value=''>{{ __('Select City') }}</option>").prop('disabled', true);
|
||||
$('#State_For_area').prop('disabled', true);
|
||||
$('#area_translations_container').html("");
|
||||
|
||||
if (!countryId) return;
|
||||
|
||||
ajaxRequest('GET', url, null, null, function (response) {
|
||||
$.each(response.data, function (key, value) {
|
||||
console.log(
|
||||
response
|
||||
);
|
||||
|
||||
$('#State_For_area').append($('<option>', { value: value.id, text: value.name }));
|
||||
});
|
||||
$('#State_For_area').prop('disabled', false);
|
||||
});
|
||||
});
|
||||
|
||||
$('#State_For_area').on('change', function () {
|
||||
let stateId = $(this).val();
|
||||
$('#city_translation').html("<option value=''>{{ __('Select City') }}</option>").prop('disabled', true);
|
||||
$('#area_translations_container').html("");
|
||||
|
||||
if (!stateId) return;
|
||||
|
||||
let url = window.baseurl + 'cities/search?state_id=' + stateId;
|
||||
|
||||
ajaxRequest('GET', url, null, null, function (response) {
|
||||
$.each(response.data, function (key, value) {
|
||||
$('#city_translation').append($('<option>', { value: value.id, text: value.name }));
|
||||
});
|
||||
$('#city_translation').prop('disabled', false);
|
||||
});
|
||||
});
|
||||
|
||||
$('#city_translation').on('change', function () {
|
||||
let cityId = $(this).val();
|
||||
$('#area_translations_container').html("");
|
||||
|
||||
if (!cityId) return;
|
||||
|
||||
let url = window.baseurl + 'area-translations/' + cityId;
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
$('#area_translations_container').html(response);
|
||||
},
|
||||
error: function () {
|
||||
$('#area_translations_container').html('<div class="text-danger">Failed to load translations.</div>');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
36
resources/views/places/area_translation_tab.blade.php
Normal file
36
resources/views/places/area_translation_tab.blade.php
Normal file
@@ -0,0 +1,36 @@
|
||||
@if($languages->isNotEmpty())
|
||||
<ul class="nav nav-tabs mb-3">
|
||||
@foreach($languages as $index => $language)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if($index == 0) active @endif"
|
||||
data-bs-toggle="tab"
|
||||
href="#lang-{{ $language->id }}-{{ $city->id }}">
|
||||
{{ $language->name }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mb-4">
|
||||
@foreach($languages as $index => $language)
|
||||
<div class="tab-pane fade @if($index == 0) show active @endif"
|
||||
id="lang-{{ $language->id }}-{{ $city->id }}">
|
||||
<div class="row">
|
||||
@foreach($areas as $area)
|
||||
@php
|
||||
$translation = $area->translations->firstWhere('language_id', $language->id);
|
||||
@endphp
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">{{ $area->name }}</label>
|
||||
<input type="text"
|
||||
name="translations[{{ $language->id }}][{{ $area->id }}]"
|
||||
class="form-control"
|
||||
value="{{ $translation?->name }}"
|
||||
placeholder="{{ __('Enter name for') }} {{ $area->name }}">
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
236
resources/views/places/city.blade.php
Normal file
236
resources/views/places/city.blade.php
Normal file
@@ -0,0 +1,236 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Cities') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row m-3">
|
||||
<div class="col-12 text-end">
|
||||
<a href="{{ route('cities.translation') }}" class="btn btn-primary">
|
||||
<i class="fa fa-language me-2"></i> {{ __('Translate Cities') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<form class="create-form" action="{{route('city.create')}}" method="POST" data-parsley-validate enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Add City")}}</div>
|
||||
<div class="card-body mt-3">
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="country" class="mandatory form-label">{{__("Country")}}</label>
|
||||
<select name="country_id" id="country" class="form-control form-select" data-placeholder="{{__("Select Country")}}">
|
||||
<option value="">{{__("Select Country")}}</option>
|
||||
@foreach ($countries as $country)
|
||||
<option value="{{ $country->id }}">{{ $country->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="state" class="mandatory form-label">{{__("State")}}</label>
|
||||
<select name="state_id" id="state" class="form-control form-select" data-placeholder="{{__("Select State")}}">
|
||||
<option value="">{{ __("Select State") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="city-container" >
|
||||
<div class="row city-input-group">
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="name" class="mandatory form-label mt-2">{{ __("City Name") }}</label><span class="text-danger">*</span>
|
||||
<div class="d-flex mb-2">
|
||||
<input type="text" name="name[]" class="form-control me-2" placeholder="{{ __("Enter City name") }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="latitude" class="mandatory form-label mt-2">{{ __("Latitude") }}</label>
|
||||
<div class="d-flex mb-2">
|
||||
<input type="text" name="latitude[]" class="form-control me-2" placeholder="{{ __("Enter Latitude") }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="longitude" class="mandatory form-label mt-2">{{ __("Longitude") }}</label>
|
||||
<div class="d-flex mb-2">
|
||||
<input type="text" name="longitude[]" class="form-control me-2" placeholder="{{ __("Enter Longitude") }}">
|
||||
<button type="button" class="btn btn-secondary add-city-button">+</button>
|
||||
<button type="button" class="btn btn-danger remove-city-button ms-2">-</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 m-2 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{__("Create")}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="filters">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-4">
|
||||
<label for="filter_country">{{__("Country")}}</label>
|
||||
<select class="form-control bootstrap-table-filter-control-country_name" id="filter_country">
|
||||
<option value="">{{__("All")}}</option>
|
||||
@foreach($countries as $country)
|
||||
<option value="{{$country->id}}">{{$country->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<label for="filter_state">{{__("State")}}</label>
|
||||
<select class="form-control bootstrap-table-filter-control-state_name" id="filter_state">
|
||||
<option value="">{{__("All")}}</option>
|
||||
@foreach($states as $state)
|
||||
<option value="{{$state->id}}">{{$state->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('cities.show',1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3" data-table="cities" data-status-column="deleted_at"
|
||||
data-escape="true"
|
||||
data-filter-control="true"
|
||||
data-toolbar="#filters"
|
||||
data-filter-control-container="#filters"
|
||||
data-show-export="true" data-export-options='{"fileName": "city-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="country_name" data-sortable="true" data-filter-name="country_id" data-filter-control="select" data-filter-data="">{{ __('Country Name') }}</th>
|
||||
<th scope="col" data-field="state_name" data-sortable="true" data-filter-name="state_id" data-filter-control="select" data-filter-data="">{{ __('State Name') }}</th>
|
||||
<th scope="col" data-field="longitude" data-sortable="false">{{ __('Longitude') }}</th>
|
||||
<th scope="col" data-field="latitude" data-sortable="false">{{ __('Latitude') }}</th>
|
||||
<th scope="col" data-field="country.emoji">{{ __('Flag') }}</th>
|
||||
<th scope="col" data-field="operate" data-sortable="false" data-escape="false" data-events="cityEvents">{{ __('Action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('city-update')
|
||||
<!-- EDIT MODEL MODEL -->
|
||||
<div id="editModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Edit City') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="edit-form" class="edit-form" action="" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="country" class="mandatory form-label">{{__("Country")}}</label>
|
||||
<select name="country_id" id="edit_country" class="form-control country form-select" data-placeholder="{{__("Select Country")}}">
|
||||
<option value="">Select Country</option>
|
||||
@foreach ($countries as $country)
|
||||
<option value="{{ $country->id }}">{{ $country->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="state" class="mandatory form-label">{{__("State")}}</label>
|
||||
<select name="state_id" id="edit_state" class="form-control form-select" data-placeholder="{{__("Select State")}}">
|
||||
@foreach ($states as $state)
|
||||
<option value="{{ $state->id }}">{{ $state->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="name" class="mandatory form-label">City Name</label>
|
||||
<div class="d-flex mb-2">
|
||||
<input type="text" name="name" class="form-control me-2" id="edit_name" placeholder="{{__("Enter City name")}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="latitude" class="mandatory form-label">Latitude</label>
|
||||
<div class="d-flex mb-2">
|
||||
<input type="text" name="latitude" id="edit_latitude" class="form-control me-2" placeholder="{{__("Enter Latitude")}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-sm-12">
|
||||
<label for="longitude" class="mandatory form-label">Longitude</label>
|
||||
<div class="d-flex mb-2">
|
||||
<input type="text" name="longitude" id="edit_longitude" class="form-control me-2" placeholder="{{__("Enter Longitude")}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<div id="edit_map" style="height: 400px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary waves-effect" data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Initialize map with default coordinates
|
||||
const map = window.mapUtils.initializeMap('map', 0, 0);
|
||||
|
||||
window.updateAreaCoordinates = function(lat, lng) {
|
||||
// Get the last area input group (the one being edited)
|
||||
const $areaGroup = $('.city-input-group').last();
|
||||
|
||||
// Update latitude and longitude fields
|
||||
$areaGroup.find('input[name="latitude[]"]').val(lat);
|
||||
$areaGroup.find('input[name="longitude[]"]').val(lng);
|
||||
};
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
58
resources/views/places/city_translation.blade.php
Normal file
58
resources/views/places/city_translation.blade.php
Normal file
@@ -0,0 +1,58 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __("Translate Cities") }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form class="edit-form" action="{{ route('cities.translation.update') }}" method="POST" data-parsley-validate enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>{{ __('Translate City Names') }}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($countries->isNotEmpty())
|
||||
<div class="form-group mb-3">
|
||||
<label for="country_translation">{{ __('Select Country') }}</label>
|
||||
<select id="country_translation" class="form-control">
|
||||
<option value="">{{ __('Select Country') }}</option>
|
||||
@foreach($countries as $country)
|
||||
<option value="{{ $country->id }}">{{ $country->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="state_translation">{{ __('Select State') }}</label>
|
||||
<select id="state_translation" class="form-control" disabled>
|
||||
<option value="">{{ __('Select State') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="city_translations_container" class="mt-4"></div>
|
||||
|
||||
|
||||
|
||||
<div class="text-end">
|
||||
<button type="submit" class="btn btn-primary">{{ __("Save") }}</button>
|
||||
</div>
|
||||
@else
|
||||
<p>{{ __("No countries found.") }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
36
resources/views/places/city_translation_tab.blade.php
Normal file
36
resources/views/places/city_translation_tab.blade.php
Normal file
@@ -0,0 +1,36 @@
|
||||
@if($languages->isNotEmpty())
|
||||
<ul class="nav nav-tabs mb-3">
|
||||
@foreach($languages as $index => $language)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if($index == 0) active @endif"
|
||||
data-bs-toggle="tab"
|
||||
href="#lang-{{ $language->id }}-{{ $state->id }}">
|
||||
{{ $language->name }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mb-4">
|
||||
@foreach($languages as $index => $language)
|
||||
<div class="tab-pane fade @if($index == 0) show active @endif"
|
||||
id="lang-{{ $language->id }}-{{ $state->id }}">
|
||||
<div class="row">
|
||||
@foreach($cities as $city)
|
||||
@php
|
||||
$translation = $city->translations->firstWhere('language_id', $language->id);
|
||||
@endphp
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">{{ $city->name }}</label>
|
||||
<input type="text"
|
||||
name="translations[{{ $language->id }}][{{ $city->id }}]"
|
||||
class="form-control"
|
||||
value="{{ $translation?->name }}"
|
||||
placeholder="{{ __('Enter name for') }} {{ $city->name }}">
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
101
resources/views/places/country.blade.php
Normal file
101
resources/views/places/country.blade.php
Normal file
@@ -0,0 +1,101 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Countries') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons d-flex justify-content-end">
|
||||
<a class="btn btn-primary" href="#" data-bs-toggle="modal" data-bs-target="#countryModal">
|
||||
+ {{ __("Import Countries") }}
|
||||
</a>
|
||||
<a class="btn btn-primary ms-2" href="{{ route('countries.translation') }}">
|
||||
<i class="fa fa-language me-2"></i> {{ __("Translate Countries") }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('countries.show',1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3" data-table="countries" data-status-column="deleted_at"
|
||||
data-escape="true"
|
||||
data-show-export="true" data-export-options='{"fileName": "country-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true" data-filter-control="true" data-filter-control-container="#filters" data-toolbar="#filters">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="emoji">{{ __('Flag') }}</th>
|
||||
<th scope="col" data-field="operate" data-escape="false">{{ __('Action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="countryModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-fullscreen">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Import Country Data') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="create-form" action="{{route('countries.import')}}" method="POST" data-success-function="successFunction">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
<input type="text" id="countrySearchInput" class="form-control" placeholder="{{ __('Search countries...') }}">
|
||||
</div>
|
||||
<div class="col-12 mb-2">
|
||||
<input type="checkbox" id="selectAllCountries" class="form-check-input">
|
||||
<label for="selectAllCountries" class="form-label">{{ __('Select All') }}</label>
|
||||
</div>
|
||||
|
||||
@foreach($countries as $country)
|
||||
<div class="col-md-3">
|
||||
<input type="checkbox" id="{{$country['id']}}" name="countries[]" value="{{$country['id']}}" {{$country['is_already_exists'] ? "checked disabled" : ""}} class="form-check-input">
|
||||
<label for="{{$country['id']}}" class="form-label">{{$country['name'].' '.$country['emoji']}}</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<input type="submit" value="{{__("Save")}}" class="btn btn-primary mt-3">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('js')
|
||||
<script>
|
||||
function successFunction() {
|
||||
$('#countryModal').modal('hide');
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
76
resources/views/places/country_translation.blade.php
Normal file
76
resources/views/places/country_translation.blade.php
Normal file
@@ -0,0 +1,76 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __("Translate Countries") }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form class="edit-form" action="{{route('countries.translation.update')}}" method="POST" data-parsley-validate enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>{{ __('Translate Country Names') }}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($languages->isNotEmpty())
|
||||
<ul class="nav nav-tabs" id="languageTabs" role="tablist">
|
||||
@foreach($languages as $index => $language)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($index === 0) active @endif" id="tab-{{ $language->id }}" data-bs-toggle="tab" data-bs-target="#lang-{{ $language->id }}" type="button" role="tab">
|
||||
{{ $language->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content border p-3 mt-3" id="languageTabContent">
|
||||
@foreach($languages as $index => $language)
|
||||
<div class="tab-pane fade @if($index === 0) show active @endif" id="lang-{{ $language->id }}" role="tabpanel">
|
||||
<h5 class="text-primary mb-3">{{ __("Translations for") }}: {{ $language->name }} ({{ $language->code }})</h5>
|
||||
<div class="row">
|
||||
@foreach($countries as $country)
|
||||
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">
|
||||
{{ $country->name }}
|
||||
</label>
|
||||
@php
|
||||
$existingTranslation = $country->nameTranslations->firstWhere('language_id', $language->id);
|
||||
@endphp
|
||||
<input type="text"
|
||||
name="translations[{{ $language->id }}][{{ $country->id }}]"
|
||||
class="form-control"
|
||||
value="{{ $existingTranslation ? $existingTranslation->name : '' }}"
|
||||
placeholder="{{ __('Enter name for') }} {{ $country->name }}">
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<div class="col-md-12 m-2 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{__("Save")}}">
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p>{{ __("No languages found.") }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
63
resources/views/places/map.blade.php
Normal file
63
resources/views/places/map.blade.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>OpenLayers Map</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ol/ol.css" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/ol/ol.js"></script>
|
||||
<style>
|
||||
#map {
|
||||
height: 500px;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="map"></div>
|
||||
|
||||
<form action="{{ route('store.location') }}" method="POST">
|
||||
@csrf
|
||||
<label>Latitude:</label>
|
||||
<input type="text" id="latitude" name="latitude" readonly>
|
||||
|
||||
<label>Longitude:</label>
|
||||
<input type="text" id="longitude" name="longitude" readonly>
|
||||
|
||||
<button type="submit">Save Location</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
const map = new ol.Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM() // OpenStreetMap Layer
|
||||
})
|
||||
],
|
||||
view: new ol.View({
|
||||
center: ol.proj.fromLonLat([0, 0]),
|
||||
zoom: 2
|
||||
})
|
||||
});
|
||||
|
||||
let marker = new ol.Overlay({
|
||||
position: ol.proj.fromLonLat([0, 0]),
|
||||
element: document.createElement('div'),
|
||||
positioning: 'center-center'
|
||||
});
|
||||
map.addOverlay(marker);
|
||||
|
||||
map.on('click', function(event) {
|
||||
const coordinate = ol.proj.toLonLat(event.coordinate);
|
||||
const lat = coordinate[1];
|
||||
const lng = coordinate[0];
|
||||
|
||||
document.getElementById('latitude').value = lat;
|
||||
document.getElementById('longitude').value = lng;
|
||||
|
||||
marker.setPosition(event.coordinate);
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
73
resources/views/places/state.blade.php
Normal file
73
resources/views/places/state.blade.php
Normal file
@@ -0,0 +1,73 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('States') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row m-3">
|
||||
<div class="col-12 text-end">
|
||||
<a href="{{ route('states.translation') }}" class="btn btn-primary">
|
||||
<i class="fa fa-language me-2"></i> {{ __('Translate States') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="filters">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-12">
|
||||
<label for="filter_country">{{__("Country")}}</label>
|
||||
<select class="form-control bootstrap-table-filter-control-country_name" id="filter_country">
|
||||
<option value="">{{__("All")}}</option>
|
||||
@foreach($countries as $country)
|
||||
<option value="{{$country->id}}">{{$country->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('states.show',1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3" data-table="states" data-status-column="deleted_at"
|
||||
data-escape="true"
|
||||
data-show-export="true" data-export-options='{"fileName": "state-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true" data-filter-control="true" data-filter-control-container="#filters" data-toolbar="#filters">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="country_name" data-sortable="true" data-filter-name="country_id" data-filter-control="select" data-filter-data="">{{ __('Country') }}</th>
|
||||
<th scope="col" data-field="country.emoji">{{ __('Flag') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
106
resources/views/places/state_translation.blade.php
Normal file
106
resources/views/places/state_translation.blade.php
Normal file
@@ -0,0 +1,106 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __("Translate States") }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form class="edit-form" action="{{ route('states.translation.update') }}" method="POST" data-parsley-validate enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>{{ __('Translate State Names') }}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
@if($countries->isNotEmpty())
|
||||
<ul class="nav nav-tabs" id="countryTabs" role="tablist">
|
||||
@foreach($countries as $index => $country)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($index === 0) active @endif"
|
||||
id="country-tab-{{ $country->id }}"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#country-{{ $country->id }}"
|
||||
type="button" role="tab">
|
||||
{{ $country->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content border p-3 mt-3" id="countryTabContent">
|
||||
@foreach($countries as $index => $country)
|
||||
<div class="tab-pane fade @if($index === 0) show active @endif" id="country-{{ $country->id }}" role="tabpanel">
|
||||
<h5 class="text-primary">{{ __('States in') }} {{ $country->name }}</h5>
|
||||
|
||||
@php
|
||||
$countryStates = $States->where('country_id', $country->id);
|
||||
@endphp
|
||||
|
||||
@if($languages->isNotEmpty())
|
||||
<ul class="nav nav-tabs mt-3" id="languageTabs-{{ $country->id }}" role="tablist">
|
||||
@foreach($languages as $langIndex => $language)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($langIndex === 0) active @endif"
|
||||
id="lang-tab-{{ $country->id }}-{{ $language->id }}"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#lang-content-{{ $country->id }}-{{ $language->id }}"
|
||||
type="button" role="tab">
|
||||
{{ $language->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content border p-3 mt-3">
|
||||
@foreach($languages as $langIndex => $language)
|
||||
<div class="tab-pane fade @if($langIndex === 0) show active @endif"
|
||||
id="lang-content-{{ $country->id }}-{{ $language->id }}"
|
||||
role="tabpanel">
|
||||
<h6 class="text-secondary">{{ __('Language') }}: {{ $language->name }}</h6>
|
||||
<div class="row">
|
||||
@foreach($countryStates as $state)
|
||||
@php
|
||||
$existingTranslation = $state->translations->firstWhere('language_id', $language->id);
|
||||
@endphp
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">{{ $state->name }}</label>
|
||||
<input type="text"
|
||||
name="translations[{{ $language->id }}][{{ $state->id }}]"
|
||||
class="form-control"
|
||||
value="{{ $existingTranslation?->name }}"
|
||||
placeholder="{{ __('Enter name for') }} {{ $state->name }}">
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<input type="submit" class="btn btn-primary" value="{{ __('Save') }}">
|
||||
</div>
|
||||
@else
|
||||
<p>{{ __("No countries found.") }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
139
resources/views/reports/index.blade.php
Normal file
139
resources/views/reports/index.blade.php
Normal file
@@ -0,0 +1,139 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __("Report Reasons") }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
@can('report-reason-create')
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<form action="{{ route('report-reasons.store') }}" class="needs-validation create-form" method="post" data-parsley-validate enctype="multipart/form-data">
|
||||
<div class="card-body">
|
||||
<input type="hidden" name="type" value="0">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
@foreach($languages as $index => $language)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($index === 0) active @endif" data-bs-toggle="tab"
|
||||
data-bs-target="#lang-{{ $language->id }}" type="button" role="tab">
|
||||
{{ $language->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $index => $language)
|
||||
<div class="tab-pane fade @if($index === 0) show active @endif"
|
||||
id="lang-{{ $language->id }}" role="tabpanel">
|
||||
<div class="form-group">
|
||||
<label>{{ __('Reason') }} ({{ $language->name }})</label>
|
||||
<textarea name="reason[{{ $language->id }}]" class="form-control"
|
||||
rows="3" {{ $language->code === 'en' ? 'required' : '' }}></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-md-12 d-flex justify-content-end">
|
||||
<button class="btn btn-primary" type="submit" name="submit">{{ __('Submit') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
<div class="{{ \Illuminate\Support\Facades\Auth::user()->can('report-reason-create')? "col-md-8" : "col-md-12" }}">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table-light table-striped" aria-describedby="mydesc"
|
||||
id="table_list" data-toggle="table" data-url="{{ route('report-reasons.show',1) }}"
|
||||
data-click-to-select="true" data-responsive="true" data-side-pagination="server"
|
||||
data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]"
|
||||
data-search="true" data-toolbar="#toolbar" data-show-columns="true"
|
||||
data-show-refresh="true" data-fixed-columns="true" data-fixed-number="1"
|
||||
data-fixed-right-number="1" data-trim-on-search="false" data-sort-name="id"
|
||||
data-sort-order="desc" data-pagination-successively-size="3"
|
||||
data-escape="true"
|
||||
data-query-params="reportReasonQueryParams"
|
||||
data-show-export="true" data-export-options='{"fileName": "advertisement-package-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="reason" data-sortable="true">{{ __('Reason') }}</th>
|
||||
@canany(['report-reason-update','report-reason-delete'])
|
||||
<th scope="col" data-field="operate" data-escape="false" data-events="reportReasonEvents">{{ __('Action') }}</th>
|
||||
@endcanany
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="editModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Edit Reason') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form action="" class="edit-form form-horizontal" enctype="multipart/form-data" method="POST" data-parsley-validate>
|
||||
<div class="modal-body">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
@foreach($languages as $index => $language)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($index === 0) active @endif" data-bs-toggle="tab"
|
||||
data-bs-target="#edit-lang-{{ $language->id }}" type="button" role="tab">
|
||||
{{ $language->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $index => $language)
|
||||
<div class="tab-pane fade @if($index === 0) show active @endif" id="edit-lang-{{ $language->id }}" role="tabpanel">
|
||||
<div class="form-group">
|
||||
<label>{{ __('Reason') }} ({{ $language->name }})</label>
|
||||
<textarea class="form-control"
|
||||
name="reason[{{ $language->id }}]"
|
||||
id="edit_reason_{{ $language->id }}"
|
||||
rows="3"
|
||||
{{ $language->code === 'en' ? 'required' : '' }}></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary waves-effect" data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light" id="btn_submit">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
||||
82
resources/views/reports/user_reports.blade.php
Normal file
82
resources/views/reports/user_reports.blade.php
Normal file
@@ -0,0 +1,82 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('User Reports') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="filters">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<label for="user_filter">{{__("User")}}</label>
|
||||
<select class="form-control bootstrap-table-filter-control-user_id" id="user_filter">
|
||||
<option value="">{{__("All")}}</option>
|
||||
@foreach($users as $user)
|
||||
<option value="{{$user->id}}">{{$user->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<label for="item_filter">{{__("Item")}}</label>
|
||||
<select class="form-control bootstrap-table-filter-control-item_id" id="item_filter">
|
||||
<option value="">{{__("All")}}</option>
|
||||
@foreach($items as $item)
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table-light table-striped" aria-describedby="mydesc"
|
||||
id="table_list" data-toggle="table" data-url="{{ route('report-reasons.user-reports.show') }}"
|
||||
data-click-to-select="true" data-responsive="true" data-side-pagination="server"
|
||||
data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]"
|
||||
data-search="true" data-show-columns="true"
|
||||
data-show-refresh="true" data-fixed-columns="true" data-fixed-number="1"
|
||||
data-fixed-right-number="1" data-trim-on-search="false" data-sort-name="id"
|
||||
data-sort-order="desc" data-pagination-successively-size="3" data-query-params="queryParams"
|
||||
data-escape="true"
|
||||
data-show-export="true" data-export-options='{"fileName": "advertisement-package-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true" data-filter-control="true" data-filter-control-container="#filters" data-toolbar="#filters">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="reason" data-align="center" data-formatter="descriptionFormatter">{{ __('Reason') }}</th>
|
||||
<th scope="col" data-field="user.name" data-sort-name="user_name" data-align="center" data-sortable="true">{{ __('User') }}</th>
|
||||
<th scope="col" data-field="item.name" data-sort-name="item_name" data-align="center" data-sortable="true">{{ __('Advertisement') }}</th>
|
||||
<th scope="col" data-field="item.image" data-align="center" data-sortable="false" data-formatter="imageFormatter">{{ __('Advertisement Image') }}</th>
|
||||
<th scope="col" data-field="item_id" data-align="center" data-sortable="true" data-visible="false" data-filter-control="select" data-filter-data="">{{ __('Advertisement ID') }}</th>
|
||||
<th scope="col" data-field="user_id" data-align="center" data-sortable="true" data-visible="false" data-filter-control="select" data-filter-data="">{{ __('User ID') }}</th>
|
||||
<th scope="col" data-field="item_status" data-visible="true" data-formatter="itemStatusSwitchFormatter">{{ __('Advertisement Status') }}</th>
|
||||
<th scope="col" data-field="user_status" data-visible="true" data-formatter="userStatusSwitchFormatter">{{ __('User status') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
||||
85
resources/views/roles/create.blade.php
Normal file
85
resources/views/roles/create.blade.php
Normal file
@@ -0,0 +1,85 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Create New Role') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="content-wrapper">
|
||||
<div class="page-header">
|
||||
<h3 class="page-title">
|
||||
{{ __('Create New Role') }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="row grid-margin">
|
||||
<div class="col-lg-12">
|
||||
<div class="mb-2">
|
||||
<a class="btn btn-primary" href="{{ route('roles.index') }}"> {{ __('Back') }}</a>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{!! Form::open(['route' => 'roles.store', 'method' => 'POST','class'=>'create-form','data-success-function'=>'successFunction']) !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<label>{{ __('Name') }} <span class="text-danger">*</span></label>
|
||||
{!! Form::text('name', null, ['placeholder' => __('Name'), 'class' => 'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div id="permission-list">
|
||||
|
||||
</div>
|
||||
<div class="permission-tree ms-5 my-3">
|
||||
<ul>
|
||||
@foreach ($groupedPermissions as $groupName => $groupData)
|
||||
<li data-jstree='{"opened":true}'>
|
||||
{{ __(ucwords(str_replace("-", " ", $groupName))) }}
|
||||
@foreach ($groupData as $permission)
|
||||
<ul>
|
||||
<li id="{{$permission->id}}"
|
||||
data-name="{{$permission->name}}"
|
||||
data-jstree='{"icon":"fa fa-user-cog"}'>
|
||||
{{ __(ucfirst($permission->short_name)) }}
|
||||
</li>
|
||||
</ul>
|
||||
@endforeach
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{-- <div class="col-xs-12 col-sm-12 col-md-12">--}}
|
||||
{{-- <label><strong>{{ __('permission') }}:</strong></label>--}}
|
||||
{{-- <div class="row">--}}
|
||||
{{-- @foreach ($groupedPermissions as $group)--}}
|
||||
{{-- <div class="form-group col-lg-3 col-sm-12 col-xs-12 col-md-3">--}}
|
||||
{{-- <div class="form-check">--}}
|
||||
{{-- <label class="form-check-label">--}}
|
||||
{{-- {{ Form::checkbox('permission[]', $value->id, false, ['class' => 'name form-check-input']) }}--}}
|
||||
{{-- {{ $value->name }}--}}
|
||||
{{-- </label>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- @endforeach--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<button type="submit" class="btn btn-primary">{{ __('Submit') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('js')
|
||||
<script>
|
||||
function successFunction() {
|
||||
$('.permission-tree').jstree(true).deselect_all();
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
77
resources/views/roles/edit.blade.php
Normal file
77
resources/views/roles/edit.blade.php
Normal file
@@ -0,0 +1,77 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Manage Role') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="content-wrapper">
|
||||
<div class="page-header">
|
||||
<h3 class="page-title">
|
||||
{{ __('Manage Role') }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="row grid-margin">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-end">
|
||||
<a class="btn btn-primary" href="{{ route('roles.index') }}">{{ __('Back') }}</a>
|
||||
</div>
|
||||
{!! Form::model($role, ['method' => 'PATCH', 'class' => 'edit-form', 'route' => ['roles.update', $role->id]]) !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<label><strong> {{ __('Name') }}:</strong></label>
|
||||
{!! Form::text('name', null, ['placeholder' => __('Name'), 'class' => 'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div id="permission-list"></div>
|
||||
<div class="permission-tree ms-5 my-3">
|
||||
<ul>
|
||||
@foreach ($groupedPermissions as $groupName => $groupData)
|
||||
<li data-jstree='{"opened":true}'>
|
||||
{{ __(ucwords(str_replace("-", " ", $groupName))) }}
|
||||
@foreach ($groupData as $permission)
|
||||
<ul>
|
||||
<li id="{{ $permission->id }}"
|
||||
data-name="{{ $permission->name }}"
|
||||
data-jstree='{
|
||||
"icon":"fa fa-user-cog",
|
||||
"selected": {{ in_array($permission->id, $rolePermissions) ? 'true' : 'false' }},
|
||||
"expand_selected_onload": true
|
||||
}'>
|
||||
{{ __(ucfirst($permission->short_name)) }}
|
||||
</li>
|
||||
</ul>
|
||||
@endforeach
|
||||
</li>
|
||||
@endforeach
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{-- <div class="col-xs-12 col-sm-12 col-md-12">--}}
|
||||
{{-- <div class="row">--}}
|
||||
{{-- @foreach ($permission as $value)--}}
|
||||
{{-- <div class="form-group col-lg-3 col-sm-12 col-xs-12 col-md-3">--}}
|
||||
{{-- <div class="form-check">--}}
|
||||
{{-- <label class="form-check-label">--}}
|
||||
{{-- {{ Form::checkbox('permission[]', $value->id, in_array($value->id, $rolePermissions), ['class' => 'name form-check-input']) }}--}}
|
||||
{{-- {{ $value->name }}--}}
|
||||
{{-- </label>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- @endforeach--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<button type="submit" class="btn btn-primary"> {{ __('Submit') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
53
resources/views/roles/index.blade.php
Normal file
53
resources/views/roles/index.blade.php
Normal file
@@ -0,0 +1,53 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{__('Role Management')}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content-wrapper">
|
||||
<div class="page-header">
|
||||
<h3 class="page-title">
|
||||
{{__('Role Management')}}
|
||||
</h3>
|
||||
@can('role-create')
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('roles.create') }}"> {{ __('Create New Role') }}</a>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
@can('role-list')
|
||||
<div class="row grid-margin">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<table aria-describedby="mydesc" class='table' id='table_list' data-toggle="table"
|
||||
data-url="{{ route('roles.list') }}" data-click-to-select="true" data-side-pagination="server"
|
||||
data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="2" data-fixed-right-number="1" data-trim-on-search="false"
|
||||
data-mobile-responsive="true" data-sort-name="id" data-toolbar="#toolbar" data-sort-order="desc"
|
||||
data-maintain-selected="true" data-export-data-type='all'
|
||||
data-escape="true"
|
||||
data-export-options='{ "fileName": "roles-list-<?= date('d-m-y') ?>" ,"ignoreColumn":["operate"]}'
|
||||
data-show-export="true" data-query-params="queryParams" data-escape="true"
|
||||
data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true" data-visible="false">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="no">{{ __('No.') }}</th>
|
||||
<th scope="col" data-field="name" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="operate" data-escape="false" data-escape="false">{{ __('Action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
46
resources/views/roles/show.blade.php
Normal file
46
resources/views/roles/show.blade.php
Normal file
@@ -0,0 +1,46 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{__('Show Role')}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content-wrapper">
|
||||
<div class="page-header">
|
||||
<h3 class="page-title">
|
||||
{{__('Show Role')}}
|
||||
</h3>
|
||||
<a class="btn btn-primary mb-2" href="{{ route('roles.index') }}">{{__('Back')}}</a>
|
||||
</div>
|
||||
<div class="row grid-margin">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<strong>{{__('Name')}}:</strong>
|
||||
{{ $role->name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="row">
|
||||
@foreach($formattedPermissions as $perm)
|
||||
<div class="col-lg-3 col-sm-12 col-xs-12 col-md-3">
|
||||
<label class="label label-success">
|
||||
{{ __(ucfirst($perm['group'])) }} - {{ __(ucfirst($perm['action'])) }}
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
157
resources/views/seller-verification/create.blade.php
Normal file
157
resources/views/seller-verification/create.blade.php
Normal file
@@ -0,0 +1,157 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{__("Seller Verifications")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form action="{{ route('seller-verification.store') }}" method="POST" class="create-form" data-success-function="afterCustomFieldCreation" data-parsley-validate enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Create Seller Verification")}}</div>
|
||||
<div class="card-body mt-2">
|
||||
<ul class="nav nav-tabs" id="langTabs" role="tablist">
|
||||
@foreach($languages as $key => $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link @if($key == 0) active @endif" id="tab-{{ $lang->id }}" data-bs-toggle="tab" data-bs-target="#lang-{{ $lang->id }}" type="button" role="tab">
|
||||
{{ $lang->name }}
|
||||
</button>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $key => $lang)
|
||||
<div class="tab-pane fade @if($key == 0) show active @endif" id="lang-{{ $lang->id }}" role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Field Name') }} ({{ $lang->name }})</label>
|
||||
<input type="text" name="name[{{ $lang->id }}]" class="form-control" @if($lang->id != 1) required @endif>
|
||||
</div>
|
||||
|
||||
@if($lang->id == 1)
|
||||
{{-- Show type only in English --}}
|
||||
<div class="form-group">
|
||||
<label>{{ __('Field Type') }}</label>
|
||||
<select name="type" class="form-control" required>
|
||||
<option value="number">{{__("Number Input")}}</option>
|
||||
<option value="textbox">{{__("Text Input")}}</option>
|
||||
<option value="fileinput">{{__("File Input")}}</option>
|
||||
<option value="radio">{{__("Radio")}}</option>
|
||||
<option value="dropdown">{{__("Dropdown")}}</option>
|
||||
<option value="checkbox">{{__("Checkboxes")}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{-- Min/Max Fields --}}
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group min-max-fields">
|
||||
<label>{{ __('Field Length (Min)') }}</label>
|
||||
<input type="number" name="min_length" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6 form-group min-max-fields">
|
||||
<label>{{ __('Field Length (Max)') }}</label>
|
||||
<input type="number" name="max_length" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-info mt-2">
|
||||
{{ __('Field type, min/max length, required and status can only be set in English.') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Field Values (only for dropdown, radio, checkbox) --}}
|
||||
<div class="form-group">
|
||||
<label>{{ __('Field Values') }} ({{ $lang->name }})</label>
|
||||
<select name="values[{{ $lang->id }}][]" data-tags="true" data-placeholder="{{__("Select an option")}}" data-allow-clear="true" class="select2 w-100 full-width-select2" multiple="multiple" @if($lang->id == 1) required @endif></select>
|
||||
@if($lang->id != 1)
|
||||
<small class="text-muted">{{ __('This will be used for translatable field types only.') }}</small>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group mandatory">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="is_required" id="required" value="0">
|
||||
<input class="form-check-input status-switch" type="checkbox" role="switch" aria-label="required">{{ __('Required') }}
|
||||
<label class="form-check-label" for="required"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group mandatory">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="status" id="status" value="1">
|
||||
<input class="form-check-input status-switch" type="checkbox" role="switch" aria-label="status" checked>{{ __('Active') }}
|
||||
<label class="form-check-label" for="status"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<input type="submit" class="btn btn-primary" value="{{__("Save and Back")}}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
function updateVerificationFieldUI() {
|
||||
const type = $('select[name="type"]').val();
|
||||
const valuesTypes = ['radio', 'dropdown', 'checkbox'];
|
||||
|
||||
// Loop through each language tab
|
||||
$('.tab-pane').each(function () {
|
||||
const $tab = $(this);
|
||||
const langId = $tab.attr('id').replace('lang-', '');
|
||||
|
||||
const $fieldValues = $tab.find('select[name^="values"]')
|
||||
.closest('.form-group');
|
||||
|
||||
const $minMaxGroup = $tab.find('.min-max-fields');
|
||||
|
||||
if (valuesTypes.includes(type)) {
|
||||
$fieldValues.show();
|
||||
$minMaxGroup.hide();
|
||||
} else if (type === 'fileinput') {
|
||||
$fieldValues.hide();
|
||||
$minMaxGroup.hide();
|
||||
} else {
|
||||
$fieldValues.hide();
|
||||
$minMaxGroup.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
updateVerificationFieldUI(); // Run on load
|
||||
|
||||
$(document).on('change', 'select[name="type"]', function () {
|
||||
updateVerificationFieldUI(); // Run on change
|
||||
});
|
||||
});
|
||||
|
||||
function afterCustomFieldCreation() {
|
||||
setTimeout(function () {
|
||||
window.location.href = "{{route('seller-verification.verification-field')}}";
|
||||
}, 1000)
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
311
resources/views/seller-verification/edit.blade.php
Normal file
311
resources/views/seller-verification/edit.blade.php
Normal file
@@ -0,0 +1,311 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{__("Seller Verifications")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary" href="{{ route('seller-verification.verification-field') }}">< {{__("Back to Verification Fields")}} </a>
|
||||
@if(in_array($verification_field->type,['radio','checkbox','dropdown']))
|
||||
<a class="btn btn-primary" data-bs-toggle="modal" data-bs-target='#addModal'>+ {{__("Add Options")}}</a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="row">
|
||||
<form action="{{ route('seller-verification.update', $verification_field->id) }}" method="POST" data-success-function="afterCustomFieldCreation" enctype="multipart/form-data" class="edit-form">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{__("Verification Field")}}</div>
|
||||
<div class="card-body mt-3">
|
||||
{{-- <div class="col-md-12 form-group mandatory">
|
||||
<label for="name" class="mandatory form-label">{{ __('Field Name') }}</label>
|
||||
<input type="text" name="name" id="name" class="form-control" data-parsley-required="true" value="{{ $verification_field->name }}">
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="type" class="mandatory form-label">{{ __('Field Type') }}</label>
|
||||
<select name="type" id="type" class="form-select form-control">
|
||||
<option value="{{ $verification_field->type }}" selected>{{ ucfirst($verification_field->type) }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@if(in_array($verification_field->type,['radio','checkbox','dropdown']))
|
||||
<div class="col-md-12">
|
||||
<label for="values" class="form-label">{{ __('Field Values') }}</label>
|
||||
<div class="form-group">
|
||||
<select id="values" name="values[]" data-tags="true" data-placeholder="{{__("Select an option")}}" data-allow-clear="true" class="select2 col-12 w-100" multiple="multiple">
|
||||
@foreach ($verification_field->values as $value)
|
||||
<option value="{{ $value }}" selected>{{ $value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="input_hint">{{__("This will be applied only for")}}:
|
||||
<text class="highlighted_text">{{__("Checkboxes").",".__("Radio")}}</text>
|
||||
and
|
||||
<text class="highlighted_text"> {{__("Dropdown")}}</text>
|
||||
.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(in_array($verification_field->type,['textbox','fileinput','number']))
|
||||
<div class="col-md-6 form-group ">
|
||||
<label for="min_length" class=" form-label">{{ __('Field Length (Min)') }}</label>
|
||||
<input type="text" name="min_length" id="min_length" class="form-control" value="{{ $verification_field->min_length }}">
|
||||
<div class="input_hint"> {{__("This will be applied only for")}}:
|
||||
<text class="highlighted_text">{{__("text").",".__("number")}}</text>
|
||||
{{__("and")}}
|
||||
<text class="highlighted_text"> {{__("textarea")}}</text>
|
||||
.
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group ">
|
||||
<label for="max_length" class=" form-label">{{ __('Field Length (Max)') }}</label>
|
||||
<input type="text" name="max_length" id="max_length" class="form-control" value="{{ $verification_field->max_length }}">
|
||||
<div class="input_hint"> {{__("This will be applied only for")}}:
|
||||
<text class="highlighted_text">{{__("text").",".__("number")}}</text>
|
||||
{{__("and")}}
|
||||
<text class="highlighted_text"> {{__("textarea")}}</text>
|
||||
</div>
|
||||
</div>
|
||||
@endif --}}
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
@foreach($languages as $key => $lang)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if($key == 0) active @endif"
|
||||
data-bs-toggle="tab"
|
||||
href="#lang-{{ $lang->id }}">{{ $lang->name }}</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $key => $lang)
|
||||
@php
|
||||
$translated = $verification_field->translations->firstWhere('language_id', $lang->id);
|
||||
$isEnglish = $lang->id == 1;
|
||||
@endphp
|
||||
<div class="tab-pane fade @if($key == 0) show active @endif" id="lang-{{ $lang->id }}" role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
|
||||
{{-- Field Name --}}
|
||||
<div class="form-group mb-3">
|
||||
<label>{{ __('Field Name') }} ({{ $lang->name }})</label>
|
||||
<input type="text"
|
||||
name="name[{{ $lang->id }}]"
|
||||
class="form-control"
|
||||
value="{{ $isEnglish ? $verification_field->name : ($translated->name ?? '') }}"
|
||||
@if($isEnglish) required @endif>
|
||||
</div>
|
||||
|
||||
@if($isEnglish)
|
||||
{{-- Field Type --}}
|
||||
<div class="form-group mb-3">
|
||||
<label>{{ __('Field Type') }}</label>
|
||||
<select name="type" id="type" class="form-control" required>
|
||||
<option value="{{ $verification_field->type }}" selected>{{ ucfirst($verification_field->type) }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{-- Min/Max fields --}}
|
||||
<div class="row min-max-fields">
|
||||
<div class="col-md-6">
|
||||
<label>{{ __('Field Length (Min)') }}</label>
|
||||
<input type="number" name="min_length" class="form-control" value="{{ $verification_field->min_length }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>{{ __('Field Length (Max)') }}</label>
|
||||
<input type="number" name="max_length" class="form-control" value="{{ $verification_field->max_length }}">
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-info">
|
||||
{{ __('Field type, min/max length, required and status can only be set in English.') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Field Values --}}
|
||||
@php
|
||||
$values = $isEnglish
|
||||
? ($verification_field->values ?? [])
|
||||
: ($translated->value ?? []) ?? [];
|
||||
@endphp
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('Field Values111') }} ({{ $lang->name }})</label>
|
||||
<select name="values[{{ $lang->id }}][]" data-tags="true" class="form-control select2" multiple>
|
||||
@foreach($values as $val)
|
||||
<option value="{{ $val }}" selected>{{ $val }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@if(!$isEnglish)
|
||||
<small class="text-muted">{{ __('Used for translatable fields like dropdown, radio, checkbox.') }}</small>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group mandatory">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="is_required" id="required" value="{{ $verification_field->is_required ? '1' : '0' }}">
|
||||
<input class="form-check-input status-switch" type="checkbox" role="switch" aria-label="required" {{ $verification_field->is_required ? 'checked' : '' }}>{{ __('Required') }}
|
||||
<label class="form-check-label" for="required"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group mandatory">
|
||||
<div class="form-check form-switch">
|
||||
|
||||
<input type="hidden" name="status" id="status" value="{{ $verification_field->deleted_at ? '0' : '1' }}">
|
||||
|
||||
<input class="form-check-input status-switch" type="checkbox" role="switch" aria-label="status"
|
||||
{{ $verification_field->deleted_at ? '' : 'checked' }}>
|
||||
{{ __('Active') }}
|
||||
<label class="form-check-label" for="status"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 text-end mb-3">
|
||||
<input type="submit" class="btn btn-primary" value="{{__("Save and Back")}}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@if(in_array($verification_field->type,['radio','checkbox','dropdown']))
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<table class="table table-borderless table-striped" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('seller-verification.value.show', $verification_field->id) }}"
|
||||
data-click-to-select="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true" data-search-align="right"
|
||||
data-toolbar="#toolbar" data-show-columns="true" data-show-refresh="true"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="id"
|
||||
data-escape="true"
|
||||
data-sort-order="desc" data-query-params="queryParams"
|
||||
data-use-row-attr-func="true" data-mobile-responsive="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="value" data-align="center" data-sortable="true">{{ __('Value') }}</th>
|
||||
<th scope="col" data-field="operate" data-escape="false" data-align="center" data-sortable="false" data-events="verificationFieldValueEvents">{{ __('Action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
{{-- add modal --}}
|
||||
@if(in_array($verification_field->type,['radio','checkbox','dropdown']))
|
||||
<div id="addModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Add Values') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('seller-verification.value.add',$verification_field->id) }}" class="create-form form-horizontal" enctype="multipart/form-data" method="POST" data-parsley-validate>
|
||||
@csrf
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="values" class="mandatory form-label">{{ __('Field Values') }}</label>
|
||||
<input type="text" name="values" id="values" class="form-control" value="{{ old('values') }}" data-parsley-required="true">
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="field_id" id="field_id" value="{{ $verification_field->id }}">
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary waves-effect" data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
{{-- edit modal --}}
|
||||
<div id="editModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Edit Verfication Field Values') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('seller-verification.value.update',$verification_field->id) }}" class="edit-form form-horizontal" enctype="multipart/form-data" method="POST" data-parsley-validate>
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<input type="hidden" name="old_verification_field_value" id="old_verification_field_value"/>
|
||||
<div class="col-md-12 form-group mandatory">
|
||||
<label for="new_verification_field_value" class="mandatory form-label">{{ __('Name') }}</label>
|
||||
<input type="text" name="new_verification_field_value" id="new_verification_field_value" class="form-control" value="" data-parsley-required="true">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary waves-effect" data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
function updateVerificationFieldUI() {
|
||||
const type = $('select[name="type"]').val();
|
||||
const valuesTypes = ['radio', 'dropdown', 'checkbox'];
|
||||
|
||||
$('.tab-pane').each(function () {
|
||||
const $tab = $(this);
|
||||
const $fieldValues = $tab.find('select[name^="values"]').closest('.form-group');
|
||||
const $minMaxGroup = $tab.find('.min-max-fields');
|
||||
|
||||
if (valuesTypes.includes(type)) {
|
||||
$fieldValues.show();
|
||||
$minMaxGroup.hide();
|
||||
} else if (type === 'fileinput') {
|
||||
$fieldValues.hide();
|
||||
$minMaxGroup.hide();
|
||||
} else {
|
||||
$fieldValues.hide();
|
||||
$minMaxGroup.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
updateVerificationFieldUI();
|
||||
$('select[name="type"]').on('change', updateVerificationFieldUI);
|
||||
});
|
||||
|
||||
function afterCustomFieldCreation() {
|
||||
setTimeout(function () {
|
||||
window.location.href = "{{route('seller-verification.verification-field')}}";
|
||||
}, 1000)
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
84
resources/views/seller-verification/index.blade.php
Normal file
84
resources/views/seller-verification/index.blade.php
Normal file
@@ -0,0 +1,84 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Seller Verification")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4 class="mb-0">@yield('title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="stable-borderless table-striped" aria-describedby="mydesc" id="table_list" data-toggle="table" data-url="{{ route('verification_requests.show') }}" data-click-to-select="true" data-side-pagination="server" data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true" data-search-align="right" data-toolbar="#filters" data-show-columns="true" data-show-refresh="true" data-fixed-columns="true" data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false" data-responsive="true" data-sort-name="id" data-sort-order="desc" data-pagination-successively-size="3" data-escape="true" data-show-export="true" data-export-options='{"fileName": "verification_requests-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']" data-mobile-responsive="true" data-filter-control="true" data-filter-control-container="#filters">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="user_name" data-align="center" data-sortable="true">{{ __('User') }}</th>
|
||||
<th scope="col" data-field="status" data-align="center" data-sortable="true" data-filter-control="select" data-formatter="sellerverificationStatusFormatter">{{ __('Status') }}</th>
|
||||
@canany(['seller-verification-request-update'])
|
||||
<th scope="col" data-field="operate" data-align="center" data-sortable="false" data-escape="false" data-events="verificationEvents">{{ __('Action') }}</th>
|
||||
@endcanany
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="editStatusModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Status') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="edit-form" action="" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<select name="status" class="form-select" id="verification_status" aria-label="status">
|
||||
<option value="pending">{{ __("Pending") }}</option>
|
||||
<option value="approved">{{ __("Approved") }}</option>
|
||||
<option value="rejected">{{ __("Rejected") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group " id="rejectionReasonField" style="display: none;">
|
||||
<label for="rejection_reason">{{ __("Rejection Reason") }} </label><span class="text-danger">*</span>
|
||||
<textarea id="rejection_reason" name="rejection_reason" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" value="{{ __("Save") }}" class="btn btn-primary mt-3">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<div id="editModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Verification Details') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="center" id="verification_fields"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
|
||||
</section>
|
||||
@endsection
|
||||
@@ -0,0 +1,56 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{__("Verification Fields")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4 class="mb-0">@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 text-end">
|
||||
@can('custom-field-create')
|
||||
<a href="{{ route('seller-verification.create') }}" class="btn btn-primary mb-0">+ {{__("Create Verification Field")}} </a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="stable-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('verification-field.show') }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]"
|
||||
data-search="true" data-search-align="right" data-toolbar="#filters" data-show-columns="true"
|
||||
data-show-refresh="true" data-fixed-columns="true" data-fixed-number="1" data-fixed-right-number="1"
|
||||
data-trim-on-search="false" data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3" data-escape="true"
|
||||
data-show-export="true" data-export-options='{"fileName": "verification-fields-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true" data-filter-control="true" data-filter-control-container="#filters">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-align="center" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="name" data-align="center" data-sortable="true">{{ __('Name') }}</th>
|
||||
<th scope="col" data-field="min_length" data-align="center" data-sortable="true">{{ __('Min Length') }}</th>
|
||||
<th scope="col" data-field="max_length" data-align="center" data-sortable="true">{{ __('Max Length') }}</th>
|
||||
<th scope="col" data-field="values" data-align="center" data-sortable="true" data-formatter="rejectedReasonFormatter">{{ __('Values') }}</th>
|
||||
{{-- <th scope="col" data-field="status" data-align="center" data-sortable="true" data-filter-control="select" data-formatter="sellerverificationStatusFormatter">{{ __('Status') }}</th> --}}
|
||||
@canany(['seller-verification-field-update','seller-verification-field-delete'])
|
||||
<th scope="col" data-field="operate" data-align="center" data-sortable="false" data-escape="false" data-events="verificationfeildEvents">{{ __('Action') }}</th>
|
||||
@endcanany
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
52
resources/views/seller_review/index.blade.php
Normal file
52
resources/views/seller_review/index.blade.php
Normal file
@@ -0,0 +1,52 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Seller Reviews') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('seller-review.show',1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false"
|
||||
data-escape="true"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3" data-table="seller_ratings" data-status-column="deleted_at"
|
||||
data-show-export="true" data-export-options='{"fileName": "seller-review-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true" data-filter-control="true">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="seller_name" data-sortable="false">{{ __('Seller Name') }}</th>
|
||||
<th scope="col" data-field="buyer_name" data-align="center" data-sortable="false">{{ __('Buyer Name') }}</th>
|
||||
<th scope="col" data-field="item_name" data-sortable="false">{{ __('Advertisement') }}</th>
|
||||
<th scope="col" data-field="ratings" data-visible="true" data-Formatter="ratingFormatter">{{ __('Ratings') }}</th>
|
||||
<th scope="col" data-field="review" data-sortable="true" data-formatter="descriptionFormatter">{{ __('Review') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
103
resources/views/seller_review/report.blade.php
Normal file
103
resources/views/seller_review/report.blade.php
Normal file
@@ -0,0 +1,103 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Seller Review Reports') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
{{-- <div id="filters">
|
||||
<label for="filter">{{__("Status")}}</label>
|
||||
<select class="form-control bootstrap-table-filter-control-report-status" id="filter">
|
||||
<option value="">{{__("All")}}</option>
|
||||
<option value="reported">{{__("Reported")}}</option>
|
||||
<option value="approved">{{__("Approved")}}</option>
|
||||
<option value="rejected">{{__("Rejected")}}</option>
|
||||
</select>
|
||||
</div> --}}
|
||||
<table class="table-borderless table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('seller-review.report',1) }}" data-click-to-select="true"
|
||||
data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true"
|
||||
data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false"
|
||||
data-escape="true"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3" data-table="seller_ratings" data-status-column="deleted_at"
|
||||
data-show-export="true" data-export-options='{"fileName": "seller-review-report-list","ignoreColumn": ["operate"]}' data-export-types="['pdf','json', 'xml', 'csv', 'txt', 'sql', 'doc', 'excel']"
|
||||
data-mobile-responsive="true" data-filter-control="true" data-filter-control-container="#filters" data-toolbar="#filters">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}</th>
|
||||
<th scope="col" data-field="seller_name" data-sortable="false">{{ __('Seller Name') }}</th>
|
||||
<th scope="col" data-field="buyer_name" data-align="center" data-sortable="false">{{ __('Buyer Name') }}</th>
|
||||
<th scope="col" data-field="item_name" data-sortable="false">{{ __('Advertisement') }}</th>
|
||||
<th scope="col" data-field="ratings" data-visible="true" data-Formatter="ratingFormatter">{{ __('Ratings') }}</th>
|
||||
<th scope="col" data-field="review" data-sortable="false" data-formatter="descriptionFormatter">{{ __('Review') }}</th>
|
||||
<th scope="col" data-field="report_status" data-sortable="true" data-filter-control="select" data-filter-data="" data-formatter="reportStatusFormatter">{{ __('Report Status') }}</th>
|
||||
<th scope="col" data-field="report_reason" data-sortable="false">{{ __('Report Reason') }}</th>
|
||||
<th scope="col" data-field="report_rejected_reason" data-sortable="false">{{ __('Report Rejection Reason') }}</th>
|
||||
@canany(['item-update','item-delete'])
|
||||
<th scope="col" data-field="operate" data-align="center" data-sortable="false" data-events="reviewReportEvents" data-escape="false">{{ __('Action') }}</th>
|
||||
@endcanany
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="editStatusModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Status') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="edit-form" action="" method="POST" data-success-function="updateApprovalSuccess">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<select name="report_status" class="form-select" id="report_status" aria-label="status">
|
||||
<option value="approved">{{__("Approve")}}</option>
|
||||
<option value="rejected">{{__("Reject")}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="report_rejected_reason_container" class="col-md-12" style="display: none;">
|
||||
<label for="rejected_reason" class="mandatory form-label">{{ __('Reason') }}</label>
|
||||
<textarea name="report_rejected_reason" id="report_rejected_reason" class="form-control" placeholder={{ __('Reason') }}></textarea>
|
||||
</div>
|
||||
<input type="submit" value="{{__("Save")}}" class="btn btn-primary mt-3">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
function updateApprovalSuccess() {
|
||||
$('#editStatusModal').modal('hide');
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
82
resources/views/settings/about-us.blade.php
Normal file
82
resources/views/settings/about-us.blade.php
Normal file
@@ -0,0 +1,82 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('About Us') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('content')
|
||||
<section class="section">
|
||||
|
||||
<div class="card">
|
||||
<form action="{{ route('settings.store') }}" method="post" class="create-form-without-reset">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-tabs" id="languageTabs" role="tablist">
|
||||
@foreach ($languages as $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link {{ $loop->first ? 'active' : '' }}" id="tab-{{ $lang->id }}"
|
||||
data-bs-toggle="tab" href="#lang-{{ $lang->id }}" role="tab">
|
||||
{{ $lang->name }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach ($languages as $lang)
|
||||
<div class="tab-pane fade {{ $loop->first ? 'show active' : '' }}" id="lang-{{ $lang->id }}"
|
||||
role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
<div class="form-group">
|
||||
<label>{{ __('About Us') }} ({{ $lang->name }})</label>
|
||||
<textarea name="about_us[{{ $lang->id }}]" id="tinymce_editor_{{ $lang->id }}"
|
||||
class="tinymce_editor form-control" rows="6">{{ old("about_us.$lang->id", $translations['about_us'][$lang->id] ?? ($settings['about_us'] ?? '')) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="col-12 mt-3 d-flex justify-content-end">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor',
|
||||
height: 400,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist autolink lists link charmap preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
'insertdatetime table paste code help wordcount'
|
||||
],
|
||||
toolbar: 'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | removeformat | code',
|
||||
setup: function(editor) {
|
||||
editor.on("change keyup", function() {
|
||||
editor.save();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
117
resources/views/settings/admob.blade.php
Normal file
117
resources/views/settings/admob.blade.php
Normal file
@@ -0,0 +1,117 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Admob')." ".__("Settings")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form class="create-form-without-reset" action="{{ route('settings.store') }}" method="post" enctype="multipart/form-data">
|
||||
<div class="row d-flex mb-3">
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('Banner Ad') }}</h6>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-3">
|
||||
<label for="banner_ad_id_android" class="col-sm-12 form-check-label mt-2">{{ __('Banner Ad Id Android') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="banner_ad_id_android" name="banner_ad_id_android" type="text" class="form-control" placeholder="{{ __('Banner Ad Id Android') }}" value="{{ $settings['banner_ad_id_android'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="banner_ad_id_ios" class="col-sm-12 form-check-label mt-2">{{ __('Banner Ad Id IOS') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="banner_ad_id_ios" name="banner_ad_id_ios" type="text" class="form-control" placeholder="{{ __('Banner Ad Id IOS') }}" value="{{ $settings['banner_ad_id_ios'] ?? '' }}">
|
||||
</div>
|
||||
<label class="col-sm-12 form-check-label mt-2" id='banner_ad_status'>{{__("Status")}}</label>
|
||||
<div class="col-sm-2 col-md-12 col-xs-12 mt-2">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="banner_ad_status" id="banner_ad_status" value="{{ $settings['banner_ad_status'] ?? 0 }}">
|
||||
<input class="form-check-input switch-input status-switch" type="checkbox" role="switch" {{ isset($settings['banner_ad_status']) && $settings['banner_ad_status'] == '1' ? 'checked' : '' }} id="switch_banner_ad_status" aria-label="switch_banner_ad_status">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('Interstitial Ad') }}</h6>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-3">
|
||||
<label for="interstitial_ad_id_android" class="col-sm-12 form-check-label mt-2">{{ __('Interstitial Ad Id Android') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="interstitial_ad_id_android" name="interstitial_ad_id_android" type="text" class="form-control" placeholder="{{ __('Interstitial Ad Id Android') }}" value="{{ $settings['interstitial_ad_id_android'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="interstitial_ad_id_ios" class="col-sm-12 form-check-label mt-2">{{ __('Interstitial Ad Id IOS') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="interstitial_ad_id_ios" name="interstitial_ad_id_ios" type="text" class="form-control" placeholder="{{ __('Interstitial Ad Id IOS') }}" value="{{ $settings['interstitial_ad_id_ios'] ?? '' }}">
|
||||
</div>
|
||||
<label class="col-sm-12 form-check-label mt-2" id='interstitial_ad_status'>{{__("Status")}}</label>
|
||||
<div class="col-sm-2 col-md-12 col-xs-12 mt-2">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="interstitial_ad_status" id="interstitial_ad_status" value="{{ $settings['interstitial_ad_status'] ?? 0 }}">
|
||||
<input class="form-check-input switch-input status-switch" type="checkbox" role="switch" {{ isset($settings['interstitial_ad_status']) && $settings['interstitial_ad_status'] == '1' ? 'checked' : '' }} id="switch_interstitial_ad_status" aria-label="switch_interstitial_ad_status">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('Native Ad') }}</h6>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-3">
|
||||
<label for="native _app_id_android" class="col-sm-12 form-check-label mt-2">{{ __('Native App Id Android') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="native_app_id_android" name="native_app_id_android" type="text" class="form-control" placeholder="{{ __('Native App Id Android') }}" value="{{ $settings['native_app_id_android'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="native _app_id_ios" class="col-sm-12 form-check-label mt-2">{{ __('Native App Id iOS') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="native_app_id_ios" name="native_app_id_ios" type="text" class="form-control" placeholder="{{ __('Native App Id iOS') }}" value="{{ $settings['native_app_id_ios'] ?? '' }}">
|
||||
</div>
|
||||
<label class="col-sm-12 form-check-label mt-2" id='native _ad_status'>{{__("Status")}}</label>
|
||||
<div class="col-sm-2 col-md-12 col-xs-12 mt-2">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="native_ad_status" id="native_ad_status" value="{{ $settings['native _ad_status'] ?? 0 }}">
|
||||
<input class="form-check-input switch-input status-switch" type="checkbox" role="switch" {{ isset($settings['native_ad_status']) && $settings['native_ad_status'] == '1' ? 'checked' : '' }} id="switch_native_ad_status" aria-label="switch_native_ad_status">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-primary me-1 mb-3">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
85
resources/views/settings/contact-us.blade.php
Normal file
85
resources/views/settings/contact-us.blade.php
Normal file
@@ -0,0 +1,85 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{ __('Contact Us') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<form action="{{ route('settings.store') }}" method="post" class="create-form-without-reset">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-tabs" id="languageTabs" role="tablist">
|
||||
@foreach($languages as $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link {{ $loop->first ? 'active' : '' }}"
|
||||
id="tab-{{ $lang->id }}"
|
||||
data-bs-toggle="tab"
|
||||
href="#lang-{{ $lang->id }}"
|
||||
role="tab">
|
||||
{{ $lang->name }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $lang)
|
||||
<div class="tab-pane fade {{ $loop->first ? 'show active' : '' }}"
|
||||
id="lang-{{ $lang->id }}"
|
||||
role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
<div class="form-group">
|
||||
<label>{{ __("Contact Us") }} ({{ $lang->name }})</label>
|
||||
<textarea name="contact_us[{{ $lang->id }}]"
|
||||
id="tinymce_editor_contact_{{ $lang->id }}"
|
||||
class="tinymce_editor form-control"
|
||||
rows="6">{{ old("contact_us.$lang->id", $translations['contact_us'][$lang->id] ?? ($settings['contact_us'] ?? '')) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="col-12 mt-3 d-flex justify-content-end">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor',
|
||||
height: 400,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist autolink lists link charmap preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
'insertdatetime table paste code help wordcount'
|
||||
],
|
||||
toolbar: 'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | removeformat | code',
|
||||
setup: function (editor) {
|
||||
editor.on("change keyup", function () {
|
||||
editor.save();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
109
resources/views/settings/default-currency.blade.php
Normal file
109
resources/views/settings/default-currency.blade.php
Normal file
@@ -0,0 +1,109 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Default Currency Settings') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form class="create-form-without-reset" action="{{ route('settings.store') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row d-flex mb-3">
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('Default Currency Settings') }}</h6>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12 mt-2">
|
||||
<label for="currency_iso_code" class="col-sm-12 form-check-label mt-2">{{ __('Default Currency ISO Code') }}</label>
|
||||
@if(count($currencies) > 0)
|
||||
<select name="currency_iso_code" id="currency_iso_code" class="form-select form-control-sm">
|
||||
@foreach($currencies as $currency)
|
||||
<option value="{{ $currency->iso_code }}" {{ (isset($settings['currency_iso_code']) && $settings['currency_iso_code'] == $currency->iso_code) ? 'selected' : '' }}>
|
||||
{{ $currency->iso_code }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
<input type="text" name="currency_iso_code" id="currency_iso_code" class="form-control"
|
||||
placeholder="e.g. USD" maxlength="3" required
|
||||
value="{{ $settings['currency_iso_code'] ?? '' }}"
|
||||
oninput="this.value = this.value.toUpperCase().replace(/[^A-Z]/g, '')">
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 mt-2">
|
||||
<label for="currency_symbol" class="col-sm-12 form-check-label mt-2">{{ __('Currency Symbol') }}</label>
|
||||
<input id="currency_symbol" name="currency_symbol" type="text" class="form-control" placeholder="{{ __('Currency Symbol') }}" value="{{ $settings['currency_symbol'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 mt-3">
|
||||
<label for="currency_symbol_position" class="col-sm-12 form-check-label mt-2">{{ __('Currency Symbol Position') }}</label>
|
||||
<div class="mt-2 d-flex align-items-center">
|
||||
<div class="form-check me-3">
|
||||
<input
|
||||
type="radio"
|
||||
id="currency_symbol_left"
|
||||
name="currency_symbol_position"
|
||||
value="left"
|
||||
class="form-check-input"
|
||||
{{ (isset($settings['currency_symbol_position']) && $settings['currency_symbol_position'] === 'left') ? 'checked' : '' }}
|
||||
>
|
||||
<label for="currency_symbol_left" class="form-check-label">{{ __('Left') }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input
|
||||
type="radio"
|
||||
id="currency_symbol_right"
|
||||
name="currency_symbol_position"
|
||||
value="right"
|
||||
class="form-check-input"
|
||||
{{ (isset($settings['currency_symbol_position']) && $settings['currency_symbol_position'] === 'right') ? 'checked' : '' }}
|
||||
>
|
||||
<label for="currency_symbol_right" class="form-check-label">{{ __('Right') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 mt-3">
|
||||
<label for="decimal_places" class="col-sm-12 form-check-label mt-2">{{ __('Decimal Places') }}</label>
|
||||
<input id="decimal_places" name="decimal_places" type="number" class="form-control" value="{{ $settings['decimal_places'] ?? 2 }}" min="0" max="6">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 mt-3">
|
||||
<label for="thousand_separator" class="col-sm-12 form-check-label mt-2">{{ __('Thousand Separator') }}</label>
|
||||
<input id="thousand_separator" name="thousand_separator" type="text" class="form-control" value="{{ $settings['thousand_separator'] ?? ',' }}" maxlength="1">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 mt-3">
|
||||
<label for="decimal_separator" class="col-sm-12 form-check-label mt-2">{{ __('Decimal Separator') }}</label>
|
||||
<input id="decimal_separator" name="decimal_separator" type="text" class="form-control" value="{{ $settings['decimal_separator'] ?? '.' }}" maxlength="1">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-12 d-flex justify-content-end mt-3">
|
||||
<button type="submit" class="btn btn-primary me-1 mb-3">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
74
resources/views/settings/dummy-data.blade.php
Normal file
74
resources/views/settings/dummy-data.blade.php
Normal file
@@ -0,0 +1,74 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Import Dummy Data') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<h5 class="alert-heading">
|
||||
<i class="fas fa-exclamation-triangle"></i> {{ __('Important Notice') }}
|
||||
</h5>
|
||||
<hr>
|
||||
<p class="mb-0">
|
||||
<strong>{{ __('Warning:') }}</strong>
|
||||
{{ __('This action will delete ALL categories and custom fields and insert fresh dummy data. This cannot be undone.') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info">
|
||||
<h6 class="alert-heading">
|
||||
<i class="fas fa-info-circle"></i> {{ __('Instructions:') }}
|
||||
</h6>
|
||||
<ol class="mb-0">
|
||||
<li>{{ __('Click the button below to import dummy data automatically.') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="mt-3 text-center">
|
||||
<button type="button" id="importDummyBtn" class="btn btn-danger btn-lg">
|
||||
<i class="fas fa-database"></i> {{ __('Import Dummy Data') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
@section('script')
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#importDummyBtn').on('click', function () {
|
||||
showSweetAlertForDataConfirmPopup(
|
||||
"{{ route('settings.dummy-data.import') }}",
|
||||
"POST",
|
||||
{
|
||||
text: "This action will delete ALL categories and custom fields and insert fresh dummy data. This cannot be undone.",
|
||||
confirmButtonText: "Yes, Delete & Import",
|
||||
data: {
|
||||
_token: "{{ csrf_token() }}"
|
||||
},
|
||||
successCallBack: function () {
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
86
resources/views/settings/file-manager.blade.php
Normal file
86
resources/views/settings/file-manager.blade.php
Normal file
@@ -0,0 +1,86 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('File Manager') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form class="create-form-without-reset" action="{{ route('settings.file-manager.store') }}" method="post" enctype="multipart/form-data">
|
||||
<div class="row d-flex mb-3">
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('File Manager Setting') }}</h6>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12 mt-2">
|
||||
<label for="file_manager" class="col-sm-12 form-check-label mt-2">{{ __('File Manager') }}</label>
|
||||
<select name="file_manager" id="file_manager" class="form-select form-control-sm">
|
||||
<option value="public">{{ __('Local Server') }}</option>
|
||||
<option value="s3">{{ __('AWS S3') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="s3_div" style="display: none">
|
||||
<label for="stripe_secret_key" class="col-sm-12 form-check-label mt-2">{{ __('AWS Access Key ID') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="stripe_secret_key" name="S3_aws_access_key_id" type="text" class="form-control" placeholder="{{ __('AWS Access Key ID') }}" value="{{ $settings['S3_aws_access_key_id'] ?? '' }}" >
|
||||
</div>
|
||||
|
||||
<label for="stripe_publishable_key" class="col-sm-12 form-check-label mt-2">{{ __('AWS Secret Access Key') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="AWS_SECRET_ACCESS_KEY" name="s3_aws_secret_access_key" type="text" class="form-control" placeholder="{{ __('AWS Secret Access Key') }}" value="{{ $settings['s3_aws_secret_access_key'] ?? '' }}" >
|
||||
</div>
|
||||
|
||||
<label for="stripe_webhook_secret" class="col-sm-12 form-check-label mt-2">{{ __('AWS Default Region') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="AWS_DEFAULT_REGION" name="s3_aws_default_region" type="text" class="form-control" placeholder="{{ __('AWS Default Region') }}" value="{{ $settings['s3_aws_default_region'] ?? '' }}" >
|
||||
</div>
|
||||
|
||||
<label for="stripe_webhook_url" class="col-sm-12 form-check-label mt-2">{{ __('AWS Bucket') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="AWS_BUCKET" name="s3_aws_bucket" type="text" class="form-control" placeholder="{{ __('AWS Bucket') }}" value="{{ $settings['s3_aws_default_region'] ?? '' }}" >
|
||||
</div>
|
||||
<label for="stripe_webhook_url" class="col-sm-12 form-check-label mt-2">{{ __('AWS URL') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="AWS_URL" name="s3_aws_url" type="text" class="form-control" placeholder="{{ __('AWS URL') }}" value="{{ $settings['s3_aws_url'] ?? '' }}" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-12 d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-primary me-1 mb-3">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{--Stripe Payment Gateway END--}}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
$('#file_manager').val("{{$settings['file_manager'] ?? ''}}").trigger("change");
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
73
resources/views/settings/firebase.blade.php
Normal file
73
resources/views/settings/firebase.blade.php
Normal file
@@ -0,0 +1,73 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{__("Firebase Settings")}}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<form class="create-form-without-reset" action="{{ route('settings.firebase.update') }}" method="POST">
|
||||
<div class="card-body">
|
||||
<div class="row mt-1">
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label for="apiKey" class="col-sm-2 col-form-label text-center">{{__("Api Key")}}</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="apiKey" type="text" class="form-control" placeholder="{{__("Api Key")}}" id="apiKey" value="{{ $settings['apiKey'] ?? '' }}" required="">
|
||||
</div>
|
||||
|
||||
<label for="authDomain" class="col-sm-2 col-form-label text-center">{{__("Auth Domain")}}</label>
|
||||
<div class="col-sm-4">
|
||||
<input required name="authDomain" type="text" class="form-control" placeholder="{{__("Auth Domain")}}" id="authDomain" value="{{ $settings['authDomain'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="projectId" class="col-sm-2 col-form-label text-center">{{__("Project Id")}}</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="projectId" type="text" class="form-control" placeholder="{{__("Project Id")}}" id="projectId" value="{{ $settings['projectId'] ?? '' }}" required="">
|
||||
</div>
|
||||
<label for="storageBucket" class="col-sm-2 col-form-label text-center">{{__("Storage Bucket")}}</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="storageBucket" type="text" class="form-control" id="storageBucket" placeholder="{{__("Storage Buckets")}}" value="{{ $settings['storageBucket'] ?? '' }}" required="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="messagingSenderId" class="col-sm-2 col-form-label text-center">{{__("Messaging Sender Id")}}</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="messagingSenderId" type="text" class="form-control" placeholder="{{__("Messaging Sender Id")}}" id="messagingSenderId" value="{{ $settings['messagingSenderId'] ?? '' }}" required="">
|
||||
</div>
|
||||
<label for="appId" class="col-sm-2 col-form-label text-center">{{__("App Id")}}</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="appId" id="appId" type="text" class="form-control" placeholder="{{__("App Id")}}" value="{{ $settings['appId'] ?? '' }}" required="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
|
||||
<label for="measurementId" class="col-sm-2 col-form-label text-center">{{__("Measurement Id")}}</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="measurementId" type="text" class="form-control" id="measurementId" placeholder="{{__("Measurement Id")}}" value="{{ $settings['measurementId'] ?? '' }}" required="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 d-flex justify-content-end">
|
||||
<button type="submit" value="btnAdd" class="btn btn-primary me-1 mb-1">{{__("Save")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
382
resources/views/settings/index.blade.php
Normal file
382
resources/views/settings/index.blade.php
Normal file
@@ -0,0 +1,382 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Settings') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.system') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<i class="fas fa-cogs text-dark icon_font_size "></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Settings') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.web-settings') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<i class="fas fa-cog text-dark icon_font_size "></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Web Settings') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.notification-setting') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<i class="fas fa-bell text-dark icon_font_size "></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Notification Settings') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.watermark-settings') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<i class="fas fa-solid fa-image text-dark icon_font_size "></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Watermark Settings') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.login-method') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<i class="fa fa-envelope text-dark icon_font_size"></i>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('OTP Provider Settings') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.dummy-data.index') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<i class="fas fa-database text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Import Dummy Data') }}</h5>
|
||||
<div class="">{{ __('Add dummy categories and custom fields') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.admob.index') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test ">
|
||||
<i class="fas fa-ad text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Admob') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.about-us.index') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test ">
|
||||
<i class="fas fa-info-circle text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('About Us') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.terms-conditions.index') }}" class="card setting_active_tab h-100"
|
||||
style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test ">
|
||||
<i class=" fas fa-file-contract text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Terms & Conditions') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.privacy-policy.index') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<i class=" fas fas fa-shield-alt text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Privacy Policy') }}</h5>
|
||||
<div class="{{ route('settings.privacy-policy.index') }}">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i></div>
|
||||
</div>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.refund-policy.index') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<i class=" fas fas fa-shield-alt text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Refund Policy') }}</h5>
|
||||
<div class="{{ route('settings.refund-policy.index') }}">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i></div>
|
||||
</div>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.contact-us.index') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<i class=" fas fas fa-address-book text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Contact Us') }}</h5>
|
||||
<div class="{{ route('settings.contact-us.index') }}">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i></div>
|
||||
</div>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- <div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">--}}
|
||||
{{-- <a href="{{ route('settings.firebase.index') }}" class="card setting_active_tab h-100"--}}
|
||||
{{-- style="text-decoration: none;">--}}
|
||||
{{-- <div class="content d-flex h-100">--}}
|
||||
{{-- <div class="row mx-2 ">--}}
|
||||
{{-- <div class="provider_a test ">--}}
|
||||
{{-- <i class=" fas fa-cloud text-dark icon_font_size"></i>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
|
||||
{{-- <div class="card-body">--}}
|
||||
{{-- <h5 class="title">{{ __('Firebase Settings') }}</h5>--}}
|
||||
{{-- <div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </a>--}}
|
||||
{{-- </div>--}}
|
||||
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.language.index') }}" class="card setting_active_tab h-100"
|
||||
style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test ">
|
||||
<i class=" fas fas fa-language text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Languages') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.payment-gateway.index') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test ">
|
||||
<i class="fas fa-dollar-sign text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Payment Gateways') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.system-status.index') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test ">
|
||||
<i class="fas fa-external-link-square-alt text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('System Status') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.seo-settings.index') }}" class="card setting_active_tab h-100"
|
||||
style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test ">
|
||||
<i class="fab fa-searchengin text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Seo-Settings') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.file-manager.index') }}" class="card setting_active_tab h-100"
|
||||
style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<FontAwesomeIcon icon="" />
|
||||
<i class="fas fa-file-export text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('File Manager') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.default-currency.index') }}" class="card setting_active_tab h-100"
|
||||
style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test">
|
||||
<FontAwesomeIcon icon="" />
|
||||
<i class="fas bi-cash-stack text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Default Currency Settings') }}</h5>
|
||||
<div class="">{{ __('Go to settings') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@hasrole('Super Admin')
|
||||
<div class="col-xxl-3 col-xl-4 col-lg-6 col-md-12 mb-3">
|
||||
<a href="{{ route('settings.error-logs.index') }}" class="card setting_active_tab h-100" style="text-decoration: none;">
|
||||
<div class="content d-flex h-100">
|
||||
<div class="row mx-2 ">
|
||||
<div class="provider_a test ">
|
||||
<i class="fa fa-file-alt text-dark icon_font_size"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="title">{{ __('Log Viewer') }}</h5>
|
||||
<div class="">{{ __('Find Errors in your System') }} <i class="fas fa-arrow-right mt-2 arrow_icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@endhasrole
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
309
resources/views/settings/language.blade.php
Normal file
309
resources/views/settings/language.blade.php
Normal file
@@ -0,0 +1,309 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Languages') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="divider">
|
||||
<div class="divider-text">
|
||||
<h4>{{ __('Add Language') }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="card-body">
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-12 col-md-12 form-group">
|
||||
{!! Form::open([
|
||||
'url' => route('language.store'),
|
||||
'files' => true,
|
||||
'data-parsley-validate',
|
||||
'class' => 'create-form',
|
||||
]) !!}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12 form-group mandatory ">
|
||||
{{ Form::label('Language Name', __('Language Name'), ['class' => 'form-label text-center']) }}
|
||||
{{ Form::text('name', '', ['class' => 'form-control', 'placeholder' => __('Language Name'), 'data-parsley-required' => 'true']) }}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-12 form-group mandatory ">
|
||||
{{ Form::label('Language Name', __('Language Name') . ' (' . __('in English') . ')', ['class' => 'form-label text-center']) }}
|
||||
{{ Form::text('name_in_english', '', ['class' => 'form-control', 'placeholder' => __('Language Name') . ' (' . __('in English') . ')', 'data-parsley-required' => 'true']) }}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-12 form-group mandatory ">
|
||||
{{ Form::label('Language Code', __('Language Code'), ['class' => 'form-label text-center']) }}
|
||||
{{ Form::text('code', '', ['class' => 'form-control', 'placeholder' => __('Language Code'), 'data-parsley-required' => 'true']) }}
|
||||
</div>
|
||||
{{-- <div class="col-sm-12 col-md-12 form-group mandatory ">
|
||||
{{ Form::label('Country Code', __('Country Code'), ['class' => 'form-label text-center']) }}
|
||||
{{ Form::text('country_code', '', ['class' => 'form-control', 'placeholder' => __('Country Code'), 'data-parsley-required' => 'true']) }}
|
||||
</div> --}}
|
||||
<div class="col-sm-12 col-md-12 form-group mandatory">
|
||||
{{ Form::label('country_code', __('Country Code'), ['class' => 'form-label text-center']) }}
|
||||
{{ Form::text('country_code', '', [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => __('Country Code'),
|
||||
'data-parsley-required' => 'true',
|
||||
]) }}
|
||||
<small class="form-text text-muted">
|
||||
{{ __('Provide the two-letter ISO country code for a country. Reference:') }}
|
||||
<a href="https://countrycode.org" target="_blank">CountryCode.org</a>.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-12 form-group mandatory">
|
||||
<label class="form-label ">{{ __('Image') }}</label>
|
||||
<div class="">
|
||||
<input class="filepond" type="file" name="image" id="favicon_icon">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-1 col-md-12">
|
||||
{{ Form::label('file', __('RTL'), ['class' => 'col-form-label text-center']) }}
|
||||
<div class="form-check form-switch col-12" style='padding-right:12.5rem;'>
|
||||
{{ Form::checkbox('rtl', '', false, ['class' => 'form-check-input', 'id' => 'rtl']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div class="row">
|
||||
<div class="col-sm-2 col-md-12 form-group mandatory">
|
||||
{{ Form::label('file', __('File For Admin Panel'), ['class' => 'form-label text-center', 'accept' => '.json.*']) }}
|
||||
{{ Form::file('panel_file', ['class' => 'form-control', 'language code', 'data-parsley-required' => 'true', 'accept' => '.json']) }}
|
||||
</div>
|
||||
<div class="col-sm-2 col-md-12 form-group mandatory">
|
||||
{{ Form::label('file', __('File For App'), ['class' => 'form-label text-center', 'accept' => '.json.*']) }}
|
||||
{{ Form::file('app_file', ['class' => 'form-control', 'data-parsley-required' => 'true', 'accept' => '.json']) }}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 col-md-12 form-group mandatory">
|
||||
{{ Form::label('file', __('File For Web'), ['class' => 'form-label text-center', 'accept' => '.json.*']) }}
|
||||
{{ Form::file('web_file', ['class' => 'form-control', 'data-parsley-required' => 'true', 'accept' => '.json']) }}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-1 col-md-4">
|
||||
{{ Form::label('file', __('Sample for Admin'), ['class' => 'col-form-label text-center']) }}
|
||||
<div class="form-check form-switch col-12" style='padding-right:12.5rem;'>
|
||||
<a class="btn icon btn-primary btn-sm rounded-pill" href="{{ route('language.download.panel.json') }}" title="Edit">
|
||||
<i class="bi bi-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-1 col-md-4">
|
||||
{{ Form::label('file', __('Sample For App'), ['class' => 'col-form-label text-center']) }}
|
||||
<div class="form-check form-switch col-12" style='padding-right:12.5rem;'>
|
||||
<a class="btn icon btn-primary btn-sm rounded-pill" href="{{ route('language.download.app.json') }}" title="Edit">
|
||||
<i class="bi bi-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-1 col-md-4">
|
||||
{{ Form::label('file', __('Sample For Web'), ['class' => 'col-form-label text-center']) }}
|
||||
<div class="form-check form-switch col-12" style='padding-right:12.5rem;'>
|
||||
<a class="btn icon btn-primary btn-sm rounded-pill" href="{{ route('language.download.web.json') }}" title="Edit">
|
||||
<i class="bi bi-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<div class="col-sm-12 d-flex justify-content-end mt-3">
|
||||
{{ Form::submit(__('Save'), ['class' => 'btn btn-primary me-1 mb-1']) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table-light table-striped" aria-describedby="mydesc" id="table_list"
|
||||
data-toggle="table" data-url="{{ route('language.show', 1) }}"
|
||||
data-click-to-select="true" data-side-pagination="server" data-pagination="true"
|
||||
data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true" data-toolbar="#toolbar"
|
||||
data-show-columns="true" data-show-refresh="true" data-fixed-columns="true"
|
||||
data-fixed-number="1" data-fixed-right-number="1" data-trim-on-search="false"
|
||||
data-responsive="true" data-sort-name="id" data-sort-order="desc"
|
||||
data-pagination-successively-size="3" data-escape="true" data-query-params="queryParams"
|
||||
data-mobile-responsive="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" data-field="id" data-sortable="true">{{ __('ID') }}
|
||||
</th>
|
||||
<th scope="col" data-field="name" data-sortable="false">{{ __('Name') }}
|
||||
</th>
|
||||
<th scope="col" data-field="name_in_english" data-sortable="false">
|
||||
{{ __('Name') . ' (' . __('in English') . ')' }}</th>
|
||||
<th scope="col" data-field="code" data-sortable="true">
|
||||
{{ __('Language Code') }}</th>
|
||||
<th scope="col" data-field="country_code" data-sortable="true">
|
||||
{{ __('Country Code') }}</th>
|
||||
{{-- <th scope="col" data-field="rtl_text" data-sortable="true">{{ __('RTL') }}</th> --}}
|
||||
<th scope="col" data-field="image" data-sortable="false"
|
||||
data-formatter="imageFormatter">{{ __('Image') }}</th>
|
||||
<th scope="col" data-field="operate" data-escape="false"
|
||||
data-sortable="false" data-events="languageEvents">{{ __('Action') }}</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- EDIT MODEL MODEL -->
|
||||
<div id="editModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<form action="#" class="form-horizontal" id="edit-form" enctype="multipart/form-data" method="POST"
|
||||
data-parsley-validate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel1">{{ __('Edit Language') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="col-md-12 col-12">
|
||||
<div class="form-group mandatory">
|
||||
<label for="edit_name"
|
||||
class="form-label col-12">{{ __('Language Name') }}</label>
|
||||
<input type="text" id="edit_name" class="form-control col-12"
|
||||
placeholder="{{ __('Name') }}" name="name"
|
||||
data-parsley-required="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<div class="col-md-12 col-12">
|
||||
<div class="form-group mandatory">
|
||||
<label for="edit_name_in_english"
|
||||
class="form-label col-12">{{ __('Language Name') }}({{ __('in English') }})</label>
|
||||
<input type="text" id="edit_name_in_english" class="form-control col-12"
|
||||
placeholder="{{ __('Name') }}" name="name_in_english"
|
||||
data-parsley-required="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="col-md-12 col-12">
|
||||
<div class="form-group mandatory">
|
||||
<label for="edit_code"
|
||||
class="form-label col-12">{{ __('Language Code') }}</label>
|
||||
<input type="text" id="edit_code" class="form-control col-12"
|
||||
placeholder="{{ __('Language Code') }}" name="code"
|
||||
data-parsley-required="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="col-md-12 col-12">
|
||||
<div class="form-group mandatory">
|
||||
<label for="edit_code" class="form-label col-12">{{ __('Country Code') }}</label>
|
||||
<input type="text" id="edit_country_code" class="form-control col-12"
|
||||
placeholder="{{ __('Country Code') }}" name="country_code"
|
||||
data-parsley-required="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-12 form-group">
|
||||
<label class="col-form-label ">{{ __('Image') }}</label>
|
||||
<div class="">
|
||||
<input class="filepond" type="file" name="image" id="edit_image">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="col-md-12 col-12">
|
||||
<div class="form-group">
|
||||
<label for="edit_panel_file"
|
||||
class="form-label col-12">{{ __('File For Admin Panel') }}</label>
|
||||
<input type="file" id="edit_panel_file" class="form-control col-12"
|
||||
name="panel_file" accept=".json">
|
||||
<a id="download_panel_file" href="#" target="_blank"
|
||||
class="btn btn-sm btn-outline-primary mt-2">
|
||||
<i class="bi bi-download"></i> {{ __('Download Current') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<div class="col-md-12 col-12">
|
||||
<div class="form-group">
|
||||
<label for="edit_app_file"
|
||||
class="form-label col-12">{{ __('File For App') }}</label>
|
||||
<input type="file" id="edit_app_file" class="form-control col-12"
|
||||
name="app_file" accept=".json">
|
||||
<a id="download_app_file" href="#" target="_blank"
|
||||
class="btn btn-sm btn-outline-primary mt-2">
|
||||
<i class="bi bi-download"></i> {{ __('Download Current') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<div class="col-md-12 col-12">
|
||||
<div class="form-group">
|
||||
<label for="edit_web_file"
|
||||
class="form-label col-12">{{ __('File For Web') }}</label>
|
||||
<input type="file" id="edit_web_file" class="form-control col-12"
|
||||
name="web_file" accept=".json">
|
||||
<a id="download_web_file" href="#" target="_blank"
|
||||
class="btn btn-sm btn-outline-primary mt-2">
|
||||
<i class="bi bi-download"></i> {{ __('Download Current') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<div class="col-md-12 col-12">
|
||||
<div class="form-group form-check form-switch">
|
||||
<label for="edit_rtl" class="form-label col-12">{{ __('RTL') }}</label>
|
||||
<input type="hidden" value="0" name="rtl" id="edit_rtl">
|
||||
<input type="checkbox" class="form-check-input status-switch"
|
||||
id="edit_rtl_switch" aria-label="edit_rtl">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary waves-effect"
|
||||
data-bs-dismiss="modal">{{ __('Close') }}</button>
|
||||
<button type="submit"
|
||||
class="btn btn-primary waves-effect waves-light">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
39
resources/views/settings/languageedit.blade.php
Normal file
39
resources/views/settings/languageedit.blade.php
Normal file
@@ -0,0 +1,39 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Edit Language') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<form action="{{ route('updatelanguage', ['id' => $language->id, 'type' => $type]) }}" method="POST" enctype="multipart/form-data" class="editlanguage-form">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __("Language JSON - " .($type)) }}
|
||||
<!-- <button type="button" class="btn btn-secondary float-end" onclick="location.href='{{ route('auto-translate', ['id' => $language->id, 'type' => $type, 'locale' => $language->code]) }}'">
|
||||
Auto Translate
|
||||
</button> -->
|
||||
|
||||
</div>
|
||||
<div class="card-body mt-3">
|
||||
<div class="row">
|
||||
@foreach($enLabels as $key => $value)
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="value-{{ $loop->index }}" class="form-labe">{{$key}}</label>
|
||||
<input type="text" class="form-control" id="value-{{ $loop->index }}" name="values[]" value="{{ $value }}" required>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<button type="submit" class="btn btn-primary">{{__("Save Changes")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
79
resources/views/settings/login-method.blade.php
Normal file
79
resources/views/settings/login-method.blade.php
Normal file
@@ -0,0 +1,79 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('OTP Provider Settings') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form class="create-form-without-reset" action="{{ route('settings.store') }}" method="post" enctype="multipart/form-data" data-success-function="successFunction" data-parsley-validate>
|
||||
@csrf
|
||||
<div class="row d-flex mb-3">
|
||||
<div class="card mb-0">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('OTP Provider Settings') }}</h6>
|
||||
</div>
|
||||
{{-- OTP Services Provider --}}
|
||||
<div class="form-group row mt-3" id="otp-services-provider-div">
|
||||
<label class="col-sm-12 form-label-mandatory" for="otp-services-provider">{{ __('OTP Services Provider') }}</label>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<select name="otp_service_provider" id="otp-services-provider" class="choosen-select form-select form-control-sm otp-services-provider">
|
||||
<option value="firebase" {{ !empty($settings['otp_service_provider']) && $settings['otp_service_provider'] == 'firebase' ? 'selected' : '' }}>{{ __('Firebase') }}</option>
|
||||
<option value="twilio" {{ !empty($settings['otp_service_provider']) && $settings['otp_service_provider'] == 'twilio' ? 'selected' : '' }}>{{ __('Twilio') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Twilio SMS Settings --}}
|
||||
<div class="col-12 mt-2 p-4 row bg-light" id="twilio-sms-settings-div">
|
||||
<h5>{{ __('Twilio SMS Settings') }}</h5>
|
||||
|
||||
<div class="form-group row mt-3">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="twilio_account_sid" class="form-label">{{ __('Account SID') }}</label>
|
||||
<input type="text" name="twilio_account_sid" id="twilio_account_sid" class="form-control" placeholder="{{ __('Account SID') }}" value="{{ $settings['twilio_account_sid'] ?? '' }}">
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="twilio_auth_token" class="form-label">{{ __('Auth Token') }}</label>
|
||||
<input type="text" name="twilio_auth_token" id="twilio_auth_token" class="form-control" placeholder="{{ __('Auth Token') }}" value="{{ $settings['twilio_auth_token'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-3">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="twilio_my_phone_number" class="form-label">{{ __('My Twilio Phone Number') }}</label>
|
||||
<input type="text" name="twilio_my_phone_number" id="twilio_my_phone_number" class="form-control" placeholder="{{ __('My Twilio Phone Number') }}" value="{{ $settings['twilio_my_phone_number'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 d-flex justify-content-end">
|
||||
<button type="submit" value="btnAdd" class="btn btn-primary me-1 mb-3">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<script>
|
||||
function successFunction() {
|
||||
window.location.reload();
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
101
resources/views/settings/notification-setting.blade.php
Normal file
101
resources/views/settings/notification-setting.blade.php
Normal file
@@ -0,0 +1,101 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Notification Settings') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form class="create-form-without-reset" action="{{route('settings.store') }}" method="post" enctype="multipart/form-data" data-success-function="successFunction" data-parsley-validate>
|
||||
@csrf
|
||||
<div class="row d-flex mb-3">
|
||||
<div class="card mb-0">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('FCM Notification Settings') }}</h6>
|
||||
</div>
|
||||
<div class="form-group row mt-3">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="firebase_project_id" class="form-label">{{ __('Firebase Project Id') }}</label>
|
||||
<input type="text" id="firebase_project_id" name="firebase_project_id" class="form-control" placeholder="{{ __('Firebase Project Id') }}" value="{{ $settings['firebase_project_id'] ?? '' }}"/>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="service_file" class="form-label">{{ __('Service Json File') }}</label><span style="color: #00B2CA">
|
||||
* {{ __('Accept only Json File') }}</span>
|
||||
<input id="service_file" name="service_file" type="file" class="form-control">
|
||||
<p style="display: none" id="img_error_msg" class="badge rounded-pill bg-danger"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row d-flex mb-3">
|
||||
<div class="card mb-0">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('Email Notification Settings') }}</h6>
|
||||
</div>
|
||||
<div class="form-group row mt-3">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="mail_mailer" class="form-label">{{ __('Mail Mailer') }}</label>
|
||||
<input type="text" id="mail_mailer" name="mail_mailer" class="form-control" placeholder="{{ __('Mail Mailer') }}" value="{{ $settings['mail_mailer'] ?? '' }}"/>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="mail_host" class="form-label">{{ __('Mail Host') }}</label>
|
||||
<input type="text" id="mail_host" name="mail_host" class="form-control" placeholder="{{ __('Mail Host') }}" value="{{ $settings['mail_host'] ?? '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mt-3">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="mail_port" class="form-label">{{ __('Mail Port') }}</label>
|
||||
<input type="text" id="mail_port" name="mail_port" class="form-control" placeholder="{{ __('Mail Port') }}" value="{{ $settings['mail_port'] ?? '' }}"/>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="mail_username" class="form-label">{{ __('Mail Username') }}</label>
|
||||
<input type="text" id="mail_username" name="mail_username" class="form-control" placeholder="{{ __('Mail Username') }}" value="{{ $settings['mail_username'] ?? '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mt-3">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="mail_password" class="form-label">{{ __('Mail Password') }}</label>
|
||||
<input type="password" id="mail_password" name="mail_password" class="form-control" placeholder="{{ __('Mail Password') }}" value="{{ $settings['mail_password'] ?? '' }}"/>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="mail_encryption" class="form-label">{{ __('Mail Encryption') }}</label>
|
||||
<input type="text" id="mail_encryption" name="mail_encryption" class="form-control" placeholder="{{ __('Mail Encryption') }}" value="{{ $settings['mail_encryption'] ?? '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mt-3">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label for="mail_from_address" class="form-label">{{ __('Mail From Address') }}</label>
|
||||
<input type="text" id="mail_from_address" name="mail_from_address" class="form-control" placeholder="{{ __('Mail From Address') }}" value="{{ $settings['mail_from_address'] ?? '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 d-flex justify-content-end">
|
||||
<button type="submit" value="btnAdd" class="btn btn-primary me-1 mb-3">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
@section('js')
|
||||
<script>
|
||||
function successFunction() {
|
||||
window.location.reload();
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
827
resources/views/settings/payment-gateway.blade.php
Normal file
827
resources/views/settings/payment-gateway.blade.php
Normal file
@@ -0,0 +1,827 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('title')
|
||||
{{ __('Payment Gateways Settings') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<form class="create-form-without-reset" action="{{ route('settings.payment-gateway.store') }}" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div class="row d-flex mb-3">
|
||||
|
||||
{{-- Stripe Payment Gateway START --}}
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('Stripe Setting') }}</h6>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-3">
|
||||
<label for="stripe_currency_code"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Stripe Currency Symbol') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<select name="gateway[Stripe][currency_code]" id="stripe_currency_code"
|
||||
class="select2 form-select form-control">
|
||||
<option value="USD">USD</option>
|
||||
<option value="AED">AED</option>
|
||||
<option value="AFN">AFN</option>
|
||||
<option value="ALL">ALL</option>
|
||||
<option value="AMD">AMD</option>
|
||||
<option value="ANG">ANG</option>
|
||||
<option value="AOA">AOA</option>
|
||||
<option value="ARS">ARS</option>
|
||||
<option value="AUD">AUD</option>
|
||||
<option value="AWG">AWG</option>
|
||||
<option value="AZN">AZN</option>
|
||||
<option value="BAM">BAM</option>
|
||||
<option value="BBD">BBD</option>
|
||||
<option value="BDT">BDT</option>
|
||||
<option value="BGN">BGN</option>
|
||||
<option value="BMD">BMD</option>
|
||||
<option value="BND">BND</option>
|
||||
<option value="BOB">BOB</option>
|
||||
<option value="BRL">BRL</option>
|
||||
<option value="BSD">BSD</option>
|
||||
<option value="BWP">BWP</option>
|
||||
<option value="BYN">BYN</option>
|
||||
<option value="BZD">BZD</option>
|
||||
<option value="CAD">CAD</option>
|
||||
<option value="CDF">CDF</option>
|
||||
<option value="CHF">CHF</option>
|
||||
<option value="CNY">CNY</option>
|
||||
<option value="COP">COP</option>
|
||||
<option value="CRC">CRC</option>
|
||||
<option value="CVE">CVE</option>
|
||||
<option value="CZK">CZK</option>
|
||||
<option value="DKK">DKK</option>
|
||||
<option value="DOP">DOP</option>
|
||||
<option value="DZD">DZD</option>
|
||||
<option value="EGP">EGP</option>
|
||||
<option value="ETB">ETB</option>
|
||||
<option value="EUR">EUR</option>
|
||||
<option value="FJD">FJD</option>
|
||||
<option value="FKP">FKP</option>
|
||||
<option value="GBP">GBP</option>
|
||||
<option value="GEL">GEL</option>
|
||||
<option value="GIP">GIP</option>
|
||||
<option value="GMD">GMD</option>
|
||||
<option value="GTQ">GTQ</option>
|
||||
<option value="GYD">GYD</option>
|
||||
<option value="HKD">HKD</option>
|
||||
<option value="HNL">HNL</option>
|
||||
<option value="HTG">HTG</option>
|
||||
<option value="HUF">HUF</option>
|
||||
<option value="IDR">IDR</option>
|
||||
<option value="ILS">ILS</option>
|
||||
<option value="INR">INR</option>
|
||||
<option value="ISK">ISK</option>
|
||||
<option value="JMD">JMD</option>
|
||||
<option value="KES">KES</option>
|
||||
<option value="KGS">KGS</option>
|
||||
<option value="KHR">KHR</option>
|
||||
<option value="KYD">KYD</option>
|
||||
<option value="KZT">KZT</option>
|
||||
<option value="LAK">LAK</option>
|
||||
<option value="LBP">LBP</option>
|
||||
<option value="LKR">LKR</option>
|
||||
<option value="LRD">LRD</option>
|
||||
<option value="LSL">LSL</option>
|
||||
<option value="MAD">MAD</option>
|
||||
<option value="MDL">MDL</option>
|
||||
<option value="MKD">MKD</option>
|
||||
<option value="MMK">MMK</option>
|
||||
<option value="MNT">MNT</option>
|
||||
<option value="MOP">MOP</option>
|
||||
<option value="MUR">MUR</option>
|
||||
<option value="MVR">MVR</option>
|
||||
<option value="MWK">MWK</option>
|
||||
<option value="MXN">MXN</option>
|
||||
<option value="MYR">MYR</option>
|
||||
<option value="MZN">MZN</option>
|
||||
<option value="NAD">NAD</option>
|
||||
<option value="NGN">NGN</option>
|
||||
<option value="NIO">NIO</option>
|
||||
<option value="NOK">NOK</option>
|
||||
<option value="NPR">NPR</option>
|
||||
<option value="NZD">NZD</option>
|
||||
<option value="PAB">PAB</option>
|
||||
<option value="PEN">PEN</option>
|
||||
<option value="PGK">PGK</option>
|
||||
<option value="PHP">PHP</option>
|
||||
<option value="PKR">PKR</option>
|
||||
<option value="PLN">PLN</option>
|
||||
<option value="QAR">QAR</option>
|
||||
<option value="RON">RON</option>
|
||||
<option value="RSD">RSD</option>
|
||||
<option value="RUB">RUB</option>
|
||||
<option value="SAR">SAR</option>
|
||||
<option value="SBD">SBD</option>
|
||||
<option value="SCR">SCR</option>
|
||||
<option value="SEK">SEK</option>
|
||||
<option value="SGD">SGD</option>
|
||||
<option value="SHP">SHP</option>
|
||||
<option value="SLE">SLE</option>
|
||||
<option value="SOS">SOS</option>
|
||||
<option value="SRD">SRD</option>
|
||||
<option value="STD">STD</option>
|
||||
<option value="SZL">SZL</option>
|
||||
<option value="THB">THB</option>
|
||||
<option value="TJS">TJS</option>
|
||||
<option value="TOP">TOP</option>
|
||||
<option value="TRY">TRY</option>
|
||||
<option value="TTD">TTD</option>
|
||||
<option value="TWD">TWD</option>
|
||||
<option value="TZS">TZS</option>
|
||||
<option value="UAH">UAH</option>
|
||||
<option value="UYU">UYU</option>
|
||||
<option value="UZS">UZS</option>
|
||||
<option value="WST">WST</option>
|
||||
<option value="XAF">XAF</option>
|
||||
<option value="XCD">XCD</option>
|
||||
<option value="YER">YER</option>
|
||||
<option value="ZAR">ZAR</option>
|
||||
<option value="ZMW">ZMW</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="stripe_secret_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Stripe Secret key') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="stripe_secret_key" name="gateway[Stripe][secret_key]" type="text"
|
||||
class="form-control" placeholder="{{ __('Stripe Secret key') }}"
|
||||
value="{{ $paymentGateway['Stripe']['secret_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="stripe_publishable_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Stripe Publishable key') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="stripe_publishable_key" name="gateway[Stripe][api_key]" type="text"
|
||||
class="form-control" placeholder="{{ __('Stripe Publishable key') }}"
|
||||
value="{{ $paymentGateway['Stripe']['api_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="stripe_webhook_secret"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Stripe Webhook Secret') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="stripe_webhook_secret" name="gateway[Stripe][webhook_secret_key]"
|
||||
type="text" class="form-control"
|
||||
placeholder="{{ __('Stripe Webhook Secret') }}"
|
||||
value="{{ $paymentGateway['Stripe']['webhook_secret_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="stripe_webhook_url"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Stripe Webhook URL') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="stripe_webhook_url" name="gateway[Stripe][webhook_url]" type="text"
|
||||
class="form-control" placeholder="{{ __('Stripe Webhook URL') }}"
|
||||
value="{{ url('/webhook/stripe') }}" disabled>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-12 form-check-label mt-2"
|
||||
id='lbl_stripe'>{{ __('Status') }}</label>
|
||||
<div class="col-sm-2 col-md-12 col-xs-12 mt-2">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="gateway[Stripe][status]" id="stripe_gateway"
|
||||
value="{{ $paymentGateway['Stripe']['status'] ?? 0 }}">
|
||||
<input class="form-check-input switch-input status-switch" type="checkbox"
|
||||
role="switch" name='op'
|
||||
{{ isset($paymentGateway['Stripe']['status']) && $paymentGateway['Stripe']['status'] == '1' ? 'checked' : '' }}
|
||||
id="switch_stripe_gateway" aria-label="switch_stripe_gateway">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- Stripe Payment Gateway END --}}
|
||||
|
||||
{{-- Razorpay Payment Gateway START --}}
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('Razorpay Setting') }}</h6>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-3">
|
||||
<label for="razorpay_currency_code"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Razorpay Currency Symbol') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<select name="gateway[Razorpay][currency_code]" id="razorpay_currency_code"
|
||||
class="select2 form-select form-control">
|
||||
<option value="AED">AED</option>
|
||||
<option value="ALL">ALL</option>
|
||||
<option value="AMD">AMD</option>
|
||||
<option value="ARS">ARS</option>
|
||||
<option value="AUD">AUD</option>
|
||||
<option value="AWG">AWG</option>
|
||||
<option value="AZN">AZN</option>
|
||||
<option value="BAM">BAM</option>
|
||||
<option value="BBD">BBD</option>
|
||||
<option value="BDT">BDT</option>
|
||||
<option value="BGN">BGN</option>
|
||||
<option value="BHD">BHD</option>
|
||||
<option value="BIF">BIF</option>
|
||||
<option value="BMD">BMD</option>
|
||||
<option value="BND">BND</option>
|
||||
<option value="BOB">BOB</option>
|
||||
<option value="BRL">BRL</option>
|
||||
<option value="BSD">BSD</option>
|
||||
<option value="BTN">BTN</option>
|
||||
<option value="BWP">BWP</option>
|
||||
<option value="BZD">BZD</option>
|
||||
<option value="CAD">CAD</option>
|
||||
<option value="CHF">CHF</option>
|
||||
<option value="CLP">CLP</option>
|
||||
<option value="CNY">CNY</option>
|
||||
<option value="COP">COP</option>
|
||||
<option value="CRC">CRC</option>
|
||||
<option value="CUP">CUP</option>
|
||||
<option value="CVE">CVE</option>
|
||||
<option value="CZK">CZK</option>
|
||||
<option value="DJF">DJF</option>
|
||||
<option value="DKK">DKK</option>
|
||||
<option value="DOP">DOP</option>
|
||||
<option value="DZD">DZD</option>
|
||||
<option value="EGP">EGP</option>
|
||||
<option value="ETB">ETB</option>
|
||||
<option value="EUR">EUR</option>
|
||||
<option value="FJD">FJD</option>
|
||||
<option value="GBP">GBP</option>
|
||||
<option value="GHS">GHS</option>
|
||||
<option value="GIP">GIP</option>
|
||||
<option value="GMD">GMD</option>
|
||||
<option value="GNF">GNF</option>
|
||||
<option value="GTQ">GTQ</option>
|
||||
<option value="GYD">GYD</option>
|
||||
<option value="HKD">HKD</option>
|
||||
<option value="HNL">HNL</option>
|
||||
<option value="HRK">HRK</option>
|
||||
<option value="HTG">HTG</option>
|
||||
<option value="HUF">HUF</option>
|
||||
<option value="IDR">IDR</option>
|
||||
<option value="ILS">ILS</option>
|
||||
<option value="INR">INR</option>
|
||||
<option value="IQD">IQD</option>
|
||||
<option value="ISK">ISK</option>
|
||||
<option value="JMD">JMD</option>
|
||||
<option value="JOD">JOD</option>
|
||||
<option value="JPY">JPY</option>
|
||||
<option value="KES">KES</option>
|
||||
<option value="KGS">KGS</option>
|
||||
<option value="KHR">KHR</option>
|
||||
<option value="KMF">KMF</option>
|
||||
<option value="KRW">KRW</option>
|
||||
<option value="KWD">KWD</option>
|
||||
<option value="KYD">KYD</option>
|
||||
<option value="KZT">KZT</option>
|
||||
<option value="LAK">LAK</option>
|
||||
<option value="LKR">LKR</option>
|
||||
<option value="LRD">LRD</option>
|
||||
<option value="LSL">LSL</option>
|
||||
<option value="MAD">MAD</option>
|
||||
<option value="MDL">MDL</option>
|
||||
<option value="MGA">MGA</option>
|
||||
<option value="MKD">MKD</option>
|
||||
<option value="MMK">MMK</option>
|
||||
<option value="MNT">MNT</option>
|
||||
<option value="MOP">MOP</option>
|
||||
<option value="MUR">MUR</option>
|
||||
<option value="MVR">MVR</option>
|
||||
<option value="MWK">MWK</option>
|
||||
<option value="MXN">MXN</option>
|
||||
<option value="MYR">MYR</option>
|
||||
<option value="MZN">MZN</option>
|
||||
<option value="NAD">NAD</option>
|
||||
<option value="NGN">NGN</option>
|
||||
<option value="NIO">NIO</option>
|
||||
<option value="NOK">NOK</option>
|
||||
<option value="NPR">NPR</option>
|
||||
<option value="NZD">NZD</option>
|
||||
<option value="OMR">OMR</option>
|
||||
<option value="PEN">PEN</option>
|
||||
<option value="PGK">PGK</option>
|
||||
<option value="PHP">PHP</option>
|
||||
<option value="PKR">PKR</option>
|
||||
<option value="PLN">PLN</option>
|
||||
<option value="PYG">PYG</option>
|
||||
<option value="QAR">QAR</option>
|
||||
<option value="RON">RON</option>
|
||||
<option value="RSD">RSD</option>
|
||||
<option value="RUB">RUB</option>
|
||||
<option value="RWF">RWF</option>
|
||||
<option value="SAR">SAR</option>
|
||||
<option value="SCR">SCR</option>
|
||||
<option value="SEK">SEK</option>
|
||||
<option value="SGD">SGD</option>
|
||||
<option value="SLL">SLL</option>
|
||||
<option value="SOS">SOS</option>
|
||||
<option value="SSP">SSP</option>
|
||||
<option value="SVC">SVC</option>
|
||||
<option value="SZL">SZL</option>
|
||||
<option value="THB">THB</option>
|
||||
<option value="TND">TND</option>
|
||||
<option value="TRY">TRY</option>
|
||||
<option value="TTD">TTD</option>
|
||||
<option value="TWD">TWD</option>
|
||||
<option value="TZS">TZS</option>
|
||||
<option value="UAH">UAH</option>
|
||||
<option value="UGX">UGX</option>
|
||||
<option value="USD">USD</option>
|
||||
<option value="UYU">UYU</option>
|
||||
<option value="UZS">UZS</option>
|
||||
<option value="VND">VND</option>
|
||||
<option value="VUV">VUV</option>
|
||||
<option value="XAF">XAF</option>
|
||||
<option value="XCD">XCD</option>
|
||||
<option value="XOF">XOF</option>
|
||||
<option value="XPF">XPF</option>
|
||||
<option value="YER">YER</option>
|
||||
<option value="ZAR">ZAR</option>
|
||||
<option value="ZMW">ZMW</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="razorpay_secret_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Razorpay Secret key') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="razorpay_secret_key" name="gateway[Razorpay][secret_key]" type="text"
|
||||
class="form-control" placeholder="{{ __('Razorpay Secret key') }}"
|
||||
value="{{ $paymentGateway['Razorpay']['secret_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="razorpay_public_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Razorpay Public key') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="razorpay_public_key" name="gateway[Razorpay][api_key]" type="text"
|
||||
class="form-control" placeholder="{{ __('Razorpay Publishable key') }}"
|
||||
value="{{ $paymentGateway['Razorpay']['api_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="razorpay_webhook_secret"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Razorpay Webhook Secret') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="razorpay_webhook_secret" name="gateway[Razorpay][webhook_secret_key]"
|
||||
type="text" class="form-control"
|
||||
placeholder="{{ __('Razorpay Webhook Secret') }}"
|
||||
value="{{ $paymentGateway['Razorpay']['webhook_secret_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="razorpay_webhook_url"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Razorpay Webhook URL') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="razorpay_webhook_url" name="gateway[Razorpay][webhook_url]" type="text"
|
||||
class="form-control" placeholder="{{ __('Razorpay Webhook URL') }}"
|
||||
value="{{ url('/webhook/razorpay') }}" disabled>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-12 form-check-label mt-2"
|
||||
id='lbl_stripe'>{{ __('Status') }}</label>
|
||||
<div class="col-sm-2 col-md-12 col-xs-12 mt-2">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="gateway[Razorpay][status]" id="razorpay_gateway"
|
||||
value="{{ $paymentGateway['Razorpay']['status'] ?? 0 }}">
|
||||
<input class="form-check-input switch-input status-switch" type="checkbox"
|
||||
role="switch" name='op'
|
||||
{{ isset($paymentGateway['Razorpay']['status']) && $paymentGateway['Razorpay']['status'] == '1' ? 'checked' : '' }}
|
||||
id="switch_razorpay_gateway" aria-label="switch_razorpay_gateway">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- Razorpay Payment Gateway END --}}
|
||||
|
||||
{{-- Paystack Payment Gateway START --}}
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('Paystack Setting') }}</h6>
|
||||
</div>
|
||||
<div class="form-group row mt-3">
|
||||
<label for="paystack_currency_code"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Paystack Currency Symbol') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<select name="gateway[Paystack][currency_code]" id="paystack_currency_code"
|
||||
class="select2 form-select form-control">
|
||||
<option value="USD">USD</option>
|
||||
<option value="GHS">GHS</option>
|
||||
<option value="KES">KES</option>
|
||||
<option value="NGN">NGN</option>
|
||||
<option value="ZAR">ZAR</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="paystack_secret_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Paystack Secret key') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paystack_secret_key" name="gateway[Paystack][secret_key]" type="text"
|
||||
class="form-control" placeholder="{{ __('Paystack Secret key') }}"
|
||||
value="{{ $paymentGateway['Paystack']['secret_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="paystack_publishable_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Paystack Public key') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paystack_publishable_key" name="gateway[Paystack][api_key]" type="text"
|
||||
class="form-control" placeholder="{{ __('Paystack Public key') }}"
|
||||
value="{{ $paymentGateway['Paystack']['api_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="paystack_webhook_url"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Paystack Webhook URL') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paystack_webhook_url" name="gateway[Paystack][webhook_url]" type="text"
|
||||
class="form-control" placeholder="{{ __('Paystack Webhook URL') }}"
|
||||
value="{{ url('/webhook/paystack') }}" disabled>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-12 form-check-label mt-2"
|
||||
id='lbl_stripe'>{{ __('Status') }}</label>
|
||||
<div class="col-sm-2 col-md-12 col-xs-12 mt-2">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="gateway[Paystack][status]" id="paystack_gateway"
|
||||
value="{{ $paymentGateway['Paystack']['status'] ?? 0 }}">
|
||||
<input class="form-check-input switch-input status-switch" type="checkbox"
|
||||
role="switch" name='op'
|
||||
{{ isset($paymentGateway['Paystack']['status']) && $paymentGateway['Paystack']['status'] == '1' ? 'checked' : '' }}
|
||||
id="switch_paystack_gateway" aria-label="switch_paystack_gateway">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- Paystack Payment Gateway END --}}
|
||||
|
||||
{{-- phonePe Payment Gateway START --}}
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('PhonePe Setting') }}</h6>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-3">
|
||||
<label for="paystack_secret_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PhonePe Client Secret') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paystack_secret_key" name="gateway[PhonePe][secret_key]" type="text"
|
||||
class="form-control phonepe-required"
|
||||
placeholder="{{ __('PhonePe Client Secret') }}"
|
||||
value="{{ $paymentGateway['PhonePe']['secret_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="paystack_publishable_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PhonePe Client ID') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paystack_publishable_key" name="gateway[PhonePe][api_key]" type="text"
|
||||
class="form-control phonepe-required" placeholder="{{ __('PhonePe Client ID') }}"
|
||||
value="{{ $paymentGateway['PhonePe']['api_key'] ?? '' }}">
|
||||
</div>
|
||||
<label for="paystack_publishable_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PhonePe Client Version') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paystack_publishable_key" name="gateway[PhonePe][additional_data_1]"
|
||||
type="text" class="form-control phonepe-required"
|
||||
placeholder="{{ __('PhonePe Client Version') }}"
|
||||
value="{{ $paymentGateway['PhonePe']['additional_data_1'] ?? '' }}">
|
||||
</div>
|
||||
<label for="paystack_publishable_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PhonePe Merchant ID') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paystack_publishable_key" name="gateway[PhonePe][additional_data_2]"
|
||||
type="text" class="form-control phonepe-required"
|
||||
placeholder="{{ __('PhonePe Merchant ID') }}"
|
||||
value="{{ $paymentGateway['PhonePe']['additional_data_2'] ?? '' }}">
|
||||
</div>
|
||||
<label for="phonepe_username"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PhonePe Username') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="phonepe_username_key" name="gateway[PhonePe][username]"
|
||||
type="text" class="form-control phonepe-required"
|
||||
placeholder="{{ __('PhonePe Username') }}"
|
||||
value="{{ $paymentGateway['PhonePe']['username'] ?? '' }}">
|
||||
</div>
|
||||
<label for="phonepe_password"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PhonePe Password') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paystack_publishable_key" name="gateway[PhonePe][password]"
|
||||
type="text" class="form-control phonepe-required"
|
||||
placeholder="{{ __('PhonePe Password') }}"
|
||||
value="{{ $paymentGateway['PhonePe']['password'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="phonepe_mode"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PhonePe Payment Mode') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<select id="phonepe_mode" name="gateway[PhonePe][payment_mode]"
|
||||
class="form-control phonepe-required">
|
||||
<option value="UAT"
|
||||
{{ isset($paymentGateway['PhonePe']['payment_mode']) && $paymentGateway['PhonePe']['payment_mode'] == 'UAT' ? 'selected' : '' }}>
|
||||
UAT</option>
|
||||
<option value="PROD"
|
||||
{{ isset($paymentGateway['PhonePe']['payment_mode']) && $paymentGateway['PhonePe']['payment_mode'] == 'PROD' ? 'selected' : '' }}>
|
||||
PROD</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="paystack_webhook_url"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PhonePe Webhook URL') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="phonePe_webhook_url" name="gateway[PhonePe][webhook_url]" type="text"
|
||||
class="form-control" placeholder="{{ __('PhonePe Webhook URL') }}"
|
||||
value="{{ url('/webhook/phonePe') }}" disabled>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-12 form-check-label mt-2"
|
||||
id='lbl_stripe'>{{ __('Status') }}</label>
|
||||
<div class="col-sm-2 col-md-12 col-xs-12 mt-2">
|
||||
<div class="form-check form-switch ">
|
||||
<input type="hidden" name="gateway[PhonePe][status]" id="paystack_gateway"
|
||||
value="{{ $paymentGateway['PhonePe']['status'] ?? 0 }}">
|
||||
<input class="form-check-input switch-input status-switch" type="checkbox"
|
||||
role="switch" name='op'
|
||||
{{ isset($paymentGateway['PhonePe']['status']) && $paymentGateway['PhonePe']['status'] == '1' ? 'checked' : '' }}
|
||||
id="switch_phonepe_gateway" aria-label="switch_paystack_gateway">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- phonePe Payment Gateway END --}}
|
||||
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('Flutterwave Setting') }}</h6>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-3">
|
||||
<label for="flutterwave_currency_code" class="col-sm-12 form-check-label mt-2">
|
||||
{{ __('Flutterwave Currency') }}
|
||||
</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<select name="gateway[flutterwave][currency_code]" id="flutterwave_currency_code"
|
||||
class="select2 form-select form-control-sm">
|
||||
<option value="NGN">NGN</option>
|
||||
<option value="USD">USD</option>
|
||||
<option value="GHS">GHS</option>
|
||||
<option value="KES">KES</option>
|
||||
<option value="UGX">UGX</option>
|
||||
<option value="TZS">TZS</option>
|
||||
<option value="ZAR">ZAR</option>
|
||||
<option value="XOF">XOF</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="flutterwave_secret_key" class="col-sm-12 form-check-label mt-2">
|
||||
{{ __('Flutterwave Secret Key') }}
|
||||
</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="flutterwave_secret_key" name="gateway[flutterwave][secret_key]"
|
||||
type="text" class="form-control"
|
||||
placeholder="{{ __('Flutterwave Secret Key') }}"
|
||||
value="{{ $paymentGateway['flutterwave']['secret_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="flutterwave_public_key" class="col-sm-12 form-check-label mt-2">
|
||||
{{ __('Flutterwave Public Key') }}
|
||||
</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="flutterwave_public_key" name="gateway[flutterwave][api_key]"
|
||||
type="text" class="form-control"
|
||||
placeholder="{{ __('Flutterwave Public Key') }}"
|
||||
value="{{ $paymentGateway['flutterwave']['api_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="flutterwave_encryption_key" class="col-sm-12 form-check-label mt-2">
|
||||
{{ __('Flutterwave Webhook Secret') }}
|
||||
</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="flutterwave_encryption_key" name="gateway[flutterwave][webhook_secret_key]"
|
||||
type="text" class="form-control"
|
||||
placeholder="{{ __('Flutterwave Webhook Secret') }}"
|
||||
value="{{ $paymentGateway['flutterwave']['webhook_secret_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="flutterwave_webhook_url" class="col-sm-12 form-check-label mt-2">
|
||||
{{ __('Flutterwave Webhook URL') }}
|
||||
</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="flutterwave_webhook_url" name="gateway[flutterwave][webhook_url]"
|
||||
type="text" class="form-control"
|
||||
placeholder="{{ __('Flutterwave Webhook URL') }}"
|
||||
value="{{ url('/webhook/flutterwave') }}" disabled>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-12 form-check-label mt-2"
|
||||
id='lbl_flutterwave'>{{ __('Status') }}</label>
|
||||
<div class="col-sm-2 col-md-12 col-xs-12 mt-2">
|
||||
<div class="form-check form-switch">
|
||||
<input type="hidden" name="gateway[flutterwave][status]"
|
||||
id="flutterwave_gateway"
|
||||
value="{{ $paymentGateway['flutterwave']['status'] ?? 0 }}">
|
||||
<input class="form-check-input switch-input status-switch" type="checkbox"
|
||||
role="switch" name='op'
|
||||
{{ isset($paymentGateway['flutterwave']['status']) && $paymentGateway['flutterwave']['status'] == '1' ? 'checked' : '' }}
|
||||
id="switch_flutterwave_gateway" aria-label="switch_flutterwave_gateway">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- paypal Payment Gateway START --}}
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('PayPal Setting') }}</h6>
|
||||
</div>
|
||||
<div class="form-group row mt-3">
|
||||
|
||||
<label for="paypal_currency_code"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PayPal Currency Symbol') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<select name="gateway[Paypal][currency_code]" id="paypal_currency_code"
|
||||
class="select2 form-select form-control">
|
||||
<option value="USD"
|
||||
{{ ($paymentGateway['Paypal']['currency_code'] ?? '') == 'USD' ? 'selected' : '' }}>
|
||||
USD</option>
|
||||
<option value="EUR"
|
||||
{{ ($paymentGateway['Paypal']['currency_code'] ?? '') == 'EUR' ? 'selected' : '' }}>
|
||||
EUR</option>
|
||||
<option value="GBP"
|
||||
{{ ($paymentGateway['Paypal']['currency_code'] ?? '') == 'GBP' ? 'selected' : '' }}>
|
||||
GBP</option>
|
||||
<option value="AUD"
|
||||
{{ ($paymentGateway['Paypal']['currency_code'] ?? '') == 'AUD' ? 'selected' : '' }}>
|
||||
AUD</option>
|
||||
<option value="CAD"
|
||||
{{ ($paymentGateway['Paypal']['currency_code'] ?? '') == 'CAD' ? 'selected' : '' }}>
|
||||
CAD</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="paypal_client_id"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PayPal Client ID') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paypal_client_id" name="gateway[Paypal][api_key]" type="text"
|
||||
class="form-control" placeholder="{{ __('PayPal Client ID') }}"
|
||||
value="{{ $paymentGateway['Paypal']['api_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="paypal_secret_key"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PayPal Secret Key') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paypal_secret_key" name="gateway[Paypal][secret_key]" type="text"
|
||||
class="form-control" placeholder="{{ __('PayPal Secret Key') }}"
|
||||
value="{{ $paymentGateway['Paypal']['secret_key'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label for="paypal_webhook_url"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('PayPal Webhook URL') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<input id="paypal_webhook_url" name="gateway[Paypal][webhook_url]" type="text"
|
||||
class="form-control" placeholder="{{ __('PayPal Webhook URL') }}"
|
||||
value="{{ url('/webhook/paypal') }}" disabled>
|
||||
</div>
|
||||
|
||||
<label for="phonepe_mode"
|
||||
class="col-sm-12 form-check-label mt-2">{{ __('Paypal Payment Mode') }}</label>
|
||||
<div class="col-sm-12 mt-2">
|
||||
<select id="phonepe_mode" name="gateway[Paypal][payment_mode]"
|
||||
class="form-control phonepe-required">
|
||||
<option value="UAT"
|
||||
{{ isset($paymentGateway['Paypal']['payment_mode']) && $paymentGateway['Paypal']['payment_mode'] == 'UAT' ? 'selected' : '' }}>
|
||||
UAT</option>
|
||||
<option value="PROD"
|
||||
{{ isset($paymentGateway['Paypal']['payment_mode']) && $paymentGateway['Paypal']['payment_mode'] == 'PROD' ? 'selected' : '' }}>
|
||||
PROD</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-12 form-check-label mt-2">{{ __('Status') }}</label>
|
||||
<div class="col-sm-2 col-md-12 col-xs-12 mt-2">
|
||||
<div class="form-check form-switch">
|
||||
<input type="hidden" name="gateway[Paypal][status]" id="paypal_gateway"
|
||||
value="{{ $paymentGateway['Paypal']['status'] ?? 0 }}">
|
||||
<input class="form-check-input switch-input status-switch" type="checkbox"
|
||||
role="switch" name='op'
|
||||
{{ isset($paymentGateway['Paypal']['status']) && $paymentGateway['Paypal']['status'] == '1' ? 'checked' : '' }}
|
||||
id="switch_paypal_gateway" aria-label="switch_paypal_gateway">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- paypal Payment Gateway END --}}
|
||||
{{-- Bank Account Details --}}
|
||||
<div class="col-md-6 mt-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="divider pt-3">
|
||||
<h6 class="divider-text">{{ __('Manage Bank Account Details') }}</h6>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="account_holder_name"
|
||||
class="form-label">{{ __('Account Holder Name') }}</label>
|
||||
<input class="form-control" type="text" name="bank[account_holder_name]"
|
||||
id="account_holder_name" value="{{ $settings['account_holder_name'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="bank_name" class="form-label">{{ __('Bank Name') }}</label>
|
||||
<input class="form-control" type="text" name="bank[bank_name]" id="bank_name"
|
||||
value="{{ $settings['bank_name'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="account_number" class="form-label">{{ __('Account Number') }}</label>
|
||||
<input class="form-control" type="number" name="bank[account_number]"
|
||||
id="account_number" value="{{ $settings['account_number'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="ifsc_swift_code" class="form-label">{{ __('IFSC/SWIFT Code') }}</label>
|
||||
<input class="form-control" type="text" name="bank[ifsc_swift_code]"
|
||||
id="ifsc_swift_code" value="{{ $settings['ifsc_swift_code'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
<label class="form-check-label mt-2">{{ __('Status') }}</label>
|
||||
<div class="form-check form-switch">
|
||||
<input type="hidden" name="bank[bank_transfer_status]" value="0">
|
||||
<input class="form-check-input" type="checkbox" name="bank[bank_transfer_status]"
|
||||
value="1"
|
||||
{{ isset($settings['bank_transfer_status']) && $settings['bank_transfer_status'] == '1' ? 'checked' : '' }}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-12 d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-primary me-1 mb-3">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
$('#stripe_currency_code').val("{{ $paymentGateway['Stripe']['currency_code'] ?? '' }}").trigger("change");
|
||||
$('#switch_stripe_gateway').val("{{ $paymentGateway['Stripe']['status'] ?? false }}").trigger("change");
|
||||
|
||||
$('#razorpay_currency_code').val("{{ $paymentGateway['Razorpay']['currency_code'] ?? '' }}").trigger("change");
|
||||
$('#switch_razorpay_gateway').val("{{ $paymentGateway['Stripe']['status'] ?? false }}").trigger("change");
|
||||
|
||||
$('#paystack_currency_code').val("{{ $paymentGateway['Paystack']['currency_code'] ?? '' }}").trigger("change");
|
||||
$('#switch_paystack_gateway').val("{{ $paymentGateway['Stripe']['status'] ?? false }}").trigger("change");
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
function togglePhonePeRequiredFields() {
|
||||
if ($('#switch_phonepe_gateway').is(':checked')) {
|
||||
$('.phonepe-required').attr('required', true);
|
||||
} else {
|
||||
$('.phonepe-required').removeAttr('required');
|
||||
}
|
||||
}
|
||||
|
||||
// Initial check on page load
|
||||
togglePhonePeRequiredFields();
|
||||
|
||||
// On switch toggle
|
||||
$('#switch_phonepe_gateway').on('change', function() {
|
||||
togglePhonePeRequiredFields();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
91
resources/views/settings/privacy-policy.blade.php
Normal file
91
resources/views/settings/privacy-policy.blade.php
Normal file
@@ -0,0 +1,91 @@
|
||||
@extends('layouts.main')
|
||||
@section('title')
|
||||
{{ __('Privacy Policy') }}
|
||||
@endsection
|
||||
|
||||
@section('page-title')
|
||||
<div class="page-title">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 order-md-1 order-last">
|
||||
<h4>@yield('title')</h4>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 order-md-2 order-first"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<form action="{{ route('settings.store')}}" method="post" class="create-form-without-reset">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="row form-group">
|
||||
<div class="col-2 d-flex justify-content-end">
|
||||
<a href="{{ route('public.privacy-policy') }}" target="_blank" class="col-sm-12 col-md-12 d-fluid btn icon btn-primary btn-sm rounded-pill" onclick="" title="Enable">
|
||||
<i class="bi bi-eye-fill"></i>
|
||||
</a>
|
||||
</div>
|
||||
<ul class="nav nav-tabs" id="privacyTabs" role="tablist">
|
||||
@foreach($languages as $lang)
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link {{ $loop->first ? 'active' : '' }}"
|
||||
id="privacy-tab-{{ $lang->id }}"
|
||||
data-bs-toggle="tab"
|
||||
href="#privacy-lang-{{ $lang->id }}"
|
||||
role="tab">
|
||||
{{ $lang->name }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<!-- Tab Panes -->
|
||||
<div class="tab-content mt-3">
|
||||
@foreach($languages as $lang)
|
||||
<div class="tab-pane fade {{ $loop->first ? 'show active' : '' }}"
|
||||
id="privacy-lang-{{ $lang->id }}"
|
||||
role="tabpanel">
|
||||
<input type="hidden" name="languages[]" value="{{ $lang->id }}">
|
||||
<div class="form-group">
|
||||
<label>{{ __("Privacy Policy") }} ({{ $lang->name }})</label>
|
||||
<textarea name="privacy_policy[{{ $lang->id }}]"
|
||||
id="tinymce_editor_privacy_{{ $lang->id }}"
|
||||
class="tinymce_editor form-control"
|
||||
rows="6">{{ old("privacy_policy.$lang->id", $translations['privacy_policy'][$lang->id] ?? ($settings['privacy_policy'] ?? '')) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<!-- Save Button -->
|
||||
<div class="col-12 mt-3 d-flex justify-content-end">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@section('script')
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor',
|
||||
height: 400,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist autolink lists link charmap preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
'insertdatetime table paste code help wordcount'
|
||||
],
|
||||
toolbar: 'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | removeformat | code',
|
||||
setup: function (editor) {
|
||||
editor.on("change keyup", function () {
|
||||
editor.save();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user