// 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); } } NCATT AET & Endorsement Certification | Ace Avionics Training
top of page

Before you purchase our course, take a look:

Still not convinced? 

We believe in our courses so much, that if you are not 100% satisfied we will offer your money back! 

What do you have to lose?  Buy the course today!

NCATT AET

$249

The course typically takes ten hours to complete.  Don't waste your time trying to study by yourself.  We have put over 15,000 hours into this course, so you don't have to.  Let us help guide you to success, so you have time to enjoy the things that matter to you. 
Don't become frustrated trying to study alone!  Make the easy decision and purchase our course to help you become more professional today!

  • facebook
  • linkedin
bottom of page