<?php
session_start();
include "../config.php";


// Fetch data
$sql = "SELECT bank_name, email_id FROM nodel_officer";
$result = mysqli_query($con, $sql);

// File Name
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=bank_nodel_list.xls");

echo "Sr No\tBank Name\tEmail\n";

$sr = 1;
while ($row = mysqli_fetch_assoc($result)) {

    // Keep semicolon format for Excel
    $email = $row['email_id'];

    echo $sr . "\t" . $row['bank_name'] . "\t" . $email . "\n";
    $sr++;
}
?>