Misconduct Risk Simulation – Working Copy

#ps-risk-sim{ --ink:#0d1b2a; --muted:#475569; --gold:#cfa54a; --line:#e5e7eb; --card:#f8fafc; --low:#10b981; --med:#f59e0b; --high:#ef4444; --crit:#991b1b; font-family:inherit; color:var(--ink); }#ps-risk-sim *{box-sizing:border-box}/* Ana container */ #ps-risk-sim .container{ max-width:880px; margin:0 auto; padding:24px 20px; background:linear-gradient(180deg,var(--card),#fff); border:1px solid var(--line); border-radius:36px; box-shadow:0 12px 32px rgba(13,27,42,.08); }/* Giriş açıklaması */ #ps-risk-sim .desc{ margin:10px auto 16px; max-width:780px; padding:14px 16px; background:#fff; border:1px solid var(--line); border-radius:16px; font-size:14px; line-height:1.7; color:#1e293b; }/* Sorular */ #ps-risk-sim .question{ border:1px solid var(--line); border-radius:14px; padding:14px 16px; margin:10px auto; background:#fff; max-width:760px; }#ps-risk-sim .q-title{ font-weight:600; font-size:15px; margin-bottom:6px; }#ps-risk-sim .q-meta{ font-size:12.5px; color:#64748b; margin-bottom:10px; }/* Şıklar */ #ps-risk-sim .scale{ display:flex; gap:8px; justify-content:center; }#ps-risk-sim .scale input{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px}#ps-risk-sim .scale label{ flex:0 1 110px; text-align:center; padding:10px 0; border:1px solid #cbd5e1; border-radius:999px; background:#fff; cursor:pointer; font-weight:500; font-size:13.5px; transition:.18s ease; }#ps-risk-sim .scale input:checked + label{ border-color:var(--gold); box-shadow:0 0 0 2px var(--gold) inset; }/* ===================== HESAPLA BUTONU ===================== */#ps-risk-sim .controls{ text-align:center; margin:20px 0 10px; }#ps-risk-sim .btn-main{ all:unset; display:inline-flex; align-items:center; justify-content:center;padding:17px 40px; font-size:18px; font-weight:500; font-family:"Inter", sans-serif;border-radius:24px; border:1px solid var(--e-global-color-uicore_primary); color:var(--e-global-color-uicore_primary); cursor:pointer;transition:all .2s ease; }#ps-risk-sim .btn-main:hover{ background:var(--e-global-color-uicore_primary); color:var(--e-global-color-uicore_white); transform:translateY(-1px); }/* ===================== SKOR & BAR ===================== */#ps-risk-sim .score-box{ display:none; margin:14px auto; padding:16px 18px; background:#fff; border-radius:16px; border:1px solid var(--line); max-width:760px; }#ps-risk-sim .badge{ font-weight:600; border-radius:999px; padding:6px 12px; }#ps-risk-sim .badge.low{background:#ecfdf5;color:#065f46} #ps-risk-sim .badge.med{background:#fff7ed;color:#9a3412} #ps-risk-sim .badge.high{background:#fef2f2;color:#b42318} #ps-risk-sim .badge.crit{background:#fee2e2;color:#7f1d1d}#ps-risk-sim .gauge{ height:16px; background:#e2e8f0; border-radius:999px; margin:10px 0; }#ps-risk-sim .gauge i{ display:block; height:100%; width:0; background:linear-gradient(90deg,#10b981,#cfa54a,#ef4444); border-radius:999px; transition:width .45s ease; }/* Müşteri raporu */ #ps-risk-sim .report-lead{font-size:16px;line-height:1.65;margin:12px 0;color:#1e293b} #ps-risk-sim .summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0} #ps-risk-sim .summary-card{border:1px solid var(--line);border-radius:14px;padding:16px;background:#fff} #ps-risk-sim .summary-card h3{font-size:15px;margin:0 0 8px;color:#0d1b2a} #ps-risk-sim .summary-card p{font-size:14px;line-height:1.65;margin:0;color:#475569} #ps-risk-sim .report-note{font-size:13px;line-height:1.6;color:#64748b;border-top:1px solid var(--line);padding-top:12px;margin-top:16px} #ps-risk-sim .risk-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0} #ps-risk-sim .risk-card{border:1px solid var(--line);border-radius:14px;padding:14px;background:#f8fafc} #ps-risk-sim .risk-card small{display:block;color:#b42318;font-weight:600;margin-bottom:6px} #ps-risk-sim .risk-card strong{display:block;font-size:14px;line-height:1.35} #ps-risk-sim .impact-list{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 18px} #ps-risk-sim .impact-list span{background:#eef4fb;border-radius:999px;padding:7px 10px;font-size:12px;color:#1e293b} #ps-risk-sim .report-cta{border-left:4px solid #b42318;background:#f8fafc;border-radius:12px;padding:16px;margin-top:16px} #ps-risk-sim .report-cta strong{display:block;margin-bottom:6px} #ps-risk-sim .report-cta p{font-size:13px;line-height:1.55;color:#475569;margin:0 0 14px} #ps-risk-sim .cta-button{all:unset;display:inline-flex;align-items:center;justify-content:center;padding:13px 24px;border-radius:24px;background:#0d1b2a;color:#fff;font-weight:600;cursor:pointer} #ps-risk-sim .lead-form{display:none;margin:18px auto 0;padding:18px;background:#fff;border:1px solid var(--line);border-radius:16px;max-width:760px} #ps-risk-sim .lead-form.open{display:block} #ps-risk-sim .lead-form h3{margin:0 0 6px} #ps-risk-sim .lead-form .form-intro{font-size:13px;color:#64748b;margin:0 0 14px} #ps-risk-sim .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px} #ps-risk-sim .field label{display:block;font-size:12px;font-weight:600;margin:0 0 5px} #ps-risk-sim .field input{width:100%;padding:11px 12px;border:1px solid #cbd5e1;border-radius:10px;font:inherit;background:#fff;color:#0d1b2a} #ps-risk-sim .field input:focus{outline:2px solid rgba(207,165,74,.35);border-color:#cfa54a} #ps-risk-sim .privacy-note{font-size:11px;line-height:1.55;color:#64748b;margin:12px 0} #ps-risk-sim .privacy-note a{color:#0d1b2a;text-decoration:underline} #ps-risk-sim .form-error{display:none;color:#b42318;font-size:12px;margin:8px 0} #ps-risk-sim .form-success{display:none;background:#ecfdf5;color:#065f46;border-radius:10px;padding:12px;margin-top:12px;font-size:13px}/* Mobil */ @media(max-width:640px){ #ps-risk-sim .scale{flex-direction:column} #ps-risk-sim .btn-main,#ps-risk-sim .cta-button{width:100%} #ps-risk-sim .risk-grid,#ps-risk-sim .summary-grid,#ps-risk-sim .form-grid{grid-template-columns:1fr} }#ps-risk-sim #warn{ text-align: center; margin: 14px auto; max-width: 760px; }/* ===================== MOBİL OVAL BUTON – KESİN FIX ===================== */ @media (max-width:640px){#ps-risk-sim .scale{ display:flex !important; flex-direction:column !important; gap:12px !important; }#ps-risk-sim .scale label{ /* Tema / Elementor etkilerini sıfırla */ all: unset;/* Gerçek buton davranışı */ box-sizing: border-box; display:flex; align-items:center; justify-content:center;width:100%; height:52px; /* 🔴 KRİTİK */ line-height:1; /* 🔴 KRİTİK */font-size:15px; font-weight:500; font-family:inherit;border:1px solid #cbd5e1; border-radius:26px; /* height / 2 */ background:#fff;cursor:pointer; transition:.18s ease; }#ps-risk-sim .scale input:checked + label{ border-color:var(--gold); box-shadow:0 0 0 2px var(--gold) inset; } }/* ===================== SCALE BUTON – SİTE GENELİ UYUMLU (SİYAH KENAR) ===================== *//* Normal durum */ #ps-risk-sim .scale label{ background:#fff; border:1px solid #1f2937; /* koyu gri / siyaha yakın */ box-shadow:none; transition:border-color .15s ease, box-shadow .15s ease; }/* Hover – çok hafif vurgu */ #ps-risk-sim .scale label:hover{ background:#fff; border-color:#000; box-shadow:0 2px 8px rgba(0,0,0,.08); }/* Active (basılı) */ #ps-risk-sim .scale label:active{ box-shadow:0 1px 4px rgba(0,0,0,.12); }/* Seçili (checked) */ #ps-risk-sim .scale input:checked + label{ background:#fff; border-color:#000; box-shadow:0 0 0 1px #000 inset; font-weight:500; }/* Seçili + hover ekstra efekt almasın */ #ps-risk-sim .scale input:checked + label:hover{ background:#fff; border-color:#000; box-shadow:0 0 0 1px #000 inset; }
This model is based on findings from fraud investigations conducted by Prosecure Consulting Inc. and case studies from Turkey, and is structured according to ACFE's Fraud Triangle (Pressure, Opportunity, Rationalization) and Fraud Tree methodologies (Transactional Risks, Conflict of Interest, Compliance / Governance).

It does not replace an evidence-based investigation; it provides a preliminary assessment of potential misconduct risk indicators within the organization and may indicate the need for professional evaluation. Each question item is evaluated with its unique weighting factor; results are presented in Low / Medium / High / Critical risk bands.

1. Does the employee have a lifestyle that cannot be explained by their income level?
Behavioural / Pressure
No
2. Does the employee frequently request loans, investments or advances from internal or external sources?
Behavioural / Pressure
No
3. Are there any reports of the employee engaging in gambling, betting or similar addictive behaviours?
Behavioural / Pressure
No
Is the employee under significant emotional pressure due to family or health issues or major changes in their life?
Behavioural / Pressure
No
5. Does the employee frequently work late hours alone, avoiding handing over tasks or taking holidays?
Behavioural / Pressure
No
6. Is there a lack of separation of duties, or is payment approval concentrated in one person?
Control / Opportunity
No
7. Are system accesses and user permissions not reviewed regularly?
Control / Opportunity
No
8. Is independent auditing or rotation not applied in critical financial processes (procurement, accounting, payment)?
Control / Opportunity
No
9. Is there any unusual closeness between the employee and the supplier, customer or intermediary (gifts, joint activities, personal benefits)?
Relationship / Opportunity
No
10. Does the employee frequently express that the organisation is not treating them fairly or that they are underpaid?
Culture / Rationalisation
No
11. Are there any examples of minor ethical violations being overlooked or not punished?
Culture / Rationalisation
No
12. Is the senior management's commitment to ethical values and the principle of integrity weak (weak tone at the top)?
Culture / Rationalisation
No
13. Are there frequent adjustment entries or unexplained reconciliation differences in the accounts?
Financial / Transactional
No
Are there any signs of income/expense inflation or cut-off errors at the end of the 14th period?
Financial / Transactional
No
15. Are there any recurring payments with the same amount or the same IBAN/address?
Financial / Transactional
No
16. Is there an unusually high volume of transactions with the same supplier, or is the alternative supplier unavailable?
Financial / Transactional
No
17. Are discrepancies identified in asset or inventory counts that are not reflected in the records?
Operasyonel / Transactional
No
18. Is there any indication of a conflict of interest between the employee and the supplier, such as kinship, partnership, or the same IBAN/address?
Relationship / Conflict of Interest
No
19. Are there any negative media reports, rumours or past investigations concerning the supplier or employee?
Reputasyon / Conflict of Interest
No
20. Is there an Ethics Hotline or reporting system within the company; however, is it not technically operational, or is it unknown to employees or not actively used?
Compliance
No
21. Does the internal audit or risk management unit regularly assess potential fraud risks and report them to senior management?
Governance
No
Please answer all the questions. I'm taking you to the missing question...

Total Risk

Low
0 / 100

Key Findings

Responses will appear here after evaluation.

Analysis Summary

The combined evaluation of risk areas will be summarized here.

Priority Risk Areas

This result does not constitute a finding of misconduct, evidence, or an accusation against any person or institution. The existence, source, and scope of potential risks cannot be determined solely by this simulation.

Let's confidentially discuss what the results mean.

Prosecure experts can evaluate the scope of the indicators and the appropriate professional approach during an initial consultation.

Confidential Initial Consultation Request

Leave your contact information; the Prosecure team will contact you regarding your assessment.

Your personal data will be processed for the purpose of evaluating your initial consultation request. For details, see the Disclosure Text and Personal Data Protection and Processing Policy.

Please fill in the required fields correctly.
Your request has been received. The Prosecure team will contact you.
/* ===================== ACFE UYUMLU RİSK MOTORU ===================== */// Şıkların puan karşılıkları const ANSWER_POINTS = { evet: 4, emare: 2, hayir: 0 };// Risk eşikleri (isteğin doğrultusunda) const RISK_THRESHOLDS = [ { name:"Düşük", min:0, max:29, badge:"low" }, { name:"Orta", min:30, max:59, badge:"med" }, { name:"Yüksek", min:60, max:84, badge:"high" }, { name:"Kritik", min:85, max:100, badge:"crit" } ];// 21 soru: id, kategori, ağırlık, label const QUESTIONS = [ // Pressure (5) { id:1, cat:"Pressure", weight:3.0, label:"gelirle uyumsuz yaşam tarzı" }, { id:2, cat:"Pressure", weight:2.5, label:"borç/avans/yatırım talebi" }, { id:3, cat:"Pressure", weight:2.0, label:"kumar/bağımlılık duyumu" }, { id:4, cat:"Pressure", weight:1.5, label:"kişisel kriz kaynaklı stres" }, { id:5, cat:"Pressure", weight:2.5, label:"iş devrinden veya tatilden kaçınma ve yalnız çalışma" },// Opportunity (4) { id:6, cat:"Opportunity", weight:2.5, label:"görevler ayrılığı/tekil onay" }, { id:7, cat:"Opportunity", weight:2.0, label:"erişim/yetki gözden geçirme yok" }, { id:8, cat:"Opportunity", weight:2.0, label:"bağımsız denetim/rotasyon yok" }, { id:9, cat:"Opportunity", weight:2.5, label:"tedarikçi/müşteri ile yakınlık" },// Rationalization (3) { id:10, cat:"Rationalization", weight:1.5, label:"adil olmayan muamele algısı" }, { id:11, cat:"Rationalization", weight:2.0, label:"küçük etik ihlalleri tolere ediliyor" }, { id:12, cat:"Rationalization", weight:3.0, label:"zayıf tone at the top" }, // yükseltildi// Transactional (5) { id:13, cat:"Transactional", weight:2.5, label:"sık düzeltme/mutabakat farkları" }, { id:14, cat:"Transactional", weight:2.5, label:"dönem sonu şişirme/cut-off hatası" }, { id:15, cat:"Transactional", weight:2.0, label:"tekrarlı/aynı IBAN-adres ödemeler" }, { id:16, cat:"Transactional", weight:2.0, label:"tek tedarik/olağandışı yoğunluk" }, { id:17, cat:"Transactional", weight:2.0, label:"stok/varlık sayım sapmaları" },// Conflict of Interest (2) { id:18, cat:"Conflict", weight:3.0, label:"doğrudan çıkar çatışması emareleri" }, { id:19, cat:"Conflict", weight:1.5, label:"olumsuz medya/söylenti/geçmiş dosya" },// Compliance / Governance (2) { id:20, cat:"Compliance", weight:3.0, label:"etik hattı/ihbar mekanizması zayıf" }, // yükseltildi { id:21, cat:"Governance", weight:3.0, label:"düzenli fraud risk değerlendirmesi yok" } // yükseltildi ];// Kritik faktör amplifikasyon haritası (12,20,21 için) const CRITICAL_IDS = new Set([12,20,21]); // 0/1/2/3 adet "Evet" durumuna göre çarpanlar const AMPLIFIERS = { 0:1.00, 1:1.08, 2:1.15, 3:1.22 };// Elemanlar const warnEl = document.getElementById("warn"); const boxEl = document.getElementById("resultBox"); const scoreEl = document.getElementById("score"); const badgeEl = document.getElementById("levelBadge"); const barEl = document.getElementById("bar"); const reportLeadEl = document.getElementById("reportLead"); const findingsSummaryEl = document.getElementById("findingsSummary"); const analysisSummaryEl = document.getElementById("analysisSummary"); const riskGridEl = document.getElementById("riskGrid"); const impactListEl = document.getElementById("impactList"); let lastResult = null;// Yardımcılar function getAnswerKey(qid){ const sel = document.querySelector(`input[name="q${qid}"]:checked`); return sel ? (sel.value || "").toLowerCase() : null; // "evet" | "emare" | "hayir" | null } function getSelectedPoints(qid){ const key = getAnswerKey(qid); if(!key) return null; return ANSWER_POINTS[key] ?? null; } function allAnswered(){ for(const q of QUESTIONS){ if(getSelectedPoints(q.id) === null) return false; } return true; }// Skor hesaplama + amplifikasyon function calculate(){ let sumWeighted = 0; let sumWeights = 0;const catAgg = {}; let criticalYesCount = 0;for(const q of QUESTIONS){ const pts = getSelectedPoints(q.id); if(pts === null) continue;sumWeighted += pts * q.weight; sumWeights += q.weight;if(!catAgg[q.cat]) catAgg[q.cat] = { w:0, s:0 }; catAgg[q.cat].w += q.weight; catAgg[q.cat].s += pts * q.weight;// kritik sorulara "evet" ise say if(CRITICAL_IDS.has(q.id) && pts === 4) criticalYesCount++; }// normalize baz skor (%) let percent = sumWeights > 0 ? (sumWeighted / (4 * sumWeights)) * 100 : 0;// amplifikatör uygula, 0–100 aralığına sabitle const amp = AMPLIFIERS[criticalYesCount] || 1.0; percent = Math.min(100, Math.round(percent * amp));// bandı bul let band = RISK_THRESHOLDS[0]; for(const b of RISK_THRESHOLDS){ if(percent >= b.min && percent { const c = catAgg[k]; const p = (c.s / (4 * c.w)) * 100; return { cat:k, percent: Math.round(p) }; }).sort((a,b)=> b.percent - a.percent);return { percent, band, cats }; }function highlightFirstMissing(){ for(const q of QUESTIONS){ const el = document.querySelector(`input[name="q${q.id}"]`); if(el && !document.querySelector(`input[name="q${q.id}"]:checked`)){ const card = el.closest(".question"); card.style.boxShadow="0 0 0 2px #fecaca, 0 2px 10px rgba(239,68,68,.25)"; card.scrollIntoView({behavior:"smooth",block:"center"}); setTimeout(()=>card.style.boxShadow="0 2px 8px rgba(0,0,0,.03)",1400); break; } } }const CATEGORY_LABELS = { Pressure:"Davranışsal baskı göstergeleri", Opportunity:"Kontrol ve yetki yapısı", Rationalization:"Kurum kültürü", Transactional:"İşlemsel göstergeler", Conflict:"Üçüncü taraf ilişkileri", Compliance:"Uyum mekanizmaları", Governance:"Yönetişim ve gözetim" };function customerLeadText(bandName){ if(bandName === "Kritik") return "Yanıtlarınız, gecikmeden profesyonel değerlendirme gerektirebilecek risk göstergeleri olabileceğine işaret etmektedir. Sonuçların kapsamı ve önemi yalnızca uzman değerlendirmesiyle belirlenebilir."; if(bandName === "Yüksek") return "Yanıtlarınız, birden fazla alanda birlikte değerlendirilmesi gereken risk göstergeleri olabileceğine işaret etmektedir. Bu göstergeler mali, operasyonel veya itibari etkilerle ilişkili olabilir."; if(bandName === "Orta") return "Yanıtlarınız, bazı süreçlerde daha ayrıntılı değerlendirme gerektirebilecek risk göstergeleri olabileceğine işaret etmektedir. Bu göstergelerin kaynağı ve olası etkileri simülasyonla kesin olarak belirlenemez."; return "Yanıtlarınız, değerlendirilen alanlarda sınırlı sayıda risk göstergesi olabileceğine işaret etmektedir. Bu sonuç risk bulunmadığı anlamına gelmez."; }function impactLabels(cats){ const m = new Map(cats.map(c=>[c.cat,c.percent])); const impacts = []; if((m.get("Transactional")||0) >= 30) impacts.push("Mali kayıp riski"); if((m.get("Opportunity")||0) >= 30) impacts.push("Yetkisiz işlem riski"); if((m.get("Conflict")||0) >= 30) impacts.push("Çıkar çatışması riski"); if((m.get("Compliance")||0) >= 30 || (m.get("Governance")||0) >= 30 || (m.get("Rationalization")||0) >= 40) impacts.push("İtibar ve uyum riski"); return impacts.length ? impacts : ["Kontrol sürekliliği"]; }function publicFindingsText(){ const strong = [], partial = []; QUESTIONS.forEach(q=>{ const pts = getSelectedPoints(q.id); if(pts === 4) strong.push(q.label); else if(pts === 2) partial.push(q.label); });if(!strong.length && !partial.length){ return "Yanıtlarda belirgin veya kısmi düzeyde bir risk göstergesi işaretlenmemiştir. Bu sonuç risk bulunmadığı anlamına gelmez."; }const parts = []; if(strong.length){ const shown = strong.slice(0,4); parts.push(`Daha belirgin işaretlenen göstergeler: ${shown.join(", ")}${strong.length > shown.length ? ` ve ${strong.length - shown.length} gösterge daha` : ""}.`); } if(partial.length){ const shown = partial.slice(0,3); parts.push(`Kısmi düzeyde işaretlenen göstergeler: ${shown.join(", ")}${partial.length > shown.length ? ` ve ${partial.length - shown.length} gösterge daha` : ""}.`); } return parts.join(" "); }function publicAnalysisText(res){ const focused = res.cats.filter(c=>c.percent > 0).slice(0,2); if(!focused.length){ return "Yanıtlar belirli bir risk alanında yoğunlaşmaya işaret etmemektedir. Değerlendirme yalnızca verilen yanıtlara dayanır ve mevcut risklerin tamamını dışlamaz."; }const areas = focused.map(c=>`${CATEGORY_LABELS[c.cat] || c.cat} (%${c.percent})`).join(" ve "); const impacts = impactLabels(res.cats).join(", ").toLocaleLowerCase("tr-TR"); return `Yanıt örüntüsü özellikle ${areas} alanlarında yoğunlaşmaktadır. Bu görünüm ${impacts} ile ilişkili olabilir. Bulguların kaynağı, kapsamı ve önem derecesi yalnızca bu simülasyonla kesinleştirilemez.`; }function allAnswersText(){ return QUESTIONS.map((q,i)=>{ const checked = document.querySelector(`input[name="q${q.id}"]:checked`); const label = checked ? document.querySelector(`label[for="${checked.id}"]`) : null; return `${i+1}. ${q.label} => ${label ? label.textContent.trim() : "-"}`; }).join("\n"); }function internalFindingsText(){ const high = [], partial = []; QUESTIONS.forEach(q=>{ const pts = getSelectedPoints(q.id); if(pts === 4) high.push(q.label); else if(pts === 2) partial.push(q.label); }); return `Yüksek ağırlıklı cevaplar: ${high.length ? high.join(", ") : "Yok"}.\nKısmi göstergeler: ${partial.length ? partial.join(", ") : "Yok"}.`; }function internalReviewText(cats){ const review = []; const m = new Map(cats.map(c=>[c.cat,c.percent])); if((m.get("Transactional")||0) >= 40) review.push("muhasebe kayıtları ve ödeme hareketlerinin kapsamı"); if((m.get("Opportunity")||0) >= 40) review.push("yetki matrisi, görevler ayrılığı ve erişim yönetimi"); if((m.get("Conflict")||0) >= 40) review.push("tedarikçi/çalışan ilişkileri ve çıkar çatışması göstergeleri"); if((m.get("Pressure")||0) >= 40) review.push("davranışsal göstergelerin dayanağı ve zamanlaması"); if((m.get("Compliance")||0) >= 40 || (m.get("Governance")||0) >= 40) review.push("ihbar, iç denetim ve risk raporlama mekanizmaları"); return review.length ? "Ön görüşmede doğrulanabilecek konular: " + review.join("; ") + "." : "Ön görüşmede cevapların dayanağı ve mevcut kontrol yapısı genel olarak doğrulanabilir."; }// Hesapla ve müşteri raporunu yaz function computeAndRender(){ if(!allAnswered()){ boxEl.style.display="none"; warnEl.style.display="block"; highlightFirstMissing(); return; } warnEl.style.display="none";const res = calculate();scoreEl.textContent = res.percent; barEl.style.width = res.percent + "%"; badgeEl.className = "badge " + res.band.badge; badgeEl.textContent = res.band.name;lastResult = res; reportLeadEl.textContent = customerLeadText(res.band.name); findingsSummaryEl.textContent = publicFindingsText(); analysisSummaryEl.textContent = publicAnalysisText(res); riskGridEl.innerHTML = res.cats.slice(0,3).map((c,i)=>`
0${i+1} · Öncelikli alan${CATEGORY_LABELS[c.cat] || c.cat}
`).join(""); impactListEl.innerHTML = impactLabels(res.cats).map(x=>`${x}`).join("");boxEl.style.display="block"; boxEl.scrollIntoView({behavior:"smooth",block:"start"}); }// Hesaplama ve ön görüşme formu document.getElementById("computeBtn").addEventListener("click", computeAndRender); document.getElementById("openLeadForm").addEventListener("click", ()=>{ const form = document.getElementById("leadForm"); form.classList.add("open"); form.scrollIntoView({behavior:"smooth",block:"start"}); });document.getElementById("submitLead").addEventListener("click", async ()=>{ const name = document.getElementById("leadName").value.trim(); const email = document.getElementById("leadEmail").value.trim(); const phone = document.getElementById("leadPhone").value.trim(); const company = document.getElementById("leadCompany").value.trim(); const err = document.getElementById("leadError"); const success = document.getElementById("leadSuccess"); const submit = document.getElementById("submitLead"); const emailOk = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); const phoneOk = phone.replace(/\D/g,"").length >= 8; if(!lastResult || !name || !emailOk || !phoneOk){ err.style.display="block"; return; }err.style.display="none"; submit.disabled = true; submit.textContent = "Gönderiliyor…"; const fd = new FormData(); fd.append("action","ps_risk_lead_9941"); fd.append("nonce",window.psRisk9941Nonce || ""); fd.append("name",name); fd.append("email",email); fd.append("phone",phone); fd.append("company",company); fd.append("score",String(lastResult.percent)); fd.append("band",lastResult.band.name); fd.append("categories",lastResult.cats.map(c=>`${CATEGORY_LABELS[c.cat] || c.cat}: %${c.percent}`).join("\n")); fd.append("customer_summary",`${customerLeadText(lastResult.band.name)}\nÖne Çıkan Bulgular: ${publicFindingsText()}\nAnaliz Özeti: ${publicAnalysisText(lastResult)}`); fd.append("internal_findings",internalFindingsText()); fd.append("internal_review",internalReviewText(lastResult.cats)); fd.append("answers",allAnswersText()); fd.append("page_url",window.location.href); fd.append("privacy_version","Aydınlatma Metni 2026/01"); fd.append("website",document.getElementById("leadWebsite").value);try{ const response = await fetch(window.psRisk9941AjaxUrl || "/wp-admin/admin-ajax.php",{method:"POST",body:fd,credentials:"same-origin"}); const json = await response.json(); if(!json.success) throw new Error("request_failed"); success.style.display="block"; submit.style.display="none"; }catch(e){ err.textContent="Talep şu anda gönderilemedi. Lütfen daha sonra tekrar deneyin."; err.style.display="block"; submit.disabled=false; submit.textContent="Başvurumu Gönder"; } });