Update source into github
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
@php
|
||||
$serviceCards = [
|
||||
[
|
||||
'icon' => 'box',
|
||||
'iconColor' => 'text-green-400',
|
||||
'badgeColor' => 'bg-green-400',
|
||||
'title' => __('Services'),
|
||||
'value' => count($vmware ?? []) + count($hosting ?? []),
|
||||
'label' => __('Services'),
|
||||
'tooltip' => __('Services')
|
||||
],
|
||||
[
|
||||
'icon' => 'credit-card',
|
||||
'iconColor' => 'text-primary',
|
||||
'badgeColor' => 'bg-primary',
|
||||
'title' => __('Balance'),
|
||||
'value' => number_format(auth('users')->user()->credit, 0, ',', '.') . ' đ',
|
||||
'label' => __('Balance'),
|
||||
'tooltip' => __('Balance')
|
||||
],
|
||||
[
|
||||
'icon' => 'file-text',
|
||||
'iconColor' => 'text-blue-600',
|
||||
'badgeColor' => 'bg-blue-600',
|
||||
'title' => __('Invoices'),
|
||||
'value' => count($invocie_unpaid ?? []),
|
||||
'label' => __('Invoices'),
|
||||
'tooltip' => __('Invoices')
|
||||
],
|
||||
[
|
||||
'icon' => 'help-circle',
|
||||
'iconColor' => 'text-red-600',
|
||||
'badgeColor' => 'bg-red-600',
|
||||
'title' => __('Support'),
|
||||
'value' => count($ticket ?? []),
|
||||
'label' => __('Support'),
|
||||
'tooltip' => __('Support')
|
||||
],
|
||||
[
|
||||
'icon' => 'globe',
|
||||
'iconColor' => 'text-purple-600',
|
||||
'badgeColor' => 'bg-purple-600',
|
||||
'title' => __('Domains'),
|
||||
'value' => count($domain ?? []),
|
||||
'label' => __('Domains'),
|
||||
'tooltip' => __('Domains')
|
||||
]
|
||||
];
|
||||
@endphp
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-5">
|
||||
@foreach($serviceCards as $index => $card)
|
||||
<x-service-card
|
||||
:icon="$card['icon']"
|
||||
:iconColor="$card['iconColor']"
|
||||
:badgeColor="$card['badgeColor']"
|
||||
:title="$card['title']"
|
||||
:value="$card['value']"
|
||||
:label="$card['label']"
|
||||
:animationDelay="$index * 0.1"
|
||||
/>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
// Initialize Lucide icons when component loads
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
if (typeof lucide !== 'undefined') {
|
||||
lucide.createIcons();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,173 @@
|
||||
@extends('frontend.layouts.master')
|
||||
|
||||
@section('content')
|
||||
<div class="grid grid-cols-1 md:grid-cols-12 gap-6">
|
||||
<!-- Leftbox -->
|
||||
<div class="col-span-12 2xl:col-span-9">
|
||||
@include('frontend.home.card.service')
|
||||
</div>
|
||||
|
||||
|
||||
<!-- RightBox -->
|
||||
<div class="col-span-12 2xl:col-span-3">
|
||||
<!-- Card -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md mb-3 animate__animated animate__fadeInUp">
|
||||
<!-- Card Header -->
|
||||
<div class="border-b border-slate-300 dark:border-gray-600 border-dashed p-4">
|
||||
<div class="flex items-center gap-3 font-bold">
|
||||
<i data-lucide="user" class="w-4 h-4"></i>
|
||||
<h4>Thông tin cá nhân</h4>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Card Body -->
|
||||
<div class="p-4">
|
||||
<ul class="space-y-3 text-sm">
|
||||
<li class="flex flex-wrap items-center">
|
||||
<span class="font-medium mr-2">Họ và tên:</span>
|
||||
{{ customer()?->firstname . ' ' . customer()?->lastname }}
|
||||
</li>
|
||||
<li class="flex flex-wrap items-center">
|
||||
<span class="font-medium mr-2">Email:</span> {{ customer()?->email }}
|
||||
@if (customer()?->email_hash)
|
||||
<span class="text-green-500 text-xs ml-2 flex items-center">
|
||||
<i class="fas fa-check-circle mr-1"></i> Đã xác thực
|
||||
</span>
|
||||
@else
|
||||
<span class="text-red-500 text-xs ml-2 flex items-center">
|
||||
<i class="fas fa-x mr-1"></i> Chưa xác thực
|
||||
</span>
|
||||
@endif
|
||||
</li>
|
||||
<li class="flex flex-wrap items-center">
|
||||
<span class="font-medium mr-2">Điện thoại:</span>
|
||||
<span class="phone">
|
||||
{{ customer()?->phone }}
|
||||
</span>
|
||||
<span id="user-info-verify-phone">
|
||||
|
||||
</span>
|
||||
</li>
|
||||
<li class="flex flex-wrap items-center">
|
||||
<span class="font-medium mr-2">Đặc quyền:</span> Cơ bản
|
||||
</li>
|
||||
<livewire:user-settings />
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Card -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md mb-3 animate__animated animate__fadeInUp">
|
||||
<!-- Card Header -->
|
||||
<div class="border-b border-slate-300 dark:border-gray-600 border-dashed p-4">
|
||||
<div class="flex items-center gap-3 font-bold">
|
||||
<i data-lucide="wallet-cards" class="w-4 h-4"></i>
|
||||
<h4>Thống kế Credits và Points</h4>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Card Body -->
|
||||
<div class="p-4">
|
||||
<div class="grid grid-cols-3 gap-4">
|
||||
<div class="flex flex-col items-center justify-center">
|
||||
<img src="{{ asset('images/credit-balance-icon.png') }}" alt="Credit" width="50%"
|
||||
height="50%" />
|
||||
<small>Số dư</small>
|
||||
<span class="text-green-500">{{ format_price(customer()?->credit) }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col items-center justify-center">
|
||||
<img src="{{ asset('images/total-amount-spent.png') }}" alt="Credit" width="50%"
|
||||
height="50%" />
|
||||
<small>Đã chi</small>
|
||||
<span
|
||||
class="text-red-500">{{ format_price((int) customer()?->total - (int) customer()?->credit) }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col items-center justify-center">
|
||||
<img src="{{ asset('images/total-amount-deposited.png') }}" alt="Credit" width="50%"
|
||||
height="50%" />
|
||||
<small>Đã nạp</small>
|
||||
<span class="text-blue-500">{{ format_price((int) customer()?->total) }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col items-center justify-center">
|
||||
<img src="{{ asset('images/account-points.png') }}" alt="Credit" width="50%"
|
||||
height="50%" />
|
||||
<small>Points</small>
|
||||
<span class="text-gray-500">{{ format_point(0) }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col items-center justify-center">
|
||||
<img src="{{ asset('images/total-points.png') }}" alt="Credit" width="50%"
|
||||
height="50%" />
|
||||
<small>Tổng tích điểm</small>
|
||||
<span class="text-gray-500">{{ format_point(0) }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col items-center justify-center">
|
||||
<img src="{{ asset('images/membership-level.png') }}" alt="Credit" width="60%"
|
||||
height="60%" />
|
||||
<small>Hạng</small>
|
||||
<span class="text-green-500">Cơ bản</span>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="h-px my-8 bg-gray-200 border-0 dark:bg-gray-700">
|
||||
<div class="mx-auto flex items-center justify-center gap-3 flex-row mt-3">
|
||||
<a href="{{ route('recharge.index') }}" wire:navigate>
|
||||
<flux:button icon="credit-card">Nạp tiền</flux:button>
|
||||
</a>
|
||||
<a href="{{ route('recharge.history') }}" wire:navigate>
|
||||
<flux:button icon="inbox-stack">Tất cả giao dịch</flux:button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md mb-3 animate__animated animate__fadeInUp">
|
||||
<!-- Card Header -->
|
||||
<div class="border-b border-slate-300 dark:border-gray-600 border-dashed p-4">
|
||||
<div class="flex items-center gap-3 font-bold">
|
||||
<i data-lucide="bookmark" class="w-4 h-4"></i>
|
||||
<h4>Hướng dẫn</h4>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Card Body -->
|
||||
<div class="p-4 max-h-[250px] overflow-y-auto">
|
||||
<ul>
|
||||
@foreach ($posts as $item)
|
||||
<li class="border-b border-dashed border-gray-200 last:border-0 group-hover mb-3">
|
||||
<a href="{{ $item->slug }}"
|
||||
class="hover:text-[var(--color-primary)] transition-all ease-in-out duration-300">
|
||||
{{ $item->name }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('viewScripts')
|
||||
<script>
|
||||
function updateStatus(field, checked) {
|
||||
fetch('{{ route('user.updateNotification') }}', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
[field]: checked ? 1 : 0
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Xử lý kết quả trả về
|
||||
if (data.success) {
|
||||
console.log('Cập nhật thành công!');
|
||||
} else {
|
||||
console.log('Lỗi khi cập nhật');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Có lỗi xảy ra:', error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user