<?php
// Script to fix the marksheet issue - remove fractional values from marks display

$file_path = 'reports/all_subjects_marksheet.php';
$content = file_get_contents($file_path);

// Fix 1: Class max marks should be displayed as whole numbers
$content = str_replace(
    "<?php echo htmlspecialchars(\$result['class_max_marks'] ?: '-'); ?>",
    "<?php echo htmlspecialchars(floor(\$result['class_max_marks']) ?: '-'); ?>",
    $content
);

// Fix 2: Total marks in summary should be displayed as whole numbers
$content = str_replace(
    "<?php echo \$total_obtained; ?>/<?php echo \$total_marks; ?>",
    "<?php echo floor(\$total_obtained); ?>/<?php echo floor(\$total_marks); ?>",
    $content
);

file_put_contents($file_path, $content);
echo "Marksheet fixed successfully!\n";
?>