// filename: Member Dashboard (Page Code) import wixData from 'wix-data'; import wixUsers from 'wix-users'; $w.onReady(function () { // Load member info and progress loadMemberData(); }); async function loadMemberData() { // Get current logged-in user const user = wixUsers.currentUser; if (!user.loggedIn) { // Redirect to login if not logged in wixLocation.to('/login'); return; } const userEmail = await user.getEmail(); const userName = await user.loggedIn ? (await wixUsers.currentUser.getProp('name')) : 'Student'; // Display welcome message $w('#welcomeText').text = `Welcome back, ${userName}!`; // Load progress for each module const modules = [ { name: 'Fundamentals of Electricity', btnId: '#launchBtn1', progressId: '#progressBar1' }, { name: 'Fundamentals of Maintenance', btnId: '#launchBtn2', progressId: '#progressBar2' }, { name: 'Avionics Systems', btnId: '#launchBtn3', progressId: '#progressBar3' } ]; for (let module of modules) { const progress = await getModuleProgress(userEmail, module.name); // Update progress bar if ($w(module.progressId)) { $w(module.progressId).targetValue = progress.percent; $w(module.progressId).value = progress.percent; } // Update button text based on progress const btnText = progress.percent === 0 ? '▶ Start Module' : progress.percent === 100 ? '✓ Review Module' : `⟳ Continue (${progress.percent}%)`; $w(module.btnId).label = btnText; // Set button click handler $w(module.btnId).onClick(() => { navigateToModule(module.name); }); } } async function getModuleProgress(email, moduleName) { try { const results = await wixData.query('StudentProgress') .eq('studentEmail', email) .eq('moduleName', moduleName) .find(); if (results.items.length > 0) { return { percent: results.items[0].progressPercent || 0, lastActive: results.items[0].lastActive }; } } catch (error) { console.error('Error loading progress:', error); } return { percent: 0, lastActive: null }; } function navigateToModule(moduleName) { // Map module names to page URLs const modulePages = { 'Fundamentals of Electricity': '/module-electricity', 'Fundamentals of Maintenance': '/module-maintenance', 'Avionics Systems': '/module-systems' }; const pageUrl = modulePages[moduleName]; if (pageUrl) { wixLocation.to(pageUrl); } }
top of page
Image by Mike Petrucci

Statistics

Over 750 Certifications Earned!

Become more professional TODAY!

99% pass rate on AET and all endorsements

Over 15 years of avionics training experience

Nick Brown

Nick is an Air Force avionics veteran working on the radar systems of the AWACS.  After his time in the Air Force, Nick became an avionics instructor for Kent Career Technical Center in Grand Rapids, Michigan, in 2015.  He earned his Bachelor's in Education in 2019 from Grand Valley State University.  He earned his Master's degree in Workforce Development and Leadership from Western Michigan University in 2020.  Additionally, Nick serves on the ASTM F46 avionics committee as the recording secretary that develops new avionics standards for the aviation community, including unpiloted aerial systems. 

2022-07-13 10 13 06.jpg
  • facebook
  • linkedin
bottom of page