Elegant Home
Order Manager ¡ Loadingâ€Ļ

Elegant Home

Order Manager

āĻļ⧁āϧ⧁ Elegant Home āϟāĻŋāĻŽā§‡āϰ āϜāĻ¨ā§āϝ
'; var w = window.open('', '_blank'); if (!w) return tip('āĻĒāĻĒ-āφāĻĒ āĻŦāĻ¨ā§āϧ āφāϛ⧇ — āĻāχ āĻĒ⧇āĻœā§‡āϰ āĻĒāĻĒ-āφāĻĒ āϚāĻžāϞ⧁ āĻ•āϰ⧇ āφāĻŦāĻžāϰ āϚāĻžāĻĒ⧁āύ'); w.document.open(); w.document.write(html); w.document.close(); tip('✅ ' + bn(rows.length) + 'āϟāĻž āĻ¸ā§āϞāĻŋāĻĒ āϤ⧈āϰāĻŋ āĻšāϝāĻŧ⧇āϛ⧇'); } function openM(title, text){ document.getElementById('mt').textContent = title; document.getElementById('out').value = text; document.getElementById('out').style.fontWeight = ''; document.getElementById('modal').classList.add('on'); } function closeM(){ document.getElementById('modal').classList.remove('on'); } function clearSel(){ SEL.clear(); render(); tip('āϏāĻŦ āϟāĻŋāĻ• āĻŽā§āϛ⧇ āϗ⧇āϛ⧇'); } // āĻāĻ•āϟāĻž āĻĒāĻžāĻ°ā§āϏ⧇āϞ āφāχāĻĄāĻŋ āĻ•āĻĒāĻŋ function copyPid(v){ var done = function(){ tip('✅ āĻĒāĻžāĻ°ā§āϏ⧇āϞ āφāχāĻĄāĻŋ āĻ•āĻĒāĻŋ āĻšāϝāĻŧ⧇āϛ⧇: ' + v); }; var old = function(){ var t = document.createElement('textarea'); t.value = v; t.style.position = 'fixed'; t.style.opacity = '0'; document.body.appendChild(t); t.focus(); t.select(); var ok = false; try { ok = document.execCommand('copy'); } catch(e){} document.body.removeChild(t); ok ? done() : tip('āĻĒāĻžāĻ°ā§āϏ⧇āϞ āφāχāĻĄāĻŋāϰ āωāĻĒāϰ āϞāĻŽā§āĻŦāĻž āϚāĻžāĻĒ āĻĻāĻŋāϝāĻŧ⧇ āĻ•āĻĒāĻŋ āĻ•āϰ⧁āύ'); }; if (navigator.clipboard && navigator.clipboard.writeText) navigator.clipboard.writeText(v).then(done).catch(old); else old(); } function copyText(){ var ta = document.getElementById('out'), ok = false; ta.focus(); ta.select(); try { ta.setSelectionRange(0, 999999); } catch(e){} try { ok = document.execCommand('copy'); } catch(e){} if (ok) return tip('✅ āĻ•āĻĒāĻŋ āĻšāϝāĻŧ⧇āϛ⧇'); if (navigator.clipboard){ navigator.clipboard.writeText(ta.value).then(function(){ tip('✅ āĻ•āĻĒāĻŋ āĻšāϝāĻŧ⧇āϛ⧇'); }) .catch(function(){ tip('āϞ⧇āĻ–āĻžāϰ āωāĻĒāϰ āϞāĻŽā§āĻŦāĻž āϚāĻžāĻĒ āĻĻāĻŋāϝāĻŧ⧇ āĻ•āĻĒāĻŋ āĻ•āϰ⧁āύ'); }); } else tip('āϞ⧇āĻ–āĻžāϰ āωāĻĒāϰ āϞāĻŽā§āĻŦāĻž āϚāĻžāĻĒ āĻĻāĻŋāϝāĻŧ⧇ āĻ•āĻĒāĻŋ āĻ•āϰ⧁āύ'); } // 🔑 āϞāĻ—āχāύ — User ID + Password; āĻāĻ•āĻŦāĻžāϰ āϞāĻ—āχāύ āĻ•āϰāϞ⧇ āĻāχ āĻĢā§‹āύ / āĻŦā§āϰāĻžāωāϜāĻžāϰ⧇ ā§Šā§Ļ āĻĻāĻŋāύ āĻŽāύ⧇ āĻĨāĻžāϕ⧇ var TOK_KEY = 'eh_om_token'; function lsGet(){ try { return localStorage.getItem(TOK_KEY) || ''; } catch(e){ return ''; } } function lsSet(v){ try { v ? localStorage.setItem(TOK_KEY, v) : localStorage.removeItem(TOK_KEY); } catch(e){} } // āϜāϰ⧁āϰāĻŋ āĻŦāĻžāϟāύ āĻļ⧁āϧ⧁ Owner āφāϰ Foysal āĻĻ⧇āĻ–āĻŦ⧇ function applyRole(){ var adm = window.EH_ADM === true; document.getElementById('emgBox').style.display = adm ? 'contents' : 'none'; document.getElementById('toolsTitle').textContent = adm ? 'āϟ⧁āϞāϏ' : 'āĻ…ā§āϝāĻžāĻ•āĻžāωāĻ¨ā§āϟ'; } function setWho(n){ window.EH_WHO = n || ''; applyRole(); document.getElementById('whoName').textContent = EH_WHO || '—'; document.getElementById('whoAv').textContent = (EH_WHO || '?').charAt(0).toUpperCase(); } function showLogin(msg){ EH_PIN = ''; lsSet(''); window.EH_ADM = false; applyRole(); var e = document.getElementById('lerr'); e.textContent = msg || ''; e.style.display = msg ? 'block' : 'none'; document.getElementById('login').classList.add('on'); closeTools(); closeM(); setTimeout(function(){ try { document.getElementById('lu').focus(); } catch(x){} }, 50); } function enter(r){ EH_PIN = r.token; lsSet(r.token); window.EH_ADM = r.admin === true; setWho(r.name); document.getElementById('login').classList.remove('on'); if (r.data) show(r.data); else load(false); } function doLogin(ev){ ev.preventDefault(); var u = document.getElementById('lu').value.trim(), p = document.getElementById('lp').value; var b = document.getElementById('lbtn'), e = document.getElementById('lerr'); if (!u || !p){ e.textContent = 'User ID āφāϰ Password āĻĻ⧁āĻŸā§‹āχ āϞāĻŋāϖ⧁āύ'; e.style.display = 'block'; return; } b.disabled = true; b.textContent = 'Logging inâ€Ļ'; e.style.display = 'none'; google.script.run .withSuccessHandler(function(r){ b.disabled = false; b.textContent = 'Login'; if (r && r.ok){ document.getElementById('lp').value = ''; enter(r); } else { e.textContent = (r && r.msg) || 'User ID āĻŦāĻž Password āϭ⧁āϞ'; e.style.display = 'block'; } }) .withFailureHandler(function(x){ b.disabled = false; b.textContent = 'Login'; e.textContent = 'āϏāĻŽāĻ¸ā§āϝāĻž: ' + (x && x.message || x); e.style.display = 'block'; }) .ehLogin(u, p, location.hostname); } function doLogout(){ var t = EH_PIN; ALL = []; SEL.clear(); updateCount(); dropLast(); document.getElementById('list').innerHTML = ''; showLogin(''); if (t) google.script.run.ehLogout(t); } function boot(){ if (window.EH_TEAM){ var tu = document.getElementById("lu"); /* ⧍⧝ āĻ…āĻ•ā§āĻŸā§‹: "team" āϞāĻ—āχāύ āĻŦāĻžāĻĻ â€” rakib/robiul āύāĻŋāĻœā§‡āϰ User ID āϞāĻŋāϖ⧇ āĻĸ⧁āĻ•āĻŦ⧇ */ var ts = document.querySelector("p.sub"); if (ts) ts.textContent = "Factory Team"; } if (EH_PIN){ lsSet(EH_PIN); setWho(window.EH_WHO || 'Owner'); load(true); return; } // Elegant-āĻāϰ āĻŽā§‡āχāϞ āĻĻāĻŋāϝāĻŧ⧇ āĻ–ā§‹āϞāĻž var t = lsGet(); if (!t){ showLogin(''); try { google.script.run.withSuccessHandler(function(){}).withFailureHandler(function(){}).ehWarm(); } catch(e){} // āĻĒāĻžāϏāĻ“āϝāĻŧāĻžāĻ°ā§āĻĄ āϞ⧇āĻ–āĻžāϰ āĻĢāĻžāρāϕ⧇ āϏāĻžāĻ°ā§āĻ­āĻžāϰ āĻ—āϰāĻŽ āĻ•āϰ⧇ āϰāĻžāϖ⧇ return; } // āφāϗ⧇āϰ āĻĄāĻžāϟāĻž āĻĨāĻžāĻ•āϞ⧇ āϏāĻžāĻĨ⧇ āϏāĻžāĻĨ⧇ āĻĻ⧇āĻ–āĻžāϝāĻŧ, āϤāĻžāϰāĻĒāϰ āĻĒ⧇āĻ›āύ⧇ āϞāĻ—āχāύ āĻŽāĻŋāϞāĻŋāϝāĻŧ⧇ āύāϤ⧁āύ āĻĄāĻžāϟāĻž āφāύ⧇ var last = readLast(); if (last){ EH_PIN = t; window.EH_ADM = last.a === true; setWho(last.w); document.getElementById('login').classList.remove('on'); show(last.d); document.getElementById('refBtn').classList.add('spin'); } google.script.run .withSuccessHandler(function(r){ r && r.ok ? enter(r) : (dropLast(), showLogin(last ? 'āφāĻŦāĻžāϰ āϞāĻ—āχāύ āĻ•āϰ⧁āύ' : '')); }) .withFailureHandler(function(){ if (!last) showLogin(''); else document.getElementById('refBtn').classList.remove('spin'); }) .ehResume(t); } // 🌗 Dark / Light āĻŦāĻžāϟāύ var SUN = ''; var MOON = ''; function themeIcon(){ document.getElementById('themeBtn').innerHTML = document.documentElement.getAttribute('data-theme') === 'dark' ? SUN : MOON; } function toggleTheme(){ var t = document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark'; document.documentElement.setAttribute('data-theme', t); try { localStorage.setItem('eh_theme', t); } catch(e){} themeIcon(); } themeIcon(); // āωāĻĒāϰ⧇āϰ āĻāϞāĻžāĻ•āĻž āĻŦāĻžāϟāύ⧇āϰ āϏāĻžāϰāĻŋ āĻšā§‡āĻĄāĻžāϰ⧇āϰ āĻ āĻŋāĻ• āύāĻŋāĻšā§‡ āφāϟāϕ⧇ āĻĨāĻžāϕ⧇ function fitSticky(){ var h = document.querySelector('.top').offsetHeight; document.documentElement.style.setProperty('--toph', h + 'px'); } window.addEventListener('resize', fitSticky); fitSticky(); window.addEventListener('scroll', function(){ document.getElementById('segbar').classList.toggle('stuck', window.scrollY > 10); }, { passive: true }); boot();