Skip to content
https://ibn-masood.pages.dev

Lighthouse Mobile

· 0 checks — Mobile Lighthouse audit -- Performance, Accessibility, Best Practices, and SEO category breakdown.
SCORE
0
GRADE
FIX
0
REVIEW
0
PASS
0
INFO
0

Detailed Report

Audit breakdown by category with detailed findings.

98

Performance

Insights

Remove large, duplicate JavaScript modules from bundles to reduce unnecessary bytes consumed by network activity.

Why this matters

Performance issues directly impact user engagement and conversion rates.

Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren't necessary for modern browsers. Consider modifying your JavaScript build process to not transpile Baseline features, unless you know you must support older browsers. Learn why most sites can deploy ES6+ code without transpiling

Why this matters

Performance issues directly impact user engagement and conversion rates.

3rd party code can significantly impact load performance. Reduce and defer loading of 3rd party code to prioritize your page's content.

Why this matters

Performance issues directly impact user engagement and conversion rates.

Avoid chaining critical requests by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load.

Why this matters

Performance issues directly impact user engagement and conversion rates.

description: [preconnect](https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/) hints help the browser establish a connection earlier in the page load, saving time when the first request for that origin is made. The following are the origins that the page preconnected to.
title: Preconnected origins
description: Add [preconnect](https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/) hints to your most important origins, but try to use no more than 4.
title: Preconnect candidates
value: No additional origins are good candidates for preconnecting

Requests are blocking the page's initial render, which may delay LCP. Deferring or inlining can move these network requests out of the critical path.

Why this matters

Performance issues directly impact user engagement and conversion rates.

These insights are also available in the Chrome DevTools Performance Panel - record a trace to view more detailed information.

●Time to Interactive 2.0 s
●Use efficient cache lifetimes
●Layout shift culprits
●Document request latency
●Optimize DOM size
●Font display
●Forced reflow
●Improve image delivery
●LCP breakdown
●Modern HTTP
●Optimize viewport for mobile
●Max Potential First Input Delay 20 ms
●Minify CSS
●Minify JavaScript
●Reduce unused CSS
●Reduce unused JavaScript
●Avoids enormous network payloads Total size was 54 KiB
●JavaScript execution time 0.1 s
●Minimizes main-thread work 0.2 s
●Image elements have explicit `width` and `height`
●Page didn't prevent back/forward cache restoration
●Network Requests
●Network Round Trip Times 20 ms
●Server Backend Latencies 70 ms
●Tasks
●Diagnostics
●Metrics
●Screenshot Thumbnails
●Final Screenshot
●Script Treemap Data
●Resources Summary
●Avoid multiple page redirects
●Initial server response time was short Root document took 80 ms
○INP breakdown
○LCP request discovery
○User Timing marks and measures
○Avoid long main-thread tasks
○Avoid non-composited animations
○Avoid large layout shifts
96

Accessibility

These checks highlight opportunities to improve the accessibility of your web app. Automatic detection can only detect a subset of issues and does not guarantee the accessibility of your web app, so manual testing is also encouraged.

Best practices

One main landmark helps screen reader users navigate a web page. Learn more about landmarks.

Why this matters

Performance issues directly impact user engagement and conversion rates.

Failing Elements
html html

These items highlight common accessibility best practices.

○Interactive controls are keyboard focusable
○Interactive elements indicate their purpose and state
○The page has a logical tab order
○Visual order on the page follows DOM order
○User focus is not accidentally trapped in a region
○The user's focus is directed to new content added to the page
○HTML5 landmark elements are used to improve navigation
○Offscreen content is hidden from assistive technology
○Custom controls have associated labels
○Custom controls have ARIA roles
●`[aria-hidden="true"]` is not present on the document `<body>`
●Buttons have an accessible name
●`[user-scalable="no"]` is not used in the `<meta name="viewport">` element and the `[maximum-scale]` attribute is not less than 5.
●Background and foreground colors have a sufficient contrast ratio
●Document has a `<title>` element
●`<html>` element has a `[lang]` attribute
●`<html>` element has a valid value for its `[lang]` attribute
●Touch targets have sufficient size and spacing.
●Heading elements appear in a sequentially-descending order
○`[accesskey]` values are unique
○`[aria-*]` attributes match their roles
○`button`, `link`, and `menuitem` elements have accessible names
○ARIA attributes are used as specified for the element's role
○Deprecated ARIA roles were not used
○Elements with `role="dialog"` or `role="alertdialog"` have accessible names.
○`[aria-hidden="true"]` elements do not contain focusable descendents
○ARIA input fields have accessible names
○ARIA `meter` elements have accessible names
○ARIA `progressbar` elements have accessible names
○Elements use only permitted ARIA attributes
○`[role]`s have all required `[aria-*]` attributes
○Elements with an ARIA `[role]` that require children to contain a specific `[role]` have all required children.
○`[role]`s are contained by their required parent element
○`[role]` values are valid
○Elements with the `role=text` attribute do not have focusable descendents.
○ARIA toggle fields have accessible names
○ARIA `tooltip` elements have accessible names
○ARIA `treeitem` elements have accessible names
○`[aria-*]` attributes have valid values
○`[aria-*]` attributes are valid and not misspelled
○The page contains a heading, skip link, or landmark region
○`<dl>`'s contain only properly-ordered `<dt>` and `<dd>` groups, `<script>`, `<template>` or `<div>` elements.
○Definition list items are wrapped in `<dl>` elements
○ARIA IDs are unique
○No form fields have multiple labels
○`<frame>` or `<iframe>` elements have a title
○`<html>` element has an `[xml:lang]` attribute with the same base language as the `[lang]` attribute.
○Image elements have `[alt]` attributes
○Input buttons have discernible text.
○`<input type="image">` elements have `[alt]` text
○Form elements have associated labels
○Links are distinguishable without relying on color.
○Links have a discernible name
○Lists contain only `<li>` elements and script supporting elements (`<script>` and `<template>`).
○List items (`<li>`) are contained within `<ul>`, `<ol>` or `<menu>` parent elements
○The document does not use `<meta http-equiv="refresh">`
○`<object>` elements have alternate text
○Select elements have associated label elements.
○Skip links are focusable.
○No element has a `[tabindex]` value greater than 0
○Cells in a `<table>` element that use the `[headers]` attribute refer to table cells within the same table.
○`<th>` elements and elements with `[role="columnheader"/"rowheader"]` have data cells they describe.
○`[lang]` attributes have a valid value
○`<video>` elements contain a `<track>` element with `[kind="captions"]`
○Tables have different content in the summary attribute and `<caption>`.
○All heading elements contain content.
○Uses ARIA roles only on compatible elements
○Image elements do not have `[alt]` attributes that are redundant text.
○Identical links have the same purpose.
○Elements with visible text labels have matching accessible names.
○Tables use `<caption>` instead of cells with the `[colspan]` attribute to indicate a caption.
○`<td>` elements in a large `<table>` have one or more table headers.
100

Best Practices

●Uses HTTPS
●Avoids deprecated APIs
●Avoids third-party cookies
●Allows users to paste into input fields
●Avoids requesting the geolocation permission on page load
●Avoids requesting the notification permission on page load
●Displays images with correct aspect ratio
●Serves images with appropriate resolution
●Page has the HTML doctype
●Properly defines charset
●No browser errors logged to the console
●No issues in the `Issues` panel in Chrome Devtools
●Ensure CSP is effective against XSS attacks
●Use a strong HSTS policy
●Ensure proper origin isolation with COOP
●Mitigate clickjacking with XFO or CSP
●Mitigate DOM-based XSS with Trusted Types
●Page has valid source maps
○Redirects HTTP traffic to HTTPS
○Detected JavaScript libraries
82

SEO

These checks ensure that your page is following basic search engine optimization advice. There are many additional factors Lighthouse does not score here that may affect your search ranking, including performance on Core Web Vitals. Learn more about Google Search Essentials.

Content Best Practices

Meta descriptions may be included in search results to concisely summarize page content. Learn more about the meta description.

Why this matters

Performance issues directly impact user engagement and conversion rates.

Format your HTML in a way that enables crawlers to better understand your app’s content.

Crawling and Indexing

If your robots.txt file is malformed, crawlers may not be able to understand how you want your website to be crawled or indexed. Learn more about robots.txt.

Why this matters

Performance issues directly impact user engagement and conversion rates.

Line #ContentError
1<!doctype html>Syntax not understood
2<html lang="ar" dir="rtl"><head><meta charset="utf-8">Syntax not understood
3<meta name="viewport" content="width=device-width,initial-scale=1">Syntax not understood
4<title>منظومة إدارة التسميع - مركز عبدالله بن مسعود</title>Syntax not understood
5<link rel="preconnect" href="https://amdqlvkltumzspwczytr.supabase.co"><link rel="preconnect" href="https://cdn.jsdelivr.net">Unknown directive
6<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2.45.4/dist/umd/supabase.min.js"></script>Unknown directive
7<style>Syntax not understood
8:root{--g:#2f6b45;--g2:#245536;--bg:#f6f5f1;--ink:#1c1c1c;--mut:#7a746b;--ln:#e3e0d8;--red:#b3402f}Unknown directive
9*{box-sizing:border-box}body{margin:0;min-height:100vh;font-family:system-ui,-apple-system,'Segoe UI','Noto Sans Arabic',Tahoma,Arial,sans-serif;background:var(--bg);color:var(--ink);font-size:16px}Unknown directive
10.hero{background-color:#2f6b45;background-image:repeating-linear-gradient(45deg,rgba(255,255,255,.08) 0 1px,transparent 1px 14px),repeating-linear-gradient(-45deg,rgba(255,255,255,.08) 0 1px,transparent 1px 14px);color:#fff;text-align:center;padding:22px 16px 34px;border-radius:0 0 34px 34px}Unknown directive
11.hero h1{margin:6px 0;font-size:30px;font-weight:800}.hero p{margin:4px 0;opacity:.9}Unknown directive
12.bar{background:#2f6b45;color:#fff;padding:10px 12px;display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:18px;position:sticky;top:0;z-index:20}.bar .mb{background:rgba(255,255,255,.15);width:44px;height:44px;padding:0;font-size:24px;border-radius:12px}Unknown directive
13.card{background:#fff;border:1px solid var(--ln);border-radius:22px;padding:16px;margin:12px}Unknown directive
14.gate{display:flex;gap:12px;align-items:center;border:1px solid var(--ln);border-radius:22px;padding:16px;margin:10px 0;cursor:pointer;background:#fff;width:100%;font:inherit;text-align:right}Unknown directive
15.gate{border-right:6px solid #2f6b45}.gate b{display:block;font-size:19px;color:#245536}.gate span{color:var(--mut);font-size:14px}Unknown directive
16button{font:inherit;border:0;border-radius:14px;padding:12px 16px;background:var(--g);color:#fff;font-weight:700;cursor:pointer}Unknown directive
17button.s{background:#fff;color:var(--g);border:1.5px solid var(--g)}button.r{background:var(--red)}button.sm{padding:7px 12px;font-size:14px}Unknown directive
18button:disabled{opacity:.5}Unknown directive
19input,select,textarea{font:inherit;width:100%;padding:12px;border:1.5px solid var(--ln);border-radius:14px;background:#fff;margin:4px 0}Unknown directive
20label{font-size:14px;color:var(--mut)}Unknown directive
21.tabs{display:flex;gap:6px;overflow-x:auto;padding:10px 12px}.tabs button{white-space:nowrap;background:#fff;color:var(--g);border:1.5px solid var(--ln);padding:9px 14px}Unknown directive
22.tabs button.on{background:var(--g);color:#fff;border-color:var(--g)}Unknown directive
23.row{display:flex;gap:8px;align-items:center}.row>*{flex:1}.sp{justify-content:space-between}Unknown directive
24.it{padding:12px;border-bottom:1px solid var(--ln);display:flex;justify-content:space-between;gap:8px;align-items:center}Unknown directive
25.tag{display:inline-block;padding:3px 10px;border-radius:99px;font-size:13px;background:#e8f1ea;color:var(--g2)}.tag.bad{background:#f8e5e1;color:var(--red)}.tag.w{background:#f3efe2;color:#7a6a2a}Unknown directive
26.cn{display:flex;align-items:center;gap:6px}.cn button{width:46px;height:46px;padding:0;font-size:22px}.cn input{text-align:center;font-size:20px;font-weight:700}Unknown directive
27.sec{border:1.5px solid var(--ln);border-radius:18px;padding:14px;margin:12px 0}.sec h3{margin:0 0 6px;color:var(--g2)}Unknown directive
28.lock{color:var(--mut);background:#f1efe9;border-radius:12px;padding:10px;font-size:14px}Unknown directive
29.m{color:var(--mut);font-size:14px}.err{color:var(--red)}Unknown directive
31.seg{display:flex;background:#e9e6dd;border-radius:16px;padding:4px;margin:12px}.seg button{flex:1;background:transparent;color:var(--g2);padding:10px 4px;border-radius:12px;font-size:15px}.seg button.on{background:#fff;box-shadow:0 2px 8px #0002}Unknown directive
32.kp{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px}.kp>div{background:#fff;border:1px solid var(--ln);border-radius:20px;padding:14px;text-align:center}Unknown directive
33.kp b{display:block;font-size:30px;color:var(--g2);font-weight:800}.kp span{font-size:13px;color:var(--mut)}Unknown directive
34.kp .big{grid-column:1/-1;background:var(--g);color:#fff;border:0;display:flex;align-items:center;justify-content:space-around;padding:18px}.kp .big b,.kp .big span{color:#fff}Unknown directive
35.ring{position:relative;width:104px;height:104px}.ring svg{transform:rotate(-90deg)}.ring em{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-style:normal;font-weight:800;font-size:22px}Unknown directive
36.pb{height:12px;border-radius:9px;background:#f3d9d4;overflow:hidden;margin:8px 0}.pb i{display:block;height:100%;background:var(--g);border-radius:9px}Unknown directive
37.bars{display:flex;align-items:flex-end;gap:5px;height:140px;margin-top:10px}.bars div{flex:1;display:flex;flex-direction:column;justify-content:flex-end;height:100%;font-size:10px;text-align:center;color:var(--mut)}Unknown directive
38.bars i{display:block;width:100%;background:var(--g);border-radius:5px 5px 0 0}.bars u{display:block;width:100%;background:#d98a7d;text-decoration:none}Unknown directive
39.hb{margin:10px 0}.hb div{display:flex;justify-content:space-between;font-size:14px}.hb .pb{background:#e8f1ea;height:9px;margin:4px 0}Unknown directive
40.cap{font-weight:800;font-size:17px;color:var(--g2);margin-bottom:6px}.lg{font-size:12px;color:var(--mut);display:flex;gap:12px;margin-top:6px}.lg i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-left:4px}Unknown directive
41@media print{.seg{display:none}body{background:#fff}}Unknown directive
43.ov{position:fixed;inset:0;background:#0006;opacity:0;pointer-events:none;transition:.25s;z-index:30}.ov.open{opacity:1;pointer-events:auto}Unknown directive
44.dw{position:fixed;top:0;bottom:0;right:0;width:80%;max-width:320px;background:#fff;z-index:40;transform:translateX(105%);transition:transform .25s;overflow-y:auto;box-shadow:-6px 0 24px #0003;padding-bottom:20px}.dw.open{transform:none}Unknown directive
45.dh{background:#2f6b45;color:#fff;padding:22px 16px;text-align:center}.dh b{display:block;font-size:20px;margin-top:4px}.dh span{font-size:13px;opacity:.9}Unknown directive
46.dw a{display:block;padding:15px 18px;font-size:17px;border-bottom:1px solid var(--ln);cursor:pointer;color:var(--ink)}.dw a.on{background:#e8f1ea;color:#245536;font-weight:800;border-right:5px solid #2f6b45}.dw a.lo{color:var(--red);margin-top:8px}Unknown directive
47.gl{padding:12px 18px 4px;font-size:13px;color:var(--mut);font-weight:700}Unknown directive
48.pos{display:grid;grid-template-columns:2fr 1fr;gap:8px}.c3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0}Unknown directive
49.cv{display:flex;flex-direction:column;gap:6px;text-align:center}.cv label{font-weight:700;color:var(--g2)}.cv button{height:52px;padding:0;font-size:28px}.cv input{text-align:center;font-size:26px;font-weight:800;padding:6px}Unknown directive
50.res{display:grid;grid-template-columns:1fr 1fr;gap:8px}button.big{height:56px;font-size:18px}Unknown directive
51body.busy button,body.busy .gate{pointer-events:none;opacity:.6}#ld{position:fixed;top:0;left:0;right:0;height:4px;background:#8fc3a0;z-index:99;display:none;transform-origin:right;animation:ld 1s ease-in-out infinite}body.busy #ld{display:block}@keyframes ld{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}Unknown directive
52@media print{.bar,.dw,.ov,button{display:none}}Unknown directive
53</style></head><body><div id="ld"></div><div id="app"></div>Syntax not understood
54<script>Syntax not understood
55/* ===== ضع بيانات مشروع Supabase هنا (Settings > API) ===== */Syntax not understood
56const SB_URL='https://amdqlvkltumzspwczytr.supabase.co', SB_KEY='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFtZHFsdmtsdHVtenNwd2N6eXRyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3OTU2NTUxMTIsImV4cCI6MjExMTIzMTExMn0.q-aSC6ZqbxD8zb-rA5IM5H7eXUx5s7BuB3c8y1aJ4mk';Unknown directive
57const sb=supabase.createClient(SB_URL,SB_KEY);Syntax not understood
58const SU='الفاتحة,البقرة,آل عمران,النساء,المائدة,الأنعام,الأعراف,الأنفال,التوبة,يونس,هود,يوسف,الرعد,إبراهيم,الحجر,النحل,الإسراء,الكهف,مريم,طه,الأنبياء,الحج,المؤمنون,النور,الفرقان,الشعراء,النمل,القصص,العنكبوت,الروم,لقمان,السجدة,الأحزاب,سبأ,فاطر,يس,الصافات,ص,الزمر,غافر,فصلت,الشورى,الزخرف,الدخان,الجاثية,الأحقاف,محمد,الفتح,الحجرات,ق,الذاريات,الطور,النجم,القمر,الرحمن,الواقعة,الحديد,المجادلة,الحشر,الممتحنة,الصف,الجمعة,المنافقون,التغابن,الطلاق,التحريم,الملك,القلم,الحاقة,المعارج,نوح,الجن,المزمل,المدثر,القيامة,الإنسان,المرسلات,النبأ,النازعات,عبس,التكوير,الانفطار,المطففين,الانشقاق,البروج,الطارق,الأعلى,الغاشية,الفجر,البلد,الشمس,الليل,الضحى,الشرح,التين,العلق,القدر,البينة,الزلزلة,العاديات,القارعة,التكاثر,العصر,الهمزة,الفيل,قريش,الماعون,الكوثر,الكافرون,النصر,المسد,الإخلاص,الفلق,الناس'.split(',');Syntax not understood
59const KIND={review:'مراجعة',new:'جديد',exam:'امتحان'},EXC={redo_same_day:'إعادة التسميع في نفس اليوم',open_new:'فتح خانة الجديد',open_unexamined:'فتح التسميع لغير الممتحن',exam_retake:'إعادة الامتحان'};Unknown directive
60const $=s=>document.querySelector(s),app=$('#app');Syntax not understood
61const h=s=>s==null?'':String(s).replace(/[&<>"]/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;'}[c]));Unknown directive
62let SC={},FQ=0,tmr,me=null,PT,NOSCR=0,RT=null,curOpen=false,rtT,off=0,tab='rec',ph='';Syntax not understood
63let NAV=0;const VA=(k,x)=>{if(k==NAV)$('#v').innerHTML=x};Syntax not understood
64let bz=0;const BZ=d=>{bz+=d;document.body.classList.toggle('busy',bz>0)};Syntax not understood
65async function D(p){BZ(1);try{const{data,error}=await p;if(error){alert(error.message);throw error}return data}finally{BZ(-1)}}Syntax not understood
66async function rpc(n,a){BZ(1);try{const{data,error}=await sb.rpc(n,a||{});if(error){alert(error.message);throw error}return data}finally{BZ(-1)}}Syntax not understood
67const dates=()=>{const n=new Date(),f=(l,o,d)=>new Intl.DateTimeFormat(l,{timeZone:'Africa/Tripoli',...o}).format(d);Unknown directive
68 return f('en-CA',{dateStyle:'short'},n)+' م &nbsp;|&nbsp; '+f('ar-LY-u-ca-islamic-umalqura-nu-latn',{dateStyle:'medium'},new Date(Date.now()+off*864e5))};Unknown directive
69const logo=`<svg width="64" height="48" viewBox="0 0 64 48"><path d="M32 10C24 4 12 4 4 8v32c8-4 20-4 28 2 8-6 20-6 28-2V8c-8-4-20-4-28 2z" fill="#fff"/><path d="M32 10v32" stroke="#2f6b45" stroke-width="2.5"/></svg>`;Syntax not understood
70const hero=(t)=>`<div class="hero">${logo}<p>منظومة إدارة مركز</p><h1>عبدالله بن مسعود</h1><p>${t||'إدارة الطلاب والحضور والتسميع ومتابعة الأبناء في منظومة واحدة.'}</p></div>`;Syntax not understood
71function layout(title,items,body){app.innerHTML=`<div class="bar"><button class="mb" onclick="dr(1)" aria-label="القائمة">☰</button><b>${title}</b><span style="width:44px"></span></div><div id="v">${body||''}</div><div class="ov" id="ov" onclick="dr(0)"></div><nav class="dw" id="dw"><div class="dh">${logo}<b>عبدالله بن مسعود</b><span>${dates()}</span></div>${items.map(i=>i.g?`<div class="gl">${i.g}</div>`:`<a class="${i.on?'on':''}" onclick="dr(0);${i.f}">${i.t}</a>`).join('')}<a class="lo" onclick="out()">تسجيل الخروج</a></nav>`;if(!NOSCR)window.scrollTo(0,0)}Unknown directive
72function dr(o){$('#dw').classList.toggle('open',!!o);$('#ov').classList.toggle('open',!!o)}Syntax not understood
73async function out(){rtStop();clearInterval(PT);await sb.auth.signOut();me=null;home()}Syntax not understood
75/* ---------- الصفحة الرئيسية وتسجيل الدخول ---------- */Syntax not understood
76function home(){clearInterval(PT);app.innerHTML=hero()+`<div class="card"><h2>اختر بوابة الدخول</h2><p class="m">لا يوجد إنشاء حساب عام. حسابات المشايخ ينشئها المسؤول فقط.</p>Syntax not understood
77<button class="gate" onclick="loginT()"><b>بوابة المشايخ والإدارة</b><span>تسجيل الحضور والتسميع وإدارة الجلسات</span></button>Syntax not understood
78<button class="gate" onclick="loginP()"><b>بوابة أولياء الأمور</b><span>اكتب رقم الهاتف لمتابعة جميع الأبناء المرتبطين به</span></button></div>`}Syntax not understood
79function loginT(){app.innerHTML=hero('بوابة المشايخ والإدارة')+`<div class="card"><label>اسم المستخدم</label><input id="u" autocapitalize="none" autocomplete="username"><label>كلمة السر</label><input id="p" type="password" autocomplete="current-password"><button style="width:100%;margin-top:8px" onclick="doLogin()">دخول</button><button class="s" style="width:100%;margin-top:8px" onclick="home()">رجوع</button></div>`}Unknown directive
80async function doLogin(){const u=$('#u').value.trim().toLowerCase();Syntax not understood
81 const{error}=await sb.auth.signInWithPassword({email:u+'@center.local',password:$('#p').value});if(error)return alert('بيانات الدخول غير صحيحة');await boot()}Unknown directive
82async function boot(){const{data:{session}}=await sb.auth.getSession();if(!session)return home();Unknown directive
83 const[t,st]=await Promise.all([sb.from('teachers').select('id,full_name,role,is_active,temp_admin_from,temp_admin_until').eq('id',session.user.id).single(),sb.from('settings').select('hijri_offset').single()]);Syntax not understood
84 me=t.data;if(!me||!me.is_active){await sb.auth.signOut();me=null;home();return alert('الحساب موقوف أو غير موجود')}Syntax not understood
85 off=(st.data||{}).hijri_offset||0;me.main=me.role=='admin';const n=Date.now();Syntax not understood
86 me.adm=me.main||!!(me.temp_admin_until&&new Date(me.temp_admin_from)<=n&&n<new Date(me.temp_admin_until));Syntax not understood
87 tab='rec';shell();rtStart()}Syntax not understood
88const deb=f=>{clearTimeout(tmr);tmr=setTimeout(f,300)};Syntax not understood
89async function srch(q){let r=sb.from('students').select('id,full_name,parent_phone').order('full_name').limit(30);if(q)r=r.ilike('full_name','%'+q.replace(/[%_\\]/g,' ')+'%');const d=(await D(r))||[];d.forEach(x=>SC[x.id]=x);return d}Syntax not understood
91/* ---------- القالب العام للمشايخ والمسؤول ---------- */Syntax not understood
92function shell(){const G=[['rec','التسميع'],['add','إضافة طالب'],['rep','بلاغ سري']],A=[['pend','التسميعات المعلقة'],['abs','تنبيهات الغياب'],['exc','الاستثناءات'],['tch','المشايخ'],['stu','الطلبة'],['stat','الإحصائيات'],['set','الإعدادات'],['day','إنهاء اليوم']];Syntax not understood
93 if(me.main)A.push(['sec','البلاغات السرية']);Syntax not understood
94 const it=t=>({t:t[1],on:tab==t[0],f:`tab='${t[0]}';shell()`});Unknown directive
95 const items=[{g:h(me.full_name)+(me.main?' (مسؤول)':me.adm?' (مسؤول مؤقت)':'')},...G.map(it)];Unknown directive
96 if(me.adm)items.push({g:'الإدارة'},...A.map(it));Unknown directive
97 layout((G.concat(A).find(x=>x[0]==tab)||[])[1]||'',items,'');Syntax not understood
98 const k=++NAV,err=e=>VA(k,`<div class="card"><p class="err">تعذّر تحميل الصفحة: ${h(e&&e.message||e)}</p><button onclick="shell()">إعادة المحاولة</button></div>`);Unknown directive
99 try{const r=({rec:vRec,add:vAdd,rep:vRep,pend:vPend,abs:vAbs,exc:vExc,tch:vTch,stu:vStu,stat:vStat,set:vSet,day:vDay,sec:vSec})[tab]();if(r&&r.catch)r.catch(err)}catch(e){err(e)}}Unknown directive
100const V=x=>$('#v').innerHTML=x;Syntax not understood
102/* ---------- التسميع اليومي ---------- */Syntax not understood
103function vRec(){curOpen=false;V(`<div class="card"><input id="q" placeholder="ابحث باسم الطالب..." oninput="deb(flt)" style="font-size:18px"><div id="ls"></div></div>`);flt()}Unknown directive
104const row=s=>`<div class="it" style="padding:16px 8px" onclick="openS('${s.id}')"><b>${h(s.full_name)}</b><span class="m">${h(s.parent_phone)}</span></div>`;Unknown directive
105async function flt(){const f=++FQ,q=($('#q')||{value:''}).value.trim();if(!$('#ls'))return;$('#ls').innerHTML='<p class="m">جارٍ البحث...</p>';const d=await srch(q);if(f!=FQ||!$('#ls'))return;$('#ls').innerHTML=d.map(row).join('')||'<p class="m">لا نتائج</p>'}Syntax not understood
106const sel=(id,v)=>`<select id="${id}">${SU.map((n,i)=>`<option value="${i+1}" ${v==i+1?'selected':''}>${i+1}. ${n}</option>`).join('')}</select>`;Unknown directive
107const cn=(sec,k,l)=>`<div class="cv"><label>${l}</label><button onclick="cnt('${sec}','${k}',1)">+</button><input id="${sec}_${k}" value="0" readonly><button class="s" onclick="cnt('${sec}','${k}',-1)">−</button></div>`;Syntax not understood
108function cnt(s,k,d){const e=$(`#${s}_${k}`);e.value=Math.max(0,+e.value+d);if(s=='exam')calc()}Syntax not understood
109function calc(){const d=.5*$('#exam_lahn').value+ +$('#exam_tanbih').value+2*$('#exam_fath').value;$('#ex_res').innerHTML=`الخصم: ${d} — ${d<=5?'<span class="tag">حافظ (ناجح)</span>':'<span class="tag bad">إعادة (راسب)</span>'}`}Syntax not understood
110function secForm(k,st,lp){const open=st[k+'_open'],why=st[k+'_reason'];Syntax not understood
111 let b=`<div class="sec"><h3>${KIND[k]}</h3>`;Syntax not understood
112 if(!open)return b+`<div class="lock">🔒 ${h(why||'مغلقة')}</div></div>`;Syntax not understood
113 if(k=='review')b+=`<div class="lock" style="background:#f8f1d8">تأكد من سجل الطالب أولاً لتأكيد موضع آخر تسميعة.</div>`;Unknown directive
114 b+=`<label>السورة</label>${sel(k+'_s',lp&&lp.surah)}${lp&&lp.text?`<p class="m" style="margin:4px 0">آخر تسميعة ناجحة: ${SU[lp.surah-1]} — إلى: ${h(lp.text)}</p>`:''}<label>من (بداية الآية الأولى عند الطالب)</label><input id="${k}_ft" maxlength="200" placeholder="اكتب بداية أول آية"><label>إلى (بداية آخر آية سيقرأها)</label><input id="${k}_tt" maxlength="200" placeholder="اكتب بداية آخر آية"><div class="c3">${cn(k,'lahn','لحن')}${cn(k,'tanbih','تنبيه')}${cn(k,'fath','فتح')}</div>`;Unknown directive
115 if(k=='exam')b+=`<label>عدد الأسئلة (الدرجة الكلية = العدد × 10)</label><select id="exam_q">${[3,4,5,6,7,8,9,10].map(n=>`<option>${n}</option>`).join('')}</select><div id="ex_res" style="margin:10px 0;font-size:17px"></div><button class="big" style="width:100%" onclick="saveR('exam')">حفظ الجلسة</button>`;Unknown directive
116 else b+=`<div class="res"><button class="big" onclick="saveR('${k}','pass')">✓ حافظ</button><button class="big r" onclick="saveR('${k}','redo')">↻ إعادة</button></div>`;Syntax not understood
117 return b+'</div>'}Syntax not understood
118let cur=null;Syntax not understood
119async function openS(id){const k=++NAV;cur=SC[id];V('<div class="card m">جارٍ التحميل...</div>');Syntax not understood
120 const f=await rpc('student_file',{p_student:id}),st=f.state,rec=f.recs||[],a=f.att;Unknown directive
121 if(k!=NAV)return;V(`<div class="card"><div class="row sp"><b style="font-size:20px">${h(cur.full_name)}</b><button class="sm s" onclick="vRec()">رجوع</button></div>Unknown directive
122 <p class="m">اليوم: ${a?(a=='present'?'<span class="tag">حاضر</span>':'<span class="tag bad">غائب</span>'):'لم يُسجّل'} ${st.exam_required&&!st.exam_passed?'<span class="tag w">لم يجتز امتحان السبت</span>':''}</p>Unknown directive
123 <div class="res"><button class="big" onclick="att('present')">حاضر</button><button class="big r" onclick="att('absent')">غائب</button></div></div>Syntax not understood
124 <div class="card">${secForm('review',st,f.review_pos)}${secForm('new',st,f.new_pos)}${secForm('exam',st,null)}Syntax not understood
125 <div class="sec"><h3>الملاحظات</h3><textarea id="nt" rows="3" placeholder="ملاحظة تربوية أو سلوكية"></textarea><button class="s big" style="width:100%" onclick="addN()">حفظ الملاحظة</button></div></div>Unknown directive
126 <div class="card"><b>سجل التسميع</b>${rec.map(r=>`<div class="it"><div><span class="tag">${KIND[r.kind]}</span> ${r.date}<br><span class="m">سورة ${SU[r.from_surah-1]||''}<br>من: ${h(r.from_text||r.from_ayah||'-')} ← إلى: ${h(r.to_text||r.to_ayah||'-')}<br>لحن ${r.lahn} تنبيه ${r.tanbih} فتح ${r.fath}${r.score!=null?` | ${r.score}/${r.max_score}`:''}<br>${h(r.teacher)} ${r.note?'<br>'+h(r.note):''}</span></div><div><span class="tag ${r.result=='redo'?'bad':''}">${r.result=='pass'?'حافظ':'إعادة'}</span>${r.status!='final'?`<br><span class="tag w">${r.status=='pending'?'معلّق':'مرفوض'}</span>`:''}</div></div>`).join('')||'<p class="m">لا سجل</p>'}</div>`);Unknown directive
127 curOpen=true;if(st.exam_open)calc()}Syntax not understood
128async function att(s){await rpc('mark_attendance',{p_student:cur.id,p_status:s});openS(cur.id)}Unknown directive
129async function addN(){const b=$('#nt').value.trim();if(!b)return;await rpc('add_note',{p_student:cur.id,p_body:b});alert('تم حفظ الملاحظة');openS(cur.id)}Syntax not understood
130async function saveR(k,res){const g=i=>+$('#'+k+'_'+i).value,ft=$('#'+k+'_ft').value.trim(),tt=$('#'+k+'_tt').value.trim();Syntax not understood
131 if(!ft||!tt)return alert('اكتب بداية أول آية وبداية آخر آية');Syntax not understood
132 const a={p_student:cur.id,p_kind:k,p_surah:g('s'),p_from_text:ft,p_to_text:tt,p_lahn:g('lahn'),p_tanbih:g('tanbih'),p_fath:g('fath')};Unknown directive
133 if(k=='exam')a.p_exam_questions=+$('#exam_q').value;else a.p_result=res;Syntax not understood
134 if(!confirm('حفظ الجلسة؟ لا يمكن تعديلها بعد الحفظ.'))return;Syntax not understood
135 const r=await rpc('save_recitation',a);alert(r.status=='pending'?'تم الحفظ كتسميع معلّق (خارج وقت الدراسة) بانتظار موافقة المسؤول':'تم الحفظ: '+(r.result=='pass'?'حافظ':'إعادة'));openS(cur.id)}Unknown directive
137/* ---------- إضافة طالب وبلاغ سري ---------- */Syntax not understood
138function vAdd(){V(`<div class="card"><label>اسم الطالب الكامل</label><input id="n"><label>رقم هاتف ولي الأمر</label><input id="t" type="tel"><button style="width:100%;margin-top:8px" onclick="addS()">إضافة الطالب</button></div>`)}Unknown directive
139async function addS(){await rpc('add_student',{p_name:$('#n').value,p_phone:$('#t').value});alert('تمت إضافة الطالب');vAdd()}Unknown directive
140function vRep(){V(`<div class="card"><p class="m">يصل البلاغ للمسؤول بدون اسمك.</p><textarea id="b" rows="5"></textarea><button style="width:100%" onclick="sendRep()">إرسال البلاغ</button></div>`)}Unknown directive
141async function sendRep(){const b=$('#b').value.trim();if(!b)return;await rpc('submit_secret_report',{p_body:b});alert('تم إرسال البلاغ');vRep()}Syntax not understood
143/* ---------- المسؤول ---------- */Syntax not understood
144async function vPend(){const k=NAV,d=await rpc('pending_list');Syntax not understood
145 VA(k,`<div class="card"><b>تسميعات خارج وقت الدراسة (${d.length})</b>${d.map(r=>`<div class="it"><div><b>${h(r.student)}</b> <span class="tag">${KIND[r.kind]}</span> <span class="tag ${r.result=='redo'?'bad':''}">${r.result=='pass'?'حافظ':'إعادة'}</span><br><span class="m">${h(r.teacher)} — ${r.date}</span></div><div class="row"><button class="sm" onclick="dec('${r.id}',true)">موافقة</button><button class="sm r" onclick="dec('${r.id}',false)">رفض</button></div></div>`).join('')||'<p class="m">لا يوجد</p>'}</div>`)}Unknown directive
146async function dec(i,a){await rpc('decide_pending',{p_id:i,p_approve:a});vPend()}Unknown directive
147async function vAbs(){const k=NAV,d=await rpc('absence_alerts');Syntax not understood
148 VA(k,`<div class="card"><b>طلاب غابوا 3 أيام دراسة متتالية فأكثر</b><p class="m">يبقى الطالب في القائمة حتى تقرر إخفاءه.</p>${d.map(s=>`<div class="it"><div><b>${h(s.full_name)}</b><br><a href="tel:${h(s.parent_phone)}">${h(s.parent_phone)}</a> <span class="m">آخر غياب: ${s.last_absent}</span></div><button class="sm" onclick="dis('${s.alert_id}')">تمت المتابعة</button></div>`).join('')||'<p class="m">لا توجد تنبيهات</p>'}</div>`)}Unknown directive
149async function dis(i){if(!confirm('إخفاء هذا التنبيه؟'))return;await rpc('dismiss_absence_alert',{p_id:i});vAbs()}Unknown directive
150function vExc(){V(`<div class="card"><b>استثناء لطالب واحد</b><label>ابحث عن الطالب</label><input id="eq" oninput="deb(exs)" placeholder="اكتب الاسم"><select id="es" size="5"></select><label>نوع الاستثناء (ينتهي بنهاية اليوم)</label><select id="ek">${Object.entries(EXC).map(([k,v])=>`<option value="${k}">${v}</option>`).join('')}</select><button style="width:100%;margin-top:8px" onclick="gx()">منح الاستثناء</button></div>Unknown directive
151<div class="card"><b>استثناء جماعي لكل الطلاب</b><p class="m">يُمنح لجميع الطلاب المسجلين الآن، وينتهي بنهاية اليوم. الطالب الذي يُضاف بعد ذلك لا يشمله.</p>Syntax not understood
152<button style="width:100%;margin:6px 0" onclick="gxPreset()">اليوم الكل "جديد" فقط (فتح الجديد + رفع قفل الامتحان)</button>Unknown directive
153<label>أو اختر نوعاً واحداً للجميع</label><select id="ea">${Object.entries(EXC).map(([k,v])=>`<option value="${k}">${v}</option>`).join('')}</select><button class="s" style="width:100%;margin-top:8px" onclick="gxAll()">منح للجميع</button></div>`);exs()}Unknown directive
154async function gxAll(){const k=$('#ea').value;if(!confirm('منح "'+EXC[k]+'" لجميع الطلاب اليوم؟'))return;const n=await rpc('grant_exception_all',{p_kind:k});alert('تم المنح لـ '+n+' طالب')}Syntax not understood
155async function gxPreset(){if(!confirm('منح استثناء "الكل جديد فقط" لجميع الطلاب اليوم؟'))return;const a=await rpc('grant_exception_all',{p_kind:'open_new'}),b=await rpc('grant_exception_all',{p_kind:'open_unexamined'});alert('تم: فتح الجديد لـ '+a+' طالب، ورفع قفل الامتحان لـ '+b+' طالب')}Unknown directive
156async function exs(){const d=await srch(($('#eq')||{value:''}).value.trim());if($('#es'))$('#es').innerHTML=d.map(s=>`<option value="${s.id}">${h(s.full_name)}</option>`).join('')}Syntax not understood
157async function gx(){if(!$('#es').value)return alert('اختر الطالب');await rpc('grant_exception',{p_student:$('#es').value,p_kind:$('#ek').value});alert('تم منح الاستثناء وسيُوثّق في السجل')}Syntax not understood
158async function vTch(){const k=NAV;const d=((await D(sb.from('teachers').select('id,username,full_name,role,is_active,temp_admin_from,temp_admin_until').order('created_at').limit(300)))||[]);Syntax not understood
159 VA(k,`<div class="card"><b>إضافة شيخ</b><input id="tn" placeholder="الاسم الكامل"><input id="tu" placeholder="اسم المستخدم (إنجليزي)" autocapitalize="none"><input id="tp" placeholder="كلمة السر"><button style="width:100%" onclick="addT()">إنشاء الحساب</button></div>Unknown directive
160 <div class="card">${d.map(t=>`<div class="it"><div><b>${h(t.full_name)}</b> <span class="m">${h(t.username)}</span><br>${t.role=='admin'?'<span class="tag">مسؤول</span> ':''}${t.is_active?'':'<span class="tag bad">موقوف</span>'}${t.temp_admin_until&&new Date(t.temp_admin_until)>new Date()?' <span class="tag w">مسؤول مؤقت</span>':''}</div><div style="display:flex;flex-direction:column;gap:5px">Unknown directive
161 <button class="sm s" onclick="pw('${t.id}')">كلمة السر</button><button class="sm ${t.is_active?'r':''}" onclick="act('${t.id}',${!t.is_active})">${t.is_active?'إيقاف':'تفعيل'}</button><button class="sm s" onclick="al('${t.id}')">الأداء</button>${me.main&&t.role=='teacher'?`<button class="sm s" onclick="tmp('${t.id}')">مسؤول مؤقت</button>`:''}</div></div>`).join('')}</div>`)}Unknown directive
162async function addT(){await rpc('admin_create_teacher',{p_username:$('#tu').value,p_password:$('#tp').value,p_full_name:$('#tn').value});vTch()}Unknown directive
163async function pw(i){const p=prompt('كلمة السر الجديدة (6 أحرف على الأقل)');if(p){await rpc('admin_set_password',{p_teacher:i,p_password:p});alert('تم التغيير')}}Unknown directive
164async function act(i,a){await rpc('set_teacher_active',{p_teacher:i,p_active:a});vTch()}Unknown directive
165async function tmp(i){const d=prompt('عدد أيام التفويض (0 لإلغاء التفويض)','1');if(d===null)return;const n=+d;await rpc('set_temp_admin',{p_teacher:i,p_from:n?new Date().toISOString():null,p_until:n?new Date(Date.now()+n*864e5).toISOString():null});vTch()}Unknown directive
166async function al(i){const k=NAV;const d=((await D(sb.from('recitations').select('kind,result,status,students(full_name),school_days(day_date)').eq('teacher_id',i).order('created_at',{ascending:false}).limit(100)))||[]);Unknown directive
167 VA(k,`<div class="card"><div class="row sp"><b>سجل أداء الشيخ</b><button class="sm s" onclick="vTch()">رجوع</button></div>${d.map(r=>`<div class="it"><span>${h((r.students||{}).full_name)} <span class="m">${r.school_days.day_date}</span></span><span><span class="tag">${KIND[r.kind]}</span> <span class="tag ${r.result=='redo'?'bad':''}">${r.result=='pass'?'حافظ':'إعادة'}</span></span></div>`).join('')||'<p class="m">لا سجل</p>'}</div>`)}Unknown directive
168function vStu(){V(`<div class="card"><input id="q" placeholder="بحث..." oninput="deb(fs)"><div id="ls"></div></div>`);fs()}Syntax not understood
169async function fs(){const f=++FQ,q=($('#q')||{value:''}).value.trim();const d=await srch(q);if(f!=FQ||!$('#ls'))return;$('#ls').innerHTML=d.map(s=>`<div class="it"><div><b>${h(s.full_name)}</b><br><span class="m">${h(s.parent_phone)}</span></div><button class="sm r" onclick="delS('${s.id}')">حذف</button></div>`).join('')||'<p class="m">لا نتائج</p>'}Syntax not understood
170async function delS(i){if(!confirm('حذف الطالب من المركز؟ (تبقى سجلاته محفوظة داخلياً)'))return;await rpc('delete_student',{p_student:i});fs()}Unknown directive
171let SP='w',SM='d',SD='';Syntax not understood
172const ring=(v,c)=>{const r=44,C=2*Math.PI*r;return `<div class="ring"><svg width="104" height="104"><circle cx="52" cy="52" r="${r}" fill="none" stroke="${c?'#ffffff40':'#f3d9d4'}" stroke-width="11"/><circle cx="52" cy="52" r="${r}" fill="none" stroke="${c?'#fff':'#2f6b45'}" stroke-width="11" stroke-linecap="round" stroke-dasharray="${C*v/100} ${C}"/></svg><em style="color:${c?'#fff':'#245536'}">${v}%</em></div>`};Syntax not understood
173const pc=(a,b)=>b?Math.round(100*a/b):0;Unknown directive
174const modeSeg=()=>`<div class="seg"><button class="${SM=='d'?'on':''}" onclick="SM='d';vStat()">تقرير اليوم</button><button class="${SM=='p'?'on':''}" onclick="SM='p';vStat()">الفترات</button></div>`;Unknown directive
175const tripDate=()=>new Intl.DateTimeFormat('en-CA',{timeZone:'Africa/Tripoli'}).format(new Date());Unknown directive
176function vStat(){return SM=='d'?vDayRep():vStatP()}Unknown directive
177async function vDayRep(){const k=NAV;SD=SD||tripDate();const d=await rpc('day_report',{p_date:SD}),L=d.lists,pp=pc(d.passed,d.present),w=v=>d.present?(100*v/d.present).toFixed(1):0;Unknown directive
178 const box=(t,a,c)=>`<details class="card"><summary style="font-weight:800;font-size:17px;cursor:pointer">${t} <span class="tag ${c?'bad':''}">${a.length}</span></summary>${a.map((x,i)=>`<div class="it"><span>${i+1}. ${h(x.n)}</span><span class="m">${h(x.t||'')}</span></div>`).join('')||'<p class="m">لا يوجد</p>'}</details>`;Unknown directive
179 VA(k,modeSeg()+`<div class="card"><label>تاريخ اليوم</label><div class="row"><input type="date" id="sd" value="${SD}" onchange="SD=this.value||tripDate();vStat()"><button class="sm s" onclick="SD=tripDate();vStat()">اليوم</button></div></div>Syntax not understood
180 <div class="kp"><div class="big"><div>${ring(pp,1)}</div><div><b>${d.passed} من ${d.present}</b><span>حافظ من إجمالي الحاضرين</span><br><span>إعادة: ${d.redo} — بدون تسميع: ${d.no_rec}</span></div></div>Unknown directive
181 <div><b>${d.total_students}</b><span>إجمالي الطلاب</span></div><div><b>${d.present}</b><span>الحاضرون</span></div><div><b>${d.absent}</b><span>الغائبون</span></div><div><b>${d.unrecorded}</b><span>لم يُسجّل لهم حضور</span></div></div>Syntax not understood
182 <div class="card"><span class="cap">توزيع الحاضرين</span><div style="display:flex;height:16px;border-radius:9px;overflow:hidden;background:#e9e6dd;margin:8px 0"><i style="width:${w(d.passed)}%;background:#2f6b45"></i><i style="width:${w(d.redo)}%;background:#d98a7d"></i><i style="width:${w(d.no_rec)}%;background:#bdb8ab"></i></div><div class="lg"><span><i style="background:#2f6b45"></i>حافظ ${d.passed}</span><span><i style="background:#d98a7d"></i>إعادة ${d.redo}</span><span><i style="background:#bdb8ab"></i>بدون تسميع ${d.no_rec}</span></div>Unknown directive
183 <p class="m" style="margin-top:8px">الحاضر: من سُجّل حضوره أو سمّع تسميعاً معتمداً. الحافظ: كل تسميعاته اليوم حافظ. الإعادة: له إعادة واحدة على الأقل.</p></div>Unknown directive
184 <details class="card" style="border-color:#d98a7d" ${L.redo_all.length?'open':''}><summary style="font-weight:800;font-size:17px;cursor:pointer">قائمة الإعادة (للفرز) <span class="tag bad">${L.redo_all.length}</span></summary>${L.redo_all.map((x,i)=>`<div class="it"><span>${i+1}. ${h(x.n)}</span><span>${x.secs.map(z=>`<span class="tag bad">${KIND[z]}</span>`).join(' ')}</span></div>`).join('')||'<p class="m">لا يوجد</p>'}</details>Unknown directive
185 ${box('راجع وحافظ',L.review_pass)}${box('راجع وإعادة',L.review_redo,1)}${box('جديد وحافظ',L.new_pass)}${box('جديد وإعادة',L.new_redo,1)}${box('امتحان وحافظ',L.exam_pass)}${box('امتحان وإعادة',L.exam_redo,1)}${box('حاضر بدون تسميع',L.none)}${box('الغائبون',L.absent)}Syntax not understood
186 <div class="card"><button style="width:100%" onclick="document.querySelectorAll('details').forEach(x=>x.open=true);print()">تصدير التقرير PDF</button></div>`)}Unknown directive
187async function vStatP(){const k=NAV;const D=864e5,t=new Date(),iso=d=>new Date(d).toISOString().slice(0,10);Syntax not understood
188 const P={d:['اليوم',iso(t)],w:['7 أيام',iso(t-6*D)],m:['الشهر',iso(t).slice(0,8)+'01'],y:['السنة',iso(t).slice(0,5)+'01-01']};Unknown directive
189 const d=await rpc('stats_dashboard',{p_from:P[SP][1],p_to:iso(t)});Unknown directive
190 const K=d.kinds||{},rv=K.review||{total:0,pass:0},nw=K.new||{total:0,pass:0},tt=rv.total+nw.total,pp=rv.pass+nw.pass,at=d.att.present+d.att.absent,mx=Math.max(1,...d.daily.map(x=>x.p+x.r)),ex=d.exam,et=ex.pass+ex.redo,mt=Math.max(1,...d.teachers.map(x=>x.c));Unknown directive
191 const pr=(n,k)=>`<div class="card"><div class="row sp"><span class="cap">${n}</span><b>${pc(k.pass,k.total)}%</b></div><div class="pb"><i style="width:${pc(k.pass,k.total)}%"></i></div><div class="row sp m"><span>✓ ${k.pass} حافظ</span><span>↻ ${k.total-k.pass} إعادة</span><span>${k.total} جلسة</span></div></div>`;Unknown directive
192 VA(k,modeSeg()+`<div class="seg">${Object.entries(P).map(([k,v])=>`<button class="${SP==k?'on':''}" onclick="SP='${k}';vStat()">${v[0]}</button>`).join('')}</div>Unknown directive
193 <div class="kp"><div class="big"><div>${ring(pc(pp,tt),1)}</div><div><b>${pc(pp,tt)}%</b><span>نسبة الحفظ الإجمالية</span><br><span>${pp} حافظ من ${tt} جلسة</span></div></div>Syntax not understood
194 <div><b>${d.students}</b><span>عدد الطلاب</span></div><div><b>${pc(d.att.present,at)}%</b><span>نسبة الحضور</span></div>Syntax not understood
195 <div><b>${d.att.present}</b><span>مرات الحضور</span></div><div><b>${d.att.absent}</b><span>مرات الغياب</span></div></div>Syntax not understood
196 ${pr('المراجعة',rv)}${pr('الجديد',nw)}Syntax not understood
197 <div class="card"><span class="cap">النشاط اليومي</span>${d.daily.length?`<div class="bars">${d.daily.slice(-14).map(x=>`<div title="${x.d}"><i style="height:${100*x.p/mx}%"></i><u style="height:${100*x.r/mx}%"></u>${x.d.slice(8)}</div>`).join('')}</div><div class="lg"><span><i style="background:#2f6b45"></i>حافظ</span><span><i style="background:#d98a7d"></i>إعادة</span></div>`:'<p class="m">لا بيانات في هذه الفترة</p>'}</div>Unknown directive
198 <div class="card"><span class="cap">الامتحان</span>${et?`<div class="row" style="justify-content:space-around">${ring(pc(ex.pass,et))}<div><b style="font-size:22px">${ex.pass} ناجح</b><br><span class="tag bad">${ex.redo} إعادة</span></div></div>`:'<p class="m">لا امتحانات في هذه الفترة</p>'}</div>Unknown directive
199 <div class="card"><span class="cap">نشاط المشايخ</span>${d.teachers.map(x=>`<div class="hb"><div><span>${h(x.n)}</span><b>${x.c}</b></div><div class="pb"><i style="width:${100*x.c/mt}%"></i></div></div>`).join('')||'<p class="m">لا بيانات</p>'}</div>Unknown directive
200 <div class="card"><span class="cap">طلاب يحتاجون متابعة (الأكثر إعادة)</span>${d.redo_students.map(x=>`<div class="it"><span>${h(x.n)}</span><span class="tag bad">${x.c} إعادة</span></div>`).join('')||'<p class="m">لا يوجد</p>'}</div>Syntax not understood
201 <div class="card"><button style="width:100%" onclick="print()">تصدير التقرير PDF</button></div>`)}Unknown directive
202async function vSet(){const k=NAV;const s=(await sb.from('settings').select('study_days,evening_start,evening_end,morning_enabled,morning_start,morning_end,hijri_offset').single()).data,D=['الأحد','الإثنين','الثلاثاء','الأربعاء','الخميس','الجمعة','السبت'];Syntax not understood
203 VA(k,`<div class="card"><b>أيام الدراسة</b><div>${D.map((n,i)=>`<label style="display:inline-block;margin:6px"><input type="checkbox" class="sd" value="${i}" ${s.study_days.includes(i)?'checked':''} style="width:auto"> ${n}</label>`).join('')}</div>Unknown directive
204 <label>الفترة المسائية: من / إلى</label><div class="row"><input id="es1" type="time" value="${s.evening_start.slice(0,5)}"><input id="es2" type="time" value="${s.evening_end.slice(0,5)}"></div>Unknown directive
205 <label><input id="mo" type="checkbox" style="width:auto" ${s.morning_enabled?'checked':''}> تفعيل الفترة الصباحية</label><div class="row"><input id="ms1" type="time" value="${s.morning_start.slice(0,5)}"><input id="ms2" type="time" value="${s.morning_end.slice(0,5)}"></div>Unknown directive
206 <label>تعديل التاريخ الهجري (يوم زيادة أو نقصان)</label><select id="ho">${[-1,0,1].map(n=>`<option ${n==s.hijri_offset?'selected':''}>${n}</option>`).join('')}</select><button style="width:100%;margin-top:8px" onclick="saveSet()">حفظ الإعدادات</button></div>`)}Unknown directive
207async function saveSet(){const{error}=await sb.from('settings').update({study_days:[...document.querySelectorAll('.sd:checked')].map(e=>+e.value),evening_start:$('#es1').value,evening_end:$('#es2').value,morning_enabled:$('#mo').checked,morning_start:$('#ms1').value,morning_end:$('#ms2').value,hijri_offset:+$('#ho').value}).eq('id',1);if(error)return alert(error.message);off=+$('#ho').value;alert('تم الحفظ')}Unknown directive
208function vDay(){V(`<div class="card"><p>سيُسجَّل غياب تلقائي لمن لم يحضر ولم يُسمّع، وتُرفع القيود لليوم الجديد وتُؤرشف السجلات. التسميعات المعلّقة تبقى بانتظار قرارك.</p><button class="r" style="width:100%" onclick="cd()">إنهاء جلسة اليوم وبدء يوم جديد</button></div>`)}Unknown directive
209async function cd(){if(!confirm('هل أنت متأكد من إنهاء جلسة اليوم وبدء يوم جديد؟'))return;await rpc('close_day');alert('تم بدء يوم جديد')}Syntax not understood
210async function vSec(){const k=NAV;const d=((await D(sb.from('secret_reports').select('id,body,is_read,created_at').order('created_at',{ascending:false}).limit(100)))||[]);Unknown directive
211 VA(k,`<div class="card"><b>البلاغات السرية</b>${d.map(r=>`<div class="it"><div>${h(r.body)}<br><span class="m">${new Date(r.created_at).toLocaleString('ar-LY')}</span></div>${r.is_read?'':`<button class="sm" onclick="rd('${r.id}')">تمت القراءة</button>`}</div>`).join('')||'<p class="m">لا بلاغات</p>'}</div>`)}Unknown directive
212async function rd(i){await sb.from('secret_reports').update({is_read:true}).eq('id',i);vSec()}Unknown directive
215/* ---------- التحديث اللحظي (للشيوخ والمسؤول) ---------- */Syntax not understood
216function rtStart(){if(RT)return;const ev=t=>({event:'*',schema:'public',table:t});Unknown directive
217 RT=sb.channel('live').on('postgres_changes',ev('recitations'),rtEv).on('postgres_changes',ev('attendance'),rtEv).on('postgres_changes',ev('admin_exceptions'),rtEv).on('postgres_changes',ev('school_days'),rtEv).subscribe()}Syntax not understood
218function rtStop(){if(RT){sb.removeChannel(RT);RT=null}}Syntax not understood
219function rtEv(p){if(!me)return;const n=p.new||{},o=p.old||{},sid=n.student_id||o.student_id;Syntax not understood
220 if(tab=='stat'){clearTimeout(rtT);rtT=setTimeout(()=>{if(tab=='stat')Promise.resolve(vStat()).catch(()=>{})},1500);return}Syntax not understood
221 if(tab=='rec'&&curOpen&&cur&&(!sid||sid==cur.id)){if((n.teacher_id||n.granted_by)==me.id)return;Syntax not understood
222 if(!$('#rtb')&&$('#v'))$('#v').insertAdjacentHTML('afterbegin','<div class="card" id="rtb" style="background:#f8f1d8"><b>تحدّثت حالة الطالب من جهاز آخر.</b><p class="m">ما كتبته لن يُمسح حتى تضغط تحديث.</p><button onclick="openS(cur.id)">تحديث الآن</button></div>')}}Syntax not understood
224/* ---------- بوابة أولياء الأمور (قراءة فقط) ---------- */Syntax not understood
225function loginP(){app.innerHTML=hero('بوابة أولياء الأمور')+`<div class="card"><label>رقم هاتف ولي الأمر</label><input id="ph" type="tel" inputmode="tel"><button style="width:100%;margin-top:8px" onclick="pKids()">دخول</button><button class="s" style="width:100%;margin-top:8px" onclick="home()">رجوع</button></div>`}Unknown directive
226async function pKids(){clearInterval(PT);ph=$('#ph').value;const k=await rpc('parent_children',{p_phone:ph});if(!k.length)return alert('لا يوجد طلاب مرتبطون بهذا الرقم');Syntax not understood
227 app.innerHTML=hero('اختر الابن')+`<div class="card">${k.map(x=>`<button class="gate" onclick="pView('${x.student_id}')"><b>${h(x.student_name)}</b></button>`).join('')}<button class="s" style="width:100%" onclick="home()">خروج</button></div>`}Unknown directive
228async function pView(id,t,q){t=t||'r';const d=q?(await sb.rpc('parent_student_log',{p_phone:ph,p_student:id})).data:await rpc('parent_student_log',{p_phone:ph,p_student:id});if(!d)return;off=d.hijri_offset||0;Unknown directive
229 if(!q){clearInterval(PT);PT=setInterval(()=>{if(!document.hidden&&ph)pView(id,t,1)},45000)}Syntax not understood
230 const T={r:'سجل التسميع',a:'الحضور والغياب',n:'الملاحظات'};let b='';Unknown directive
231 if(t=='r')b=d.recitations.map(r=>`<div class="it"><div><span class="tag">${KIND[r.kind]}</span> ${r.date}<br><span class="m">سورة ${SU[r.from_surah-1]||''}<br>من: ${h(r.from_text||r.from_ayah||'-')} ← إلى: ${h(r.to_text||r.to_ayah||'-')}<br>لحن ${r.lahn} | تنبيه ${r.tanbih} | فتح ${r.fath}${r.score!=null?` | ${r.score}/${r.max_score}`:''}<br>الشيخ: ${h(r.teacher)}</span></div><span class="tag ${r.result=='redo'?'bad':''}">${r.result=='pass'?'حافظ':'إعادة'}</span></div>`).join('');Unknown directive
232 if(t=='a')b=d.attendance.map(a=>`<div class="it"><span>${a.date}</span><span class="tag ${a.status=='absent'?'bad':''}">${a.status=='present'?'حاضر':'غائب'}</span></div>`).join('');Unknown directive
233 if(t=='n')b=d.notes.map(n=>`<div class="it"><div>${h(n.body)}<br><span class="m">${h(n.teacher)} — ${n.date.slice(0,10)}</span></div></div>`).join('');Syntax not understood
234 NOSCR=!!q;layout(T[t],[{g:h(d.student.full_name)},...Object.entries(T).map(([k,v])=>({t:v,on:t==k,f:`pView('${id}','${k}')`})),{t:'تغيير الابن',f:'pKids()'}],`<div class="card">${b||'<p class="m">لا يوجد</p>'}</div>`);NOSCR=0}Unknown directive
235boot();Syntax not understood
236</script></body></html>Syntax not understood

To appear in search results, crawlers need access to your app.

○Structured data is valid
●Page isn’t blocked from indexing
●Document has a `<title>` element
●Page has successful HTTP status code
●Links have descriptive text
●Links are crawlable
●Document has a valid `hreflang`
○Image elements have `[alt]` attributes
○Document has a valid `rel=canonical`

Send Feedback