@extends('layout.app') @section('_style') @endsection @section('content')

Tài khoản quảng cáo Meta @if(!$isOwnAccount) — {{ $targetUser->full_name }} @endif

@if($isAdmin) @endif @if(!$appConfigError && $isOwnAccount) Lấy token qua Facebook @endif {{-- Gia hạn chỉ cần token đang lưu, nên admin gia hạn được cho cả nhân viên đang chọn. --}} @if(!$configError) @endif Cấu hình Meta App
@if(session('status'))
{{ session('status') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($configError) @if($appConfigError)
{{ $appConfigError['status'] }} — {{ $appConfigError['message'] }}
Vào Thông tin tài khoản để nhập META_APP_ID và META_APP_SECRET.
@elseif(!$isOwnAccount)
Nhân viên {{ $targetUser->full_name }} chưa có access token. Nhân viên cần tự đăng nhập Facebook để cấp quyền ads_read.
@else
Chưa có access token. App ID và App Secret không tự sinh ra được token — bạn cần đăng nhập Facebook và duyệt quyền ads_read một lần (giống nút Generate Access Token của Graph API Explorer).
@endif @if(!$appConfigError) @include('marketing.meta_ads.token_panel', ['panelUser' => $targetUser, 'canManage' => $isOwnAccount]) @endif @include('marketing.meta_ads.redirect_hint', ['redirectUri' => $redirectUri]) @else @include('marketing.meta_ads.token_panel', ['panelUser' => $targetUser, 'canManage' => $isOwnAccount])
@if($isAdmin) {{-- Admin xem dữ liệu của nhân viên nào: chọn ở header, gửi kèm mọi ajax. --}} @endif
@include('marketing.meta_ads.redirect_hint', ['redirectUri' => $redirectUri])
@include('marketing.meta_ads.ajax', ['report' => $report])
@endif
@endsection @section('_script') @endsection