@extends('admin::.layouts.master')
@php
$pageTitle = 'جزئیات برادکست';
@endphp
@section('title', $pageTitle)
@push('css')
@endpush
@section('content')
@php
// دادههای نمونه برای برادکست
$broadcast = (object)[
'id' => 1,
'title' => 'اعلان جشنواره پاییزه',
'description' => 'اطلاع رسانی درباره جشنواره تخفیفهای پاییزی و محصولات جدید',
'owner' => (object)['name' => 'کاربر تست', 'email' => 'test@example.com'],
'segment' => 'تمام کاربران فعال',
'platform' => 'instagram',
'message_content' => '🎉 جشنواره پاییزه آغاز شد!\n\n✅ تخفیف ۳۰٪ روی تمام محصولات\n✅ ارسال رایگان برای خریدهای بالای ۲۰۰ هزار تومان\n✅ هدیه ویژه برای اولین خرید\n\n🛒 برای مشاهده محصولات:\nexample.com/fall-festival\n\n⏰ فرصت محدود - فقط تا پایان هفته',
'scheduled_at' => \Carbon\Carbon::now()->addDays(2),
'sent_at' => \Carbon\Carbon::now()->subHours(3),
'status' => 'sending',
'is_active' => true,
'recipients_count' => 1250,
'sent_count' => 1200,
'opened_count' => 850,
'failed_count' => 50,
'created_at' => \Carbon\Carbon::now()->subDays(1),
'metadata' => [
'image_url' => 'https://example.com/images/fall-festival.jpg',
'buttons' => ['مشاهده محصولات', 'اطلاعات بیشتر'],
'tags' => ['جشنواره', 'تخفیف', 'پاییز']
]
];
// دادههای نمونه برای تاریخچه ارسال
$deliveryLogs = [
(object)[
'id' => 1,
'user' => (object)['name' => 'علی رضایی', 'username' => 'ali_rezaei'],
'platform' => 'instagram',
'sent_at' => \Carbon\Carbon::now()->subHours(3),
'status' => 'delivered',
'opened_at' => \Carbon\Carbon::now()->subHours(2),
'error_message' => null
],
(object)[
'id' => 2,
'user' => (object)['name' => 'مریم احمدی', 'username' => 'maryam_ahmadi'],
'platform' => 'instagram',
'sent_at' => \Carbon\Carbon::now()->subHours(3),
'status' => 'delivered',
'opened_at' => \Carbon\Carbon::now()->subHours(1),
'error_message' => null
],
(object)[
'id' => 3,
'user' => (object)['name' => 'حمید قاسمی', 'username' => 'hamid_ghasemi'],
'platform' => 'instagram',
'sent_at' => \Carbon\Carbon::now()->subHours(3),
'status' => 'failed',
'opened_at' => null,
'error_message' => 'Rate limit exceeded - Try again in 30 minutes'
],
(object)[
'id' => 4,
'user' => (object)['name' => 'سارا محمدی', 'username' => 'sara_mohammadi'],
'platform' => 'instagram',
'sent_at' => \Carbon\Carbon::now()->subHours(2),
'status' => 'delivered',
'opened_at' => \Carbon\Carbon::now()->subHours(1),
'error_message' => null
],
(object)[
'id' => 5,
'user' => (object)['name' => 'رضا کریمی', 'username' => 'reza_karimi'],
'platform' => 'instagram',
'sent_at' => \Carbon\Carbon::now()->subHours(2),
'status' => 'pending',
'opened_at' => null,
'error_message' => null
]
];
// محاسبه آمار
$successRate = $broadcast->recipients_count > 0 ? ($broadcast->sent_count / $broadcast->recipients_count) * 100 : 0;
$openRate = $broadcast->sent_count > 0 ? ($broadcast->opened_count / $broadcast->sent_count) * 100 : 0;
$completionRate = ($broadcast->sent_count + $broadcast->failed_count) / $broadcast->recipients_count * 100;
@endphp
📢 {{ $broadcast->title }}
{{ $broadcast->description }}
@if($broadcast->status == 'sending')
@endif
@if($broadcast->status == 'scheduled')
@endif
{{ number_format($broadcast->recipients_count) }}
کل گیرندگان
{{ number_format($broadcast->sent_count) }}
ارسال موفق
{{ number_format($broadcast->failed_count) }}
خطا
{{ number_format($successRate, 1) }}%
نرخ موفقیت
{{ number_format($openRate, 1) }}%
نرخ باز شدن
پیشرفت کلی: {{ number_format($completionRate, 1) }}%
{{ $broadcast->sent_count + $broadcast->failed_count }} / {{ $broadcast->recipients_count }}
{{ number_format($successRate, 1) }}% موفق
{{ number_format(($broadcast->failed_count / $broadcast->recipients_count) * 100, 1) }}
% خطا
{{ number_format(100 - $completionRate, 1) }}
% باقیمانده
{{ number_format($successRate, 1) }}%
موفقیت ارسال
{{ number_format($openRate, 1) }}%
نرخ باز شدن
{{ $broadcast->recipients_count - $broadcast->sent_count - $broadcast->failed_count }}
در صف ارسال
{{ number_format(($broadcast->failed_count / $broadcast->recipients_count) * 100, 1) }}
%
نرخ خطا
ایجاد کننده:
{{ $broadcast->owner->name }}
ایمیل:
{{ $broadcast->owner->email }}
پلتفرم:
اینستاگرام
سگمنت:
{{ $broadcast->segment }}
وضعیت:
در حال ارسال
زمان ایجاد:
{{ $broadcast->created_at->format('d M Y H:i') }}
آخرین بروزرسانی:
{{ $broadcast->sent_at->format('d M Y H:i') }}
{{ $broadcast->message_content }}
@if(isset($broadcast->metadata['image_url']))
@endif
@if(isset($broadcast->metadata['buttons']))
@foreach($broadcast->metadata['buttons'] as $button)
@endforeach
@endif
@if(isset($broadcast->metadata['tags']))
@foreach($broadcast->metadata['tags'] as $tag)
{{ $tag }}
@endforeach
@endif
| کاربر |
پلتفرم |
زمان ارسال |
زمان باز شدن |
وضعیت |
عملیات |
@foreach($deliveryLogs as $log)
{{ $log->user->name }}
@{{ $log->user->username
}}
|
اینستاگرام
|
{{ $log->sent_at->format('H:i') }}
{{ $log->sent_at->format('d M') }}
|
@if($log->opened_at)
{{ $log->opened_at->format('H:i') }}
{{ $log->opened_at->format('d M') }}
@else
-
@endif
|
@if($log->status == 'delivered')
ارسال شد
@elseif($log->status == 'pending')
در انتظار
@else
خطا
@endif
|
@if($log->status == 'failed')
@endif
@if($log->status == 'delivered' && !$log->opened_at)
@endif
|
@endforeach
@endsection
@push('js')
@endpush