<?php
/**
 * Test script for non-masking SMS functionality
 */
require_once 'config/database.php';
require_once 'includes/sms_helper.php';

echo "<h2>Testing Non-Masking SMS Functionality</h2>";

// Test configuration loading
$config = non_musking_config();
echo "<h3>Current Configuration:</h3>";
echo "<pre>" . print_r($config, true) . "</pre>";

// Test sending an SMS (this will only work if properly configured)
$testNumber = "+8801712345678"; // Test number
$testMessage = "পরীক্ষা বার্তা: এটি একটি টেস্ট এসএমএস।";

echo "<h3>Attempting to send test message:</h3>";
echo "To: " . $testNumber . "<br>";
echo "Message: " . $testMessage . "<br>";

$result = non_musking_send($pdo, [$testNumber], $testMessage, [
    'message_type' => 'test',
    'recipient_name' => 'Test User'
]);

echo "<h3>Result:</h3>";
echo "<pre>" . print_r($result, true) . "</pre>";

echo "<p><strong>Note:</strong> If 'success' is false, it likely means non-masking SMS is not configured yet. ";
echo "Please configure your API settings in Admin Panel → Non-Masking Settings.</p>";
?>