<?php
require_once __DIR__ . '/../includes/config.php';
if (file_exists(__DIR__ . '/../includes/auth.php')) require_once __DIR__ . '/../includes/auth.php';
require_once __DIR__ . '/functions.php';

admin_require_post_action('influencer_status', admin_url('influencers/list.php'));

$id = (int)($_POST['id'] ?? 0);
$status = (int)($_POST['status'] ?? -1);
$res = infl_set_status($id, $status);
admin_log_activity('influencer.set_status', 'تغيير حالة مؤثر', 'تم تغيير حالة المؤثر.', 'influencer', $id, ['status' => $status], true);
infl_redirect(admin_url('influencers/list.php?msg=').urlencode($res['message']));
