Healthcare professionals
person
1. Personal Info Step 1 of 3
medical_services
2. Clinical Details Step 2 of 3
done_all
3. Complete Step 3 of 3

Start your application

Please enter your basic contact details and identity information.

person
badge
mail
call
calendar_month
shield_lock

Privacy & Security Guarantee

Your data is encrypted and secure. We only use this information for job placement and credentialing purposes.

Already registered? Sign In
+ Number(progData.bonusAmount).toLocaleString(); } if (banner) { banner.classList.remove('hidden'); } } }).catch(err => console.warn('Could not lookup referral info:', err)); } } catch (refErr) { console.warn('Error reading referral params:', refErr); } try { const res = await PublicAPI.getStates(); if (res && res.success && Array.isArray(res.states)) { const select = document.getElementById('regState'); if (select) { select.innerHTML = ''; res.states.forEach(state => { const opt = document.createElement('option'); opt.value = state.Pk_StateID; opt.textContent = `${state.StateCode} - ${state.StateName}`; select.appendChild(opt); if (state.StateCode === 'VA') { select.value = state.Pk_StateID; } }); } } } catch (err) { console.error('Error loading states dynamically:', err); } // Add real-time field change/blur listeners const fieldsToValidate = [ 'regFirstName', 'regLastName', 'regEmail', 'regPhone', 'regDOB', 'regCategory', 'regExperience', 'regState', 'regStartDate', 'regTerms' ]; fieldsToValidate.forEach(fieldId => { const el = document.getElementById(fieldId); if (el) { const eventName = (el.tagName === 'SELECT' || el.type === 'date' || el.type === 'checkbox') ? 'change' : 'blur'; el.addEventListener(eventName, () => { validateField(fieldId); }); el.addEventListener('input', () => { const errSpan = document.getElementById('err-' + fieldId); if (errSpan && !errSpan.classList.contains('hidden')) { validateField(fieldId); } }); } }); // Reset registration status if key credentials are edited const fieldsToResetReg = ['regEmail', 'regPhone', 'regFirstName', 'regLastName']; fieldsToResetReg.forEach(fieldId => { document.getElementById(fieldId)?.addEventListener('change', () => { isRegistered = false; registeredToken = ''; }); }); // Auto-formatting for Phone const phoneInput = document.getElementById('regPhone'); if (phoneInput) { phoneInput.addEventListener('input', (e) => { e.target.value = formatPhoneNumber(e.target.value); }); } // OTP Inputs Focus Navigation & Paste const otpInputs = document.querySelectorAll('.otp-input'); otpInputs.forEach((input, index) => { input.addEventListener('keyup', (e) => { if (e.key >= '0' && e.key <= '9' && input.value.length === 1 && index < otpInputs.length - 1) { otpInputs[index + 1].focus(); } else if (e.key === 'Backspace' && index > 0) { otpInputs[index - 1].focus(); } }); input.addEventListener('paste', (e) => { e.preventDefault(); const pasteData = (e.clipboardData || window.clipboardData).getData('text').replace(/\D/g, ''); if (!pasteData) return; for (let i = 0; i < otpInputs.length; i++) { if (pasteData[i]) otpInputs[i].value = pasteData[i]; } if (otpInputs[5].value) document.getElementById('btnCompleteRegister').focus(); }); }); // Resend OTP handler document.getElementById('btnResendRegisterOtp')?.addEventListener('click', async () => { const btn = document.getElementById('btnResendRegisterOtp'); btn.disabled = true; btn.textContent = 'Sending...'; try { const response = await fetch('/api/auth/send-confirm-otp', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email: registeredEmail }) }); const data = await response.json(); if (response.ok && data.success) { Swal.fire('Code Sent', 'A new 6-digit verification code has been sent to your email.', 'success'); } else { Swal.fire('Resend Failed', data.message || 'Failed to resend code. Please try again.', 'error'); } } catch (err) { console.error(err); Swal.fire('Error', 'Error resending verification code.', 'error'); } finally { btn.disabled = false; btn.textContent = 'Resend Code'; } }); }); async function goToStep(step) { // Validate step progression if (step > currentStep) { if (currentStep === 1 && !validateStep(1)) return; if (currentStep === 2) { if (!validateStep(1) || !validateStep(2)) return; // Trigger backend registration (sends verification OTP) before showing Step 3 if (step === 3) { const success = await triggerUserRegistration(); if (!success) return; // Block step transition if registration API fails } } if (step === 3 && currentStep === 1) { if (!validateStep(1) || !validateStep(2)) return; const success = await triggerUserRegistration(); if (!success) return; } } currentStep = step; // Show wizard indicator bar back if going back to steps document.getElementById('stepIndicatorContainer')?.classList.remove('hidden'); const step1View = document.getElementById('step1-view'); const step2View = document.getElementById('step2-view'); const step3View = document.getElementById('step3-view'); const s1Ind = document.getElementById('step1-indicator'); const s1Circ = document.getElementById('step1-circle'); const s1Icon = document.getElementById('step1-icon'); const s1Sub = document.getElementById('step1-sub'); const s2Ind = document.getElementById('step2-indicator'); const s2Circ = document.getElementById('step2-circle'); const s2Icon = document.getElementById('step2-icon'); const s2Sub = document.getElementById('step2-sub'); const s3Ind = document.getElementById('step3-indicator'); const s3Circ = document.getElementById('step3-circle'); const s3Icon = document.getElementById('step3-icon'); const s3Sub = document.getElementById('step3-sub'); const progressBar = document.getElementById('step-progress-bar'); function setStepState(ind, circ, icon, defaultIcon, sub, state) { if (!ind || !circ || !icon || !sub) return; if (state === 'active') { ind.className = 'flex items-center gap-2 md:gap-3 p-2 md:p-3 rounded-xl bg-white border border-primary/30 shadow-sm cursor-pointer transition-all duration-200 opacity-100'; circ.className = 'w-9 h-9 md:w-10 md:h-10 rounded-lg bg-primary text-white font-extrabold text-sm flex items-center justify-center shrink-0 shadow-sm'; icon.textContent = defaultIcon; sub.className = 'text-[10px] md:text-[11px] text-primary font-bold block truncate'; } else if (state === 'completed') { ind.className = 'flex items-center gap-2 md:gap-3 p-2 md:p-3 rounded-xl bg-primary/5 border border-primary/20 cursor-pointer transition-all duration-200 opacity-100'; circ.className = 'w-9 h-9 md:w-10 md:h-10 rounded-lg bg-primary/20 text-primary font-extrabold text-sm flex items-center justify-center shrink-0'; icon.textContent = 'check'; sub.className = 'text-[10px] md:text-[11px] text-primary/80 font-semibold block truncate'; } else { ind.className = 'flex items-center gap-2 md:gap-3 p-2 md:p-3 rounded-xl bg-slate-100/60 border border-transparent cursor-pointer opacity-60 transition-all duration-200'; circ.className = 'w-9 h-9 md:w-10 md:h-10 rounded-lg bg-white border border-slate-300 text-slate-500 font-extrabold text-sm flex items-center justify-center shrink-0'; icon.textContent = defaultIcon; sub.className = 'text-[10px] md:text-[11px] text-slate-400 font-medium block truncate'; } } if (step === 1) { step1View.classList.remove('hidden'); step2View.classList.add('hidden'); step3View.classList.add('hidden'); setStepState(s1Ind, s1Circ, s1Icon, 'person', s1Sub, 'active'); setStepState(s2Ind, s2Circ, s2Icon, 'medical_services', s2Sub, 'inactive'); setStepState(s3Ind, s3Circ, s3Icon, 'shield', s3Sub, 'inactive'); if (progressBar) progressBar.style.width = '33.33%'; } else if (step === 2) { step1View.classList.add('hidden'); step2View.classList.remove('hidden'); step3View.classList.add('hidden'); setStepState(s1Ind, s1Circ, s1Icon, 'person', s1Sub, 'completed'); setStepState(s2Ind, s2Circ, s2Icon, 'medical_services', s2Sub, 'active'); setStepState(s3Ind, s3Circ, s3Icon, 'shield', s3Sub, 'inactive'); if (progressBar) progressBar.style.width = '66.66%'; } else if (step === 3) { step1View.classList.add('hidden'); step2View.classList.add('hidden'); step3View.classList.remove('hidden'); setStepState(s1Ind, s1Circ, s1Icon, 'person', s1Sub, 'completed'); setStepState(s2Ind, s2Circ, s2Icon, 'medical_services', s2Sub, 'completed'); setStepState(s3Ind, s3Circ, s3Icon, 'done_all', s3Sub, 'active'); if (progressBar) progressBar.style.width = '100%'; } window.scrollTo({ top: 120, behavior: 'smooth' }); } async function handleRegistrationSubmit(e) { e.preventDefault(); // Enforce Term verification if (!validateField('regTerms')) return; // Extract OTP Code const otpInputs = document.querySelectorAll('.otp-input'); let otpCode = ''; otpInputs.forEach(i => otpCode += i.value.trim()); const errOtp = document.getElementById('err-otpCode'); if (errOtp) { errOtp.classList.add('hidden'); errOtp.textContent = ''; } if (otpCode.length !== 6 || !/^\d{6}$/.test(otpCode)) { if (errOtp) { errOtp.textContent = 'Please enter the full 6-digit verification code.'; errOtp.classList.remove('hidden'); } return; } const btn = document.getElementById('btnCompleteRegister'); btn.disabled = true; btn.innerHTML = 'sync Verifying & Completing...'; try { const response = await fetch('/api/auth/verify-confirm-otp', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email: registeredEmail, otp: otpCode }) }); const data = await response.json(); if (response.ok && data.success) { // Attempt to save profile details entered during onboarding before redirect try { const dob = document.getElementById('regDOB') ? document.getElementById('regDOB').value : null; const category = document.getElementById('regCategory') ? document.getElementById('regCategory').value : null; const experience = document.getElementById('regExperience') ? document.getElementById('regExperience').value : ''; const state = document.getElementById('regState') ? document.getElementById('regState').value : null; const profileBody = { dateOfBirth: dob || null, category: category ? Number(category) : null, yearsofExperience: experience || '', stateId: state || null }; await fetch('/api/user-profile/personal', { method: 'PUT', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${data.token || registeredToken}` }, body: JSON.stringify(profileBody) }); } catch (profileErr) { console.error('Failed to sync profile onboarding details:', profileErr); } const finalToken = data.token || registeredToken; if (finalToken) { localStorage.setItem('bilkins_token', finalToken); localStorage.setItem('bilkins_user', JSON.stringify(data.user || { email: registeredEmail, role: 'user' })); } Swal.fire({ icon: 'success', title: 'Verified!', text: 'Email verified successfully! Logging you in...', timer: 1500, showConfirmButton: false }); setTimeout(() => { window.location.href = '/user/index.html'; }, 1200); } else { if (errOtp) { errOtp.textContent = data.message || 'Invalid verification code. Please check and try again.'; errOtp.classList.remove('hidden'); } btn.disabled = false; btn.innerHTML = 'Complete Registration check_circle'; } } catch (err) { console.error('Verification error:', err); Swal.fire('Verification Error', 'Verification failed due to a server error. Please try again.', 'error'); btn.disabled = false; btn.innerHTML = 'Complete Registration check_circle'; } }