Sindbad~EG File Manager
<?php
require_once '../../config/config.php';
require_once '../../classes/SMSService.php';
checkLogin();
// Only superusers can manage SMS settings
if (!isSuperuser()) {
header('Location: ../../dashboard.php');
exit;
}
$db = Database::getInstance()->getConnection();
$message = '';
$error = '';
// Get current settings
$stmt = $db->query("SELECT * FROM sms_settings ORDER BY id DESC LIMIT 1");
$settings = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$settings) {
// Create default settings
$db->exec("INSERT INTO sms_settings (gateway_provider, is_enabled, test_mode) VALUES ('africas_talking', 0, 1)");
$stmt = $db->query("SELECT * FROM sms_settings ORDER BY id DESC LIMIT 1");
$settings = $stmt->fetch(PDO::FETCH_ASSOC);
}
// Handle form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['save_settings'])) {
$gateway = sanitize($_POST['gateway_provider'] ?? 'africas_talking');
$isEnabled = isset($_POST['is_enabled']) ? 1 : 0;
$testMode = isset($_POST['test_mode']) ? 1 : 0;
// Africa's Talking
$atApiKey = sanitize($_POST['at_api_key'] ?? '');
$atUsername = sanitize($_POST['at_username'] ?? '');
$atSenderId = sanitize($_POST['at_sender_id'] ?? '');
// Twilio
$twilioSid = sanitize($_POST['twilio_account_sid'] ?? '');
$twilioToken = sanitize($_POST['twilio_auth_token'] ?? '');
$twilioFrom = sanitize($_POST['twilio_from_number'] ?? '');
// BulkSMS Nigeria
$bulksmsToken = sanitize($_POST['bulksms_api_token'] ?? '');
$bulksmsSender = sanitize($_POST['bulksms_sender_id'] ?? '');
// Hubtel
$hubtelClientId = sanitize($_POST['hubtel_client_id'] ?? '');
$hubtelSecret = sanitize($_POST['hubtel_client_secret'] ?? '');
$hubtelSender = sanitize($_POST['hubtel_sender_id'] ?? '');
// Clickatell
$clickatellKey = sanitize($_POST['clickatell_api_key'] ?? '');
// SMS Portal
$smsportalClientId = sanitize($_POST['smsportal_client_id'] ?? '');
$smsportalSecret = sanitize($_POST['smsportal_client_secret'] ?? '');
// Arkesel
$arkeselApiKey = sanitize($_POST['arkesel_api_key'] ?? '');
$arkeselSender = sanitize($_POST['arkesel_sender_id'] ?? '');
// Custom Gateway
$customUrl = sanitize($_POST['custom_api_url'] ?? '');
$customKey = sanitize($_POST['custom_api_key'] ?? '');
$customMethod = sanitize($_POST['custom_method'] ?? 'POST');
$customHeaders = sanitize($_POST['custom_headers'] ?? '');
// General
$defaultSender = sanitize($_POST['default_sender_name'] ?? '');
$stmt = $db->prepare("
UPDATE sms_settings SET
gateway_provider = ?,
is_enabled = ?,
at_api_key = ?,
at_username = ?,
at_sender_id = ?,
twilio_account_sid = ?,
twilio_auth_token = ?,
twilio_from_number = ?,
bulksms_api_token = ?,
bulksms_sender_id = ?,
hubtel_client_id = ?,
hubtel_client_secret = ?,
hubtel_sender_id = ?,
clickatell_api_key = ?,
smsportal_client_id = ?,
smsportal_client_secret = ?,
arkesel_api_key = ?,
arkesel_sender_id = ?,
custom_api_url = ?,
custom_api_key = ?,
custom_method = ?,
custom_headers = ?,
default_sender_name = ?,
test_mode = ?
WHERE id = ?
");
if ($stmt->execute([
$gateway, $isEnabled, $atApiKey, $atUsername, $atSenderId,
$twilioSid, $twilioToken, $twilioFrom,
$bulksmsToken, $bulksmsSender,
$hubtelClientId, $hubtelSecret, $hubtelSender,
$clickatellKey,
$smsportalClientId, $smsportalSecret,
$arkeselApiKey, $arkeselSender,
$customUrl, $customKey, $customMethod, $customHeaders,
$defaultSender, $testMode,
$settings['id']
])) {
$message = 'SMS settings updated successfully!';
// Reload settings
$stmt = $db->query("SELECT * FROM sms_settings ORDER BY id DESC LIMIT 1");
$settings = $stmt->fetch(PDO::FETCH_ASSOC);
} else {
$error = 'Failed to update SMS settings';
}
}
// Handle test SMS
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['send_test'])) {
$testPhone = sanitize($_POST['test_phone'] ?? '');
$testMessage = sanitize($_POST['test_message'] ?? '');
if (empty($testPhone) || empty($testMessage)) {
$error = 'Please enter phone number and message';
} else {
$smsService = new SMSService();
$result = $smsService->sendInstantSMS($testPhone, $testMessage, 'Test User');
if ($result['success']) {
$message = 'Test SMS sent successfully! ' . (isset($result['test_mode']) ? '(Test Mode - Not actually sent)' : '');
} else {
$error = 'Failed to send test SMS: ' . ($result['error'] ?? 'Unknown error');
}
}
}
$pageTitle = 'SMS Settings';
include '../../includes/header.php';
?>
<?php include '../../includes/sidebar.php'; ?>
<!-- Main Content -->
<main class="flex-1 md:ml-64 mt-16">
<div class="container mx-auto px-4 py-8">
<!-- Header -->
<div class="flex justify-between items-center mb-6">
<div>
<h1 class="text-3xl font-bold text-gray-800">
<i class="fas fa-sms mr-3 text-blue-600"></i>SMS Gateway Settings
</h1>
<p class="text-gray-600 mt-2">Configure SMS gateway and sending options</p>
</div>
<a href="index.php" class="bg-gray-500 hover:bg-gray-600 text-white px-6 py-3 rounded-lg transition duration-200">
<i class="fas fa-arrow-left mr-2"></i>Back to SMS
</a>
</div>
<?php if ($message): ?>
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded-lg mb-6 flex items-center animate-fade-in">
<i class="fas fa-check-circle mr-3"></i>
<span><?php echo htmlspecialchars($message); ?></span>
</div>
<?php endif; ?>
<?php if ($error): ?>
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded-lg mb-6 flex items-center animate-fade-in">
<i class="fas fa-exclamation-circle mr-3"></i>
<span><?php echo htmlspecialchars($error); ?></span>
</div>
<?php endif; ?>
<form method="POST" action="" class="space-y-6">
<!-- General Settings -->
<div class="bg-white rounded-xl shadow-lg p-6">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<i class="fas fa-cog mr-2 text-blue-600"></i>General Settings
</h2>
<div class="grid md:grid-cols-3 gap-6">
<div>
<label class="flex items-center space-x-3">
<input type="checkbox" name="is_enabled" value="1" <?php echo $settings['is_enabled'] ? 'checked' : ''; ?> class="w-5 h-5 text-blue-600 rounded focus:ring-blue-500">
<span class="font-semibold text-gray-700">Enable SMS Service</span>
</label>
<p class="text-sm text-gray-500 mt-1 ml-8">Turn on/off SMS sending</p>
</div>
<div>
<label class="flex items-center space-x-3">
<input type="checkbox" name="test_mode" value="1" <?php echo $settings['test_mode'] ? 'checked' : ''; ?> class="w-5 h-5 text-yellow-600 rounded focus:ring-yellow-500">
<span class="font-semibold text-gray-700">Test Mode</span>
</label>
<p class="text-sm text-gray-500 mt-1 ml-8">SMS will be logged but not sent</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Default Sender Name</label>
<input type="text" name="default_sender_name" value="<?php echo htmlspecialchars($settings['default_sender_name'] ?? ''); ?>" maxlength="11" placeholder="e.g., ChurchApp" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent">
<p class="text-xs text-gray-500 mt-1">Max 11 characters</p>
</div>
</div>
</div>
<!-- Gateway Selection -->
<div class="bg-white rounded-xl shadow-lg p-6">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<i class="fas fa-network-wired mr-2 text-purple-600"></i>Select SMS Gateway
</h2>
<div class="grid md:grid-cols-3 lg:grid-cols-4 gap-4">
<?php
$gateways = [
'africas_talking' => ['name' => "Africa's Talking", 'icon' => 'π', 'countries' => 'Kenya, Nigeria, Uganda, Tanzania'],
'twilio' => ['name' => 'Twilio', 'icon' => 'βοΈ', 'countries' => 'Global'],
'bulksms_nigeria' => ['name' => 'BulkSMS Nigeria', 'icon' => 'π³π¬', 'countries' => 'Nigeria'],
'hubtel' => ['name' => 'Hubtel', 'icon' => 'π¬π', 'countries' => 'Ghana'],
'clickatell' => ['name' => 'Clickatell', 'icon' => 'π±', 'countries' => 'Global'],
'smsportal' => ['name' => 'SMS Portal', 'icon' => 'πΏπ¦', 'countries' => 'South Africa'],
'arkesel' => ['name' => 'Arkesel', 'icon' => 'π¬π', 'countries' => 'Ghana'],
'custom' => ['name' => 'Custom Gateway', 'icon' => 'βοΈ', 'countries' => 'Any']
];
foreach ($gateways as $key => $gateway):
?>
<label class="gateway-option cursor-pointer">
<input type="radio" name="gateway_provider" value="<?php echo $key; ?>" <?php echo $settings['gateway_provider'] === $key ? 'checked' : ''; ?> class="sr-only gateway-radio">
<div class="gateway-card border-2 border-gray-300 rounded-lg p-4 text-center transition-all hover:shadow-lg">
<div class="text-4xl mb-2"><?php echo $gateway['icon']; ?></div>
<div class="font-bold text-gray-800"><?php echo $gateway['name']; ?></div>
<div class="text-xs text-gray-500 mt-1"><?php echo $gateway['countries']; ?></div>
</div>
</label>
<?php endforeach; ?>
</div>
</div>
<!-- Africa's Talking Settings -->
<div class="bg-white rounded-xl shadow-lg p-6 gateway-config" data-gateway="africas_talking" style="display: none;">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<span class="text-2xl mr-2">π</span>Africa's Talking Configuration
</h2>
<div class="grid md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">API Key *</label>
<input type="text" name="at_api_key" value="<?php echo htmlspecialchars($settings['at_api_key'] ?? ''); ?>" placeholder="Enter API Key" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Username *</label>
<input type="text" name="at_username" value="<?php echo htmlspecialchars($settings['at_username'] ?? ''); ?>" placeholder="sandbox or production username" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Sender ID</label>
<input type="text" name="at_sender_id" value="<?php echo htmlspecialchars($settings['at_sender_id'] ?? ''); ?>" maxlength="11" placeholder="e.g., CHURCH" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
</div>
<div class="mt-4 p-4 bg-blue-50 rounded-lg">
<p class="text-sm text-blue-800"><i class="fas fa-info-circle mr-2"></i><strong>Note:</strong> Get your credentials from <a href="https://account.africastalking.com" target="_blank" class="underline">africastalking.com</a></p>
</div>
</div>
<!-- Twilio Settings -->
<div class="bg-white rounded-xl shadow-lg p-6 gateway-config" data-gateway="twilio" style="display: none;">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<span class="text-2xl mr-2">βοΈ</span>Twilio Configuration
</h2>
<div class="grid md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Account SID *</label>
<input type="text" name="twilio_account_sid" value="<?php echo htmlspecialchars($settings['twilio_account_sid'] ?? ''); ?>" placeholder="ACxxxxxxxxxx" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Auth Token *</label>
<input type="password" name="twilio_auth_token" value="<?php echo htmlspecialchars($settings['twilio_auth_token'] ?? ''); ?>" placeholder="Enter Auth Token" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">From Number *</label>
<input type="text" name="twilio_from_number" value="<?php echo htmlspecialchars($settings['twilio_from_number'] ?? ''); ?>" placeholder="+1234567890" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
</div>
<div class="mt-4 p-4 bg-blue-50 rounded-lg">
<p class="text-sm text-blue-800"><i class="fas fa-info-circle mr-2"></i><strong>Note:</strong> Get your credentials from <a href="https://console.twilio.com" target="_blank" class="underline">twilio.com</a></p>
</div>
</div>
<!-- BulkSMS Nigeria Settings -->
<div class="bg-white rounded-xl shadow-lg p-6 gateway-config" data-gateway="bulksms_nigeria" style="display: none;">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<span class="text-2xl mr-2">π³π¬</span>BulkSMS Nigeria Configuration
</h2>
<div class="grid md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">API Token *</label>
<input type="text" name="bulksms_api_token" value="<?php echo htmlspecialchars($settings['bulksms_api_token'] ?? ''); ?>" placeholder="Enter API Token" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Sender ID</label>
<input type="text" name="bulksms_sender_id" value="<?php echo htmlspecialchars($settings['bulksms_sender_id'] ?? ''); ?>" maxlength="11" placeholder="e.g., CHURCH" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
</div>
<div class="mt-4 p-4 bg-blue-50 rounded-lg">
<p class="text-sm text-blue-800"><i class="fas fa-info-circle mr-2"></i><strong>Note:</strong> Get your token from <a href="https://www.bulksmsnigeria.com" target="_blank" class="underline">bulksmsnigeria.com</a></p>
</div>
</div>
<!-- Hubtel Settings -->
<div class="bg-white rounded-xl shadow-lg p-6 gateway-config" data-gateway="hubtel" style="display: none;">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<span class="text-2xl mr-2">π¬π</span>Hubtel Configuration
</h2>
<div class="grid md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Client ID *</label>
<input type="text" name="hubtel_client_id" value="<?php echo htmlspecialchars($settings['hubtel_client_id'] ?? ''); ?>" placeholder="Enter Client ID" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Client Secret *</label>
<input type="password" name="hubtel_client_secret" value="<?php echo htmlspecialchars($settings['hubtel_client_secret'] ?? ''); ?>" placeholder="Enter Client Secret" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Sender ID</label>
<input type="text" name="hubtel_sender_id" value="<?php echo htmlspecialchars($settings['hubtel_sender_id'] ?? ''); ?>" maxlength="11" placeholder="e.g., CHURCH" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
</div>
<div class="mt-4 p-4 bg-blue-50 rounded-lg">
<p class="text-sm text-blue-800"><i class="fas fa-info-circle mr-2"></i><strong>Note:</strong> Get your credentials from <a href="https://developers.hubtel.com" target="_blank" class="underline">hubtel.com</a></p>
</div>
</div>
<!-- Clickatell Settings -->
<div class="bg-white rounded-xl shadow-lg p-6 gateway-config" data-gateway="clickatell" style="display: none;">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<span class="text-2xl mr-2">π±</span>Clickatell Configuration
</h2>
<div class="grid md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">API Key *</label>
<input type="text" name="clickatell_api_key" value="<?php echo htmlspecialchars($settings['clickatell_api_key'] ?? ''); ?>" placeholder="Enter API Key" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
</div>
<div class="mt-4 p-4 bg-blue-50 rounded-lg">
<p class="text-sm text-blue-800"><i class="fas fa-info-circle mr-2"></i><strong>Note:</strong> Get your API key from <a href="https://portal.clickatell.com" target="_blank" class="underline">clickatell.com</a></p>
</div>
</div>
<!-- SMS Portal Settings -->
<div class="bg-white rounded-xl shadow-lg p-6 gateway-config" data-gateway="smsportal" style="display: none;">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<span class="text-2xl mr-2">πΏπ¦</span>SMS Portal Configuration
</h2>
<div class="grid md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Client ID *</label>
<input type="text" name="smsportal_client_id" value="<?php echo htmlspecialchars($settings['smsportal_client_id'] ?? ''); ?>" placeholder="Enter Client ID" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Client Secret *</label>
<input type="password" name="smsportal_client_secret" value="<?php echo htmlspecialchars($settings['smsportal_client_secret'] ?? ''); ?>" placeholder="Enter Client Secret" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
</div>
<div class="mt-4 p-4 bg-blue-50 rounded-lg">
<p class="text-sm text-blue-800"><i class="fas fa-info-circle mr-2"></i><strong>Note:</strong> Get your credentials from <a href="https://www.smsportal.com" target="_blank" class="underline">smsportal.com</a></p>
</div>
</div>
<!-- Arkesel Settings -->
<div class="bg-white rounded-xl shadow-lg p-6 gateway-config" data-gateway="arkesel" style="display: none;">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<span class="text-2xl mr-2">π¬π</span>Arkesel Configuration
</h2>
<div class="grid md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">API Key *</label>
<input type="text" name="arkesel_api_key" value="<?php echo htmlspecialchars($settings['arkesel_api_key'] ?? ''); ?>" placeholder="Enter API Key" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Sender ID</label>
<input type="text" name="arkesel_sender_id" value="<?php echo htmlspecialchars($settings['arkesel_sender_id'] ?? ''); ?>" maxlength="11" placeholder="e.g., CHURCH" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
</div>
<div class="mt-4 p-4 bg-blue-50 rounded-lg">
<p class="text-sm text-blue-800"><i class="fas fa-info-circle mr-2"></i><strong>Note:</strong> Get your API key from <a href="https://sms.arkesel.com" target="_blank" class="underline">sms.arkesel.com</a></p>
</div>
</div>
<!-- Custom Gateway Settings -->
<div class="bg-white rounded-xl shadow-lg p-6 gateway-config" data-gateway="custom" style="display: none;">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<span class="text-2xl mr-2">βοΈ</span>Custom Gateway Configuration
</h2>
<div class="grid md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">API URL *</label>
<input type="url" name="custom_api_url" value="<?php echo htmlspecialchars($settings['custom_api_url'] ?? ''); ?>" placeholder="https://api.example.com/send" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">API Key</label>
<input type="text" name="custom_api_key" value="<?php echo htmlspecialchars($settings['custom_api_key'] ?? ''); ?>" placeholder="Optional API Key" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">HTTP Method</label>
<select name="custom_method" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
<option value="POST" <?php echo ($settings['custom_method'] ?? 'POST') === 'POST' ? 'selected' : ''; ?>>POST</option>
<option value="GET" <?php echo ($settings['custom_method'] ?? '') === 'GET' ? 'selected' : ''; ?>>GET</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Custom Headers (JSON)</label>
<textarea name="custom_headers" rows="3" placeholder='{"Authorization": "Bearer token"}' class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"><?php echo htmlspecialchars($settings['custom_headers'] ?? ''); ?></textarea>
</div>
</div>
</div>
<!-- Save Button -->
<div class="flex justify-end">
<button type="submit" name="save_settings" class="bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white px-8 py-3 rounded-lg font-semibold transition duration-200 transform hover:scale-105 shadow-lg">
<i class="fas fa-save mr-2"></i>Save Settings
</button>
</div>
</form>
<!-- Test SMS Section -->
<div class="bg-white rounded-xl shadow-lg p-6 mt-6">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<i class="fas fa-vial mr-2 text-green-600"></i>Test SMS
</h2>
<form method="POST" action="" class="space-y-4">
<div class="grid md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Phone Number *</label>
<input type="tel" name="test_phone" placeholder="+234xxxxxxxxxx or +233xxxxxxxxx" required class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
<p class="text-xs text-gray-500 mt-1">Include country code (e.g., +234, +233, +254)</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Test Message *</label>
<textarea name="test_message" rows="3" required placeholder="Test message from church management system" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"></textarea>
</div>
</div>
<div class="flex justify-end">
<button type="submit" name="send_test" class="bg-gradient-to-r from-green-600 to-green-700 hover:from-green-700 hover:to-green-800 text-white px-6 py-3 rounded-lg font-semibold transition duration-200 transform hover:scale-105 shadow-lg">
<i class="fas fa-paper-plane mr-2"></i>Send Test SMS
</button>
</div>
</form>
</div>
</div>
<style>
.gateway-radio:checked + .gateway-card {
border-color: #3B82F6;
background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.gateway-card {
transition: all 0.3s ease;
}
.gateway-card:hover {
transform: translateY(-2px);
}
</style>
<script>
// Show/hide gateway configurations based on selection
document.addEventListener('DOMContentLoaded', function() {
const radios = document.querySelectorAll('.gateway-radio');
const configs = document.querySelectorAll('.gateway-config');
function updateGatewayDisplay() {
const selected = document.querySelector('.gateway-radio:checked')?.value;
configs.forEach(config => {
if (config.dataset.gateway === selected) {
config.style.display = 'block';
} else {
config.style.display = 'none';
}
});
}
radios.forEach(radio => {
radio.addEventListener('change', updateGatewayDisplay);
});
// Initial display
updateGatewayDisplay();
});
</script>
</div>
</main>
<?php include '../../includes/footer.php'; ?>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists