@extends('backEnd.layouts.master') @section('title', 'Manual Fraud Check') @section('content')

আপনার যাচাই করতে চাওয়া মোবাইল নাম্বারটি দিয়ে সার্চ দিন

{{-- Search Box --}} {{-- Route Name Fixed: admin.manual_fraud_check --}}
@csrf
{{-- API Error Message --}} @if(session('error'))
{{ session('error') }}
@endif {{-- Results --}} @if(isset($data) && !empty($data))
{{-- LEFT: SUMMARY SECTION --}}
মোট সফলতার হার

# {{ $mobile }}

@php $summary = $data['summary'] ?? []; $overallRate = isset($summary['success_ratio']) ? round($summary['success_ratio']) : null; $rateText = $overallRate !== null ? $overallRate.'%' : 'N/A'; $totalParcels = $summary['total_parcel'] ?? 0; @endphp {{-- Circle --}}
{{ $rateText }}
({{ $totalParcels }} টি অর্ডার)
{{-- Rate Message (Bangla) --}} @if($overallRate !== null) @php if ($overallRate >= 90) { $class = "status-green"; $msg = "✔ নিরাপদ - ঝুঁকিমুক্ত অবস্থা 😎"; $desc = "এই কাস্টমারের সফলতার হার চমৎকার। নিশ্চিন্তে অর্ডার প্রসেস করুন।"; } elseif ($overallRate >= 70) { $class = "status-blue"; $msg = "ℹ️ ভালো - তবে সতর্ক থাকুন 🙂"; $desc = "সফলতার হার ভালো, তবে লোকেশন বা অন্য বিষয়গুলো চেক করে নিন।"; } elseif ($overallRate >= 40) { $class = "status-orange"; $msg = "⚠ ঝুঁকি আছে – কনফার্ম হয়ে নিন ⚠"; $desc = "রিটার্নের হার বেশি। অবশ্যই ডেলিভারি চার্জ অগ্রিম নিন।"; } else { $class = "status-red"; $msg = "❗ উচ্চ ঝুঁকি – অর্ডার না নেওয়াই ভালো ❗"; $desc = "এই কাস্টমারের বেশিরভাগ পার্সেল ক্যানসেল হয়। সাবধান!"; } @endphp
{{ $msg }}

{{ $desc }}

@endif
{{-- RIGHT: TABLE --}}
@php $couriers = [ 'pathao' => 'Pathao', 'steadfast' => 'SteadFast', 'redx' => 'RedX', 'paperfly' => 'PaperFly', 'parceldex' => 'ParcelDex', 'carrybee' => 'CarryBee' ]; // ⭐ আপনার লোকাল লোগোর পাথ এখানে সেট করুন ⭐ $myLogos = [ 'pathao' => asset('public/assets/images/courier/pathao-logo.png'), 'steadfast' => asset('public/assets/images/courier/steadfast-logo.png'), 'redx' => asset('public/assets/images/courier/redx-logo.png'), 'paperfly' => asset('public/assets/images/courier/paperfly-logo.png'), 'parceldex' => asset('public/assets/images/courier/parceldex-logo.png'), 'carrybee' => asset('public/assets/images/courier/carrybee-logo.webp'), ]; @endphp @foreach($couriers as $key => $name) @php $info = $data[$key] ?? []; $s = (int) ($info['success_parcel'] ?? 0); $c = (int) ($info['cancelled_parcel'] ?? 0); $t = (int) ($info['total_parcel'] ?? ($s + $c)); $rate = isset($info['success_ratio']) ? round($info['success_ratio']) : ($t > 0 ? round(($s/$t)*100) : 0); // সরাসরি লোকাল লোগো ব্যবহার $logo = $myLogos[$key] ?? null; @endphp @endforeach
কুরিয়ার মোট অর্ডার সফল বাতিল হার
@if($logo) @endif {{ $name }} {{ $t }} {{ $s }} {{ $c }} @php $borderColor = $rate < 50 ? '#dc3545' : ($rate < 80 ? '#fd7e14' : '#28a745'); $bgColor = $rate < 50 ? '#ffeeee' : ($rate < 80 ? '#fff8e1' : '#e9ffe9'); $textColor = $rate < 50 ? '#dc3545' : ($rate < 80 ? '#fd7e14' : '#28a745'); @endphp
{{ $rate }}%
@if($t == 0) তথ্য নেই @elseif($rate == 100) চমৎকার @elseif($rate >= 80) ভালো @elseif($rate >= 50) সাধারণ @else ঝুঁকিপূর্ণ @endif
@endif
@endsection