<?php
// Script to fix the syntax error in the bulk_print_marksheets.php file
$file_path = 'reports/bulk_print_marksheets.php';

// Read the file content
$content = file_get_contents($file_path);

// Fix the specific syntax error - remove the extra closing brace
$pattern = '/(\s*\}\s*\}\s*)(\s*\/\/ Enhance results with subject-specific marks distribution and GP)/s';

$replacement = '
        }
        
        // Enhance results with subject-specific marks distribution and GP';

$content = preg_replace($pattern, $replacement, $content);

// Write the fixed content back to the file
file_put_contents($file_path, $content);

echo "Fix v5 applied successfully!\n";
?>