<?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';

$id = (int)($_GET['id'] ?? 0);
if ($id <= 0) {
    cust_redirect('list.php?msg=' . urlencode('رقم الزبون غير صالح'));
}

$result = cust_toggle_customer_status($id);
cust_redirect('list.php?msg=' . urlencode($result['message']));
