Bhāva Student Import

No school selected

Import Students from CSV

CSV format (first row = header, columns in any order):

roll_no,name,class,section 1,Arjun Reddy,6,A 2,Priya Sharma,6,A 3,Kavya Nair,6,B

📄

Click to choose a CSV file or drag and drop it here

Supports .csv and .txt files

Add Single Student

All Students

Roll NoNameClassSectionPINStatusAction
Load a school to view students.
`; var w = window.open('', '_blank'); w.document.write(html); w.document.close(); w.print(); } // ── Sync to Cloud ─────────────────────────────────────────────────────────────── async function syncToCloud() { if (!schoolId) { alert('Enter a School ID first.'); return; } const btn = document.getElementById('syncCloudBtn'); const msg = document.getElementById('sync-msg'); btn.disabled = true; btn.textContent = '⏳ Syncing…'; msg.style.color = '#64748b'; msg.textContent = 'Uploading students to cloud…'; try { // Get all students from local DB via IPC const students = await window.bhava.getStudents(schoolId); if (!students || students.length === 0) { msg.style.color = '#f59e0b'; msg.textContent = '⚠️ No students found. Load students first.'; return; } // POST to cloud const res = await fetch('https://bhava-cloud.onrender.com/sync/students', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-bhava-sync-key': '0042bfd36ef4a5a219e0bbb206e58ec7b84c7d9334b75c7e' }, body: JSON.stringify({ school_id: schoolId, students: students.map(s => ({ id: s.id, roll_no: s.roll_no || s.roll_number, name: s.name, class: s.class, section: s.section || '', pin: s.pin || '', is_active: s.is_active !== false })) }) }); const result = await res.json(); if (res.ok) { msg.style.color = '#22c55e'; msg.textContent = `✓ ${students.length} students synced to cloud. Login works from any device now.`; } else { msg.style.color = '#ef4444'; msg.textContent = `✗ Sync failed: ${result.error || 'Unknown error'}`; } } catch (e) { msg.style.color = '#ef4444'; msg.textContent = `✗ Error: ${e.message}`; } finally { btn.disabled = false; btn.textContent = '☁️ Sync to Cloud'; } }