File Manager
Server IP: 103.233.102.32
Your IP: 18.221.147.141
Current Path: /
/
home
/
bprcakhr
/
public_html
Back to Parent Directory
Create New Directory:
Upload File:
Run Command:
Name
Action
admin/
Delete
|
Rename
database/
Delete
|
Rename
db/
Delete
|
Rename
gambar-pengajuan/
Delete
|
Rename
images/
Delete
|
Rename
about.php
Download
|
Delete
|
Edit
|
Rename
cakhra2.png
Download
|
Delete
|
Edit
|
Rename
deposito.php
Download
|
Delete
|
Edit
|
Rename
edukasi.php
Download
|
Delete
|
Edit
|
Rename
error_log
Download
|
Delete
|
Edit
|
Rename
index.php
Download
|
Delete
|
Edit
|
Rename
kre_investasi.php
Download
|
Delete
|
Edit
|
Rename
kre_konsutif.php
Download
|
Delete
|
Edit
|
Rename
kre_modal_kerja.php
Download
|
Delete
|
Edit
|
Rename
lainnya.php
Download
|
Delete
|
Edit
|
Rename
layanan.php
Download
|
Delete
|
Edit
|
Rename
logo1.png
Download
|
Delete
|
Edit
|
Rename
lokasi.php
Download
|
Delete
|
Edit
|
Rename
mahasiswaa.php
Download
|
Delete
|
Edit
|
Rename
nav.php
Download
|
Delete
|
Edit
|
Rename
post.php
Download
|
Delete
|
Edit
|
Rename
post_publikasi.php
Download
|
Delete
|
Edit
|
Rename
proses-kredit.php
Download
|
Delete
|
Edit
|
Rename
proses_kredit1.php
Download
|
Delete
|
Edit
|
Rename
proses_pengajuan.php
Download
|
Delete
|
Edit
|
Rename
publikasi.php
Download
|
Delete
|
Edit
|
Rename
sim-depo.php
Download
|
Delete
|
Edit
|
Rename
sim-kre.php
Download
|
Delete
|
Edit
|
Rename
sim-tab.php
Download
|
Delete
|
Edit
|
Rename
sosialisasi.php
Download
|
Delete
|
Edit
|
Rename
tab-berhadiah.php
Download
|
Delete
|
Edit
|
Rename
tab-bisnis.php
Download
|
Delete
|
Edit
|
Rename
tab-inti.php
Download
|
Delete
|
Edit
|
Rename
tab-intiplus.php
Download
|
Delete
|
Edit
|
Rename
tab.php
Download
|
Delete
|
Edit
|
Rename
tabungan.php
Download
|
Delete
|
Edit
|
Rename
uploadstest.png
Download
|
Delete
|
Edit
|
Rename
Edit File: ./edukasi.php
<!DOCTYPE html> <html> <head> <title>BANK CAKHRA</title> <link rel="icon" type="image/png" href="images/logo1.png"> <link rel="stylesheet" type="text/css" href="style.css"> <style> /* Base Styles */ body { margin: 0; padding: 0; font-family: Arial, sans-serif; } .container { padding: 20px; /* Padding for spacing from the edge of the screen */ } .article-container { display: flex; flex-wrap: wrap; gap: 20px; /* Space between elements */ } .article { flex: 1 1 23%; /* Size of elements, 4 elements per row (23% for some spacing) */ box-sizing: border-box; text-align: center; /* Center text inside article element */ padding: 10px; /* Padding inside article element */ border: 1px solid #ddd; /* Article border */ border-radius: 8px; /* Rounded corners */ } .article h2 { margin: 0 0 10px 0; /* Space between title and image */ font-size: 18px; /* Title font size */ } .article img { width: 100%; height: auto; max-width: 250px; /* Maximum image width */ margin: 10px 0; /* Space between image and description */ } .article p { margin: 5px 0; text-align: justify; /* Justify text for description */ } .read-more { display: inline-block; padding: 10px 20px; margin-top: 10px; border: none; border-radius: 5px; background-color: #007bff; /* Button color */ color: #fff; text-decoration: none; font-weight: bold; text-align: center; /* Center button text */ } .read-more:hover { background-color: #0056b3; /* Button color on hover */ } .pagination { margin-top: 20px; text-align: center; } .pagination a { text-decoration: none; padding: 10px 20px; margin: 0 5px; border: 1px solid #ddd; border-radius: 5px; color: #333; } .pagination a.active { background-color: #333; color: #fff; } /* Responsive Styles */ @media (max-width: 768px) { .article { flex: 1 1 48%; /* Two articles per row on tablets and smaller screens */ } } @media (max-width: 480px) { .article { flex: 1 1 100%; /* One article per row on smartphones */ } .article img { max-width: 100%; /* Adjust image width to fit the container */ } .pagination a { display: block; margin: 5px 0; /* Stack pagination links vertically on small screens */ } } </style> </head> <body> <?php include 'nav.php'; ?> <div class="container"> <h1>Edukasi Keuangan</h1> <?php include 'db/db.php'; // Koneksi ke database // Tentukan halaman saat ini $current_page = isset($_GET['page']) ? intval($_GET['page']) : 1; $items_per_page = 8; $offset = ($current_page - 1) * $items_per_page; // Ambil artikel dari database dengan kategori 'edukasi' $sql = "SELECT * FROM articles WHERE category = 'edukasi' ORDER BY created_at DESC LIMIT $items_per_page OFFSET $offset"; $result = mysqli_query($conn, $sql); if ($result && mysqli_num_rows($result) > 0) { echo '<div class="article-container">'; // Kontainer untuk artikel while ($row = mysqli_fetch_assoc($result)) { $image_url = $row['image'] ? 'uploads/' . $row['image'] : 'uploads/default-image.png'; // Gambar default jika tidak ada gambar echo '<div class="article">'; echo '<h2>' . htmlspecialchars($row['title']) . '</h2>'; echo '<img src="' . $image_url . '" alt="' . htmlspecialchars($row['title']) . '">'; echo '<p>' . htmlspecialchars(substr($row['content'], 0, 150)) . '...</p>'; // Menampilkan ringkasan konten echo '<a href="post.php?id=' . $row['id'] . '" class="read-more">Read More</a>'; echo '</div>'; } echo '</div>'; // Tutup kontainer artikel // Pagination // Hitung total artikel dengan kategori 'edukasi' $sql_count = "SELECT COUNT(*) AS total FROM articles WHERE category = 'edukasi'"; $result_count = mysqli_query($conn, $sql_count); $total_items = mysqli_fetch_assoc($result_count)['total']; $total_pages = ceil($total_items / $items_per_page); echo '<div class="pagination">'; for ($i = 1; $i <= $total_pages; $i++) { $active = ($i == $current_page) ? 'active' : ''; echo '<a href="?page=' . $i . '" class="' . $active . '">' . $i . '</a>'; } echo '</div>'; } else { echo "<p>Belum ada artikel dengan kategori 'edukasi'.</p>"; } // Tutup koneksi database mysqli_close($conn); ?> </div> </body> </html>