This commit is contained in:
pbao9
2026-01-27 15:36:58 +07:00
parent fb6b2159da
commit bfb5f9f4a5
15 changed files with 580 additions and 542 deletions
@@ -4,12 +4,14 @@ namespace App\Http\Controllers\admin;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Repositories\Module\IPPool\IPPoolRepositoryInterface; use App\Repositories\Module\IPPool\IPPoolRepositoryInterface;
use App\Repositories\Module\Network\NetworkRepository;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class ModuleIPPoolController extends Controller class ModuleIPPoolController extends Controller
{ {
public function __construct( public function __construct(
public IPPoolRepositoryInterface $ipPoolRepository public IPPoolRepositoryInterface $ipPoolRepository,
public NetworkRepository $moduleNetworkRepository
) { ) {
} }
public function index(Request $request) public function index(Request $request)
@@ -26,7 +28,12 @@ class ModuleIPPoolController extends Controller
public function create() public function create()
{ {
$title = 'Add new server ip pool'; $title = 'Add new server ip pool';
return view('admin.module.ippool.add', compact('title')); $moduleNetworks = $this->moduleNetworkRepository->filter(
[
'page' => 1
]
);
return view('admin.module.ippool.add', compact('title', 'moduleNetworks'));
} }
public function store(Request $request) public function store(Request $request)
@@ -48,8 +55,13 @@ class ModuleIPPoolController extends Controller
public function edit(int $id = 0) public function edit(int $id = 0)
{ {
$module = $this->ipPoolRepository->find($id); $module = $this->ipPoolRepository->find($id);
$moduleNetworks = $this->moduleNetworkRepository->filter(
[
'page' => 1
]
);
$title = 'Edit server ip pool'; $title = 'Edit server ip pool';
return view('admin.module.ippool.edit', compact('module', 'title')); return view('admin.module.ippool.edit', ['module' => $module, 'title' => $title, 'moduleNetworks' => $moduleNetworks]);
} }
public function update(Request $request, int $id = 0) public function update(Request $request, int $id = 0)
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('module_ip_address', function (Blueprint $table) {
$table->unsignedBigInteger('module_host_id')->nullable()->default(null)->change();
$table->unsignedBigInteger('module_network_id')->nullable()->default(null)->change();
$table->foreign('module_host_id')->references('id')->on('module_host')->onDelete('set null');
$table->foreign('module_network_id')->references('id')->on('module_network')->onDelete('set null');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('module_ip_address', function (Blueprint $table) {
$table->dropForeign(['module_host_id']);
$table->dropForeign(['module_network_id']);
$table->bigInteger('module_host_id')->default(0)->nullable(false)->change();
$table->bigInteger('module_network_id')->default(0)->nullable(false)->change();
});
}
};
+12 -20
View File
@@ -1,5 +1,5 @@
@import url(https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Lexend:wght@100..900&display=swap); @import url(https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Lexend:wght@100..900&display=swap);
/*! tailwindcss v4.1.4 | MIT License | https://tailwindcss.com */ /*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
@layer properties; @layer properties;
@layer theme, base, components, utilities; @layer theme, base, components, utilities;
@layer theme { @layer theme {
@@ -435,6 +435,9 @@
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field { ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
padding-block: 0; padding-block: 0;
} }
::-webkit-calendar-picker-indicator {
line-height: 1;
}
:-moz-ui-invalid { :-moz-ui-invalid {
box-shadow: none; box-shadow: none;
} }
@@ -476,7 +479,7 @@
padding: 0; padding: 0;
margin: -1px; margin: -1px;
overflow: hidden; overflow: hidden;
clip: rect(0, 0, 0, 0); clip-path: inset(50%);
white-space: nowrap; white-space: nowrap;
border-width: 0; border-width: 0;
} }
@@ -1720,19 +1723,19 @@
border-collapse: separate; border-collapse: separate;
} }
.origin-bottom-left { .origin-bottom-left {
transform-origin: bottom left; transform-origin: 0 100%;
} }
.origin-bottom-right { .origin-bottom-right {
transform-origin: bottom right; transform-origin: 100% 100%;
} }
.origin-left { .origin-left {
transform-origin: left; transform-origin: 0;
} }
.origin-top-left { .origin-top-left {
transform-origin: top left; transform-origin: 0 0;
} }
.origin-top-right { .origin-top-right {
transform-origin: top right; transform-origin: 100% 0;
} }
.-translate-x-1\/2 { .-translate-x-1\/2 {
--tw-translate-x: calc(calc(1/2 * 100%) * -1); --tw-translate-x: calc(calc(1/2 * 100%) * -1);
@@ -4807,51 +4810,43 @@
} }
.backdrop-blur-2xl { .backdrop-blur-2xl {
--tw-backdrop-blur: blur(var(--blur-2xl)); --tw-backdrop-blur: blur(var(--blur-2xl));
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
} }
.backdrop-blur-3xl { .backdrop-blur-3xl {
--tw-backdrop-blur: blur(var(--blur-3xl)); --tw-backdrop-blur: blur(var(--blur-3xl));
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
} }
.backdrop-blur-lg { .backdrop-blur-lg {
--tw-backdrop-blur: blur(var(--blur-lg)); --tw-backdrop-blur: blur(var(--blur-lg));
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
} }
.backdrop-blur-md { .backdrop-blur-md {
--tw-backdrop-blur: blur(var(--blur-md)); --tw-backdrop-blur: blur(var(--blur-md));
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
} }
.backdrop-blur-none { .backdrop-blur-none {
--tw-backdrop-blur: ; --tw-backdrop-blur: ;
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
} }
.backdrop-blur-sm { .backdrop-blur-sm {
--tw-backdrop-blur: blur(var(--blur-sm)); --tw-backdrop-blur: blur(var(--blur-sm));
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
} }
.backdrop-blur-xl { .backdrop-blur-xl {
--tw-backdrop-blur: blur(var(--blur-xl)); --tw-backdrop-blur: blur(var(--blur-xl));
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
} }
.backdrop-blur-xs { .backdrop-blur-xs {
--tw-backdrop-blur: blur(var(--blur-xs)); --tw-backdrop-blur: blur(var(--blur-xs));
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
} }
.transition { .transition {
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter; transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)); transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
transition-duration: var(--tw-duration, var(--default-transition-duration)); transition-duration: var(--tw-duration, var(--default-transition-duration));
} }
.transition\! { .transition\! {
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter !important; transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, backdrop-filter, display, content-visibility, overlay, pointer-events !important;
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important; transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;
transition-duration: var(--tw-duration, var(--default-transition-duration)) !important; transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;
} }
@@ -5924,14 +5919,12 @@
} }
.before\:content-\[\'\'\] { .before\:content-\[\'\'\] {
&::before { &::before {
content: var(--tw-content);
--tw-content: ''; --tw-content: '';
content: var(--tw-content); content: var(--tw-content);
} }
} }
.before\:content-\[\\\'\\\'\] { .before\:content-\[\\\'\\\'\] {
&::before { &::before {
content: var(--tw-content);
--tw-content: \'\'; --tw-content: \'\';
content: var(--tw-content); content: var(--tw-content);
} }
@@ -6089,7 +6082,6 @@
} }
.after\:content-\[\'\'\] { .after\:content-\[\'\'\] {
&::after { &::after {
content: var(--tw-content);
--tw-content: ''; --tw-content: '';
content: var(--tw-content); content: var(--tw-content);
} }
+46 -40
View File
File diff suppressed because one or more lines are too long
+4 -4
View File
File diff suppressed because one or more lines are too long
+4 -4
View File
File diff suppressed because one or more lines are too long
+4 -4
View File
File diff suppressed because one or more lines are too long
+4 -4
View File
File diff suppressed because one or more lines are too long
+4 -4
View File
File diff suppressed because one or more lines are too long
+4 -1
View File
@@ -5,5 +5,8 @@
"/js/core.min.js": "/js/core.min.js", "/js/core.min.js": "/js/core.min.js",
"/js/main.min.js": "/js/main.min.js", "/js/main.min.js": "/js/main.min.js",
"/js/service/vminfo.min.js": "/js/service/vminfo.min.js", "/js/service/vminfo.min.js": "/js/service/vminfo.min.js",
"/css/app.css": "/css/app.css" "/css/app.css": "/css/app.css",
"/fonts/AvertaPE-Regular.woff2?d2975139654f9cae8bac2e858686ffa8": "/fonts/AvertaPE-Regular.woff2?d2975139654f9cae8bac2e858686ffa8",
"/fonts/AvertaPE-Bold.woff2?0c3fa07354777de57ba64f1838b591dc": "/fonts/AvertaPE-Bold.woff2?0c3fa07354777de57ba64f1838b591dc",
"/fonts/AvertaPE-Extrabold.woff2?45d04f8ca8d830e0dd8e1c11b97e3bd4": "/fonts/AvertaPE-Extrabold.woff2?45d04f8ca8d830e0dd8e1c11b97e3bd4"
} }
@@ -107,10 +107,6 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<table class="table table-sm table-borderless"> <table class="table table-sm table-borderless">
<tr>
<td width="30%" class="text-muted">VM ID:</td>
<td><code>{{ $product->vmware_id ?? 'N/A' }}</code></td>
</tr>
<tr> <tr>
<td class="text-muted">Tên VM:</td> <td class="text-muted">Tên VM:</td>
<td>{{ $product->name ?? 'Chưa đặt tên' }}</td> <td>{{ $product->name ?? 'Chưa đặt tên' }}</td>
@@ -162,11 +158,13 @@
<tr> <tr>
<td class="text-muted">vCenter:</td> <td class="text-muted">vCenter:</td>
<td> <td>
@if (isset($product->ipaddress) && @if (
isset($product->ipaddress) &&
isset($product->ipaddress->host) && isset($product->ipaddress->host) &&
isset($product->ipaddress->host->datacenter) && isset($product->ipaddress->host->datacenter) &&
isset($product->ipaddress->host->datacenter->vCenter)) isset($product->ipaddress->host->datacenter->vCenter)
{{ $product->ipaddress->host->datacenter->vCenter->host ?? 'N/A' }} )
{{ $product->ipaddress->host->datacenter->vCenter->host ?? 'N/A' }}
@else @else
N/A N/A
@endif @endif
@@ -274,9 +272,6 @@
<span class="badge badge-secondary ml-1">Hết hạn</span> <span class="badge badge-secondary ml-1">Hết hạn</span>
@endif @endif
</div> </div>
<div class="col-md-6">
<small class="text-muted">VM ID:</small> <code>{{ $product->vmware_id ?? 'N/A' }}</code>
</div>
</div> </div>
<div class="row mt-1"> <div class="row mt-1">
<div class="col-md-6"> <div class="col-md-6">
@@ -19,8 +19,12 @@
<div class="form-group row"> <div class="form-group row">
<label class="col-md-3" for="module_network_id">Module Network</label> <label class="col-md-3" for="module_network_id">Module Network</label>
<div class="col-md-9"> <div class="col-md-9">
<input type="text" id="module_network_id" name="module_network_id" placeholder="1" <select name="module_network_id" id="module_network_id" class="form-control">
value="{{ old('module_network_id') }}" class="form-control"> <option value="">Select Module Network</option>
@foreach ($moduleNetworks as $moduleNetwork)
<option value="{{ $moduleNetwork->id }}">{{ $moduleNetwork->name . ' - ' . $moduleNetwork->network }}</option>
@endforeach
</select>
</div> </div>
</div> </div>
</div> </div>
+210 -216
View File
@@ -21,248 +21,242 @@
</div> </div>
</div> </div>
@else @else
<div class="bg-gray-50 rounded-lg py-12"> <div class="bg-gray-50 rounded-lg py-12">
<div class="container mx-auto px-4 max-w-4xl"> <div class="container mx-auto px-4 max-w-4xl">
<!-- Card chính --> <!-- Card chính -->
<div class="bg-white rounded-lg shadow-lg overflow-hidden mb-8"> <div class="bg-white rounded-lg shadow-lg overflow-hidden mb-8">
<!-- Header --> <!-- Header -->
<div class="bg-primary p-6"> <div class="bg-primary p-6">
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<h1 class="text-white text-2xl font-bold">Thông tin đơn hàng</h1> <h1 class="text-white text-2xl font-bold">Thông tin đơn hàng</h1>
<span class="bg-white text-primary px-4 py-2 rounded-full text-sm font-medium"> <span class="bg-white text-primary px-4 py-2 rounded-full text-sm font-medium">
Mã đơn: #{{ $invoice->order_num ?? 'N/A'}} Mã đơn: #{{ $invoice->order_num ?? 'N/A'}}
</span> </span>
</div>
</div>
<!-- Thông tin đơn hàng -->
<div class="p-6 border-b border-gray-200">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<h2 class="text-gray-700 text-lg font-semibold mb-4">Thông tin đơn hàng</h2>
<div class="space-y-2">
<div class="flex justify-between">
<span class="text-gray-600">Ngày đặt:</span>
<span class="font-medium">
@if ($invoice->date)
{{ date('d/m/Y H:i', strtotime($invoice->date)) }}
@else
N/A
@endif
</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Trạng thái:</span>
<span class="font-medium">
@if ($invoice->status == 1)
<span class="bg-yellow-100 text-yellow-800 px-2 py-1 rounded-full text-xs">Chờ
thanh toán</span>
@elseif($invoice->status == 2)
<span class="bg-green-100 text-green-800 px-2 py-1 rounded-full text-xs">Đã
thanh toán</span>
@else
<span
class="bg-gray-100 text-gray-800 px-2 py-1 rounded-full text-xs">Khác</span>
@endif
</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Tên miền (Domain):</span>
<span class="font-medium">{{ $invoice->invoiceItem->first()->server_name ?? '' }}
</span>
</div>
@if ($invoice->vm_id)
<div class="flex justify-between">
<span class="text-gray-600">VM ID:</span>
<span class="font-medium text-green-600">{{ $invoice->vm_id }}</span>
</div>
@endif
</div>
</div> </div>
<div> </div>
<h2 class="text-gray-700 text-lg font-semibold mb-4">Thông tin khách hàng</h2>
<div class="space-y-2"> <!-- Thông tin đơn hàng -->
<div class="flex justify-between"> <div class="p-6 border-b border-gray-200">
<span class="text-gray-600">Họ tên:</span> <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<span <div>
class="font-medium">{{ $invoice->customer->firstname . ' ' . $invoice->customer->lastname }}</span> <h2 class="text-gray-700 text-lg font-semibold mb-4">Thông tin đơn hàng</h2>
<div class="space-y-2">
<div class="flex justify-between">
<span class="text-gray-600">Ngày đặt:</span>
<span class="font-medium">
@if ($invoice->date)
{{ date('d/m/Y H:i', strtotime($invoice->date)) }}
@else
N/A
@endif
</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Trạng thái:</span>
<span class="font-medium">
@if ($invoice->status == 1)
<span class="bg-yellow-100 text-yellow-800 px-2 py-1 rounded-full text-xs">Chờ
thanh toán</span>
@elseif($invoice->status == 2)
<span class="bg-green-100 text-green-800 px-2 py-1 rounded-full text-xs">Đã
thanh toán</span>
@else
<span
class="bg-gray-100 text-gray-800 px-2 py-1 rounded-full text-xs">Khác</span>
@endif
</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Tên miền (Domain):</span>
<span class="font-medium">{{ $invoice->invoiceItem->first()->server_name ?? '' }}
</span>
</div>
</div> </div>
<div class="flex justify-between"> </div>
<span class="text-gray-600">Số điện thoại:</span> <div>
<span class="font-medium">{{ $invoice->customer->phone }}</span> <h2 class="text-gray-700 text-lg font-semibold mb-4">Thông tin khách hàng</h2>
</div> <div class="space-y-2">
<div class="flex justify-between"> <div class="flex justify-between">
<span class="text-gray-600">Email:</span> <span class="text-gray-600">Họ tên:</span>
<span class="font-medium">{{ $invoice->customer->email }}</span> <span
class="font-medium">{{ $invoice->customer->firstname . ' ' . $invoice->customer->lastname }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Số điện thoại:</span>
<span class="font-medium">{{ $invoice->customer->phone }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Email:</span>
<span class="font-medium">{{ $invoice->customer->email }}</span>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Chi tiết sản phẩm --> <!-- Chi tiết sản phẩm -->
<div class="p-6"> <div class="p-6">
<h2 class="text-gray-700 text-lg font-semibold mb-4">Chi tiết sản phẩm</h2> <h2 class="text-gray-700 text-lg font-semibold mb-4">Chi tiết sản phẩm</h2>
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<table class="w-full text-left"> <table class="w-full text-left">
<thead> <thead>
<tr class="bg-gray-50"> <tr class="bg-gray-50">
<th class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider"> <th class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider">
Mô tả Mô tả
</th> </th>
<th <th
class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider text-right"> class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider text-right">
Số lượng Số lượng
</th> </th>
<th <th
class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider text-right"> class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider text-right">
Giá Giá
</th> </th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
@foreach ($invoice->invoiceItem as $item)
<tr class="bg-white">
<td class="px-4 py-3">
<div class="font-medium text-gray-800">Sản phẩm
{{ $item->product->name ?? 'Không xác định' }}
</div>
<div class="text-sm text-gray-500">
Loại:
@if ($item->product_type == 1)
Shared Hosting
@elseif($item->product_type == 4)
VPS
@elseif($item->product_type == 3)
Dedicated Server
@else
Khác
@endif
</div>
<div class="text-sm text-gray-500 flex flex-row items-center">
Hệ điều hành:
<div class="ml-2 flex items-center gap-2">
<div class="avatar">
<div class="size-6 rounded-md">
<img src="{{ $item->os->osGroup->thumbnail }}"
alt="{{ $item->os->osGroup->name }}" />
</div>
</div>{{ $item->os->osGroup->name }}
{{ $item->os->version }}
</div>
</div>
</td>
<td class="px-4 py-3 text-right">
{{ $item->quantity }}
</td>
<td class="px-4 py-3 text-right">
<p>
{{ format_price($item->price) }}
/{{ $item->months }}tháng
</p>
</td>
</tr> </tr>
</thead>
<!-- Addon items --> <tbody class="divide-y divide-gray-200">
@foreach ($item->addons as $addon) @foreach ($invoice->invoiceItem as $item)
<tr class="bg-gray-50"> <tr class="bg-white">
<td class="px-4 py-2 pl-8"> <td class="px-4 py-3">
<div class="text-sm text-gray-600"> <div class="font-medium text-gray-800">Sản phẩm
<span class="text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded"> {{ $item->product->name ?? 'Không xác định' }}
Addon </div>
</span> <div class="text-sm text-gray-500">
<span class="ml-2">{{ $addon->addonItems->name }} đơn giá: Loại:
({{ format_price($addon->addonItems->price) }}) @if ($item->product_type == 1)
/ {{ $addon->addonItems->step . $addon->addonItems->prefix }} Shared Hosting
</span> @elseif($item->product_type == 4)
VPS
@elseif($item->product_type == 3)
Dedicated Server
@else
Khác
@endif
</div>
<div class="text-sm text-gray-500 flex flex-row items-center">
Hệ điều hành:
<div class="ml-2 flex items-center gap-2">
<div class="avatar">
<div class="size-6 rounded-md">
<img src="{{ $item->os->osGroup->thumbnail }}"
alt="{{ $item->os->osGroup->name }}" />
</div>
</div>{{ $item->os->osGroup->name }}
{{ $item->os->version }}
</div>
</div> </div>
</td> </td>
<td class="px-4 py-2 text-right text-sm text-gray-600"> <td class="px-4 py-3 text-right">
{{ $addon->qty }} / {{ $addon->addonItems->prefix }} {{ $item->quantity }}
({{ $item->months }} tháng)
</td> </td>
<td class="px-4 py-2 text-right text-sm text-gray-600"> <td class="px-4 py-3 text-right">
{{ number_format($addon->price * $item->months) }} VNĐ <p>
{{ format_price($item->price) }}
/{{ $item->months }}tháng
</p>
</td> </td>
</tr> </tr>
<!-- Addon items -->
@foreach ($item->addons as $addon)
<tr class="bg-gray-50">
<td class="px-4 py-2 pl-8">
<div class="text-sm text-gray-600">
<span class="text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded">
Addon
</span>
<span class="ml-2">{{ $addon->addonItems->name }} đơn giá:
({{ format_price($addon->addonItems->price) }})
/ {{ $addon->addonItems->step . $addon->addonItems->prefix }}
</span>
</div>
</td>
<td class="px-4 py-2 text-right text-sm text-gray-600">
{{ $addon->qty }} / {{ $addon->addonItems->prefix }}
({{ $item->months }} tháng)
</td>
<td class="px-4 py-2 text-right text-sm text-gray-600">
{{ number_format($addon->price * $item->months) }} VNĐ
</td>
</tr>
@endforeach
@endforeach @endforeach
@endforeach </tbody>
</tbody> <tfoot>
<tfoot> @php
@php $addonTotal = 0;
$addonTotal = 0; foreach ($invoice->invoiceItem as $item) {
foreach ($invoice->invoiceItem as $item) { foreach ($item->addons as $addon) {
foreach ($item->addons as $addon) { $addonTotal += $addon->price * $item->months;
$addonTotal += $addon->price * $item->months; }
} }
} $productTotal = $invoice->total - $addonTotal;
$productTotal = $invoice->total - $addonTotal; @endphp
@endphp <tr class="border-t-2 border-gray-200">
<tr class="border-t-2 border-gray-200"> <td class="px-4 py-3 text-gray-500 font-medium">Giá trị sản phẩm</td>
<td class="px-4 py-3 text-gray-500 font-medium">Giá trị sản phẩm</td>
<td></td>
<td class="px-4 py-3 text-right text-gray-500 font-medium">
{{ number_format($productTotal) }} VNĐ
</td>
</tr>
<tr>
<td class="px-4 py-3 text-gray-500 font-medium">Tổng addon</td>
<td></td>
<td class="px-4 py-3 text-right text-gray-500 font-medium">
{{ number_format($addonTotal) }} VNĐ
</td>
</tr>
@if ($invoice->discount_value)
<tr>
<td class="px-4 py-3 text-gray-500 font-medium">Giảm giá</td>
<td></td> <td></td>
<td class="px-4 py-3 text-right text-gray-500 font-medium"> <td class="px-4 py-3 text-right text-gray-500 font-medium">
-{{ number_format($invoice->discount_value) }} VNĐ {{ number_format($productTotal) }} VNĐ
</td> </td>
</tr> </tr>
@endif <tr>
<tr> <td class="px-4 py-3 text-gray-500 font-medium">Tổng addon</td>
<td class="px-4 py-3 text-lg font-bold text-gray-800">Tổng cộng</td> <td></td>
<td></td> <td class="px-4 py-3 text-right text-gray-500 font-medium">
<td class="px-4 py-3 text-right text-lg font-bold text-gray-800"> {{ number_format($addonTotal) }} VNĐ
{{ number_format($invoice->total) }} VNĐ </td>
</td> </tr>
</tr> @if ($invoice->discount_value)
</tfoot> <tr>
</table> <td class="px-4 py-3 text-gray-500 font-medium">Giảm giá</td>
<td></td>
<td class="px-4 py-3 text-right text-gray-500 font-medium">
-{{ number_format($invoice->discount_value) }} VNĐ
</td>
</tr>
@endif
<tr>
<td class="px-4 py-3 text-lg font-bold text-gray-800">Tổng cộng</td>
<td></td>
<td class="px-4 py-3 text-right text-lg font-bold text-gray-800">
{{ number_format($invoice->total) }} VNĐ
</td>
</tr>
</tfoot>
</table>
</div>
</div> </div>
</div> </div>
</div>
<!-- Ghi chú --> <!-- Ghi chú -->
@if ($invoice->note) @if ($invoice->note)
<div class="bg-white rounded-lg shadow-lg p-6 mt-8"> <div class="bg-white rounded-lg shadow-lg p-6 mt-8">
<h2 class="text-gray-700 text-lg font-semibold mb-2">Ghi chú đơn hàng</h2> <h2 class="text-gray-700 text-lg font-semibold mb-2">Ghi chú đơn hàng</h2>
<p class="text-gray-600">{{ $invoice->note }}</p> <p class="text-gray-600">{{ $invoice->note }}</p>
</div>
@endif
<!-- Hỗ trợ -->
<div class="bg-blue-50 rounded-lg p-6 mt-8 border border-blue-100">
<div class="flex items-start">
<div class="flex-shrink-0 w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center mr-4">
<svg class="w-6 h-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</div> </div>
<div class="flex-1"> @endif
<h3 class="text-lg font-medium text-blue-800">Bạn cần hỗ trợ?</h3>
<p class="text-blue-600 mt-1">Nếu bạn gặp bất kỳ vấn đề nào khi thanh toán, vui lòng liên hệ với <!-- Hỗ trợ -->
chúng tôi thông qua. </br> Hotline <span <div class="bg-blue-50 rounded-lg p-6 mt-8 border border-blue-100">
class="font-medium">{{ setting('setting.tel') }}</span> hoặc <div class="flex items-start">
thông qua Email <span class="font-medium">{{ setting('setting.support') }}</span></p> <div class="flex-shrink-0 w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center mr-4">
<svg class="w-6 h-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</div>
<div class="flex-1">
<h3 class="text-lg font-medium text-blue-800">Bạn cần hỗ trợ?</h3>
<p class="text-blue-600 mt-1">Nếu bạn gặp bất kỳ vấn đề nào khi thanh toán, vui lòng liên hệ với
chúng tôi thông qua. </br> Hotline <span
class="font-medium">{{ setting('setting.tel') }}</span> hoặc
thông qua Email <span class="font-medium">{{ setting('setting.support') }}</span></p>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
@endif @endif
@endsection @endsection
+226 -229
View File
@@ -1,255 +1,252 @@
@extends('frontend.layouts.master') @extends('frontend.layouts.master')
@section('content') @section('content')
<div class="bg-gray-50 rounded-lg py-12"> <div class="bg-gray-50 rounded-lg py-12">
<div class="container mx-auto px-4 max-w-4xl"> <div class="container mx-auto px-4 max-w-4xl">
<!-- Card chính --> <!-- Card chính -->
<div class="bg-white rounded-lg shadow-lg overflow-hidden mb-8"> <div class="bg-white rounded-lg shadow-lg overflow-hidden mb-8">
<!-- Header --> <!-- Header -->
<div class="bg-primary p-6"> <div class="bg-primary p-6">
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<h1 class="text-white text-2xl font-bold">Thanh toán đơn hàng</h1> <h1 class="text-white text-2xl font-bold">Thanh toán đơn hàng</h1>
<span class="bg-white text-primary px-4 py-2 rounded-full text-sm font-medium"> <span class="bg-white text-primary px-4 py-2 rounded-full text-sm font-medium">
Mã đơn: #{{ $orders->order_num }} Mã đơn: #{{ $orders->order_num }}
</span> </span>
</div>
</div>
<!-- Thông tin đơn hàng -->
<div class="p-6 border-b border-gray-200">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<h2 class="text-gray-700 text-lg font-semibold mb-4">Thông tin đơn hàng</h2>
<div class="space-y-2">
<div class="flex justify-between">
<span class="text-gray-600">Ngày đặt:</span>
<span class="font-medium">{{ date('d/m/Y H:i', $orders->date) }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Trạng thái:</span>
<span class="font-medium">
@if ($orders->status == 0)
<span class="bg-red-100 text-red-800 px-2 py-1 rounded-full text-xs">Chờ xử lý</span>
@elseif($orders->status == 1)
<span class="bg-green-100 text-green-800 px-2 py-1 rounded-full text-xs">Đã kích hoạt</span>
@elseif($orders->status == 2)
<span class="bg-gray-100 text-gray-800 px-2 py-1 rounded-full text-xs">Đã hủy</span>
@elseif($orders->status == 3)
<span class="bg-yellow-100 text-yellow-800 px-2 py-1 rounded-full text-xs">Đang xử lý</span>
@else
<span class="bg-gray-100 text-gray-800 px-2 py-1 rounded-full text-xs">Khác</span>
@endif
</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Tên miền (Domain):</span>
<span class="font-medium">{{ $orders->orderItems[0]->server_name }}</span>
</div>
</div>
</div>
<div>
<h2 class="text-gray-700 text-lg font-semibold mb-4">Thông tin khách hàng</h2>
<div class="space-y-2">
<div class="flex justify-between">
<span class="text-gray-600">Họ tên:</span>
<span
class="font-medium">{{ $orders->customer->firstname . ' ' . $orders->customer->lastname }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Số điện thoại:</span>
<span class="font-medium">{{ $orders->customer->phone }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Email:</span>
<span class="font-medium">{{ $orders->customer->email }}</span>
</div>
</div>
</div> </div>
</div> </div>
</div>
<!-- Chi tiết sản phẩm --> <!-- Thông tin đơn hàng -->
<div class="p-6"> <div class="p-6 border-b border-gray-200">
<h2 class="text-gray-700 text-lg font-semibold mb-4">Chi tiết sản phẩm</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<div class="overflow-x-auto"> <h2 class="text-gray-700 text-lg font-semibold mb-4">Thông tin đơn hàng</h2>
<table class="w-full text-left"> <div class="space-y-2">
<thead> <div class="flex justify-between">
<tr class="bg-gray-50"> <span class="text-gray-600">Ngày đặt:</span>
<th class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider"> <span class="font-medium">{{ date('d/m/Y H:i', $orders->date) }}</span>
Mô tả </div>
</th> <div class="flex justify-between">
<th <span class="text-gray-600">Trạng thái:</span>
class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider text-right"> <span class="font-medium">
Số lượng @if ($orders->status == 0)
</th> <span class="bg-red-100 text-red-800 px-2 py-1 rounded-full text-xs">Chờ xử
<th lý</span>
class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider text-right"> @elseif($orders->status == 1)
Giá <span class="bg-green-100 text-green-800 px-2 py-1 rounded-full text-xs">Đã kích
</th> hoạt</span>
</tr> @elseif($orders->status == 2)
</thead> <span class="bg-gray-100 text-gray-800 px-2 py-1 rounded-full text-xs">Đã hủy</span>
<tbody class="divide-y divide-gray-200"> @elseif($orders->status == 3)
@foreach ($orders->orderItems as $item) <span class="bg-yellow-100 text-yellow-800 px-2 py-1 rounded-full text-xs">Đang xử
<tr class="bg-white"> lý</span>
<td class="px-4 py-3">
<div class="font-medium text-gray-800">Sản phẩm
{{ $item->product->name ?? 'Không xác định' }}
</div>
<div class="text-sm text-gray-500">
Loại:
@if ($item->product_type == 1)
Shared Hosting
@elseif($item->product_type == 2)
VPS
@elseif($item->product_type == 3)
Dedicated Server
@else @else
Khác <span class="bg-gray-100 text-gray-800 px-2 py-1 rounded-full text-xs">Khác</span>
@endif @endif
</div> </span>
<div class="text-sm text-gray-500 flex flex-row items-center"> </div>
Hệ điều hành: <div class="flex justify-between">
<div class="ml-2 flex items-center gap-2"> <span class="text-gray-600">Tên miền (Domain):</span>
<div class="avatar"> <span class="font-medium">{{ $orders->orderItems[0]->server_name }}</span>
<div class="size-6 rounded-md"> </div>
<img src="{{ $item->os->osGroup->thumbnail }}" </div>
alt="{{ $item->os->osGroup->name }}" /> </div>
<div>
<h2 class="text-gray-700 text-lg font-semibold mb-4">Thông tin khách hàng</h2>
<div class="space-y-2">
<div class="flex justify-between">
<span class="text-gray-600">Họ tên:</span>
<span class="font-medium">{{ $orders->customer->firstname . ' ' . $orders->customer->lastname }}</span>
</div> </div>
</div>{{ $item->os->osGroup->name }} <div class="flex justify-between">
{{ $item->os->version }} <span class="text-gray-600">Số điện thoại:</span>
<span class="font-medium">{{ $orders->customer->phone }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Email:</span>
<span class="font-medium">{{ $orders->customer->email }}</span>
</div>
</div>
</div>
</div> </div>
</div>
</td>
<td class="px-4 py-3 text-right">
{{ $item->quantity }}
</td>
<td class="px-4 py-3 text-right">
<p>
{{ format_price($item->price) }}
/{{ $item->months }}tháng
</p>
</td>
</tr>
<!-- Addon items -->
@foreach ($item->addons as $addon)
<tr class="bg-gray-50">
<td class="px-4 py-2 pl-8">
<div class="text-sm text-gray-600">
<span class="text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded">
Addon
</span>
<span class="ml-2">{{ $addon->addonItems->name }} đơn giá:
({{ format_price($addon->addonItems->price) }})
/ {{ $addon->addonItems->step . $addon->addonItems->prefix }}
</span>
</div> </div>
</td>
<td class="px-4 py-2 text-right text-sm text-gray-600">
{{ $addon->qty }} / {{ $addon->addonItems->prefix }}
({{ $item->months }} tháng)
</td>
<td class="px-4 py-2 text-right text-sm text-gray-600">
{{ number_format($addon->price * $item->months) }} VNĐ
</td>
</tr>
@endforeach
@endforeach
</tbody>
<tfoot>
@php
$addonTotal = 0;
foreach ($orders->orderItems as $item) {
foreach ($item->addons as $addon) {
$addonTotal += $addon->price * $item->months;
}
}
$productTotal = $orders->amount - $addonTotal;
@endphp
<tr class="border-t-2 border-gray-200">
<td class="px-4 py-3 text-gray-500 font-medium">Giá trị sản phẩm</td>
<td></td>
<td class="px-4 py-3 text-right text-gray-500 font-medium">
{{ number_format($productTotal) }} VNĐ
</td>
</tr>
<tr>
<td class="px-4 py-3 text-gray-500 font-medium">Tổng addon</td>
<td></td>
<td class="px-4 py-3 text-right text-gray-500 font-medium">
{{ number_format($addonTotal) }} VNĐ
</td>
</tr>
@if ($orders->discount_value)
<tr>
<td class="px-4 py-3 text-gray-500 font-medium">Giảm giá</td>
<td></td>
<td class="px-4 py-3 text-right text-gray-500 font-medium">
-{{ number_format($orders->discount_value) }} VNĐ
</td>
</tr>
@endif
<tr>
<td class="px-4 py-3 text-lg font-bold text-gray-800">Tổng cộng</td>
<td></td>
<td class="px-4 py-3 text-right text-lg font-bold text-gray-800">
{{ number_format($orders->amount) }} VNĐ
</td>
</tr>
</tfoot>
</table>
@if ($orders->status == 1)
<div class="flex flex-row justify-between pt-3 border-t border-gray-200">
<flux:modal.trigger name="destroy-order">
<flux:button type="button" variant="danger" icon="trash">Huỷ đơn hàng</flux:button>
</flux:modal.trigger>
<flux:modal.trigger name="confirm-order"> <!-- Chi tiết sản phẩm -->
<flux:button type="button" variant="primary" color="orange" icon="credit-card">Xác nhận thanh toán</flux:button> <div class="p-6">
</flux:modal.trigger> <h2 class="text-gray-700 text-lg font-semibold mb-4">Chi tiết sản phẩm</h2>
</div>
@endif
</div>
</div>
</div>
<!-- Ghi chú --> <div class="overflow-x-auto">
@if ($orders->note) <table class="w-full text-left">
<div class="bg-white rounded-lg shadow-lg p-6 mt-8"> <thead>
<h2 class="text-gray-700 text-lg font-semibold mb-2">Ghi chú đơn hàng</h2> <tr class="bg-gray-50">
<p class="text-gray-600">{{ $orders->note }}</p> <th class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider">
</div> Mô tả
@endif </th>
<th class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider text-right">
Số lượng
</th>
<th class="px-4 py-3 text-sm font-medium text-gray-500 uppercase tracking-wider text-right">
Giá
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
@foreach ($orders->orderItems as $item)
<tr class="bg-white">
<td class="px-4 py-3">
<div class="font-medium text-gray-800">Sản phẩm
{{ $item->product->name ?? 'Không xác định' }}
</div>
<div class="text-sm text-gray-500">
Loại:
@if ($item->product_type == 1)
Shared Hosting
@elseif($item->product_type == 2)
VPS
@elseif($item->product_type == 3)
Dedicated Server
@else
Khác
@endif
</div>
<div class="text-sm text-gray-500 flex flex-row items-center">
Hệ điều hành:
<div class="ml-2 flex items-center gap-2">
<div class="avatar">
<div class="size-6 rounded-md">
<img src="{{ $item->os->osGroup->thumbnail }}"
alt="{{ $item->os->osGroup->name }}" />
</div>
</div>{{ $item->os->osGroup->name }}
{{ $item->os->version }}
</div>
</div>
</td>
<td class="px-4 py-3 text-right">
{{ $item->quantity }}
</td>
<td class="px-4 py-3 text-right">
<p>
{{ format_price($item->price) }}
/{{ $item->months }}tháng
</p>
</td>
</tr>
<!-- Hỗ trợ --> <!-- Addon items -->
<div class="bg-blue-50 rounded-lg p-6 mt-8 border border-blue-100"> @foreach ($item->addons as $addon)
<div class="flex items-start"> <tr class="bg-gray-50">
<div class="flex-shrink-0 w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center mr-4"> <td class="px-4 py-2 pl-8">
<svg class="w-6 h-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24" <div class="text-sm text-gray-600">
xmlns="http://www.w3.org/2000/svg"> <span class="text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" Addon
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path> </span>
</svg> <span class="ml-2">{{ $addon->addonItems->name }} đơn giá:
</div> ({{ format_price($addon->addonItems->price) }})
<div class="flex-1"> / {{ $addon->addonItems->step . $addon->addonItems->prefix }}
<h3 class="text-lg font-medium text-blue-800">Bạn cần hỗ trợ?</h3> </span>
<p class="text-blue-600 mt-1">Nếu bạn gặp bất kỳ vấn đề nào khi thanh toán, vui lòng liên hệ với </div>
chúng tôi thông qua. </br> Hotline <span </td>
class="font-medium">{{ setting('setting.tel') }}</span> hoặc <td class="px-4 py-2 text-right text-sm text-gray-600">
thông qua Email <span class="font-medium">{{ setting('setting.support') }}</span></p> {{ $addon->qty }} / {{ $addon->addonItems->prefix }}
({{ $item->months }} tháng)
</td>
<td class="px-4 py-2 text-right text-sm text-gray-600">
{{ number_format($addon->price * $item->months) }} VNĐ
</td>
</tr>
@endforeach
@endforeach
</tbody>
<tfoot>
@php
$addonTotal = 0;
foreach ($orders->orderItems as $item) {
foreach ($item->addons as $addon) {
$addonTotal += $addon->price * $item->months;
}
}
$productTotal = $orders->amount - $addonTotal;
@endphp
<tr class="border-t-2 border-gray-200">
<td class="px-4 py-3 text-gray-500 font-medium">Giá trị sản phẩm</td>
<td></td>
<td class="px-4 py-3 text-right text-gray-500 font-medium">
{{ number_format($productTotal) }} VNĐ
</td>
</tr>
<tr>
<td class="px-4 py-3 text-gray-500 font-medium">Tổng addon</td>
<td></td>
<td class="px-4 py-3 text-right text-gray-500 font-medium">
{{ number_format($addonTotal) }} VNĐ
</td>
</tr>
@if ($orders->discount_value)
<tr>
<td class="px-4 py-3 text-gray-500 font-medium">Giảm giá</td>
<td></td>
<td class="px-4 py-3 text-right text-gray-500 font-medium">
-{{ number_format($orders->discount_value) }} VNĐ
</td>
</tr>
@endif
<tr>
<td class="px-4 py-3 text-lg font-bold text-gray-800">Tổng cộng</td>
<td></td>
<td class="px-4 py-3 text-right text-lg font-bold text-gray-800">
{{ number_format($orders->amount) }} VNĐ
</td>
</tr>
</tfoot>
</table>
@if ($orders->status == 1)
<div class="flex flex-row justify-end pt-3 border-t border-gray-200">
<flux:modal.trigger name="confirm-order" class="flex-end">
<flux:button type="button" variant="primary" color="orange" icon="credit-card">Xác nhận
thanh toán</flux:button>
</flux:modal.trigger>
</div>
@endif
</div>
</div>
</div>
<!-- Ghi chú -->
@if ($orders->note)
<div class="bg-white rounded-lg shadow-lg p-6 mt-8">
<h2 class="text-gray-700 text-lg font-semibold mb-2">Ghi chú đơn hàng</h2>
<p class="text-gray-600">{{ $orders->note }}</p>
</div>
@endif
<!-- Hỗ trợ -->
<div class="bg-blue-50 rounded-lg p-6 mt-8 border border-blue-100">
<div class="flex items-start">
<div class="flex-shrink-0 w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center mr-4">
<svg class="w-6 h-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</div>
<div class="flex-1">
<h3 class="text-lg font-medium text-blue-800">Bạn cần hỗ trợ?</h3>
<p class="text-blue-600 mt-1">Nếu bạn gặp bất kỳ vấn đề nào khi thanh toán, vui lòng liên hệ với
chúng tôi thông qua. </br> Hotline <span class="font-medium">{{ setting('setting.tel') }}</span>
hoặc
thông qua Email <span class="font-medium">{{ setting('setting.support') }}</span></p>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
@include('frontend.order.modal.destroy', [ @include('frontend.order.modal.destroy', [
'order_id' => $orders->id, 'order_id' => $orders->id,
'order_num' => $orders->order_num, 'order_num' => $orders->order_num,
]) ])
@include('frontend.order.modal.confirm', [ @include('frontend.order.modal.confirm', [
'order_id' => $orders->id, 'order_id' => $orders->id,
'order_num' => $orders->order_num, 'order_num' => $orders->order_num,
]) ])
@@ -135,7 +135,6 @@
<div class="mt-6 pt-4 border-t border-gray-200"> <div class="mt-6 pt-4 border-t border-gray-200">
<div class="flex items-center justify-between text-sm text-gray-500"> <div class="flex items-center justify-between text-sm text-gray-500">
<span>Cập nhật lần cuối: {{ $vmInfo['last_updated'] }}</span> <span>Cập nhật lần cuối: {{ $vmInfo['last_updated'] }}</span>
<span>VM ID: {{ $vmInfo['vm_id'] }}</span>
</div> </div>
</div> </div>
@else @else