feat: Implement product and product category management with dedicated CRUD operations, services, and repositories.
This commit is contained in:
@@ -17,12 +17,17 @@
|
||||
--font-lexend: var(--lexend);
|
||||
--font-inter: var(--inter);
|
||||
--font-averta: "Averta", sans-serif;
|
||||
--color-info: var(--color-info);
|
||||
--color-success: var(--color-success);
|
||||
}
|
||||
|
||||
:root {
|
||||
--color-primary: #f66d2f;
|
||||
--color-primary-light: #ff914d;
|
||||
--color-primary-dark: #9a4b1f;
|
||||
--color-info: #005C8A;
|
||||
--color-success: #22C55E;
|
||||
|
||||
|
||||
--color-primary-100: #f9b8a0;
|
||||
--color-primary-200: #f88a73;
|
||||
|
||||
@@ -35,8 +35,8 @@ $cyan: #0dcaf0 !default;
|
||||
//
|
||||
$primary: #F16723 !default;
|
||||
$secondary: $gray-600 !default;
|
||||
$success: #10B981 !default;
|
||||
$info: #0F172A !default;
|
||||
$success: #22C55E !default;
|
||||
$info: #005C8A !default;
|
||||
$warning: #F59E0B !default;
|
||||
$danger: #dc3545 !default;
|
||||
$light: $gray-200 !default;
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
<x-button-crm variant="primary" size="sm" url="{{ route('module.hosting.import') }}" icon="plus-circle">Import From
|
||||
Excel</x-button-crm>
|
||||
</form>
|
||||
<x-button-crm variant="secondary" size="sm" url="file/Hosting.xlsx" icon="download">File Import Demo</x-button-crm>
|
||||
<x-button-crm variant="info" size="sm" url="file/Hosting.xlsx" icon="download">File Import Demo</x-button-crm>
|
||||
@@ -4,7 +4,7 @@
|
||||
@csrf
|
||||
<input type="file" name="file" class="d-none file-selector"
|
||||
accept=".csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" onchange="form.submit()" />
|
||||
<x-button-crm type="submit" variant="secondary" size="sm" icon="download">Import From Excel</x-button-crm>
|
||||
<x-button-crm type="button" variant="primary" size="sm" icon="download">Import From Excel</x-button-crm>
|
||||
</form>
|
||||
<x-button-crm type="button" variant="info" size="sm" url="file/IPPool.xlsx" icon="download">Download
|
||||
Template</x-button-crm>
|
||||
@@ -1,2 +0,0 @@
|
||||
<a href="{{ route('group.create') }}" class="btn btn-outline-secondary"><i class="fas fa-plus"></i> Add New Product Group</a>
|
||||
<a href="{{ route('product.create') }}" class="btn btn-outline-secondary"><i class="fas fa-plus-circle"></i> Add New Product</a>
|
||||
@@ -0,0 +1,6 @@
|
||||
@if(auth()->guard('admins')->user()->can("manager product"))
|
||||
<x-button-crm type="button" variant="primary" size="sm" route="products.create" icon="plus-circle">Add
|
||||
Product</x-button-crm>
|
||||
<x-button-crm type="button" variant="info" size="sm" route="products.group.create" icon="plus-circle">Add
|
||||
Group</x-button-crm>
|
||||
@endif
|
||||
@@ -7,44 +7,44 @@
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbItems = [
|
||||
['label' => 'Modules'],
|
||||
['label' => 'IP Pools', 'active' => true],
|
||||
];
|
||||
$breadcrumbItems = [
|
||||
['label' => 'Modules'],
|
||||
['label' => 'IP Pools', 'active' => true],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-breadcrumb :items="$breadcrumbItems" />
|
||||
@endsection
|
||||
@section('tab')
|
||||
@php
|
||||
$tabs = [
|
||||
[
|
||||
'label' => 'DNS',
|
||||
'route' => 'module.dns.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'Hosting',
|
||||
'route' => 'module.hosting.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'vCenter',
|
||||
'route' => 'module.vcenter.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'IpPool',
|
||||
'route' => 'module.ippool.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
];
|
||||
$tabs = [
|
||||
[
|
||||
'label' => 'DNS',
|
||||
'route' => 'module.dns.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'Hosting',
|
||||
'route' => 'module.hosting.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'vCenter',
|
||||
'route' => 'module.vcenter.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'IpPool',
|
||||
'route' => 'module.ippool.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-tab :items="$tabs" />
|
||||
@endsection
|
||||
@section('content')
|
||||
@if (auth()->guard('admins')->user()->can('manager module ippool'))
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-header">
|
||||
<div class="card-header d-flex justify-content-end gap-2">
|
||||
@include('administrator.pages.block.ModuleIPPool')
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
@endphp
|
||||
|
||||
@if($status)
|
||||
{!! $status->badge() !!}
|
||||
<x-admin-badge :variant="$status->value">
|
||||
{{ $status->label() }}
|
||||
</x-admin-badge>
|
||||
@else
|
||||
<span class="badge badge-secondary">Unknown</span>
|
||||
@endif
|
||||
<x-admin-badge variant="secondary">
|
||||
Unknown
|
||||
</x-admin-badge>
|
||||
@endif
|
||||
@@ -52,7 +52,7 @@
|
||||
['key' => 'host', 'label' => 'Host'],
|
||||
['key' => 'user', 'label' => 'User'],
|
||||
['key' => 'status', 'label' => 'Status'],
|
||||
['key' => 'action', 'label' => 'Action'],
|
||||
['key' => 'action', 'label' => 'Action', 'searchable' => false],
|
||||
]" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<x-button-crm type="button" variant="primary" size="sm" route="package.vm.edit" :params="['id' => $row->id]" icon="pencil">Edit</x-button-crm>
|
||||
<x-button-crm type="button" variant="danger" size="sm" route="package.vm.destroy" :params="['id' => $row->id]" icon="trash">Delete</x-button-crm>
|
||||
@@ -29,7 +29,6 @@
|
||||
['key' => 'cpu', 'label' => 'CPU'],
|
||||
['key' => 'ram_mb', 'label' => 'RAM (MB)'],
|
||||
['key' => 'datacenter.name', 'label' => 'Datacenter'],
|
||||
['key' => 'host.name', 'label' => 'Host'],
|
||||
['key' => 'action', 'label' => 'Action', 'orderable' => false, 'searchable' => false],
|
||||
]" />
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
@extends('administrator.layout.master')
|
||||
@push('plugin-styles')
|
||||
@foreach (config('assets.datatable.css') as $datatable)
|
||||
<link href="{{ asset($datatable) }}" rel="stylesheet" />
|
||||
@endforeach
|
||||
@endpush
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbItems = [
|
||||
['label' => 'Product'],
|
||||
['label' => 'Product / Services', 'url' => route('products.index')],
|
||||
['label' => 'Product Categories', 'url' => route('products.group.index')],
|
||||
['label' => 'Add Product Group', 'active' => true],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-breadcrumb :items="$breadcrumbItems" />
|
||||
@endsection
|
||||
@section('tab')
|
||||
@php
|
||||
$tabs = [
|
||||
[
|
||||
'label' => 'Product',
|
||||
'route' => 'products.create',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'Product Group',
|
||||
'route' => 'products.group.create',
|
||||
'icon' => 'server',
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-tab :items="$tabs" />
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form action="{{ route('products.group.store') }}" method="post">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title m-0">Basic Information</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">Group Name <span class="text-danger">*</span></label>
|
||||
<input type="text" id="name" name="name" value="{{ old('name') }}" class="form-control" required
|
||||
placeholder="Enter category name">
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="slug">Slug</label>
|
||||
<input type="text" id="slug" name="slug" value="{{ old('slug') }}" class="form-control"
|
||||
placeholder="auto-generated-if-empty">
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="parent_id">Parent Category</label>
|
||||
<select name="parent_id" id="parent_id" class="form-control select2">
|
||||
<option value="">-- Root --</option>
|
||||
@if(isset($categories))
|
||||
@foreach($categories as $category)
|
||||
<option value="{{ $category->id }}" {{ old('parent_id') == $category->id ? 'selected' : '' }}>
|
||||
{{ $category->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card card-secondary card-outline">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title m-0">Classification</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="is_active">Status</label>
|
||||
<select name="is_active" id="is_active" class="form-control select2">
|
||||
<option value="1" {{ old('is_active', 1) == 1 ? 'selected' : '' }}>Active</option>
|
||||
<option value="0" {{ old('is_active') == 0 ? 'selected' : '' }}>Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="sort_order">Sort Order</label>
|
||||
<input type="number" name="sort_order" id="sort_order" class="form-control"
|
||||
value="{{ old('sort_order', 0) }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-fixed-action-bar>
|
||||
<x-button-crm type="button" variant="secondary" size="sm" icon="arrow-left"
|
||||
route="products.group.index">Cancel</x-button-crm>
|
||||
<x-button-crm type="submit" variant="primary" size="sm" icon="plus-circle">Create Category</x-button-crm>
|
||||
</x-fixed-action-bar>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('plugin-scripts')
|
||||
@foreach (config('assets.datatable.js') as $datatable)
|
||||
<script src="{{ asset($datatable) }}"></script>
|
||||
@endforeach
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
if ($(".select2").length) {
|
||||
$(".select2").select2();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,2 @@
|
||||
<x-button-crm type="button" variant="primary" size="sm" route="products.group.edit" :params="['id' => $row->id]" icon="pencil">Edit</x-button-crm>
|
||||
<x-button-crm type="button" variant="danger" size="sm" route="products.group.destroy" :params="['id' => $row->id]" icon="trash">Delete</x-button-crm>
|
||||
@@ -0,0 +1,13 @@
|
||||
@php
|
||||
$status = App\Enums\Status::tryFrom($row->is_active);
|
||||
@endphp
|
||||
|
||||
@if($status)
|
||||
<x-admin-badge :variant="$status->value">
|
||||
{{ $status->label() }}
|
||||
</x-admin-badge>
|
||||
@else
|
||||
<x-admin-badge variant="secondary">
|
||||
Unknown
|
||||
</x-admin-badge>
|
||||
@endif
|
||||
@@ -0,0 +1,111 @@
|
||||
@extends('administrator.layout.master')
|
||||
@push('plugin-styles')
|
||||
@foreach (config('assets.datatable.css') as $datatable)
|
||||
<link href="{{ asset($datatable) }}" rel="stylesheet" />
|
||||
@endforeach
|
||||
@endpush
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbItems = [
|
||||
['label' => 'Product'],
|
||||
['label' => 'Product / Services', 'url' => route('products.index')],
|
||||
['label' => 'Product Group', 'url' => route('products.group.index')],
|
||||
['label' => 'Edit Product Group', 'active' => true],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-breadcrumb :items="$breadcrumbItems" />
|
||||
@endsection
|
||||
@section('tab')
|
||||
@php
|
||||
$tabs = [
|
||||
[
|
||||
'label' => 'Product',
|
||||
'route' => 'products.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'Product Group',
|
||||
'route' => 'products.group.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-tab :items="$tabs" />
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form action="{{ route('products.group.update', ['id' => $category->id]) }}" method="post">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name">Group Name <span class="text-danger">*</span></label>
|
||||
<input type="text" id="name" name="name" value="{{ old('name', $category->name) }}" class="form-control" required placeholder="Enter category name">
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="slug">Slug</label>
|
||||
<input type="text" id="slug" name="slug" value="{{ old('slug', $category->slug) }}" class="form-control" placeholder="auto-generated-if-empty">
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="parent_id">Parent Category</label>
|
||||
<select name="parent_id" id="parent_id" class="form-control select2">
|
||||
<option value="">-- Root --</option>
|
||||
@if(isset($categories))
|
||||
@foreach($categories as $cat)
|
||||
<option value="{{ $cat->id }}" {{ old('parent_id', $category->parent_id) == $cat->id ? 'selected' : '' }}>{{ $cat->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card card-secondary card-outline">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title m-0">Classification</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-3">
|
||||
<label for="is_active">Status</label>
|
||||
<select name="is_active" id="is_active" class="form-control select2">
|
||||
<option value="1" {{ old('is_active', $category->is_active) == 1 ? 'selected' : '' }}>Active</option>
|
||||
<option value="0" {{ old('is_active', $category->is_active) == 0 ? 'selected' : '' }}>Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="sort_order">Sort Order</label>
|
||||
<input type="number" name="sort_order" id="sort_order" class="form-control" value="{{ old('sort_order', $category->sort_order) }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-fixed-action-bar>
|
||||
<x-button-crm type="button" variant="secondary" size="sm" icon="arrow-left" route="products.group.index">Cancel</x-button-crm>
|
||||
<x-button-crm type="submit" variant="primary" size="sm" icon="save">Update Category</x-button-crm>
|
||||
</x-fixed-action-bar>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('plugin-scripts')
|
||||
@foreach (config('assets.datatable.js') as $datatable)
|
||||
<script src="{{ asset($datatable) }}"></script>
|
||||
@endforeach
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
if ($(".select2").length) {
|
||||
$(".select2").select2();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,62 @@
|
||||
@extends('administrator.layout.master')
|
||||
@push('plugin-styles')
|
||||
@foreach (config('assets.datatable.css') as $datatable)
|
||||
<link href="{{ asset($datatable) }}" rel="stylesheet" />
|
||||
@endforeach
|
||||
@endpush
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbItems = [
|
||||
['label' => 'Product'],
|
||||
['label' => 'Product Group'],
|
||||
['label' => 'Product Group List', 'active' => true]
|
||||
];
|
||||
@endphp
|
||||
<x-admin-breadcrumb :items="$breadcrumbItems" />
|
||||
@endsection
|
||||
@section('tab')
|
||||
@php
|
||||
$tabs = [
|
||||
[
|
||||
'label' => 'Product',
|
||||
'route' => 'products.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'Product Group',
|
||||
'route' => 'products.group.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-tab :items="$tabs" />
|
||||
@endsection
|
||||
@section('content')
|
||||
@if (auth()->guard('admins')->user()->can('manager product'))
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-header d-flex justify-content-end gap-2">
|
||||
@include('administrator.pages.block.product.btn')
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<x-datatable id="productTable" ajax="{{ route('products.group.datatable') }}" :columns="[
|
||||
['key' => 'name', 'label' => 'Group'],
|
||||
['key' => 'slug', 'label' => 'Slug'],
|
||||
['key' => 'is_active', 'label' => 'Status'],
|
||||
['key' => 'action', 'label' => 'Action', 'searchable' => false],
|
||||
]" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Product
|
||||
management department</h5>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
@push('plugin-scripts')
|
||||
@foreach (config('assets.datatable.js') as $datatable)
|
||||
<script src="{{ asset($datatable) }}"></script>
|
||||
@endforeach
|
||||
@endpush
|
||||
@@ -0,0 +1,295 @@
|
||||
@extends('administrator.layout.master')
|
||||
@push('plugin-styles')
|
||||
@foreach (config('assets.datatable.css') as $datatable)
|
||||
<link href="{{ asset($datatable) }}" rel="stylesheet" />
|
||||
@endforeach
|
||||
@endpush
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbItems = [
|
||||
['label' => 'Product'],
|
||||
['label' => 'Product / Services', 'url' => route('products.index')],
|
||||
['label' => 'Add Product / Services', 'active' => true],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-breadcrumb :items="$breadcrumbItems" />
|
||||
@endsection
|
||||
@section('tab')
|
||||
@php
|
||||
$tabs = [
|
||||
[
|
||||
'label' => 'Product',
|
||||
'route' => 'products.create',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'Product Group',
|
||||
'route' => 'products.group.create',
|
||||
'icon' => 'server',
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-tab :items="$tabs" />
|
||||
@endsection
|
||||
@section('content')
|
||||
<form action="{{ route('products.store') }}" method="post">
|
||||
@csrf
|
||||
<div class="row align-items-start">
|
||||
{{-- Left Column: Basic Info & Pricing --}}
|
||||
<div class="col-md-8">
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title m-0">Basic Information</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
{{-- Basic Information --}}
|
||||
<div class="mb-4">
|
||||
<h5 class="text-primary border-bottom pb-2 mb-3">Basic Information</h5>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="name">Product Name <span class="text-danger">*</span></label>
|
||||
<input type="text" id="name" name="name"
|
||||
value="{{ old('name') }}" class="form-control" required placeholder="Enter product name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="slug">Slug</label>
|
||||
<input type="text" id="slug" name="slug"
|
||||
value="{{ old('slug') }}" class="form-control" placeholder="auto-generated-if-empty"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="short_description">Short Description</label>
|
||||
<textarea name="short_description" id="short_description" rows="2" class="form-control" placeholder="Brief summary">{{ old('short_description') }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="description">Full Description</label>
|
||||
<textarea name="description" id="description" rows="4" class="form-control" placeholder="Detailed description">{{ old('description') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Pricing & Billing --}}
|
||||
<div class="mb-4">
|
||||
<h5 class="text-primary border-bottom pb-2 mb-3">Pricing & Billing</h5>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="price">Regular Price</label>
|
||||
<div class="input-group">
|
||||
<input type="number" step="0.01" id="price" name="price"
|
||||
value="{{ old('price', 0) }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="price_sale">Sale Price</label>
|
||||
<div class="input-group">
|
||||
<input type="number" step="0.01" id="price_sale" name="price_sale"
|
||||
value="{{ old('price_sale') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="setup_fee">Setup Fee</label>
|
||||
<div class="input-group">
|
||||
<input type="number" step="0.01" id="setup_fee" name="setup_fee"
|
||||
value="{{ old('setup_fee', 0) }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="currency">Currency</label>
|
||||
<select name="currency" id="currency" class="form-control select2">
|
||||
<option value="USD" {{ old('currency') == 'USD' ? 'selected' : '' }}>USD</option>
|
||||
<option value="VND" {{ old('currency') == 'VND' ? 'selected' : '' }}>VND</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="billing_cycle">Billing Cycle</label>
|
||||
<select name="billing_cycle" id="billing_cycle" class="form-control select2">
|
||||
<option value="monthly" {{ old('billing_cycle') == 'monthly' ? 'selected' : '' }}>Monthly</option>
|
||||
<option value="quarterly" {{ old('billing_cycle') == 'quarterly' ? 'selected' : '' }}>Quarterly</option>
|
||||
<option value="semi_annually" {{ old('billing_cycle') == 'semi_annually' ? 'selected' : '' }}>Semi-Annually</option>
|
||||
<option value="annually" {{ old('billing_cycle') == 'annually' ? 'selected' : '' }}>Annually</option>
|
||||
<option value="one_time" {{ old('billing_cycle') == 'one_time' ? 'selected' : '' }}>One Time</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="trial_days">Trial Days</label>
|
||||
<input type="number" id="trial_days" name="trial_days"
|
||||
value="{{ old('trial_days', 0) }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Hardware Specs (VPS/Dedicated) --}}
|
||||
<div class="mb-4">
|
||||
<h5 class="text-info border-bottom pb-2 mb-3">Hardware Specifications</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="cpu">CPU</label>
|
||||
<input type="text" name="cpu" id="cpu" class="form-control"
|
||||
value="{{ old('cpu') }}" placeholder="e.g. 2 Core" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="ram">RAM</label>
|
||||
<input type="text" name="ram" id="ram" class="form-control"
|
||||
value="{{ old('ram') }}" placeholder="e.g. 4 GB" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="disk">Disk/Storage</label>
|
||||
<input type="text" name="disk" id="disk" class="form-control"
|
||||
value="{{ old('disk') }}" placeholder="e.g. 50 GB NVMe" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="bandwidth">Bandwidth</label>
|
||||
<input type="text" name="bandwidth" id="bandwidth" class="form-control"
|
||||
value="{{ old('bandwidth') }}" placeholder="e.g. Unlimited" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="gpu">GPU</label>
|
||||
<input type="text" name="gpu" id="gpu" class="form-control"
|
||||
value="{{ old('gpu') }}" placeholder="Optional">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Right Column: Classification & Settings --}}
|
||||
<div class="col-md-4 sticky-top top-10 z-0">
|
||||
<div class="card card-secondary card-outline mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title m-0">Classification</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{-- Product Category --}}
|
||||
<div class="form-group mb-3">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<label for="product_categories_id">Category</label>
|
||||
<a href={{ route('products.group.index') }} class="text-primary text-decoration-underline">
|
||||
<i data-lucide="plus" class="w-12px h-12px"></i>
|
||||
Thêm Group
|
||||
</a>
|
||||
</div>
|
||||
<select class="form-control select2" name="product_categories_id" id="product_categories_id">
|
||||
@foreach($group as $item)
|
||||
<option value="{{ $item->id }}" {{ old('product_categories_id') == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{-- Product Type --}}
|
||||
<div class="form-group mb-3">
|
||||
<label for="product_type" class="mb-2">Product Type</label>
|
||||
<select class="form-control select2" name="product_type" id="product_type">
|
||||
@foreach($type as $item)
|
||||
<option value="{{ $item->name }}" {{ old('product_type') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{-- Status --}}
|
||||
<div class="form-group mb-3">
|
||||
<label for="status" class="mb-2">Status</label>
|
||||
<select class="form-control select2" name="status" id="status">
|
||||
<option value="{{ \App\Enums\Status::ACTIVE->value }}">Active</option>
|
||||
<option value="{{ \App\Enums\Status::DEACTIVE->value }}">Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="sort_order" class="mb-2">Sort Order</label>
|
||||
<input type="number" name="sort_order" id="sort_order" class="form-control" value="{{ old('sort_order', 0) }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-secondary card-outline">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title m-0">Inventory & Limits</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="stock">Stock Quantity</label>
|
||||
<input type="number" name="stock" id="stock" class="form-control" placeholder="Unlimited if empty" value="{{ old('stock') }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" id="is_unlimited" name="is_unlimited" value="1" {{ old('is_unlimited', true) ? 'checked' : '' }}>
|
||||
<label class="custom-control-label" for="is_unlimited">Unlimited Stock</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<label for="published_at">Publish Date</label>
|
||||
<input type="date" name="published_at" id="published_at" class="form-control" value="{{ old('published_at') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-fixed-action-bar>
|
||||
<x-button-crm type="button" variant="secondary" size="sm" icon="arrow-left" route="products.index">Cancel</x-button-crm>
|
||||
<x-button-crm type="submit" variant="primary" size="sm" icon="plus-circle">Create Product</x-button-crm>
|
||||
</x-fixed-action-bar>
|
||||
</form>
|
||||
@endsection
|
||||
@push('plugin-scripts')
|
||||
@foreach (config('assets.datatable.js') as $datatable)
|
||||
<script src="{{ asset($datatable) }}"></script>
|
||||
@endforeach
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
if ($(".select2").length) {
|
||||
$(".select2").select2();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script src="{{ asset('lib/ckeditor/ckeditor.js') }}"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
CKEDITOR.replace('description');
|
||||
CKEDITOR.replace('short_description');
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,2 @@
|
||||
<x-button-crm type="button" variant="primary" size="sm" route="product.edit" :params="['product_id' => $row->id]" icon="pencil">Edit</x-button-crm>
|
||||
<x-button-crm type="button" variant="danger" size="sm" route="product.destroy" :params="['product_id' => $row->id]" icon="trash">Delete</x-button-crm>
|
||||
@@ -0,0 +1,269 @@
|
||||
@extends('administrator.layout.master')
|
||||
@push('plugin-styles')
|
||||
@foreach (config('assets.datatable.css') as $datatable)
|
||||
<link href="{{ asset($datatable) }}" rel="stylesheet" />
|
||||
@endforeach
|
||||
@endpush
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbItems = [
|
||||
['label' => 'Product'],
|
||||
['label' => 'Product / Services', 'url' => route('products.index')],
|
||||
['label' => 'Add Product / Services', 'active' => true],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-breadcrumb :items="$breadcrumbItems" />
|
||||
@endsection
|
||||
@section('content')
|
||||
<form action="{{ route('products.store') }}" method="post">
|
||||
@csrf
|
||||
<div class="row">
|
||||
{{-- Left Column: Basic Info & Pricing --}}
|
||||
<div class="col-md-8">
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-body">
|
||||
|
||||
{{-- Basic Information --}}
|
||||
<div class="mb-4">
|
||||
<h5 class="text-primary border-bottom pb-2 mb-3">Basic Information</h5>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="name">Product Name <span class="text-danger">*</span></label>
|
||||
<input type="text" id="name" name="name"
|
||||
value="{{ old('name') }}" class="form-control" required placeholder="Enter product name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="slug">Slug</label>
|
||||
<input type="text" id="slug" name="slug"
|
||||
value="{{ old('slug') }}" class="form-control" placeholder="auto-generated-if-empty"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="short_description">Short Description</label>
|
||||
<textarea name="short_description" id="short_description" rows="2" class="form-control" placeholder="Brief summary">{{ old('short_description') }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="description">Full Description</label>
|
||||
<textarea name="description" id="description" rows="4" class="form-control" placeholder="Detailed description">{{ old('description') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Pricing & Billing --}}
|
||||
<div class="mb-4">
|
||||
<h5 class="text-primary border-bottom pb-2 mb-3">Pricing & Billing</h5>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="price">Regular Price</label>
|
||||
<div class="input-group">
|
||||
<input type="number" step="0.01" id="price" name="price"
|
||||
value="{{ old('price', 0) }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="price_sale">Sale Price</label>
|
||||
<div class="input-group">
|
||||
<input type="number" step="0.01" id="price_sale" name="price_sale"
|
||||
value="{{ old('price_sale') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="setup_fee">Setup Fee</label>
|
||||
<div class="input-group">
|
||||
<input type="number" step="0.01" id="setup_fee" name="setup_fee"
|
||||
value="{{ old('setup_fee', 0) }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="currency">Currency</label>
|
||||
<select name="currency" id="currency" class="form-control select2">
|
||||
<option value="USD" {{ old('currency') == 'USD' ? 'selected' : '' }}>USD</option>
|
||||
<option value="VND" {{ old('currency') == 'VND' ? 'selected' : '' }}>VND</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="billing_cycle">Billing Cycle</label>
|
||||
<select name="billing_cycle" id="billing_cycle" class="form-control select2">
|
||||
<option value="monthly" {{ old('billing_cycle') == 'monthly' ? 'selected' : '' }}>Monthly</option>
|
||||
<option value="quarterly" {{ old('billing_cycle') == 'quarterly' ? 'selected' : '' }}>Quarterly</option>
|
||||
<option value="semi_annually" {{ old('billing_cycle') == 'semi_annually' ? 'selected' : '' }}>Semi-Annually</option>
|
||||
<option value="annually" {{ old('billing_cycle') == 'annually' ? 'selected' : '' }}>Annually</option>
|
||||
<option value="one_time" {{ old('billing_cycle') == 'one_time' ? 'selected' : '' }}>One Time</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="trial_days">Trial Days</label>
|
||||
<input type="number" id="trial_days" name="trial_days"
|
||||
value="{{ old('trial_days', 0) }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Hardware Specs (VPS/Dedicated) --}}
|
||||
<div class="mb-4">
|
||||
<h5 class="text-info border-bottom pb-2 mb-3">Hardware Specifications</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="cpu">CPU</label>
|
||||
<input type="text" name="cpu" id="cpu" class="form-control"
|
||||
value="{{ old('cpu') }}" placeholder="e.g. 2 Core" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="ram">RAM</label>
|
||||
<input type="text" name="ram" id="ram" class="form-control"
|
||||
value="{{ old('ram') }}" placeholder="e.g. 4 GB" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="disk">Disk/Storage</label>
|
||||
<input type="text" name="disk" id="disk" class="form-control"
|
||||
value="{{ old('disk') }}" placeholder="e.g. 50 GB NVMe" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="bandwidth">Bandwidth</label>
|
||||
<input type="text" name="bandwidth" id="bandwidth" class="form-control"
|
||||
value="{{ old('bandwidth') }}" placeholder="e.g. Unlimited" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="gpu">GPU</label>
|
||||
<input type="text" name="gpu" id="gpu" class="form-control"
|
||||
value="{{ old('gpu') }}" placeholder="Optional">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Right Column: Classification & Settings --}}
|
||||
<div class="col-md-4">
|
||||
<div class="card card-secondary card-outline mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title m-0">Classification</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{-- Product Category --}}
|
||||
<div class="form-group mb-3">
|
||||
<label for="product_categories_id">Category</label>
|
||||
<select class="form-control select2" name="product_categories_id" id="product_categories_id">
|
||||
@foreach($group as $item)
|
||||
<option value="{{ $item->id }}" {{ old('product_categories_id') == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{-- Product Type --}}
|
||||
<div class="form-group mb-3">
|
||||
<label for="product_type">Product Type</label>
|
||||
<select class="form-control select2" name="product_type" id="product_type">
|
||||
@foreach($type as $item)
|
||||
<option value="{{ $item->name }}" {{ old('product_type') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{-- Status --}}
|
||||
<div class="form-group mb-3">
|
||||
<label for="status">Status</label>
|
||||
<select class="form-control select2" name="status" id="status">
|
||||
<option value="{{ \App\Enums\Status::ACTIVE->value }}">Active</option>
|
||||
<option value="{{ \App\Enums\Status::DEACTIVE->value }}">Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="sort_order">Sort Order</label>
|
||||
<input type="number" name="sort_order" id="sort_order" class="form-control" value="{{ old('sort_order', 0) }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-secondary card-outline">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title m-0">Inventory & Limits</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="stock">Stock Quantity</label>
|
||||
<input type="number" name="stock" id="stock" class="form-control" placeholder="Unlimited if empty" value="{{ old('stock') }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" id="is_unlimited" name="is_unlimited" value="1" {{ old('is_unlimited', true) ? 'checked' : '' }}>
|
||||
<label class="custom-control-label" for="is_unlimited">Unlimited Stock</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<label for="published_at">Publish Date</label>
|
||||
<input type="date" name="published_at" id="published_at" class="form-control" value="{{ old('published_at') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-fixed-action-bar>
|
||||
<x-button-crm type="button" variant="secondary" size="sm" icon="arrow-left" route="products.index">Cancel</x-button-crm>
|
||||
<x-button-crm type="submit" variant="primary" size="sm" icon="plus-circle">Create Product</x-button-crm>
|
||||
</x-fixed-action-bar>
|
||||
</form>
|
||||
@endsection
|
||||
@push('plugin-scripts')
|
||||
@foreach (config('assets.datatable.js') as $datatable)
|
||||
<script src="{{ asset($datatable) }}"></script>
|
||||
@endforeach
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
if ($(".select2").length) {
|
||||
$(".select2").select2();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script src="{{ asset('lib/ckeditor/ckeditor.js') }}"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
CKEDITOR.replace('description');
|
||||
CKEDITOR.replace('short_description');
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -2,7 +2,7 @@
|
||||
@section("content")
|
||||
@if(auth()->guard('admins')->user()->can("add product"))
|
||||
<div class="card card-outline card-primary">
|
||||
<form action="{{ route('product.create') }}" method="get">
|
||||
<form action="{{ route('products.create') }}" method="get">
|
||||
@csrf
|
||||
<input type="hidden" name="step" value="2">
|
||||
<div class="card-body">
|
||||
@@ -49,7 +49,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="{{ route('product.index') }}" class="btn btn-outline-secondary">Trở về</a>
|
||||
<a href="{{ route('products.index') }}" class="btn btn-outline-secondary">Trở về</a>
|
||||
<button type="submit" class="btn btn-outline-primary">Lưu dữ liệu</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,90 +1,62 @@
|
||||
@extends('administrator.layout.master')
|
||||
@push('plugin-styles')
|
||||
@foreach (config('assets.datatable.css') as $datatable)
|
||||
<link href="{{ asset($datatable) }}" rel="stylesheet" />
|
||||
@endforeach
|
||||
@endpush
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbItems = [
|
||||
['label' => 'Product'],
|
||||
['label' => 'Product / Services'],
|
||||
['label' => 'Product List', 'active' => true]
|
||||
];
|
||||
@endphp
|
||||
<x-admin-breadcrumb :items="$breadcrumbItems" />
|
||||
@endsection
|
||||
@section('tab')
|
||||
@php
|
||||
$tabs = [
|
||||
[
|
||||
'label' => 'Product',
|
||||
'route' => 'products.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
[
|
||||
'label' => 'Product Group',
|
||||
'route' => 'products.group.index',
|
||||
'icon' => 'server',
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-tab :items="$tabs" />
|
||||
@endsection
|
||||
@section('content')
|
||||
@if (auth()->guard('admins')->user()->can('manager product'))
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-header">
|
||||
@include('administrator.pages.block.btn')
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-invoice table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Product Name</th>
|
||||
<th>Type</th>
|
||||
<th style="width:40px"></th>
|
||||
<th style="width: 40px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (count($groups) > 0)
|
||||
@foreach ($groups->all() as $item)
|
||||
<tr class="bg-secondary">
|
||||
<td colspan="2">
|
||||
<strong>Group Name: </strong>{{ $item->name }}
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-warning btn-sm"
|
||||
href="{{ route('group.information', ['grid' => $item->id]) }}">
|
||||
<i class="fas fa-user-edit"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<form method="post" class="d-inline" action="{{ route('group.remove') }}">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<input type="hidden" name="group_id" value="{{ $item->id }}">
|
||||
<button type="submit" data-toggle="tooltip" data-placement="top" title=""
|
||||
class="btn btn-sm btn-danger" data-original-title="Xoá">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@if (!empty($item->products) && $item->products->count())
|
||||
@foreach ($item->products->all() as $_item)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $_item->name }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ $_item->Type->name }}
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-warning btn-sm"
|
||||
href="{{ route('product.edit', ['product_id' => $_item->id, 'type_id' => $item->type_id]) }}">
|
||||
<i class="fas fa-user-edit"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
@if (auth()->guard('admins')->user()->can('delete product'))
|
||||
<form method="post" class="d-inline"
|
||||
action="{{ route('product.destroy', ['type' => $_item->Type->id, 'product_id' => $_item->id]) }}">
|
||||
@csrf
|
||||
@method('delete')
|
||||
<button type="submit" data-toggle="tooltip" data-placement="top"
|
||||
title="" class="btn btn-sm btn-danger"
|
||||
data-original-title="Xoá">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
{{ $groups->withQueryString()->links() }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-header d-flex justify-content-end gap-2">
|
||||
@include('administrator.pages.block.product.btn')
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<x-datatable id="productTable" ajax="{{ route('products.datatable') }}" :columns="[
|
||||
['key' => 'name', 'label' => 'IP Host'],
|
||||
['key' => 'counter', 'label' => 'Domain Created'],
|
||||
['key' => 'status', 'label' => 'Status'],
|
||||
['key' => 'action', 'label' => 'Action'],
|
||||
]" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Product
|
||||
management department</h5>
|
||||
</div>
|
||||
@endif
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Product
|
||||
management department</h5>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
@push('plugin-scripts')
|
||||
@foreach (config('assets.datatable.js') as $datatable)
|
||||
<script src="{{ asset($datatable) }}"></script>
|
||||
@endforeach
|
||||
@endpush
|
||||
@@ -0,0 +1,311 @@
|
||||
@extends('administrator.layout.master')
|
||||
@push('plugin-styles')
|
||||
@foreach (config('assets.datatable.css') as $datatable)
|
||||
<link href="{{ asset($datatable) }}" rel="stylesheet" />
|
||||
@endforeach
|
||||
@endpush
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbItems = [
|
||||
['label' => 'Settings'],
|
||||
['label' => 'General', 'active' => true],
|
||||
];
|
||||
@endphp
|
||||
<x-admin-breadcrumb :items="$breadcrumbItems" />
|
||||
@endsection
|
||||
@section('content')
|
||||
@if (auth()->guard('admins')->user()->can('manager setting'))
|
||||
<div class="card card-outline">
|
||||
<div class="card-header bg-primary">
|
||||
<div class="card-title">Chỉnh sửa cài đặt</div>
|
||||
</div>
|
||||
<form action="{{ route('setting.store') }}" method="post">
|
||||
@csrf
|
||||
@method('put')
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{-- Title --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="title">Title</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="title" name="setting[title]" placeholder="Title"
|
||||
value="{{ setting('setting.title') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
{{-- Company name --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="company">Company Name</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="company" name="setting[company]" placeholder="Company Name"
|
||||
value="{{ setting('setting.company') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Tax --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="tax">Tax Code</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="tax" name="setting[tax]" placeholder="39123123..."
|
||||
value="{{ setting('setting.tax') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Email --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="email">Email</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="email" name="setting[email]" placeholder="email"
|
||||
value="{{ setting('setting.email') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
{{-- Address --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="address">Address</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="address" name="setting[address]" placeholder="Address"
|
||||
value="{{ setting('setting.address') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
{{-- Status --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="address">Status</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control custom-select" name="setting[status]">
|
||||
<option value="1" @selected(setting('status') == 1)>Run</option>
|
||||
<option value="0" @selected(setting('status') == 0)>Maintenance</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{-- Script --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="address">Scripts</label>
|
||||
<div class="col-md-8">
|
||||
<textarea name="setting[script]" class="form-control">{!! setting('setting.script') !!}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Discord Webhook ID --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="discord_webhook_id">Discord Webhook ID</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="discord_webhook_id" name="setting[discord_webhook_id]"
|
||||
placeholder="Discord Webhook ID" value="{{ setting('setting.discord_webhook_id') }}"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
{{-- Discord Webhook Token --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="discord_webhook_token">Discord Webhook Token</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="discord_webhook_token" name="setting[discord_webhook_token]"
|
||||
placeholder="Discord Webhook Token"
|
||||
value="{{ setting('setting.discord_webhook_token') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
{{-- Logo Url --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="logo">Logo Url</label>
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="logo" name="setting[logo]" placeholder="logo"
|
||||
value="{{ setting('setting.logo') }}" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-outline-secondary btn-open-thumb">
|
||||
<i class="fas fa-folder-open"></i> Select
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- Icon falling login/register --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="icon_falling">Icon falling</label>
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="logo" name="setting[icon_falling]"
|
||||
placeholder="Icon falling" value="{{ setting('setting.icon_falling') }}"
|
||||
class="form-control">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-outline-secondary btn-open-falling">
|
||||
<i class="fas fa-folder-open"></i> Select
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- Ảnh ở login/register customer --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="banner">Banner</label>
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="banner" name="setting[banner]"
|
||||
placeholder="banner" value="{{ setting('setting.banner') }}"
|
||||
class="form-control">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-outline-secondary btn-open-banner">
|
||||
<i class="fas fa-folder-open"></i> Select
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- Ma Mau --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="brand_color">Brand Color</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="brand_color" name="setting[brand_color]"
|
||||
placeholder="lobrand_colorgo" value="{{ setting('setting.brand_color') }}"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
{{-- Tel --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="tel">Tel (Hotline)</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="tel" name="setting[tel]" placeholder="(028) 123 456"
|
||||
value="{{ setting('setting.tel') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
{{-- Support Email --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="support">Support Email</label>
|
||||
<div class="col-md-8">
|
||||
<input type="email" id="support" name="setting[support]"
|
||||
placeholder="abc@gmail.com" value="{{ setting('setting.support') }}"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
{{-- Telegram Bot ID --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="bot_id">Telegram Bot ID</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="bot_id" name="setting[bot_id]"
|
||||
placeholder="Telegram Bot ID" value="{{ setting('setting.bot_id') }}"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
{{-- Telegram Bot Token --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="bot_token">Telegram Bot Token</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="bot_token" name="setting[bot_token]"
|
||||
placeholder="Telegram Bot Token" value="{{ setting('setting.bot_token') }}"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- VNPAY_TMN_CODE --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4 d-flex align-items-center" for="VNPAY_TMN_CODE">
|
||||
Terminal ID / Mã Website (vnp_TmnCode)
|
||||
</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="VNPAY_TMN_CODE" name="setting[vnpay_tmn_code]"
|
||||
placeholder=" Terminal ID / Mã Website (vnp_TmnCode)"
|
||||
value="{{ setting('setting.vnpay_tmn_code') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- VNPAY_HASH_SECRET --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4 d-flex align-items-center" for="VNPAY_HASH_SECRET">
|
||||
Secret Key / Chuỗi bí mật tạo checksum (vnp_HashSecret)
|
||||
</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" id="VNPAY_HASH_SECRET" name="setting[vnpay_hash_secret]"
|
||||
placeholder="Secret Key / Chuỗi bí mật tạo checksum (vnp_HashSecret)"
|
||||
value="{{ setting('setting.vnpay_hash_secret') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-outline-primary">Lưu dữ liệu</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to setting management
|
||||
department</h5>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<!-- bootstrap color picker -->
|
||||
<script src="{{ asset('lib/colorpicker/bootstrap-colorpicker.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
/* Color Picker */
|
||||
$('#brand_color').colorpicker()
|
||||
$('.btn-open-thumb').click(function() {
|
||||
CKFinder.popup({
|
||||
chooseFiles: true,
|
||||
onInit: function(finder) {
|
||||
finder.on('files:choose', function(evt) {
|
||||
let img = $('input[name="setting[logo]"]');
|
||||
if (img.length) {
|
||||
img.val(evt.data.files.first().getUrl())
|
||||
img.trigger('input')
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$('.btn-open-banner').click(function() {
|
||||
CKFinder.popup({
|
||||
chooseFiles: true,
|
||||
onInit: function(finder) {
|
||||
finder.on('files:choose', function(evt) {
|
||||
let img = $('input[name="setting[banner]"]');
|
||||
if (img.length) {
|
||||
img.val(evt.data.files.first().getUrl())
|
||||
img.trigger('input')
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$('.btn-open-falling').click(function() {
|
||||
CKFinder.popup({
|
||||
chooseFiles: true,
|
||||
onInit: function(finder) {
|
||||
finder.on('files:choose', function(evt) {
|
||||
let img = $('input[name="setting[icon_falling]"]');
|
||||
if (img.length) {
|
||||
img.val(evt.data.files.first().getUrl())
|
||||
img.trigger('input')
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
@push('plugin-scripts')
|
||||
@foreach (config('assets.datatable.js') as $datatable)
|
||||
<script src="{{ asset($datatable) }}"></script>
|
||||
@endforeach
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
if ($(".select2").length) {
|
||||
$(".select2").select2();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,8 @@
|
||||
<span class="badge {{ $class }}" {{ $attributes->merge(['class' => 'rounded-pill px-3 py-2 d-inline-flex align-items-center justify-content-center']) }}>
|
||||
@if($icon)
|
||||
<i data-lucide="{{ $icon }}" style="width: 14px; height: 14px; margin-right: 6px;"></i>
|
||||
@endif
|
||||
<span style="font-size: 0.85rem; font-weight: 500;">
|
||||
{{ $slot }}
|
||||
</span>
|
||||
</span>
|
||||
@@ -20,7 +20,7 @@
|
||||
$tag = 'a';
|
||||
}
|
||||
|
||||
$baseClasses = 'd-inline-flex gap-2 align-items-center justify-content-center text-white border-0 px-3 py-2 rounded-pill';
|
||||
$baseClasses = 'd-inline-flex gap-2 align-items-center justify-content-center text-white px-3 py-2 rounded-3 transition-all';
|
||||
|
||||
$variants = [
|
||||
'primary' => 'bg-primary',
|
||||
@@ -35,6 +35,17 @@
|
||||
'info' => 'bg-info'
|
||||
];
|
||||
|
||||
// Darker border colors for the "3D" effect
|
||||
$borderColors = [
|
||||
'primary' => '#D9561C',
|
||||
'secondary' => '#565e64',
|
||||
'success' => '#146c43',
|
||||
'danger' => '#b02a37',
|
||||
'warning' => '#997404',
|
||||
'info' => '#004C73',
|
||||
'destructive' => '#b02a37',
|
||||
];
|
||||
|
||||
$sizes = [
|
||||
'default' => 'h-10',
|
||||
'sm' => 'h-6',
|
||||
@@ -44,22 +55,30 @@
|
||||
|
||||
$variantClass = $variants[$variant ?? 'primary'] ?? $variants['primary'];
|
||||
$sizeClass = $sizes[$size ?? 'md'] ?? $sizes['default'];
|
||||
$borderColor = $borderColors[$variant ?? 'primary'] ?? 'transparent';
|
||||
|
||||
// Check if variant is outline/ghost/link to avoid weird borders
|
||||
if (in_array($variant, ['outline', 'ghost', 'link'])) {
|
||||
$borderStyle = '';
|
||||
} else {
|
||||
$borderStyle = "border-bottom: 3px solid {$borderColor};";
|
||||
}
|
||||
|
||||
$classes = "{$baseClasses} {$variantClass} {$sizeClass}";
|
||||
@endphp
|
||||
|
||||
@if($tag === 'a')
|
||||
<a href="{{ $href }}" {{ $attributes->merge(['class' => $classes]) }}>
|
||||
@if($icon)
|
||||
<i data-lucide="{{ $icon }}" class="mr-2" style="height: 15px; width: 15px"></i>
|
||||
@endif
|
||||
{{ $slot }}
|
||||
</a>
|
||||
@else
|
||||
<button type="{{ $buttonType }}" {{ $attributes->merge(['class' => $classes]) }}>
|
||||
@if($icon)
|
||||
<i data-lucide="{{ $icon }}" class="mr-2" style="height: 15px; width: 15px"></i>
|
||||
@endif
|
||||
{{ $slot }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if($tag === 'a')
|
||||
<a href="{{ $href }}" {{ $attributes->merge(['class' => $classes, 'style' => $borderStyle]) }}>
|
||||
@if($icon)
|
||||
<i data-lucide="{{ $icon }}" class="mr-2" style="height: 15px; width: 15px"></i>
|
||||
@endif
|
||||
{{ $slot }}
|
||||
</a>
|
||||
@else
|
||||
<button type="{{ $buttonType }}" {{ $attributes->merge(['class' => $classes, 'style' => $borderStyle]) }}>
|
||||
@if($icon)
|
||||
<i data-lucide="{{ $icon }}" class="mr-2" style="height: 15px; width: 15px"></i>
|
||||
@endif
|
||||
{{ $slot }}
|
||||
</button>
|
||||
@endif
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($osGroups->count() > 0)
|
||||
@if (count($osGroups) > 0)
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label
|
||||
@@ -71,7 +71,7 @@
|
||||
</svg>
|
||||
<p class="mt-2 text-sm text-gray-500">{{ __('Đang tải danh sách phiên bản...') }}</p>
|
||||
</div>
|
||||
@elseif ($operatingSystems->count() > 0)
|
||||
@elseif (count($operatingSystems) > 0)
|
||||
<div class="grid grid-cols-1 gap-3 max-h-60 overflow-y-auto">
|
||||
@foreach ($operatingSystems as $os)
|
||||
<label
|
||||
|
||||
Reference in New Issue
Block a user