File size: 1,215 Bytes
a74b879
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function submitAuditFormAndRedirect() {
  const n = document.getElementById('inp-name').value.trim();
  const e = document.getElementById('inp-email').value.trim();
  const p = document.getElementById('inp-phone').value.trim();
  const s = document.getElementById('inp-sector').value.trim();
  const u = document.getElementById('inp-url').value.trim();
  const btn = document.getElementById('audit-btn');

  if (!n || !e || !p || !u) {
    btn.textContent = '⚠️ يرجى ملء الحقول المطلوبة';
    btn.style.background = '#c0392b';
    btn.style.color = '#fff';
    setTimeout(() => {
      btn.textContent = 'تحليل المحركات الـ 5 ←';
      btn.style.background = '';
      btn.style.color = 'var(--p)';
    }, 2500);
    return;
  }

  const userData = {
    name: n,
    email: e,
    phone: p,
    sector: s,
    url: u,
    timestamp: new Date().toISOString()
  };
  localStorage.setItem('auditFormData', JSON.stringify(userData));
  localStorage.setItem('autoLaunchAnalysis', 'true');

  btn.disabled = true;
  btn.textContent = '⏳ جاري الانتقال...';
  btn.style.opacity = '0.7';

  setTimeout(() => {
    window.location.href = '/portal.html';
  }, 800);
}