πŸ—‚ My Trips Portal
View bookings, download receipts & book new trips
Sign In
Enter the email and phone number used for your bookings.
Don't have an account? Book a trip first and use those details to sign in.
?
0
Total Trips
0
Completed
$0
Total Spent
πŸ“‹ My Trips
βž• Book New Trip
πŸ‘€ Account
`; const a=document.createElement('a');a.href='data:text/html;charset=utf-8,'+encodeURIComponent(html);a.download='receipt_'+t.id.slice(-8)+'.html';a.click(); } // ── Address autocomplete ─────────────────────────────────────────────── const _ac={}; async function aa(inp,sid){ const q=inp.value.trim();const sg=document.getElementById(sid); if(q.length<3){sg.style.display='none';return;} try{ let res=[]; if(mbKey){if(!_ac[q]){const r=await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(q)}.json?access_token=${mbKey}&types=address,place&limit=5`);const d=await r.json();_ac[q]=(d.features||[]).map(f=>f.place_name);}res=_ac[q];} else{const r=await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(q)}&format=json&limit=5`,{headers:{'Accept-Language':'en'}});const d=await r.json();res=(d||[]).map(x=>x.display_name);} if(!res.length){sg.style.display='none';return;} const fld=sid==='bPuS'?'bPu':'bDo'; sg.innerHTML=res.map(s=>`
${s}
`).join(''); sg.style.display='block'; }catch(e){sg.style.display='none';} } function pa(fld,val,sid){document.getElementById(fld).value=val;hs(sid);} function hs(id){const e=document.getElementById(id);if(e)e.style.display='none';} // ── Helpers ──────────────────────────────────────────────────────────── function setTab(tab,el){ curTab=tab; ['trips','book','account'].forEach(t=>{const e=document.getElementById('tab-'+t);if(e)e.style.display=t===tab?'block':'none';}); document.querySelectorAll('.tab-bar .tab').forEach(t=>t.classList.remove('active')); if(el)el.classList.add('active'); else{const tabs=document.querySelectorAll('.tab-bar .tab');const idx={trips:0,book:1,account:2}[tab];if(tabs[idx])tabs[idx].classList.add('active');} if(tab==='trips')renderTrips(); } function showPage(id){document.querySelectorAll('.page').forEach(p=>p.classList.remove('active'));document.getElementById(id)?.classList.add('active');} function logout(){currentUser=null;userTrips=[];sessionStorage.removeItem('portalUser_'+CID);showPage('pg-login');} function v(id){return document.getElementById(id)?.value?.trim()||'';} function se(el,msg){el.textContent=msg;el.style.display='block';} function showErr(msg){document.getElementById('app').innerHTML=`
${msg}
`;} init();