<?php
require_once __DIR__ . '/config/database.php';
require_once __DIR__ . '/includes/sms_helper.php';

echo "=== Testing Direct Non-Musking Send ===\n\n";

// Test with a real phone number that should work
$testNumbers = ['+8801712345678']; // Test number
$message = "প্রিয় Test Student, আপনার ফি 500.00 টাকা গৃহীত হয়েছে। বর্তমান বকেয়া: 0.00 টাকা। ধন্যবাদ।";

echo "Sending test message...\n";
echo "Message: $message\n";
echo "To: " . implode(', ', $testNumbers) . "\n\n";

$result = non_musking_send($pdo, $testNumbers, $message, ['template'=>'fee_payment']);

echo "Result:\n";
echo json_encode($result, JSON_PRETTY_PRINT) . "\n\n";

if ($result['success']) {
    echo "✅ SMS sent successfully!\n";
    if (isset($result['raw_response'])) {
        echo "Raw response: " . $result['raw_response'] . "\n";
    }
} else {
    echo "❌ SMS failed: " . $result['message'] . "\n";
    if (isset($result['raw_response'])) {
        echo "Raw response: " . $result['raw_response'] . "\n";
    }
}
?>