<?php
/**
 * Test Bill Submission Click Functionality
 */

echo "🧪 Testing Bill Submission Click Functionality\n";
echo "=============================================\n\n";

// Check if the file exists and has the correct onclick
$file = 'fees/bill_submission.php';
if (file_exists($file)) {
    $content = file_get_contents($file);
    
    // Check for onclick in student cards
    if (strpos($content, 'onclick="selectStudent(') !== false) {
        echo "✅ onclick event found in student cards\n";
    } else {
        echo "❌ onclick event not found in student cards\n";
    }
    
    // Check for selectStudent function
    if (strpos($content, 'function selectStudent(') !== false) {
        echo "✅ selectStudent function found\n";
    } else {
        echo "❌ selectStudent function not found\n";
    }
    
    // Check for displayBillForm function
    if (strpos($content, 'function displayBillForm(') !== false) {
        echo "✅ displayBillForm function found\n";
    } else {
        echo "❌ displayBillForm function not found\n";
    }
    
    // Check for data attributes
    if (strpos($content, 'data-student-id') !== false) {
        echo "✅ data-student-id attribute found\n";
    } else {
        echo "❌ data-student-id attribute not found\n";
    }
    
    // Check for bill form area
    if (strpos($content, 'bill-form-area') !== false) {
        echo "✅ bill-form-area element found\n";
    } else {
        echo "❌ bill-form-area element not found\n";
    }
    
} else {
    echo "❌ Bill submission file not found\n";
}

echo "\n🎯 Test completed!\n";
echo "If all tests pass, the click functionality should work.\n";
echo "Visit: http://localhost/bidda/fees/bill_submission.php\n";
?>
