{{-- @extends('layouts.UserDashboard') @section('user')
Current Level: {{ $user_salary->salaryTarget->level_name ?? 'N/A' }}
Current Target: {{ $user_salary->salaryTarget->target ?? 'N/A' }} Coins
| Time | Target | Host Salary | Status |
|---|---|---|---|
| {{$salart->validity}} Days | {{$salart->target}} Coins | ${{$salart->host_dollar}} |
@php
// Check if user has met this target
$target_met = false;
// Check based on different conditions:
// 1. If this is user's current level and coins earned >= target
if ($user_current_target_id == $salart->id && $user_coins_earned >= $salart->target) {
$target_met = true;
}
// 2. If this level is lower than current level (assuming completed)
elseif ($user_salary && $salart->id < $user_current_target_id) {
$target_met = true;
}
// 3. If user has already completed this target (check in user_salary_history table if exists)
@endphp
@if ($target_met)
Target Met
@elseif($user_current_target_id == $salart->id)
@php
$percentage = $salart->target > 0 ? min(100, ($user_coins_earned / $salart->target) * 100) : 0;
@endphp
{{ $user_coins_earned }}/{{ $salart->target }}
Coins
@elseif($salart->id > $user_current_target_id)
Locked
@else
Not Started
@endif
|
User ID: {{ $target_user->user_id ?? 'N/A' }}
| Level | Validity | Target (Coins) | Host Dollar | Commission | Current Status |
|---|---|---|---|---|---|
| {{ $salart->level_name }} | {{ $salart->validity }} Days | {{ number_format($salart->target) }} | ${{ number_format($salart->host_dollar, 2) }} | ${{ number_format($commission, 2) }} ({{ $percentValue }}%) |
@if ($isPassed)
Level
Complete
@elseif ($isActive)
@php
$percent =
$salart->target > 0
? min(100, ($active_coins / $salart->target) * 100)
: 0;
@endphp
|