<?php
require 'db.php';
require 'functions.php';

if (isLoggedIn() && currentRole() === 'panchayatuser') {
    logActivity($pdo, 'panchayatuser', currentUserId(), 'logout', 'panchayatuser', currentUserId(), 'Panchayat user logged out');
}
$_SESSION = [];
session_destroy();
header('Location: panchayat_login.php');
exit;
