Created At: 2026-06-14T16:19:16Z
Completed At: 2026-06-14T16:19:17Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 3882
Total Bytes: 163903
Showing lines 2140 to 2200
The following code has been modified to include a line number before every line, in the format: <line_number>: <original_line>. Please note that any changes targeting the original code should remove the line number, colon, and leading space.
2140:       "beranda",
2141:       "historical-climate",
2142:       "future-climate",
2143:       "expert-mode",
2144:       "settings"
2145:     ];
2146: 
2147:     let isAdminLoggedIn = false;
2148: 
2149:     async function showPage(pageId) {
2150:       if (pageId === "settings" && !isAdminLoggedIn) {
2151:         try {
2152:           const res = await fetch('?action=check_auth');
2153:           const authData = await res.json();
2154:           if (authData.authenticated) {
2155:             isAdminLoggedIn = true;
2156:           } else {
2157:             openAdminLoginModal();
2158:             return;
2159:           }
2160:         } catch (err) {
2161:           console.error('Gagal memverifikasi status login:', err);
2162:           openAdminLoginModal();
2163:           return;
2164:         }
2165:       }
2166: 
2167:       pages.forEach(function (id) {
2168:         const el = document.getElementById(id);
2169:         if (el) {
2170:           el.style.display = "none";
2171:         }
2172:         const navLink = document.getElementById("nav-" + id);
2173:         if (navLink) {
2174:           navLink.classList.remove("active");
2175:         }
2176:       });
2177: 
2178:       const activePage = document.getElementById(pageId);
2179:       if (activePage) {
2180:         if (pageId === "beranda") {
2181:           activePage.style.display = "flex";
2182:         } else {
2183:           activePage.style.display = "block";
2184:         }
2185:       }
2186: 
2187:       const activeNavLink = document.getElementById("nav-" + pageId);
2188:       if (activeNavLink) {
2189:         activeNavLink.classList.add("active");
2190:       }
2191: 
2192:       window.scrollTo({
2193:         top: 0,
2194:         behavior: "smooth"
2195:       });
2196:     }
2197: 
2198:     function openAdminLoginModal() {
2199:       document.getElementById('adminLoginModal').style.display = 'flex';
2200:       document.getElementById('loginUsername').value = '';
The above content does NOT show the entire file contents. If you need to view any lines of the file which were not shown to complete your task, call this tool again to view those lines.
