USD: LKR 302.50 Gold 22K: LKR 188,500 රාහු කාලය: 1:32 PM - 3:04 PM සුබ දිශාව: දකුණ Verified Govt Sources
USD: LKR 302.50 Gold 22K: LKR 188,500 රාහු කාලය: 1:32 PM - 3:04 PM සුබ දිශාව: දකුණ Verified Govt Sources
StepLK Logo
StepLK
ඔබ වෙනුවෙන්මයි

රාජ්‍ය හා පෞද්ගලික අංශයේ රැකියා, විභාග හා පාඨමාලා සියල්ල

දිවයිනේ සියලුම නවතම ඇබෑර්තු සහ පාඨමාලා තොරතුරු එසැණින් එකම තැනින් දැනගන්න.

Advertisement

නවතම ඇබෑර්තු ලෝඩ් වෙමින් පවතී...

function renderPagination(totalItems) { const container = document.getElementById('pagination-container'); if (!container) return; const totalPages = Math.ceil(totalItems / itemsPerPage); if (totalPages <= 1) { container.innerHTML = ''; return; } let html = `
`; // Previous Button const prevDisabled = currentPage === 1; html += ` `; // Smart Windowing (Max 5 Visible Buttons) let startPage = Math.max(1, currentPage - 1); let endPage = Math.min(totalPages, startPage + 2); if (endPage - startPage < 2) { startPage = Math.max(1, endPage - 2); } if (startPage > 1) { html += ``; if (startPage > 2) { html += `...`; } } for (let i = startPage; i <= endPage; i++) { const isActive = i === currentPage; html += ` `; } if (endPage < totalPages) { if (endPage < totalPages - 1) { html += `...`; } html += ``; } // Next Button const nextDisabled = currentPage === totalPages; html += ` `; html += `
`; container.innerHTML = html; }
Sponsored Notice Ad