{"id":5446,"date":"2026-06-07T22:12:34","date_gmt":"2026-06-07T22:12:34","guid":{"rendered":"https:\/\/drsarahsakr.com\/academy-admin\/"},"modified":"2026-06-07T22:12:34","modified_gmt":"2026-06-07T22:12:34","slug":"academy-admin","status":"publish","type":"page","link":"https:\/\/drsarahsakr.com\/en\/academy-admin\/","title":{"rendered":"Academy Admin Panel"},"content":{"rendered":"<link rel=\"stylesheet\" href=\"https:\/\/drsarahsakr.com\/wp-content\/plugins\/da-student-portal\/assets\/academy-admin.css?ver=0.6.62\"><script src=\"https:\/\/drsarahsakr.com\/wp-content\/plugins\/da-student-portal\/assets\/academy-admin.js?ver=0.6.62\" defer><\/script><script>(function(){\n  if(window.DA_SP_CRITICAL_INPUT_FIX_0634){ return; }\n  window.DA_SP_CRITICAL_INPUT_FIX_0634 = true;\n  function normDigits(v){\n    return String(v || '').replace(\/[\u0660-\u0669]\/g,function(d){return '\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669'.indexOf(d);}).replace(\/[\u06f0-\u06f9]\/g,function(d){return '\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9'.indexOf(d);});\n  }\n  function normalizePhone(v){\n    v = normDigits(v).replace(\/[\u00a0\\s]+\/g, '');\n    var plus = v.charAt(0) === '+';\n    var digits = v.replace(\/\\D\/g, '');\n    return (plus ? '+' : '') + digits;\n  }\n  function isPhoneInput(el){\n    if(!el || !el.tagName || el.tagName.toLowerCase() !== 'input') return false;\n    var name = String(el.getAttribute('name') || '').toLowerCase();\n    return el.type === 'tel' || name.indexOf('phone') !== -1 || (el.classList && el.classList.contains('da-phone-clean-field'));\n  }\n  function cleanPhone(el){\n    if(!isPhoneInput(el)) return;\n    var cleaned = normalizePhone(el.value);\n    if(el.value !== cleaned) el.value = cleaned;\n    el.setAttribute('inputmode','tel');\n    el.setAttribute('autocomplete','off');\n    if(el.classList) el.classList.add('da-phone-clean-field');\n  }\n  function phoneScan(root){\n    root = root || document;\n    var inputs = root.querySelectorAll ? root.querySelectorAll('input') : [];\n    Array.prototype.forEach.call(inputs, cleanPhone);\n  }\n  function findHost(el){\n    return (el && el.closest && el.closest('.da-admin-enrollment-card,.da-admin-existing-enrollment-card,.da-sp-grid,.da-admin-card,form')) || document;\n  }\n  function isDiplomaSelect(el){\n    if(!el || !el.matches || !el.matches('select')) return false;\n    var n = String(el.getAttribute('name') || '');\n    return el.classList.contains('da-admin-diploma-select') || n === 'da_diploma_id' || n === 'da_existing_diploma_id' || \/\\[diploma_id\\]$\/.test(n);\n  }\n  function findBatchSelect(host, diplomaSelect){\n    var sels = host.querySelectorAll ? host.querySelectorAll('select') : [];\n    for(var i=0;i<sels.length;i++){\n      var s = sels[i], n = String(s.getAttribute('name') || '');\n      if(s.classList.contains('da-admin-batch-select') || n === 'da_batch_id' || n === 'da_existing_batch_id' || \/\\[batch_id\\]$\/.test(n)) return s;\n    }\n    if(diplomaSelect && diplomaSelect.form){\n      return diplomaSelect.form.querySelector('.da-admin-batch-select,select[name=\"da_batch_id\"],select[name=\"da_existing_batch_id\"],select[name$=\"[batch_id]\"]');\n    }\n    return null;\n  }\n  function storeBatchOptions(batch){\n    if(!batch || batch.__daSpAllOptions0633) return;\n    batch.__daSpAllOptions0633 = Array.prototype.map.call(batch.options, function(o){ return o.cloneNode(true); });\n  }\n  function filterPair(diplomaSelect){\n    if(!isDiplomaSelect(diplomaSelect)) return;\n    var host = findHost(diplomaSelect);\n    var batch = findBatchSelect(host, diplomaSelect);\n    if(!batch) return;\n    storeBatchOptions(batch);\n    var diploma = String(diplomaSelect.value || '');\n    var current = String(batch.value || '');\n    batch.innerHTML = '';\n    (batch.__daSpAllOptions0633 || []).forEach(function(src){\n      var val = String(src.value || '');\n      var od = String(src.getAttribute('data-diploma') || '');\n      var show = !val || (diploma && od === diploma);\n      if(show) batch.appendChild(src.cloneNode(true));\n    });\n    var keep = false;\n    Array.prototype.forEach.call(batch.options, function(opt){ if(String(opt.value || '') === current) keep = true; });\n    batch.value = keep ? current : '';\n    if(batch.options.length <= 1 && diploma){\n      batch.setAttribute('data-da-empty-for-diploma','1');\n    } else {\n      batch.removeAttribute('data-da-empty-for-diploma');\n    }\n  }\n  function batchScan(root){\n    root = root || document;\n    if(root.querySelectorAll){\n      Array.prototype.forEach.call(root.querySelectorAll('select.da-admin-batch-select,select[name=\"da_batch_id\"],select[name=\"da_existing_batch_id\"],select[name$=\"[batch_id]\"]'), storeBatchOptions);\n      Array.prototype.forEach.call(root.querySelectorAll('select.da-admin-diploma-select,select[name=\"da_diploma_id\"],select[name=\"da_existing_diploma_id\"],select[name$=\"[diploma_id]\"]'), filterPair);\n    }\n  }\n  document.addEventListener('keydown', function(e){ if(isPhoneInput(e.target) && (e.key === ' ' || e.key === 'Spacebar')) e.preventDefault(); }, true);\n  document.addEventListener('beforeinput', function(e){ if(isPhoneInput(e.target) && e.inputType !== 'insertFromPaste' && e.data && \/\\s\/.test(e.data)) e.preventDefault(); }, true);\n  ['input','keyup','change','blur'].forEach(function(evt){\n    document.addEventListener(evt, function(e){ if(isPhoneInput(e.target)) cleanPhone(e.target); }, true);\n  });\n  document.addEventListener('paste', function(e){\n    if(!isPhoneInput(e.target)) return;\n    var el = e.target;\n    var text = '';\n    try { text = (e.clipboardData || window.clipboardData).getData('text') || ''; } catch(err) {}\n    if(text){\n      e.preventDefault();\n      var cleaned = normalizePhone(text);\n      var start = (typeof el.selectionStart === 'number') ? el.selectionStart : el.value.length;\n      var end = (typeof el.selectionEnd === 'number') ? el.selectionEnd : start;\n      if(typeof el.setRangeText === 'function') { el.setRangeText(cleaned, start, end, 'end'); }\n      else { el.value = (el.value || '') + cleaned; }\n      cleanPhone(el);\n      try { el.dispatchEvent(new Event('input', {bubbles:true})); } catch(err2) {}\n    } else {\n      setTimeout(function(){ cleanPhone(el); }, 0);\n    }\n  }, true);\n  document.addEventListener('change', function(e){ if(isDiplomaSelect(e.target)) filterPair(e.target); }, true);\n  document.addEventListener('submit', function(e){\n    if(e.target && e.target.querySelectorAll){ phoneScan(e.target); batchScan(e.target); }\n  }, true);\n  function init(){ phoneScan(document); batchScan(document); }\n  if(document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init); else init();\n  setTimeout(init, 300); setTimeout(init, 1200);\n  if(window.MutationObserver){\n    new MutationObserver(function(muts){\n      muts.forEach(function(m){\n        Array.prototype.forEach.call(m.addedNodes || [], function(n){ if(n && n.nodeType === 1){ phoneScan(n); batchScan(n); } });\n      });\n    }).observe(document.documentElement || document.body, {childList:true, subtree:true});\n  }\n})();<\/script><script>(function(){\n  if(window.DA_SP_INSTALLMENT_UI_REPAIR_0638){ return; }\n  window.DA_SP_INSTALLMENT_UI_REPAIR_0638 = true;\n  function qsa(root, sel){ return Array.prototype.slice.call((root || document).querySelectorAll(sel)); }\n  function closestHost(el){ return (el && el.closest && el.closest('.da-admin-enrollment-card,.da-admin-existing-enrollment-card,.da-sp-grid,form')) || document; }\n  function findByNameEnds(host, suffixes){\n    suffixes = Array.isArray(suffixes) ? suffixes : [suffixes];\n    var fields = qsa(host, 'input,select,textarea');\n    for(var i=0;i<fields.length;i++){\n      var n = fields[i].getAttribute('name') || '';\n      for(var j=0;j<suffixes.length;j++){\n        var suf = suffixes[j];\n        if(n === suf || n.slice(-suf.length) === suf){ return fields[i]; }\n      }\n    }\n    return null;\n  }\n  function toNum(v){ v = String(v || '').replace(\/,\/g,'').trim(); var n = parseFloat(v); return isFinite(n) ? n : 0; }\n  function money(v){ var n = Math.round(toNum(v) * 100) \/ 100; return n ? n.toFixed(2).replace(\/\\.00$\/,'') : ''; }\n  function isoDate(v){\n    v = String(v || '').trim();\n    var m = v.match(\/^(\\d{4})-(\\d{2})-(\\d{2})$\/); if(m) return v;\n    m = v.match(\/^(\\d{1,2})[\\\/-](\\d{1,2})[\\\/-](\\d{4})$\/); if(m) return m[3]+'-'+('0'+m[2]).slice(-2)+'-'+('0'+m[1]).slice(-2);\n    return '';\n  }\n  function addMonths(iso, months){\n    var m = String(iso || '').match(\/^(\\d{4})-(\\d{2})-(\\d{2})$\/); if(!m) return '';\n    var d = new Date(+m[1], +m[2]-1, +m[3]); if(isNaN(d.getTime())) return '';\n    var day = d.getDate(); d.setMonth(d.getMonth() + (+months || 0)); if(d.getDate() !== day){ d.setDate(0); }\n    return d.getFullYear()+'-'+('0'+(d.getMonth()+1)).slice(-2)+'-'+('0'+d.getDate()).slice(-2);\n  }\n  function storeBatchOptions(batch){\n    if(!batch) return;\n    var source = batch.__daRepairAllBatchOptions || batch.__daSpAllOptions0633 || batch.__daAllBatchOptions;\n    if(source && source.length > 1){ batch.__daRepairAllBatchOptions = Array.prototype.map.call(source, function(opt){ return opt.cloneNode(true); }); return; }\n    if(batch.__daRepairAllBatchOptions) return;\n    batch.__daRepairAllBatchOptions = Array.prototype.map.call(batch.options, function(opt){ return opt.cloneNode(true); });\n  }\n  function filterBatches(card){\n    var diploma = card.querySelector('.da-admin-diploma-select, select[name=\"da_existing_diploma_id\"], select[name$=\"[diploma_id]\"]');\n    var batch = card.querySelector('.da-admin-batch-select, select[name=\"da_existing_batch_id\"], select[name$=\"[batch_id]\"]');\n    if(!diploma || !batch) return;\n    storeBatchOptions(batch);\n    var old = String(batch.value || ''); var dip = String(diploma.value || '');\n    batch.innerHTML = '';\n    (batch.__daRepairAllBatchOptions || []).forEach(function(src){\n      var value = String(src.value || '');\n      var od = String(src.getAttribute('data-diploma') || '');\n      if(!value || (dip && od === dip)){ batch.appendChild(src.cloneNode(true)); }\n    });\n    var keep = false; qsa(batch, 'option').forEach(function(o){ if(String(o.value) === old){ keep = true; } });\n    batch.value = keep ? old : '';\n  }\n  function togglePayment(card){\n    var sel = card.querySelector('.da-payment-type-select, select[name=\"da_existing_payment_type\"], select[name=\"da_payment_type\"], select[name$=\"[payment_type]\"]');\n    if(!sel) return;\n    var v = String(sel.value || ''); var isInst = v === 'Installments'; var excluded = (v === 'Free' || v === 'Special Case');\n    card.classList.toggle('is-installments', isInst);\n    card.setAttribute('data-payment-mode', isInst ? 'installments' : (excluded ? 'excluded' : 'standard'));\n    qsa(card, '.da-installments-only,.da-installment-plan-editor').forEach(function(el){ el.style.display = isInst ? '' : 'none'; });\n    qsa(card, '.da-payment-due-field').forEach(function(el){ el.style.display = (!isInst && !excluded) ? '' : 'none'; if(isInst || excluded){ qsa(el,'input').forEach(function(inp){ inp.value=''; }); } });\n    var note = card.querySelector('.da-free-note-field'); if(note){ note.classList.toggle('is-visible', excluded); }\n  }\n  function getCount(card){\n    var inp = findByNameEnds(card, ['[total_installments]','da_existing_total_installments','da_total_installments']);\n    var n = parseInt(inp && inp.value ? inp.value : '0', 10);\n    if(!isFinite(n) || n < 0) n = 0; if(n > 24) n = 24; return n;\n  }\n  function splitAmounts(total, count){\n    var out = []; if(!count) return out;\n    total = Math.round(toNum(total) * 100) \/ 100;\n    if(total <= 0){ for(var x=0;x<count;x++) out.push(''); return out; }\n    var base = Math.floor((total \/ count) * 100) \/ 100;\n    var sum = 0;\n    for(var i=1;i<=count;i++){\n      var val = (i === count) ? Math.round((total - sum) * 100) \/ 100 : base;\n      sum = Math.round((sum + val) * 100) \/ 100;\n      out.push(money(val));\n    }\n    return out;\n  }\n  function regeneratePlan(card, reason){\n    card = closestHost(card);\n    var editor = card.querySelector('.da-installment-plan-editor'); if(!editor) return;\n    var body = editor.querySelector('.da-installment-plan-body'); if(!body) return;\n    var count = getCount(card);\n    var prefix = editor.getAttribute('data-installment-prefix') || '';\n    var amountInput = findByNameEnds(card, ['[installment_amount_usd]','da_existing_installment_amount_usd','da_installment_amount_usd']);\n    var totalInput = findByNameEnds(card, ['[total_fee_usd]','da_existing_total_fee_usd','da_total_fee_usd']);\n    var manualDefault = amountInput && amountInput.getAttribute('data-da-manual-amount') === '1';\n    var total = totalInput ? toNum(totalInput.value) : 0;\n    var defaultAmount = amountInput ? toNum(amountInput.value) : 0;\n    var useSplit = false;\n    if(reason === 'amount'){\n      manualDefault = true; if(amountInput) amountInput.setAttribute('data-da-manual-amount','1');\n    } else if(total > 0 && count > 0 && (!manualDefault || defaultAmount <= 0)){\n      useSplit = true;\n      var per = Math.floor((total \/ count) * 100) \/ 100;\n      if(amountInput){ amountInput.value = money(per); amountInput.setAttribute('data-da-auto-amount','1'); amountInput.removeAttribute('data-da-manual-amount'); }\n    }\n    defaultAmount = amountInput ? toNum(amountInput.value) : 0;\n    editor.style.display = count > 0 ? '' : 'none';\n    var existing = {};\n    qsa(body, 'tr').forEach(function(tr, idx){\n      var nInp = tr.querySelector('.da-installment-number');\n      var n = parseInt(nInp && nInp.value ? nInp.value : (idx+1), 10) || (idx+1);\n      existing[n] = {\n        amount: (tr.querySelector('.da-installment-row-amount') || {}).value || '',\n        due: (tr.querySelector('.da-installment-row-due') || {}).value || '',\n        autoAmount: (tr.querySelector('.da-installment-row-amount') || {}).getAttribute ? (tr.querySelector('.da-installment-row-amount').getAttribute('data-da-auto-amount') === '1') : false,\n        autoDue: (tr.querySelector('.da-installment-row-due') || {}).getAttribute ? (tr.querySelector('.da-installment-row-due').getAttribute('data-da-auto-date') === '1') : false\n      };\n    });\n    var firstIso = existing[1] && existing[1].due ? isoDate(existing[1].due) : '';\n    body.innerHTML = '';\n    var split = splitAmounts(total, count);\n    for(var i=1;i<=count;i++){\n      var saved = existing[i] || {};\n      var amount = '';\n      if(useSplit){ amount = split[i-1] || ''; }\n      else if(reason === 'amount' || !saved.amount || saved.autoAmount){ amount = defaultAmount ? money(defaultAmount) : (saved.amount || ''); }\n      else { amount = saved.amount || ''; }\n      var due = saved.due || '';\n      if(firstIso && i > 1 && (!due || saved.autoDue)){ due = addMonths(firstIso, i-1); }\n      var tr = document.createElement('tr'); tr.setAttribute('data-installment-row', String(i));\n      tr.innerHTML = '<td><input type=\"number\" min=\"1\" step=\"1\" class=\"da-installment-number\" name=\"'+prefix+'['+i+'][number]\" value=\"'+i+'\"><\/td>'+\n        '<td><input type=\"number\" step=\"0.01\" min=\"0\" class=\"da-installment-row-amount\" data-da-auto-amount=\"1\" name=\"'+prefix+'['+i+'][amount]\" value=\"'+amount+'\"><\/td>'+\n        '<td><input type=\"date\" class=\"da-native-date-input da-installment-row-due\" '+(i>1 && due ? 'data-da-auto-date=\"1\" ' : '')+'name=\"'+prefix+'['+i+'][due]\" value=\"'+due+'\"><\/td>';\n      body.appendChild(tr);\n    }\n  }\n  function fillDatesFromFirst(card, overwriteAutoOnly){\n    card = closestHost(card); var body = card.querySelector('.da-installment-plan-body'); if(!body) return;\n    var rows = qsa(body, 'tr'); if(!rows.length) return;\n    var first = rows[0].querySelector('.da-installment-row-due'); var start = isoDate(first && first.value); if(!start) return;\n    rows.forEach(function(tr, idx){ if(idx===0) return; var due = tr.querySelector('.da-installment-row-due'); if(!due) return; if(overwriteAutoOnly && due.value && due.getAttribute('data-da-auto-date') !== '1') return; due.value = addMonths(start, idx); due.setAttribute('data-da-auto-date','1'); });\n  }\n  function initCard(card){ filterBatches(card); togglePayment(card); regeneratePlan(card, 'init'); }\n  function initAll(){ qsa(document, '.da-admin-enrollment-card,.da-admin-existing-enrollment-card').forEach(initCard); renumberCards(); }\n  function renumberCards(){ qsa(document, '.da-admin-enrollment-list .da-admin-enrollment-card').forEach(function(card, idx){ var title = card.querySelector('.da-admin-enrollment-head strong'); if(title) title.textContent = 'Enrollment ' + (idx+1); var rem = card.querySelector('.da-admin-remove-enrollment'); if(rem) rem.style.display = idx === 0 ? 'none' : ''; }); }\n  document.addEventListener('click', function(e){\n    var add = e.target && e.target.closest ? e.target.closest('.da-admin-add-enrollment') : null;\n    if(!add) return;\n    e.preventDefault(); e.stopImmediatePropagation();\n    var list = document.querySelector('.da-admin-enrollment-list'); var tpl = document.getElementById('da-admin-enrollment-template'); if(!list || !tpl) return;\n    var idx = String(Date.now()) + String(Math.floor(Math.random()*1000)); var num = list.querySelectorAll('.da-admin-enrollment-card').length + 1;\n    var html = tpl.innerHTML.replace(\/__i__\/g, idx).replace(\/__num__\/g, String(num)); var wrap = document.createElement('div'); wrap.innerHTML = html.trim(); var card = wrap.firstElementChild; if(!card) return;\n    list.appendChild(card); initCard(card); renumberCards(); try{ card.scrollIntoView({behavior:'smooth', block:'start'}); }catch(err){}\n  }, true);\n  document.addEventListener('click', function(e){\n    var rem = e.target && e.target.closest ? e.target.closest('.da-admin-remove-enrollment') : null; if(!rem) return;\n    var cards = qsa(document, '.da-admin-enrollment-list .da-admin-enrollment-card'); if(cards.length <= 1) return;\n    e.preventDefault(); e.stopImmediatePropagation(); var card = rem.closest('.da-admin-enrollment-card'); if(card) card.remove(); renumberCards();\n  }, true);\n  document.addEventListener('change', function(e){\n    var t = e.target; if(!t) return;\n    var card = closestHost(t);\n    if(t.matches && t.matches('.da-admin-diploma-select, select[name=\"da_existing_diploma_id\"], select[name$=\"[diploma_id]\"]')){ filterBatches(card); }\n    if(t.matches && t.matches('.da-payment-type-select, select[name=\"da_existing_payment_type\"], select[name=\"da_payment_type\"], select[name$=\"[payment_type]\"]')){ togglePayment(card); regeneratePlan(card, 'toggle'); }\n    if(t.matches && t.matches('input[name$=\"[total_installments]\"], input[name=\"da_existing_total_installments\"], input[name=\"da_total_installments\"], input[name$=\"[total_fee_usd]\"], input[name=\"da_existing_total_fee_usd\"], input[name=\"da_total_fee_usd\"]')){ regeneratePlan(card, 'split'); }\n    if(t.matches && t.matches('input[name$=\"[installment_amount_usd]\"], input[name=\"da_existing_installment_amount_usd\"], input[name=\"da_installment_amount_usd\"]')){ regeneratePlan(card, 'amount'); }\n    if(t.classList && t.classList.contains('da-installment-row-due')){ var row = t.closest('tr'); var first = row && row.parentNode ? row.parentNode.querySelector('tr') : null; if(row === first){ fillDatesFromFirst(card, false); } else { t.removeAttribute('data-da-auto-date'); } }\n    if(t.classList && t.classList.contains('da-installment-row-amount')){ t.removeAttribute('data-da-auto-amount'); }\n  }, true);\n  document.addEventListener('input', function(e){\n    var t = e.target; if(!t) return; var card = closestHost(t);\n    if(t.matches && t.matches('input[name$=\"[total_installments]\"], input[name=\"da_existing_total_installments\"], input[name=\"da_total_installments\"], input[name$=\"[total_fee_usd]\"], input[name=\"da_existing_total_fee_usd\"], input[name=\"da_total_fee_usd\"]')){ regeneratePlan(card, 'split'); }\n    if(t.matches && t.matches('input[name$=\"[installment_amount_usd]\"], input[name=\"da_existing_installment_amount_usd\"], input[name=\"da_installment_amount_usd\"]')){ regeneratePlan(card, 'amount'); }\n  }, true);\n  if(document.readyState === 'loading') document.addEventListener('DOMContentLoaded', initAll); else initAll();\n  setTimeout(initAll, 400); setTimeout(initAll, 1200);\n})();<\/script><script>(function(){\n  if(window.DA_SP_BATCH_DROPDOWN_REPAIR_0638){ return; }\n  window.DA_SP_BATCH_DROPDOWN_REPAIR_0638 = true;\n  var MASTER = [{\"value\":\"\",\"label\":\"Select Batch\",\"diploma\":\"\"}];\n  if(!MASTER || !MASTER.length){ MASTER = [{value:'', label:'Select Batch', diploma:''}]; }\n  function qsa(root, sel){ return Array.prototype.slice.call((root || document).querySelectorAll(sel)); }\n  function isBatchSelect(el){ return !!(el && el.matches && el.matches('.da-admin-batch-select, select[name=\"da_batch_id\"], select[name=\"da_existing_batch_id\"], select[name$=\"[batch_id]\"]')); }\n  function isDiplomaSelect(el){ return !!(el && el.matches && el.matches('.da-admin-diploma-select, select[name=\"da_diploma_id\"], select[name=\"da_existing_diploma_id\"], select[name$=\"[diploma_id]\"]')); }\n  function cardOf(el){ return (el && el.closest && el.closest('.da-admin-enrollment-card,.da-admin-existing-enrollment-card,.da-sp-grid,form')) || document; }\n  function findDiploma(card){ return card.querySelector ? card.querySelector('.da-admin-diploma-select, select[name=\"da_diploma_id\"], select[name=\"da_existing_diploma_id\"], select[name$=\"[diploma_id]\"]') : null; }\n  function findBatch(card){ return card.querySelector ? card.querySelector('.da-admin-batch-select, select[name=\"da_batch_id\"], select[name=\"da_existing_batch_id\"], select[name$=\"[batch_id]\"]') : null; }\n  function makeOption(item){ var opt = document.createElement('option'); opt.value = String(item.value || ''); opt.textContent = String(item.label || (item.value ? 'Batch' : 'Select Batch')); opt.setAttribute('data-diploma', String(item.diploma || '')); return opt; }\n  function masterNodes(){ return MASTER.map(makeOption); }\n  function setMasterCaches(batch){\n    if(!batch) return;\n    var nodes = masterNodes();\n    batch.__daAllBatchOptions = nodes.map(function(o){ return o.cloneNode(true); });\n    batch.__daRepairAllBatchOptions = nodes.map(function(o){ return o.cloneNode(true); });\n    batch.__daSpAllOptions0633 = nodes.map(function(o){ return o.cloneNode(true); });\n    try{\n      if(window.jQuery){\n        var jqNodes = nodes.map(function(o){ return window.jQuery(o.cloneNode(true)); });\n        window.jQuery(batch).data('daAllBatchOptions', jqNodes);\n      }\n    }catch(err){}\n  }\n  function optionExists(batch, value){ value = String(value || ''); for(var i=0;i<batch.options.length;i++){ if(String(batch.options[i].value || '') === value){ return true; } } return false; }\n  function rebuild(card){\n    if(!card || !card.querySelector) return;\n    var diploma = findDiploma(card), batch = findBatch(card); if(!diploma || !batch) return;\n    var dip = String(diploma.value || ''); var current = String(batch.value || '');\n    setMasterCaches(batch);\n    batch.innerHTML = '';\n    MASTER.forEach(function(item){\n      var value = String(item.value || ''), od = String(item.diploma || '');\n      if(!value || (dip && od === dip)){ batch.appendChild(makeOption(item)); }\n    });\n    batch.value = (current && optionExists(batch, current)) ? current : '';\n    setMasterCaches(batch);\n  }\n  function rebuildAll(root){\n    root = root || document;\n    qsa(root, '.da-admin-enrollment-card,.da-admin-existing-enrollment-card,.da-sp-grid,form').forEach(rebuild);\n    if(root !== document && root.matches && (isDiplomaSelect(root) || isBatchSelect(root))){ rebuild(cardOf(root)); }\n  }\n  function delayedRebuild(card){ rebuild(card); setTimeout(function(){ rebuild(card); }, 0); setTimeout(function(){ rebuild(card); }, 120); }\n  document.addEventListener('change', function(e){ if(isDiplomaSelect(e.target)){ delayedRebuild(cardOf(e.target)); } }, true);\n  document.addEventListener('input', function(e){ if(isDiplomaSelect(e.target)){ delayedRebuild(cardOf(e.target)); } }, true);\n  ['focus','mousedown','pointerdown','touchstart'].forEach(function(evt){\n    document.addEventListener(evt, function(e){ if(isBatchSelect(e.target)){ delayedRebuild(cardOf(e.target)); } }, true);\n  });\n  document.addEventListener('click', function(e){ if(e.target && e.target.closest && (e.target.closest('.da-admin-add-enrollment') || e.target.closest('.da-admin-remove-enrollment'))){ setTimeout(function(){ rebuildAll(document); }, 0); setTimeout(function(){ rebuildAll(document); }, 200); } }, true);\n  function init(){ rebuildAll(document); }\n  if(document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init); else init();\n  setTimeout(init, 0); setTimeout(init, 350); setTimeout(init, 1400); setTimeout(init, 3000);\n  if(window.MutationObserver){ new MutationObserver(function(muts){ muts.forEach(function(m){ Array.prototype.forEach.call(m.addedNodes || [], function(n){ if(n && n.nodeType === 1){ rebuildAll(n); } }); }); }).observe(document.documentElement || document.body, {childList:true, subtree:true}); }\n})();<\/script>            <div class=\"da-admin-public da-admin-login-panel\">\n                <div class=\"da-admin-login-card\">\n                    <div class=\"da-admin-kicker\">DIETETICS ACADEMY<\/div>\n                    <h1>Academy Admin Panel<\/h1>\n                    <p>Secure access for academy administration, finance, lecture, and marketing teams.<\/p>\n                    <form name=\"loginform\" id=\"loginform\" action=\"https:\/\/drsarahsakr.com\/wp-login.php\" method=\"post\"><p class=\"login-username\">\n\t\t\t\t<label for=\"user_login\">Username or Email Address<\/label>\n\t\t\t\t<input type=\"text\" name=\"log\" id=\"user_login\" autocomplete=\"username\" class=\"input\" value=\"\" size=\"20\" \/>\n\t\t\t<\/p><p class=\"login-password\">\n\t\t\t\t<label for=\"user_pass\">Password<\/label>\n\t\t\t\t<input type=\"password\" name=\"pwd\" id=\"user_pass\" autocomplete=\"current-password\" spellcheck=\"false\" class=\"input\" value=\"\" size=\"20\" \/>\n\t\t\t<\/p><p class=\"login-remember\"><label><input name=\"rememberme\" type=\"checkbox\" id=\"rememberme\" value=\"forever\" \/> Remember Me<\/label><\/p><p class=\"login-submit\">\n\t\t\t\t<input type=\"submit\" name=\"wp-submit\" id=\"wp-submit\" class=\"button button-primary\" value=\"Login to Admin Panel\" \/>\n\t\t\t\t<input type=\"hidden\" name=\"redirect_to\" value=\"https:\/\/drsarahsakr.com\/en\/academy-admin\/\" \/>\n\t\t\t<\/p><\/form>                <\/div>\n            <\/div>\n            \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-5446","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/drsarahsakr.com\/en\/wp-json\/wp\/v2\/pages\/5446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/drsarahsakr.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/drsarahsakr.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/drsarahsakr.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/drsarahsakr.com\/en\/wp-json\/wp\/v2\/comments?post=5446"}],"version-history":[{"count":0,"href":"https:\/\/drsarahsakr.com\/en\/wp-json\/wp\/v2\/pages\/5446\/revisions"}],"wp:attachment":[{"href":"https:\/\/drsarahsakr.com\/en\/wp-json\/wp\/v2\/media?parent=5446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}