Bagus ini

This commit is contained in:
Flatlogic Bot 2026-02-25 22:41:29 +00:00
parent b67ab46d1e
commit dc6297b93b
13 changed files with 225 additions and 85 deletions

View File

@ -3,6 +3,7 @@
namespace App\Controllers;
use App\Core\Controller;
use App\Services\LanguageService;
class AIController extends Controller {
@ -13,13 +14,14 @@ class AIController extends Controller {
$userMessage = $input['message'] ?? '';
if (empty($userMessage)) {
echo json_encode(['error' => 'Message is empty']);
echo json_encode(['error' => __('error_empty_message', 'Message is empty')]);
return;
}
require_once __DIR__ . '/../../ai/LocalAIApi.php';
$systemPrompt = "You are a helpful assistant for " . get_setting('site_name', 'ApkNusa') . ", an APK downloader and tech blog site. Provide concise and accurate information about Android apps, games, and technology. Be youthful and professional.";
$langName = LanguageService::getLang() == 'id' ? 'Indonesian' : 'English';
$systemPrompt = "You are a helpful assistant for " . get_setting('site_name', 'ApkNusa') . ", an APK downloader and tech blog site. Provide concise and accurate information about Android apps, games, and technology. Be youthful and professional. IMPORTANT: Always respond in " . $langName . ".";
$resp = \LocalAIApi::createResponse([
'input' => [
@ -32,7 +34,7 @@ class AIController extends Controller {
$text = \LocalAIApi::extractText($resp);
echo json_encode(['reply' => $text]);
} else {
echo json_encode(['error' => 'AI Assistant is currently unavailable.']);
echo json_encode(['error' => __('error_ai', 'AI Assistant is currently unavailable.')]);
}
}
}
}

View File

@ -26,7 +26,7 @@ document.addEventListener('DOMContentLoaded', () => {
const textLabels = document.querySelectorAll('.theme-status-text');
textLabels.forEach(label => {
label.textContent = theme === 'dark' ? 'Dark Mode' : 'Light Mode';
label.textContent = theme === 'dark' ? (window.i18n?.dark_mode || 'Dark Mode') : (window.i18n?.light_mode || 'Light Mode');
});
};
@ -170,7 +170,7 @@ document.addEventListener('DOMContentLoaded', () => {
.catch(err => {
btn.disabled = false;
btn.innerHTML = originalText;
msg.innerHTML = '<span class="text-danger">An error occurred.</span>';
msg.innerHTML = `<span class="text-danger">${window.i18n?.error_generic || 'An error occurred.'}</span>`;
});
});
};
@ -222,7 +222,7 @@ document.addEventListener('DOMContentLoaded', () => {
const loadingDiv = document.createElement('div');
loadingDiv.className = 'mb-3 d-flex';
loadingDiv.innerHTML = '<div class="bg-white p-3 rounded-4 shadow-sm small" style="border-bottom-left-radius: 0 !important;"><div class="spinner-border spinner-border-sm text-success" role="status"></div> Thinking...</div>';
loadingDiv.innerHTML = `<div class="bg-white p-3 rounded-4 shadow-sm small" style="border-bottom-left-radius: 0 !important;"><div class="spinner-border spinner-border-sm text-success" role="status"></div> ${window.i18n?.thinking || 'Thinking...'}</div>`;
messagesContainer.appendChild(loadingDiv);
messagesContainer.scrollTop = messagesContainer.scrollHeight;
@ -237,12 +237,12 @@ document.addEventListener('DOMContentLoaded', () => {
if (data.reply) {
appendMessage(data.reply);
} else {
appendMessage(data.error || 'Sorry, something went wrong.');
appendMessage(data.error || (window.i18n?.something_wrong || 'Sorry, something went wrong.'));
}
})
.catch(err => {
if (messagesContainer.contains(loadingDiv)) messagesContainer.removeChild(loadingDiv);
appendMessage('Error connecting to AI assistant.');
appendMessage(window.i18n?.error_ai || 'Error connecting to AI assistant.');
console.error(err);
});
};

View File

@ -145,4 +145,62 @@ return array (
'404_title' => 'Page Not Found',
'404_text' => 'The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.',
'back_to_home' => 'Back to Home',
);
'featured_apps' => 'Featured Apps',
'newsletter_title' => 'Subscribe to our Newsletter',
'newsletter_subtitle' => 'Get notified about the latest APKs and updates directly in your inbox.',
'enter_email' => 'Enter your email',
'all' => 'All',
'similar_apps' => 'Similar Apps',
'support_issues' => 'Support & Issues',
'support_text' => 'Found a problem with this app or want to request a newer version?',
'report_issue' => 'Report Issue',
'request_update' => 'Request Update',
'your_email' => 'Your Email',
'message_details' => 'Message / Details',
'message_placeholder' => 'Please describe the issue or your request...',
'send' => 'Send',
'verified' => 'Verified',
'share_text' => 'Check out this app on ApkNusa!',
'error_occurred' => 'An error occurred.',
'sending' => 'Sending...',
'copied' => 'Copied!',
'search_apks' => 'Search APKs',
'search_go' => 'Go',
'popular_categories' => 'Popular Categories',
'ai_assistant' => 'ApkNusa AI',
'ai_greeting' => 'Hello! How can I help you today?',
'type_message' => 'Type a message...',
'blog' => 'Blog',
'contact' => 'Contact',
'dark_mode' => 'Dark Mode',
'light_mode' => 'Light Mode',
'language' => 'Language',
'back' => 'Back',
'get_in_touch' => 'Get in Touch',
'contact_subtitle' => 'Have questions or feedback about our APKs? We\'d love to hear from you. Send us a message and we\'ll respond as soon as possible.',
'follow_us' => 'Follow Us',
'full_name' => 'Full Name',
'your_name' => 'Your Name',
'email_address' => 'Email Address',
'subject' => 'Subject',
'help_how' => 'How can we help?',
'message' => 'Message',
'your_message_here' => 'Your message here...',
'send_message' => 'Send Message',
'processing' => 'Processing...',
'pending' => 'Pending',
'approved' => 'Approved',
'rejected' => 'Rejected',
'bank_transfer' => 'Bank Transfer',
'error_try_again' => 'An error occurred. Please try again.',
'blog_title' => 'Blog & Articles',
'blog_subtitle' => 'Get the latest information about apps, games, and tech tips here.',
'no_articles' => 'No articles published yet.',
'share_article' => 'Share this article:',
'admin_user' => 'Admin',
'location_indonesia' => 'Jakarta, Indonesia',
'thinking' => 'Thinking...',
'error_ai' => 'Error connecting to AI assistant.',
'something_wrong' => 'Sorry, something went wrong.',
'error_empty_message' => 'Message is empty',
);

View File

@ -145,4 +145,62 @@ return array (
'404_title' => 'Halaman Tidak Ditemukan',
'404_text' => 'Halaman yang Anda cari mungkin telah dihapus, namanya diubah, atau sementara tidak tersedia.',
'back_to_home' => 'Kembali ke Beranda',
);
'featured_apps' => 'Aplikasi Unggulan',
'newsletter_title' => 'Berlangganan Newsletter Kami',
'newsletter_subtitle' => 'Dapatkan notifikasi tentang APK dan pembaruan terbaru langsung di kotak masuk Anda.',
'enter_email' => 'Masukkan email Anda',
'all' => 'Semua',
'similar_apps' => 'Aplikasi Serupa',
'support_issues' => 'Dukungan & Masalah',
'support_text' => 'Menemukan masalah dengan aplikasi ini atau ingin meminta versi terbaru?',
'report_issue' => 'Laporkan Masalah',
'request_update' => 'Minta Pembaruan',
'your_email' => 'Email Anda',
'message_details' => 'Pesan / Detail',
'message_placeholder' => 'Mohon jelaskan masalah atau permintaan Anda...',
'send' => 'Kirim',
'verified' => 'Terverifikasi',
'share_text' => 'Cek aplikasi ini di ApkNusa!',
'error_occurred' => 'Terjadi kesalahan.',
'sending' => 'Mengirim...',
'copied' => 'Tersalin!',
'search_apks' => 'Cari APK',
'search_go' => 'Cari',
'popular_categories' => 'Kategori Populer',
'ai_assistant' => 'AI ApkNusa',
'ai_greeting' => 'Halo! Ada yang bisa saya bantu hari ini?',
'type_message' => 'Ketik pesan...',
'blog' => 'Blog',
'contact' => 'Kontak',
'dark_mode' => 'Mode Gelap',
'light_mode' => 'Mode Terang',
'language' => 'Bahasa',
'back' => 'Kembali',
'get_in_touch' => 'Hubungi Kami',
'contact_subtitle' => 'Punya pertanyaan atau masukan tentang APK kami? Kami ingin mendengar dari Anda. Kirimkan pesan kepada kami dan kami akan membalas secepat mungkin.',
'follow_us' => 'Ikuti Kami',
'full_name' => 'Nama Lengkap',
'your_name' => 'Nama Anda',
'email_address' => 'Alamat Email',
'subject' => 'Subjek',
'help_how' => 'Ada yang bisa kami bantu?',
'message' => 'Pesan',
'your_message_here' => 'Pesan Anda di sini...',
'send_message' => 'Kirim Pesan',
'processing' => 'Memproses...',
'pending' => 'Menunggu',
'approved' => 'Disetujui',
'rejected' => 'Ditolak',
'bank_transfer' => 'Transfer Bank',
'error_try_again' => 'Terjadi kesalahan. Silakan coba lagi.',
'blog_title' => 'Blog & Artikel',
'blog_subtitle' => 'Dapatkan informasi terbaru seputar aplikasi, game, dan tips teknologi di sini.',
'no_articles' => 'Belum ada artikel yang diterbitkan.',
'share_article' => 'Bagikan artikel ini:',
'admin_user' => 'Admin',
'location_indonesia' => 'Jakarta, Indonesia',
'thinking' => 'Berpikir...',
'error_ai' => 'Gagal terhubung ke asisten AI.',
'something_wrong' => 'Maaf, terjadi kesalahan.',
'error_empty_message' => 'Pesan kosong',
);

View File

@ -32,7 +32,7 @@
</a>
<button onclick="window.history.back()" class="btn btn-outline-dark btn-lg rounded-pill px-5 py-3 hover-lift d-flex align-items-center w-100 w-sm-auto">
<i class="bi bi-arrow-left me-2"></i>
<span class="fw-bold"><?php echo __('Kembali', 'Kembali'); ?></span>
<span class="fw-bold"><?php echo __('back'); ?></span>
</button>
</div>
@ -43,7 +43,7 @@
<span class="input-group-text bg-transparent border-0 ps-3">
<i class="bi bi-search text-muted small"></i>
</span>
<input type="text" name="search" class="form-control bg-transparent border-0 py-2 fs-6" placeholder="<?php echo __('search', 'Search...'); ?>">
<input type="text" name="search" class="form-control bg-transparent border-0 py-2 fs-6" placeholder="<?php echo __('search_placeholder'); ?>">
<button class="btn btn-success rounded-pill px-4 fw-bold" type="submit"><?php echo __('search'); ?></button>
</div>
</form>

View File

@ -113,7 +113,7 @@
?>
<div class="mb-5">
<h4 class="fw-bold h5 mb-3 d-flex align-items-center">
<i class="bi bi-grid-fill text-success me-2"></i> Similar Apps
<i class="bi bi-grid-fill text-success me-2"></i> <?php echo __('similar_apps'); ?>
</h4>
<div class="row g-2">
<?php foreach ($relatedApks as $rapk): ?>
@ -153,15 +153,15 @@
<!-- Report / Request Section -->
<div class="bg-light p-4 rounded-4 mb-4 border-0">
<h6 class="fw-bold mb-3 d-flex align-items-center">
<i class="bi bi-flag-fill text-danger me-2"></i> Support & Issues
<i class="bi bi-flag-fill text-danger me-2"></i> <?php echo __('support_issues'); ?>
</h6>
<p class="text-muted small mb-3">Found a problem with this app or want to request a newer version?</p>
<p class="text-muted small mb-3"><?php echo __('support_text'); ?></p>
<div class="d-grid gap-2">
<button type="button" class="btn btn-outline-danger btn-sm rounded-pill" data-bs-toggle="modal" data-bs-target="#reportModal" onclick="setReportType('Report Issue')">
<i class="bi bi-exclamation-triangle me-1"></i> Report Issue
<button type="button" class="btn btn-outline-danger btn-sm rounded-pill" data-bs-toggle="modal" data-bs-target="#reportModal" onclick="setReportType('<?php echo __('report_issue'); ?>')">
<i class="bi bi-exclamation-triangle me-1"></i> <?php echo __('report_issue'); ?>
</button>
<button type="button" class="btn btn-outline-dark btn-sm rounded-pill" data-bs-toggle="modal" data-bs-target="#reportModal" onclick="setReportType('Request Update')">
<i class="bi bi-arrow-repeat me-1"></i> Request Update
<button type="button" class="btn btn-outline-dark btn-sm rounded-pill" data-bs-toggle="modal" data-bs-target="#reportModal" onclick="setReportType('<?php echo __('request_update'); ?>')">
<i class="bi bi-arrow-repeat me-1"></i> <?php echo __('request_update'); ?>
</button>
</div>
</div>
@ -184,7 +184,7 @@
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content border-0 rounded-4 overflow-hidden">
<div class="modal-header bg-dark text-white py-4 border-0">
<h5 class="modal-title fw-bold" id="reportModalLabel">Report Issue</h5>
<h5 class="modal-title fw-bold" id="reportModalLabel"><?php echo __('report_issue'); ?></h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<form id="report-form">
@ -193,17 +193,17 @@
<div class="modal-body p-4">
<div id="report-alert"></div>
<div class="mb-3">
<label class="form-label fw-bold">Your Email</label>
<label class="form-label fw-bold"><?php echo __('your_email'); ?></label>
<input type="email" class="form-control" name="email" placeholder="email@example.com" required>
</div>
<div class="mb-0">
<label class="form-label fw-bold">Message / Details</label>
<textarea class="form-control" name="message" rows="4" placeholder="Please describe the issue or your request..." required></textarea>
<label class="form-label fw-bold"><?php echo __('message_details'); ?></label>
<textarea class="form-control" name="message" rows="4" placeholder="<?php echo __('message_placeholder'); ?>" required></textarea>
</div>
</div>
<div class="modal-footer border-0 p-4 pt-0">
<button type="button" class="btn btn-light px-4 rounded-pill" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-success px-4 rounded-pill" id="report-submit-btn">Send</button>
<button type="button" class="btn btn-light px-4 rounded-pill" data-bs-dismiss="modal"><?php echo __('cancel'); ?></button>
<button type="submit" class="btn btn-success px-4 rounded-pill" id="report-submit-btn"><?php echo __('send'); ?></button>
</div>
</form>
</div>
@ -219,7 +219,7 @@
<span class="x-small text-muted" style="font-size: 0.7rem;">v<?php echo $apk['version']; ?></span>
</div>
<a href="/download/<?php echo $apk['slug']; ?>" class="btn btn-success btn-sm rounded-pill px-3 fw-bold">
Download
<?php echo __('download'); ?>
</a>
</div>
</div>
@ -238,7 +238,7 @@ function copyShareLink() {
const btn = event.target;
const originalText = btn.innerText;
btn.innerText = "Copied!";
btn.innerText = "<?php echo __('copied'); ?>";
btn.classList.replace('btn-success', 'btn-dark');
setTimeout(() => {
btn.innerText = originalText;
@ -257,7 +257,7 @@ document.getElementById('report-form').addEventListener('submit', function(e) {
const alertBox = document.getElementById('report-alert');
btn.disabled = true;
btn.innerHTML = '<span class="spinner-border spinner-border-sm"></span> Sending...';
btn.innerHTML = '<span class="spinner-border spinner-border-sm"></span> <?php echo __('sending'); ?>';
const formData = new FormData(this);
@ -269,7 +269,7 @@ document.getElementById('report-form').addEventListener('submit', function(e) {
.then(res => res.json())
.then(data => {
btn.disabled = false;
btn.innerHTML = 'Send';
btn.innerHTML = '<?php echo __('send'); ?>';
if (data.success) {
alertBox.innerHTML = '<div class="alert alert-success border-0 small">' + data.success + '</div>';
setTimeout(() => {
@ -284,8 +284,8 @@ document.getElementById('report-form').addEventListener('submit', function(e) {
})
.catch(err => {
btn.disabled = false;
btn.innerHTML = 'Send';
alertBox.innerHTML = '<div class="alert alert-danger border-0 small">An error occurred.</div>';
btn.innerHTML = '<?php echo __('send'); ?>';
alertBox.innerHTML = '<div class="alert alert-danger border-0 small"><?php echo __('error_occurred'); ?></div>';
});
});
@ -309,7 +309,7 @@ document.getElementById('mobile-share-btn').addEventListener('click', function(e
if (navigator.share) {
navigator.share({
title: '<?php echo $apk['title']; ?>',
text: 'Check out this app on ApkNusa!',
text: '<?php echo __('share_text'); ?>',
url: '<?php echo $shareLink; ?>',
}).catch((error) => console.log('Error sharing', error));
} else {
@ -318,4 +318,4 @@ document.getElementById('mobile-share-btn').addEventListener('click', function(e
});
</script>
<?php include 'footer.php'; ?>
<?php include 'footer.php'; ?>

View File

@ -89,16 +89,26 @@
<tr>
<td class="ps-4"><?php echo date('d M Y, H:i', strtotime($wd['created_at'])); ?></td>
<td class="fw-bold text-success">Rp <?php echo number_format($wd['amount'], 0, ',', '.'); ?></td>
<td><?php echo $wd['method']; ?></td>
<td><?php echo $wd['method'] === 'BANK' ? __('bank_transfer') : $wd['method']; ?></td>
<td>
<?php
$statusClass = 'secondary';
if ($wd['status'] === 'pending') $statusClass = 'warning';
if ($wd['status'] === 'approved') $statusClass = 'success';
if ($wd['status'] === 'rejected') $statusClass = 'danger';
$statusText = ucfirst($wd['status']);
if ($wd['status'] === 'pending') {
$statusClass = 'warning';
$statusText = __('pending');
}
if ($wd['status'] === 'approved') {
$statusClass = 'success';
$statusText = __('approved');
}
if ($wd['status'] === 'rejected') {
$statusClass = 'danger';
$statusText = __('rejected');
}
?>
<span class="badge bg-<?php echo $statusClass; ?>">
<?php echo ucfirst($wd['status']); ?>
<?php echo $statusText; ?>
</span>
</td>
</tr>
@ -138,7 +148,7 @@
<option value="OVO">OVO</option>
<option value="GOPAY">GoPay</option>
<option value="ShopeePay">ShopeePay</option>
<option value="BANK">Bank Transfer</option>
<option value="BANK"><?php echo __('bank_transfer'); ?></option>
</select>
</div>
<div class="mb-0">
@ -175,7 +185,7 @@ document.getElementById('withdraw-form').addEventListener('submit', function(e)
const noHistoryRow = document.getElementById('no-history-row');
btn.disabled = true;
btn.innerHTML = '<span class="spinner-border spinner-border-sm"></span> Processing...';
btn.innerHTML = '<span class="spinner-border spinner-border-sm"></span> <?php echo __('processing'); ?>';
const formData = new FormData(form);
@ -205,18 +215,20 @@ document.getElementById('withdraw-form').addEventListener('submit', function(e)
alertContainer.innerHTML = '<div class="alert alert-success border-0 rounded-4 mb-4">' + data.success + '</div>';
// Add to table (simplified, just reload or prepend)
// For now, let's just prepend a row if we can
if (noHistoryRow) noHistoryRow.remove();
const now = new Date();
const dateStr = now.toLocaleDateString('id-ID', { day: '2-digit', month: 'short', year: 'numeric' }) + ', ' +
now.toLocaleTimeString('id-ID', { hour: '2-digit', minute: '2-digit' });
let methodText = formData.get('method');
if (methodText === 'BANK') methodText = '<?php echo __('bank_transfer'); ?>';
const newRow = `<tr>
<td class="ps-4">${dateStr}</td>
<td class="fw-bold text-success">Rp ${parseInt(formData.get('amount')).toLocaleString('id-ID')}</td>
<td>${formData.get('method')}</td>
<td><span class="badge bg-warning">Pending</span></td>
<td>${methodText}</td>
<td><span class="badge bg-warning"><?php echo __('pending'); ?></span></td>
</tr>`;
tableBody.insertAdjacentHTML('afterbegin', newRow);
@ -228,7 +240,7 @@ document.getElementById('withdraw-form').addEventListener('submit', function(e)
.catch(err => {
btn.disabled = false;
btn.innerHTML = '<?php echo __('submit_request'); ?>';
modalAlert.innerHTML = '<div class="alert alert-danger border-0 small">An error occurred. Please try again.</div>';
modalAlert.innerHTML = '<div class="alert alert-danger border-0 small"><?php echo __('error_try_again'); ?></div>';
});
});
</script>

View File

@ -6,8 +6,8 @@
<div class="col-lg-8">
<nav aria-label="breadcrumb" class="mb-4">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="/blog">Blog</a></li>
<li class="breadcrumb-item"><a href="/"><?php echo __('home'); ?></a></li>
<li class="breadcrumb-item"><a href="/blog"><?php echo __('blog'); ?></a></li>
<li class="breadcrumb-item active" aria-current="page"><?php echo htmlspecialchars($post['title']); ?></li>
</ol>
</nav>
@ -16,7 +16,7 @@
<h1 class="display-4 fw-bold mb-3"><?php echo htmlspecialchars($post['title']); ?></h1>
<div class="text-muted d-flex align-items-center justify-content-center">
<span class="me-3"><i class="far fa-calendar-alt me-1"></i> <?php echo date('F d, Y', strtotime($post['created_at'])); ?></span>
<span><i class="far fa-user me-1"></i> Admin</span>
<span><i class="far fa-user me-1"></i> <?php echo __('admin_user'); ?></span>
</div>
</header>
@ -33,7 +33,7 @@
<hr class="my-5">
<div class="d-flex justify-content-between align-items-center bg-light p-4 rounded-4">
<div class="fw-bold">Share this article:</div>
<div class="fw-bold"><?php echo __('share_article'); ?></div>
<div class="d-flex gap-2">
<a href="https://facebook.com/sharer/sharer.php?u=<?php echo urlencode("https://" . $_SERVER['HTTP_HOST'] . "/blog/" . $post['slug']); ?>" target="_blank" class="btn btn-outline-primary btn-sm rounded-circle">
<i class="fab fa-facebook-f"></i>
@ -64,4 +64,4 @@
}
</style>
<?php include dirname(__DIR__) . '/footer.php'; ?>
<?php include dirname(__DIR__) . '/footer.php'; ?>

View File

@ -5,8 +5,8 @@
<div class="container">
<div class="row mb-5">
<div class="col-lg-6 mx-auto text-center">
<h1 class="display-4 fw-bold mb-3">Blog & Articles</h1>
<p class="lead text-muted">Dapatkan informasi terbaru seputar aplikasi, game, dan tips teknologi di sini.</p>
<h1 class="display-4 fw-bold mb-3"><?php echo __('blog_title'); ?></h1>
<p class="lead text-muted"><?php echo __('blog_subtitle'); ?></p>
</div>
</div>
@ -46,8 +46,8 @@
<div class="mb-3">
<i class="fas fa-folder-open fa-3x text-muted opacity-25"></i>
</div>
<h3 class="text-muted">Belum ada artikel yang diterbitkan.</h3>
<a href="/" class="btn btn-primary mt-3">Kembali ke Beranda</a>
<h3 class="text-muted"><?php echo __('no_articles'); ?></h3>
<a href="/" class="btn btn-primary mt-3"><?php echo __('back_to_home'); ?></a>
</div>
<?php endif; ?>
</div>

View File

@ -6,12 +6,12 @@
<div class="card shadow border-0 rounded-4 overflow-hidden">
<div class="row g-0">
<div class="col-lg-5 bg-success p-5 text-white d-flex flex-column justify-content-center">
<h2 class="fw-bold mb-4">Get in Touch</h2>
<p class="mb-4 opacity-75">Have questions or feedback about our APKs? We'd love to hear from you. Send us a message and we'll respond as soon as possible.</p>
<h2 class="fw-bold mb-4"><?php echo __('get_in_touch'); ?></h2>
<p class="mb-4 opacity-75"><?php echo __('contact_subtitle'); ?></p>
<div class="d-flex align-items-center mb-3">
<i class="bi bi-geo-alt-fill me-3 fs-4"></i>
<span>Jakarta, Indonesia</span>
<span><?php echo __('location_indonesia'); ?></span>
</div>
<div class="d-flex align-items-center mb-3">
<i class="bi bi-envelope-fill me-3 fs-4"></i>
@ -19,7 +19,7 @@
</div>
<div class="mt-4 pt-4 border-top border-white border-opacity-25">
<h6 class="fw-bold mb-3">Follow Us</h6>
<h6 class="fw-bold mb-3"><?php echo __('follow_us'); ?></h6>
<div class="d-flex gap-3">
<?php if($fb = get_setting('facebook_url')): ?><a href="<?php echo $fb; ?>" class="text-white fs-5"><i class="bi bi-facebook"></i></a><?php endif; ?>
<?php if($tw = get_setting('twitter_url')): ?><a href="<?php echo $tw; ?>" class="text-white fs-5"><i class="bi bi-twitter-x"></i></a><?php endif; ?>
@ -47,24 +47,24 @@
<form action="/contact" method="POST">
<div class="mb-3">
<label class="form-label fw-bold small text-uppercase">Full Name</label>
<input type="text" name="name" class="form-control form-control-lg bg-light border-0 px-4" placeholder="Your Name" required>
<label class="form-label fw-bold small text-uppercase"><?php echo __('full_name'); ?></label>
<input type="text" name="name" class="form-control form-control-lg bg-light border-0 px-4" placeholder="<?php echo __('your_name'); ?>" required>
</div>
<div class="mb-3">
<label class="form-label fw-bold small text-uppercase">Email Address</label>
<label class="form-label fw-bold small text-uppercase"><?php echo __('email_address'); ?></label>
<input type="email" name="email" class="form-control form-control-lg bg-light border-0 px-4" placeholder="name@example.com" required>
</div>
<div class="mb-3">
<label class="form-label fw-bold small text-uppercase">Subject</label>
<input type="text" name="subject" class="form-control form-control-lg bg-light border-0 px-4" placeholder="How can we help?">
<label class="form-label fw-bold small text-uppercase"><?php echo __('subject'); ?></label>
<input type="text" name="subject" class="form-control form-control-lg bg-light border-0 px-4" placeholder="<?php echo __('help_how'); ?>">
</div>
<div class="mb-4">
<label class="form-label fw-bold small text-uppercase">Message</label>
<textarea name="message" class="form-control bg-light border-0 px-4 py-3" rows="4" placeholder="Your message here..." required></textarea>
<label class="form-label fw-bold small text-uppercase"><?php echo __('message'); ?></label>
<textarea name="message" class="form-control bg-light border-0 px-4 py-3" rows="4" placeholder="<?php echo __('your_message_here'); ?>" required></textarea>
</div>
<div class="d-grid">
<button type="submit" class="btn btn-success btn-lg rounded-pill py-3 fw-bold">
Send Message <i class="bi bi-send-fill ms-2"></i>
<?php echo __('send_message'); ?> <i class="bi bi-send-fill ms-2"></i>
</button>
</div>
</form>
@ -75,4 +75,4 @@
</div>
</div>
<?php include 'footer.php'; ?>
<?php include 'footer.php'; ?>

View File

@ -26,11 +26,11 @@
<div class="col-6 col-lg-2">
<h6 class="fw-bold mb-3"><?php echo __('resources'); ?></h6>
<ul class="list-unstyled">
<li><a href="/blog" class="text-muted text-decoration-none py-1 d-block small">Blog</a></li>
<li><a href="/blog" class="text-muted text-decoration-none py-1 d-block small"><?php echo __('blog'); ?></a></li>
<li><a href="/help-center" class="text-muted text-decoration-none py-1 d-block small"><?php echo __('support_center'); ?></a></li>
<li><a href="/terms-of-service" class="text-muted text-decoration-none py-1 d-block small"><?php echo __('terms_of_service'); ?></a></li>
<li><a href="/privacy-policy" class="text-muted text-decoration-none py-1 d-block small"><?php echo __('privacy_policy'); ?></a></li>
<li><a href="/contact" class="text-muted text-decoration-none py-1 d-block small">Contact Us</a></li>
<li><a href="/contact" class="text-muted text-decoration-none py-1 d-block small"><?php echo __('contact'); ?></a></li>
</ul>
</div>
<div class="col-lg-4">
@ -86,7 +86,7 @@
</a>
<a href="/blog" class="mobile-nav-item <?php echo strpos($_SERVER['REQUEST_URI'], '/blog') !== false ? 'active' : ''; ?>">
<i class="bi bi-newspaper"></i>
<span>Blog</span>
<span><?php echo __('blog'); ?></span>
</a>
<a href="<?php echo isset($_SESSION['user_id']) ? '/profile' : '/login'; ?>" class="mobile-nav-item <?php echo (strpos($_SERVER['REQUEST_URI'], '/profile') !== false || strpos($_SERVER['REQUEST_URI'], '/login') !== false) ? 'active' : ''; ?>">
<i class="bi bi-person"></i>
@ -112,19 +112,19 @@
<i class="bi bi-x-lg"></i>
</button>
<div class="mt-5">
<h4 class="fw-bold mb-4">Search APKs</h4>
<h4 class="fw-bold mb-4"><?php echo __('search_apks'); ?></h4>
<form action="/" method="GET" id="ajax-search-form">
<div class="input-group input-group-lg border rounded-pill overflow-hidden shadow-sm">
<span class="input-group-text bg-white border-0 ps-3">
<i class="bi bi-search text-muted"></i>
</span>
<input type="text" name="search" class="form-control border-0 ps-1" placeholder="Search for apps or games..." autofocus>
<button class="btn btn-success px-4" type="submit">Go</button>
<input type="text" name="search" class="form-control border-0 ps-1" placeholder="<?php echo __('search_placeholder'); ?>" autofocus>
<button class="btn btn-success px-4" type="submit"><?php echo __('search_go'); ?></button>
</div>
</form>
<div class="mt-5">
<h6 class="text-muted small fw-bold text-uppercase mb-3">Popular Categories</h6>
<h6 class="text-muted small fw-bold text-uppercase mb-3"><?php echo __('popular_categories'); ?></h6>
<div class="d-flex flex-wrap gap-2">
<?php
$db = db();
@ -146,20 +146,20 @@
<div class="bg-white rounded-circle p-1 me-2">
<i class="bi bi-robot text-success"></i>
</div>
<span class="fw-bold">ApkNusa AI</span>
<span class="fw-bold"><?php echo __('ai_assistant'); ?></span>
</div>
<button type="button" class="btn-close btn-close-white" id="close-ai-chat"></button>
</div>
<div class="card-body overflow-auto p-3" id="ai-chat-messages" style="background: var(--subtle-bg);">
<div class="mb-3">
<div class="bg-white p-3 rounded-4 shadow-sm small" style="max-width: 85%; border-bottom-left-radius: 0 !important;">
Hello! How can I help you today?
<?php echo __('ai_greeting'); ?>
</div>
</div>
</div>
<div class="card-footer bg-white border-0 p-3" style="border-radius: 0 0 20px 20px;">
<div class="input-group">
<input type="text" id="ai-chat-input" class="form-control border-light-subtle rounded-pill-start px-3" placeholder="Type a message...">
<input type="text" id="ai-chat-input" class="form-control border-light-subtle rounded-pill-start px-3" placeholder="<?php echo __('type_message'); ?>">
<button class="btn btn-success rounded-pill-end px-3" id="send-ai-chat">
<i class="bi bi-send-fill"></i>
</button>

View File

@ -33,6 +33,16 @@ $currentLang = \App\Services\LanguageService::getLang();
document.documentElement.setAttribute('data-theme', savedTheme);
}
})();
// i18n for JS
window.i18n = {
dark_mode: "<?php echo __('dark_mode'); ?>",
light_mode: "<?php echo __('light_mode'); ?>",
thinking: "<?php echo __('thinking', 'Thinking...'); ?>",
error_ai: "<?php echo __('error_ai', 'Error connecting to AI assistant.'); ?>",
error_generic: "<?php echo __('error_occurred'); ?>",
something_wrong: "<?php echo __('something_wrong', 'Sorry, something went wrong.'); ?>"
};
</script>
</head>
<body class="animated-bg">
@ -99,7 +109,7 @@ $currentLang = \App\Services\LanguageService::getLang();
</li>
<li class="nav-item">
<a class="nav-link px-3" href="/blog">Blog</a>
<a class="nav-link px-3" href="/blog"><?php echo __('blog'); ?></a>
</li>
<li class="nav-item dropdown px-3">
@ -149,7 +159,7 @@ $currentLang = \App\Services\LanguageService::getLang();
<!-- Mobile Controls -->
<li class="d-lg-none mt-3">
<div class="mobile-theme-row">
<span class="theme-status-text small fw-bold"><?php echo $currentTheme === 'dark' ? 'Dark Mode' : 'Light Mode'; ?></span>
<span class="theme-status-text small fw-bold"><?php echo $currentTheme === 'dark' ? __('dark_mode') : __('light_mode'); ?></span>
<button id="theme-toggle-mobile" class="theme-toggle-btn" aria-label="Toggle theme">
<i class="fa-solid <?php echo $currentTheme === 'dark' ? 'fa-sun' : 'fa-moon'; ?>"></i>
</button>
@ -158,7 +168,7 @@ $currentLang = \App\Services\LanguageService::getLang();
<div class="mobile-lang-row">
<div class="d-flex align-items-center gap-2">
<i class="fas fa-globe text-success"></i>
<span class="small fw-bold">Language</span>
<span class="small fw-bold"><?php echo __('language'); ?></span>
</div>
<div class="dropdown">
<button class="btn btn-link text-decoration-none p-0 dropdown-toggle small fw-bold" type="button" data-bs-toggle="dropdown" style="color: inherit;">

View File

@ -26,7 +26,7 @@
?>
<section class="mb-5">
<h4 class="fw-bold mb-3 d-flex align-items-center">
<i class="bi bi-fire text-danger me-2"></i> Featured Apps
<i class="bi bi-fire text-danger me-2"></i> <?php echo __('featured_apps'); ?>
</h4>
<div class="d-flex overflow-auto pb-3 featured-scroll" style="scrollbar-width: none; -ms-overflow-style: none;">
<?php foreach ($featuredApks as $f): ?>
@ -105,13 +105,13 @@
<div class="card-body p-4 p-md-5">
<div class="row align-items-center">
<div class="col-lg-6 mb-4 mb-lg-0">
<h3 class="fw-bold mb-2">Subscribe to our Newsletter</h3>
<p class="text-muted mb-0">Get notified about the latest APKs and updates directly in your inbox.</p>
<h3 class="fw-bold mb-2"><?php echo __('newsletter_title'); ?></h3>
<p class="text-muted mb-0"><?php echo __('newsletter_subtitle'); ?></p>
</div>
<div class="col-lg-6">
<form action="/newsletter/subscribe" method="POST" class="d-flex gap-2 p-1 bg-light rounded-pill border shadow-sm">
<input type="email" name="email" class="form-control border-0 bg-transparent px-4 py-2" placeholder="Enter your email" required>
<button type="submit" class="btn btn-success rounded-pill px-4">Subscribe</button>
<input type="email" name="email" class="form-control border-0 bg-transparent px-4 py-2" placeholder="<?php echo __('enter_email'); ?>" required>
<button type="submit" class="btn btn-success rounded-pill px-4"><?php echo __('subscribe'); ?></button>
</form>
</div>
</div>