38751-vm/views/apk_detail.php
2026-02-24 23:19:12 +00:00

119 lines
7.7 KiB
PHP

<?php include 'header.php'; ?>
<div class="container">
<nav aria-label="breadcrumb" class="mb-4">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="/" class="text-success text-decoration-none"><?php echo __('home'); ?></a></li>
<?php
$db = db_pdo();
$catName = $db->query("SELECT name FROM categories WHERE id = " . ($apk['category_id'] ?: 0))->fetchColumn();
?>
<li class="breadcrumb-item"><a href="/?category=<?php echo strtolower($catName); ?>" class="text-success text-decoration-none"><?php echo $catName ?: 'Apps'; ?></a></li>
<li class="breadcrumb-item active" aria-current="page"><?php echo $apk['title']; ?></li>
</ol>
</nav>
<div class="row g-5">
<div class="col-lg-8">
<div class="bg-white p-5 rounded-4 border-0 shadow-sm mb-5">
<div class="d-flex flex-column flex-md-row align-items-center align-items-md-start mb-5">
<?php
$icon = !empty($apk['icon_path']) ? '/'.$apk['icon_path'] : $apk['image_url'];
?>
<img src="<?php echo $icon; ?>" class="rounded-4 me-md-5 mb-4 mb-md-0 shadow-sm" width="160" height="160" alt="<?php echo $apk['title']; ?>" style="object-fit: cover;">
<div class="text-center text-md-start">
<h1 class="display-5 fw-bold mb-2"><?php echo $apk['title']; ?> <span class="badge bg-light text-dark fs-6 fw-normal align-middle">v<?php echo $apk['version']; ?></span></h1>
<p class="lead text-muted mb-4"><?php echo __('official_version_text'); ?></p>
<div class="d-flex flex-wrap gap-2 justify-content-center justify-content-md-start mb-4">
<span class="badge bg-success-subtle text-success px-3 py-2 rounded-pill fw-medium"><i class="bi bi-download me-1"></i> <?php echo number_format($apk['total_downloads']); ?> <?php echo __('downloads'); ?></span>
<span class="badge bg-info-subtle text-info px-3 py-2 rounded-pill fw-medium"><i class="bi bi-shield-check me-1"></i> <?php echo __('verified_safe'); ?></span>
<span class="badge bg-light text-dark px-3 py-2 rounded-pill fw-medium"><i class="bi bi-calendar3 me-1"></i> <?php echo date('M d, Y', strtotime($apk['created_at'])); ?></span>
<?php if ($apk['is_vip']): ?>
<span class="badge bg-warning-subtle text-warning px-3 py-2 rounded-pill fw-medium"><i class="bi bi-star-fill me-1"></i> VIP</span>
<?php endif; ?>
</div>
<a href="/download/<?php echo $apk['slug']; ?>" class="btn btn-success btn-lg px-5 rounded-pill shadow-sm py-3 fw-bold w-100 w-md-auto mb-3">
<i class="bi bi-download me-2"></i> <?php echo __('download_now'); ?>
</a>
<p class="text-muted small"><?php echo __('agree_terms_text'); ?></p>
</div>
</div>
<div class="mb-5">
<h4 class="fw-bold mb-4"><?php echo __('description'); ?></h4>
<p class="text-muted"><?php echo nl2br(htmlspecialchars($apk['description'])); ?></p>
</div>
<div class="row g-4 mb-5">
<div class="col-md-6">
<div class="p-4 rounded-4 bg-light border-0">
<h6 class="fw-bold mb-3"><?php echo __('main_features'); ?></h6>
<ul class="list-unstyled mb-0 text-muted small">
<li class="mb-2"><i class="bi bi-check-circle-fill text-success me-2"></i> <?php echo __('feature_original'); ?></li>
<li class="mb-2"><i class="bi bi-check-circle-fill text-success me-2"></i> <?php echo __('feature_no_extra'); ?></li>
<li class="mb-2"><i class="bi bi-check-circle-fill text-success me-2"></i> <?php echo __('feature_fast'); ?></li>
<li><i class="bi bi-check-circle-fill text-success me-2"></i> <?php echo __('feature_regular'); ?></li>
</ul>
</div>
</div>
<div class="col-md-6">
<div class="p-4 rounded-4 bg-light border-0">
<h6 class="fw-bold mb-3"><?php echo __('system_requirements'); ?></h6>
<ul class="list-unstyled mb-0 text-muted small">
<li class="mb-2"><i class="bi bi-info-circle me-2"></i> <?php echo __('req_android'); ?></li>
<li class="mb-2"><i class="bi bi-memory me-2"></i> <?php echo __('req_ram'); ?></li>
<li class="mb-2"><i class="bi bi-hdd-network me-2"></i> <?php echo __('req_internet'); ?></li>
<li><i class="bi bi-cpu me-2"></i> <?php echo __('req_cpu'); ?></li>
</ul>
</div>
</div>
</div>
<div class="text-center p-4 rounded-4 bg-success bg-opacity-10">
<h6 class="fw-bold mb-3"><?php echo __('safe_question'); ?></h6>
<p class="text-muted small mb-0"><?php echo __('safe_answer'); ?></p>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="position-sticky" style="top: 2rem;">
<div class="bg-white p-4 rounded-4 border-0 shadow-sm mb-4 text-center py-5">
<h5 class="fw-bold mb-3"><?php echo __('share_earn'); ?></h5>
<p class="text-muted small mb-4"><?php echo __('share_earn_text'); ?></p>
<div class="input-group mb-3">
<?php
$ref = isset($_SESSION['user_id']) ? $db->query("SELECT referral_code FROM users WHERE id = ".$_SESSION['user_id'])->fetchColumn() : '';
$shareLink = 'http://'.$_SERVER['HTTP_HOST'].'/apk/'.$apk['slug'].($ref ? '?ref='.$ref : '');
?>
<input type="text" class="form-control form-control-sm bg-light" id="shareLink" value="<?php echo $shareLink; ?>" readonly>
<button class="btn btn-outline-success btn-sm" type="button" onclick="copyShareLink()"><?php echo __('copy'); ?></button>
</div>
<?php if (!$ref): ?>
<a href="/login" class="small text-success text-decoration-none"><?php echo __('login_to_earn'); ?></a>
<?php endif; ?>
</div>
<div class="bg-dark text-white p-4 rounded-4 border-0 shadow-sm text-center">
<i class="bi bi-trophy display-4 mb-3 text-success"></i>
<h5 class="fw-bold mb-3"><?php echo __('referral_program'); ?></h5>
<p class="small text-white-50 mb-4"><?php echo __('referral_program_text'); ?></p>
<a href="/register" class="btn btn-success fw-bold w-100 rounded-pill py-2"><?php echo __('get_started'); ?></a>
</div>
</div>
</div>
</div>
</div>
<script>
function copyShareLink() {
var copyText = document.getElementById("shareLink");
copyText.select();
copyText.setSelectionRange(0, 99999);
navigator.clipboard.writeText(copyText.value);
alert("<?php echo __('copy_success_js'); ?>");
}
</script>
<?php include 'footer.php'; ?>