HEX
Server: nginx/1.24.0
System: Linux webserver-one 6.8.0-101-generic #101-Ubuntu SMP PREEMPT_DYNAMIC Mon Feb 9 10:15:05 UTC 2026 x86_64
User: www-data (33)
PHP: 8.4.18
Disabled: NONE
Upload Files
File: /srv/www/rectt-csmcri.res.in/public_html/pdf_scientist.php
<?php
// session_start();
// ini_set("display_errors", 1);
// ini_set("display_startup_errors", 1);
// error_reporting(E_ALL);
require_once 'sites/config/config.php';

function getScientistSummaryHtml($application_id)
{
    global $conn;

    $fieldval = fn($v) => ($v !== null && $v !== '') ? htmlspecialchars($v) : '<em>-</em>';
    $dateFormat = fn($d) => ($d && $d !== '0000-00-00') ? date('d-m-Y', strtotime($d)) : '<em>-</em>';

    // Fetch main application
    $stmt = $conn->prepare("SELECT * FROM scientist_applications WHERE id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $app = $stmt->get_result()->fetch_assoc();
    $stmt->close();

    if (!$app) {
        return "<div style='color:#a00;text-align:center;margin-top:50px;'>Application not found.</div>";
    }

    // Determine exemption status from available fields
    $category = $_SESSION['category'] ?? 'General';
    $gender = $_SESSION['gender'] ?? '';
    $ex_servicemen = $_SESSION['ex_servicemen'] ?? '';
    $csir_employee = $_SESSION['csir_employee'] ?? '';
    $disability = $_SESSION['disability'] ?? 'No';

    $is_exempt = in_array($category, ['SC', 'ST']) ||
        $gender === 'Female' ||
        $ex_servicemen === 'Yes' ||
        $csir_employee === 'Yes' ||
        $disability === 'Yes';


    // Fetch PhD details
    $stmt = $conn->prepare("SELECT * FROM scientist_phd_details WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $phd = $stmt->get_result()->fetch_assoc();
    $stmt->close();

    // Fetch qualifications
    $stmt = $conn->prepare("SELECT * FROM scientist_qualifications WHERE application_id = ? ORDER BY FIELD(qualification_type, 'SSC', 'HSC', 'B.E./B.Tech.', 'M.E./M.Tech.', 'BSc', 'MSc')");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $quals = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
    $stmt->close();

    // Fetch experiences
    $stmt = $conn->prepare("SELECT * FROM scientist_experiences WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $exps = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
    $stmt->close();

    // Fetch scientific contributions
    $stmt = $conn->prepare("SELECT * FROM scientific_contributions WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $sci_contribs = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
    $stmt->close();

    // Fetch publications
    $stmt = $conn->prepare("SELECT * FROM scientist_publications WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $pubs = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
    $stmt->close();

    // Fetch patents
    $stmt = $conn->prepare("SELECT * FROM scientist_patents WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $patents = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
    $stmt->close();

    // Fetch books
    $stmt = $conn->prepare("SELECT * FROM scientist_books WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $books = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
    $stmt->close();

    // Fetch seminars
    $stmt = $conn->prepare("SELECT * FROM scientist_seminars WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $seminars = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
    $stmt->close();

    // Fetch awards
    $stmt = $conn->prepare("SELECT * FROM scientist_awards WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $awards = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
    $stmt->close();

    // Fetch visits
    $stmt = $conn->prepare("SELECT * FROM scientist_visits WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $visits = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
    $stmt->close();

    // Fetch referees
    $stmt = $conn->prepare("SELECT * FROM scientist_referees WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $referees = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
    $stmt->close();

    // Fetch uploads
    $uploads = [];
    $stmt = $conn->prepare("SELECT document_type, file_path FROM scientist_uploads WHERE application_id = ?");
    $stmt->bind_param("i", $application_id);
    $stmt->execute();
    $res = $stmt->get_result();
    while ($row = $res->fetch_assoc()) {
        $uploads[$row['document_type']] = $row['file_path'];
    }
    $stmt->close();

    ob_start();
?>
    <!DOCTYPE html>
    <html lang="en">

    <head>
        <meta charset="UTF-8">
        <title>Scientist Application Summary</title>
        <style>
            body {
                font-family: Arial, sans-serif;
                background: #fff;
                color: #222;
            }

            .main-table {
                width: 830px;
                margin: 0 auto 28px auto;
            }

            h2 {
                font-size: 16px;
                color: #333;
                font-weight: bold;
                margin: 38px 0 16px 0;
                text-align: left;
            }

            table,
            .qual-table,
            .exp-table,
            .upload-table {
                width: 100%;
                border-collapse: collapse;
                font-size: 13px;
                margin-bottom: 14px;
            }

            th {
                background: #fafafb;
                color: #555;
                font-weight: bold;
                padding: 7px 8px;
                border: 1px solid #e4e4e4;
            }

            td {
                padding: 7px 8px;
                border: 1px solid #e4e4e4;
                vertical-align: top;
            }

            tr:last-child td {
                border-bottom: none;
            }

            .not-uploaded {
                color: #b0b0b0;
                font-style: italic;
                text-align: center;
            }

            .section-divider {
                border: none;
                border-top: 1px solid #ddd;
                margin: 28px 0;
            }

            .label {
                width: 300px;
                color: #444;
                font-weight: 500;
            }

            .value {
                color: #000;
            }

            em {
                color: #888;
            }

            /* PHOTO & SIGNATURE TABLE */
            .photo-sign-table {
                width: 100%;
                margin: 28px 0 28px 0;
                border: none;
            }

            .photo-sign-label {
                font-size: 14px;
                font-weight: bold;
                color: #222;
                margin-bottom: 8px;
                display: block;
            }

            .photo-sign-img {
                width: 120px;
                height: auto;
                border: 2px solid #bbb;
                border-radius: 6px;
                background: #f9f9f9;
                margin: 0 auto 6px auto;
                display: block;
            }

            .sign-img {
                width: 100px;
                height: auto;
                border: 2px solid #bbb;
                border-radius: 6px;
                background: #f9f9f9;
                margin: 0 auto 6px auto;
                display: block;
            }

            .bottom-section {
                font-size: 13px;
                margin: 16px 0 30px 0;
            }

            .declaration-row {
                margin-top: 18px;
            }

            .checkbox-checked {
                display: inline-block;
                width: 15px;
                height: 15px;
                border: 1.6px solid #007e32;
                border-radius: 3px;
                background: #e7f7ea;
                text-align: center;
                vertical-align: middle;
            }

            .checkbox-checked-tick {
                font-size: 12px;
                color: #007e32;
                font-weight: bold;
                position: relative;
                top: -2px;
            }

            .declaration-text {
                color: #222;
                background: #f7f7f8;
                padding: 9px 15px;
                border-radius: 7px;
                display: inline-block;
                margin-left: 8px;
                font-size: 13px;
            }

            .right {
                text-align: right;
            }
        </style>
    </head>

    <body>
        <div class="main-table">
            <hr class="section-divider">
            <h2>Educational Qualifications</h2>
            <?php if ($quals): ?>
                <table>
                    <tr>
                        <th>Qualification</th>
                        <th>School/College</th>
                        <th>Board/University</th>
                        <th>Subjects Studied/ Thesis Topic</th>
                        <th>Marks</th>
                        <th>Scale</th>
                        <th>Passing Date</th>
                        <th>Mode of Study</th>
                        <th>Remarks</th>
                    </tr>
                    <?php foreach ($quals as $q): ?>
                        <tr>
                            <td><?= $fieldval($q['qualification_type']) ?></td>
                            <td><?= $fieldval($q['school_college']) ?></td>
                            <td><?= $fieldval($q['board_university']) ?></td>
                            <td><?= $fieldval($q['subjects']) ?></td>
                            <td><?= $fieldval($q['marks']) ?></td>
                            <td><?= $fieldval($q['scale']) ?></td>
                            <td><?= $dateFormat($q['passing_date']) ?></td>
                            <td><?= $fieldval($q['mode_of_study']) ?></td>
                            <td><?= $fieldval($q['remarks']) ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No qualifications provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Ph.D. Details</h2>
            <?php if ($phd): ?>
                <table>
                    <tr>
                        <td class="label">Status</td>
                        <td class="value"><?= $fieldval($phd['status']) ?></td>
                    </tr>
                    <tr>
                        <td class="label">Guide Name</td>
                        <td class="value"><?= $fieldval($phd['guide_name']) ?></td>
                    </tr>
                    <tr>
                        <td class="label">Guide Email</td>
                        <td class="value"><?= $fieldval($phd['guide_email']) ?></td>
                    </tr>
                    <tr>
                        <td class="label">Date of Submission/Award of Ph.D.</td>
                        <td class="value"><?= $dateFormat($phd['date']) ?></td>
                    </tr>
                    <tr>
                        <td class="label">Title of the thesis</td>
                        <td class="value"><?= $fieldval($phd['title']) ?></td>
                    </tr>
                    <tr>
                        <td class="label">Relevant Area</td>
                        <td class="value"><?= $fieldval($phd['area']) ?></td>
                    </tr>
                    <tr>
                        <td class="label">Department</td>
                        <td class="value"><?= $fieldval($phd['department']) ?></td>
                    </tr>
                    <tr>
                        <td class="label">University</td>
                        <td class="value"><?= $fieldval($phd['university']) ?></td>
                    </tr>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No Ph.D. details provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Work Experience</h2>
            <?php if ($exps): ?>
                <table>
                    <tr>
                        <th>Type of Organization</th>
                        <th>Name of the Organization</th>
                        <th>Position Held</th>
                        <th>Nature of Work</th>
                        <th>Last Pay Drawn</th>
                        <th>Status of Job</th>
                        <th>From</th>
                        <th>To</th>
                    </tr>
                    <?php foreach ($exps as $e): ?>
                        <tr>
                            <td><?= $fieldval($e['org_type']) ?></td>
                            <td><?= $fieldval($e['organization']) ?></td>
                            <td><?= $fieldval($e['designation']) ?></td>
                            <td><?= $fieldval($e['nature']) ?></td>
                            <td><?= $fieldval($e['last_pay']) ?></td>
                            <td><?= $fieldval($e['status_of_job']) ?></td>
                            <td><?= $dateFormat($e['from_date']) ?></td>
                            <td><?= $dateFormat($e['to_date']) ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No experience provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Scientific Contributions</h2>
            <?php if ($sci_contribs): ?>
                <table>
                    <tr>
                        <th>Section</th>
                        <th>Contributed</th>
                        <th>Patented</th>
                        <th>Patent Details</th>
                    </tr>
                    <?php foreach ($sci_contribs as $sc): ?>
                        <tr>
                            <td><?= $fieldval($sc['section']) ?></td>
                            <td><?= $fieldval($sc['contributed']) ?></td>
                            <td><?= $fieldval($sc['patented']) ?></td>
                            <td><?= nl2br($fieldval($sc['patent_details'])) ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No scientific contributions provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Publication Details</h2>
            <?php if ($pubs): ?>
                <table>
                    <tr>
                        <th>Journal Type</th>
                        <th>Title of the paper</th>
                        <th>Authorship</th>
                        <th>Total No. of Authors</th>
                        <th>Journal Name</th>
                        <th>Year</th>
                        <th>Volume No.</th>
                        <th>Page No.</th>
                        <th>No. of Citations</th>
                        <th>Impact Factor</th>
                        <th>Paper</th>
                    </tr>
                    <?php foreach ($pubs as $p): ?>
                        <tr>
                            <td><?= $fieldval($p['journal_type']) ?></td>
                            <td><?= $fieldval($p['paper_title']) ?></td>
                            <td><?= $fieldval($p['authorship']) ?></td>
                            <td><?= $fieldval($p['total_authors']) ?></td>
                            <td><?= $fieldval($p['journal_name']) ?></td>
                            <td><?= $fieldval($p['year']) ?></td>
                            <td><?= $fieldval($p['volume_no']) ?></td>
                            <td><?= $fieldval($p['page_no']) ?></td>
                            <td><?= $fieldval($p['citations']) ?></td>
                            <td><?= $fieldval($p['impact_factor']) ?></td>
                            <td><?= ($p['file_path'] && file_exists($p['file_path'])) ? 'Uploaded' : '<em>Not uploaded</em>' ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No publications provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Patents filed/granted</h2>
            <?php if ($patents): ?>
                <table>
                    <tr>
                        <th>Title</th>
                        <th>Inventor(s)</th>
                        <th>Status</th>
                        <th>Country of registeration</th>
                        <th>Patent Number</th>
                        <th>Patent Seal & Date</th>
                    </tr>
                    <?php foreach ($patents as $pat): ?>
                        <tr>
                            <td><?= $fieldval($pat['title']) ?></td>
                            <td><?= $fieldval($pat['inventors']) ?></td>
                            <td><?= $fieldval($pat['status']) ?></td>
                            <td><?= $fieldval($pat['country']) ?></td>
                            <td><?= $fieldval($pat['patent_no']) ?></td>
                            <td><?= $dateFormat($pat['patent_date']) ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No patents provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Books/Chapters Details</h2>
            <?php if ($books): ?>
                <table>
                    <tr>
                        <th>Book Title</th>
                        <th>Chapter Title</th>
                        <th>Publication Agency</th>
                        <th>Role</th>
                    </tr>
                    <?php foreach ($books as $b): ?>
                        <tr>
                            <td><?= $fieldval($b['book_title']) ?></td>
                            <td><?= $fieldval($b['chapter_title']) ?></td>
                            <td><?= $fieldval($b['publication_agency']) ?></td>
                            <td><?= $fieldval($b['role']) ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No books or chapters provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Paper read/presented in Seminar/Symposium/Conference</h2>
            <?php if ($seminars): ?>
                <table>
                    <tr>
                        <th>Name of the Seminar/Symposium/Conference</th>
                        <th>Title of the paper read/presented</th>
                        <th>Place</th>
                        <th>Date</th>
                        <th>Organizer (with address)</th>
                    </tr>
                    <?php foreach ($seminars as $s): ?>
                        <tr>
                            <td><?= $fieldval($s['event_name']) ?></td>
                            <td><?= $fieldval($s['paper_title']) ?></td>
                            <td><?= $fieldval($s['place']) ?></td>
                            <td><?= $dateFormat($s['date']) ?></td>
                            <td><?= $fieldval($s['organizer']) ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No seminars or conferences provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Awards/Honours</h2>
            <?php if ($awards): ?>
                <table>
                    <tr>
                        <th>Name of the Award/Honour</th>
                        <th>Year</th>
                        <th>Sponsoring organization/agency with address</th>
                    </tr>
                    <?php foreach ($awards as $a): ?>
                        <tr>
                            <td><?= $fieldval($a['name']) ?></td>
                            <td><?= $fieldval($a['year']) ?></td>
                            <td><?= $fieldval($a['sponsor']) ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No awards provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Country visited</h2>
            <?php if ($visits): ?>
                <table>
                    <tr>
                        <th>Name of the country visited</th>
                        <th>From Date</th>
                        <th>To Date</th>
                        <th>Institute/organization/agency visited (with address)</th>
                        <th>Purpose</th>
                        <th>Sponsorer (name & address)</th>
                    </tr>
                    <?php foreach ($visits as $v): ?>
                        <tr>
                            <td><?= $fieldval($v['country']) ?></td>
                            <td><?= $dateFormat($v['from_date']) ?></td>
                            <td><?= $dateFormat($v['to_date']) ?></td>
                            <td><?= $fieldval($v['institute']) ?></td>
                            <td><?= $fieldval($v['purpose']) ?></td>
                            <td><?= $fieldval($v['sponsorer']) ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No country visits provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Referees</h2>
            <?php if ($referees): ?>
                <table>
                    <tr>
                        <th>Name of the Referee</th>
                        <th>Occupation or Position held</th>
                        <th>Postal address</th>
                        <th>Mobile No.</th>
                        <th>Email</th>
                    </tr>
                    <?php foreach ($referees as $r): ?>
                        <tr>
                            <td><?= $fieldval($r['name']) ?></td>
                            <td><?= $fieldval($r['occupation']) ?></td>
                            <td><?= $fieldval($r['address']) ?></td>
                            <td><?= $fieldval($r['mobile']) ?></td>
                            <td><?= $fieldval($r['email']) ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php else: ?>
                <div class="not-uploaded">No referees provided.</div>
            <?php endif; ?>

            <hr class="section-divider">
            <h2>Uploaded Documents</h2>
            <table class="upload-table">
                <thead>
                    <tr>
                        <th>Document Type</th>
                        <th>Uploaded</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    $docLabels = [
                        'SSC Marksheet'           => '10th/SSC Marksheet',
                        'HSC Marksheet'           => '12th/Intermediate',
                        'B.E._B.Tech. Marksheet'  => 'B.E./B.Tech. Marksheet',
                        'M.E._M.Tech. Marksheet'  => 'M.E./M.Tech./Equal Marksheet',
                        'BSc Marksheet'           => 'BSc Marksheet',
                        'MSc Marksheet'           => 'MSc Marksheet',
                        'Ph.D. Certificate'       => 'Ph.D. Certificate',
                    ];
                    $skip = ['photograph', 'signature'];
                    ?>
                    <?php foreach ($uploads as $type => $path): ?>
                        <?php if (!in_array(strtolower($type), $skip, true)): ?>
                            <tr>
                                <td>
                                    <?php
                                    $label = $docLabels[$type] ?? ucwords(str_replace('_', ' ', $type));
                                    echo htmlspecialchars($label, ENT_QUOTES, 'UTF-8');
                                    ?>
                                </td>
                                <td>
                                    <?= ($path && file_exists($path))
                                        ? 'Yes'
                                        : '<span class="not-uploaded">No</span>' ?>
                                </td>
                            </tr>
                        <?php endif; ?>
                    <?php endforeach; ?>
                </tbody>
            </table>

            <hr class="section-divider">

            <h2>Other Details</h2>
            <table>
                <tr>
                    <td class="label">Briefly explain your R&D experience</td>
                    <td class="value"><?= nl2br($fieldval($app['rd_experience'])) ?></td>
                </tr>
                <tr>
                    <td class="label">Statement of Purpose</td>
                    <td class="value"><?= nl2br($fieldval($app['statement_of_purpose'])) ?></td>
                </tr>
                <tr>
                    <td class="label">Are you willing to accept the minimum initial pay offered?</td>
                    <td class="value"><?= $fieldval($app['min_initial_pay']) ?></td>
                </tr>
                <tr>
                    <td class="label">If not, please state the initial lowest pay that you would accept in the prescribed scale</td>
                    <td class="value"><?= $fieldval($app['expected_pay']) ?></td>
                </tr>
                <tr>
                    <td class="label">If selected, minimum time to join</td>
                    <td class="value"><?= $fieldval($app['joining_time']) ?></td>
                </tr>
            </table>

            <hr class="section-divider">

            <h2>Payment Reference</h2>
            <table>
                <tr>
                    <td class="label">Payment Reference No.</td>
                    <td class="value"><?= $fieldval($app['payment_reference_no']) ?></td>
                </tr>
                <?php if (!$is_exempt): ?>
                    <tr>
                        <td class="label">Payment Date</td>
                        <td class="value"><?= $dateFormat($app['payment_date'] ?? '') ?></td>
                    </tr>
                <?php endif; ?>
            </table>


            <hr class="section-divider">

            <!-- PHOTO & SIGNATURE TABLE -->
            <table class="photo-sign-table">
                <tr>
                    <td align="center" valign="top">
                        <span class="photo-sign-label">Photograph</span><br>
                        <?php if (!empty($uploads['Photograph']) && file_exists($uploads['Photograph'])): ?>
                            <img class="photo-sign-img" src="<?= htmlspecialchars($uploads['Photograph']) ?>" alt="Photograph">
                        <?php else: ?>
                            <span class="not-uploaded">Not uploaded</span>
                        <?php endif; ?>
                    </td>
                    <td align="center" valign="top">
                        <span class="photo-sign-label">Signature</span><br>
                        <?php if (!empty($uploads['Signature']) && file_exists($uploads['Signature'])): ?>
                            <img class="sign-img" src="<?= htmlspecialchars($uploads['Signature']) ?>" alt="Signature">
                        <?php else: ?>
                            <span class="not-uploaded">Not uploaded</span>
                        <?php endif; ?>
                    </td>
                </tr>
            </table>

            <hr class="section-divider">

            <div class="bottom-section">
                <div class="declaration-row">
                    <span class="checkbox-checked"><span class="checkbox-checked-tick">&#10003;</span></span>
                    <span class="declaration-text">
                        I, hereby, declare that all the statements made in this application are true, complete and correct to the best of my knowledge and belief.
                        In the event of any information being found false or incorrect or any ineligibility being detected before or after the selection, my candidature is liable to be cancelled and action can be initiated against me.
                    </span>
                </div>
                <div class="right" style="color:#555;font-size:1.02rem;margin-top:35px;">
                    <b>Submitted On:</b> <?= $dateFormat($app['created_at']) ?>
                </div>
            </div>
        </div>
    </body>

    </html>
<?php
    $data = ob_get_clean();
    return $data;
}

// $data = getScientistSummaryHtml(32);
// require_once dirname(__DIR__) . "/vendor/autoload.php";

// // Use the custom temporary directory setting
// $mpdf = new \Mpdf\Mpdf([
//     "tempDir" => dirname(__DIR__) . "/tmp", // Custom writable tmp directory
// ]);

// // Define the output directory and filename
// $outputDir = "sites/upload"; // 'applications' folder outside public_html
// $outputFilename = "1SUMMMm" . ".pdf";

// $outputPath = $outputDir . "/" . $outputFilename;
// $mpdf->WriteHTML($data);
// $mpdf->Output($outputPath, "D");
// echo $data; // Or use as needed
?>