<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
session_start();
include("dbconfig.php");
if (!$db) {
    die("Connection failed: " . mysqli_connect_error());
}

if (isset($_SESSION['username']) && isset($_SESSION['password'])) {
    $username = $_SESSION['username'];
    $pass = $_SESSION['password'];
} else {
    echo '<META http-equiv="refresh" content="0;logout.php">';
}

$ipdCount = 0;
$opdCount = 0;
$ipdPatientIds = [];
$opdPatientIds = [];
$ipdPatientNames = [];
$opdPatientNames = [];
$patientBills = [];
$patientAdvances = [];
$patientFinalBills = [];

if (isset($_POST['mrId'])) {
    $mrId = $_POST['mrId'];

    if (!empty($mrId) && strlen($mrId) == 10) {
        // Get IPD patients
        $patientQuery = mysqli_query($db, "SELECT PatId, Name FROM patientdetails WHERE Contact='$mrId'");
        $ipdCount = mysqli_num_rows($patientQuery);

        if ($ipdCount > 0) {
            while ($row = mysqli_fetch_assoc($patientQuery)) {
                $ipdPatientIds[] = $row['PatId'];
                $ipdPatientNames[] = $row['Name'];
            }
        }

        // Get OPD patients
        $opdQuery = mysqli_query($db, "SELECT PatientId, Name FROM opdpatientregister WHERE Contact='$mrId'");
        $opdCount = mysqli_num_rows($opdQuery);

        if ($opdCount > 0) {
            while ($row = mysqli_fetch_assoc($opdQuery)) {
                $opdPatientIds[] = $row['PatientId'];
                $opdPatientNames[] = $row['Name'];
            }
        }

        // Get all distinct bills with sum of payable amounts for each patient (both IPD and OPD)
        $allPatientIds = array_merge($ipdPatientIds, $opdPatientIds);
        foreach ($allPatientIds as $patId) {
            $billQuery = mysqli_query($db, "SELECT BillNo, SUM(PayableAmount) AS totalPayable 
                                           FROM bill 
                                           WHERE PatientId='$patId' 
                                           GROUP BY BillNo");

            while ($billRow = mysqli_fetch_assoc($billQuery)) {
                if (!isset($patientBills[$patId])) {
                    $patientBills[$patId] = [];
                }
                $patientBills[$patId][] = [
                    'billNo' => $billRow['BillNo'],
                    'amount' => $billRow['totalPayable']
                ];
            }
        }

        // Get advances for IPD patients (with distinct BillNo)
        foreach ($ipdPatientIds as $patId) {
            $advanceQuery = mysqli_query($db, "SELECT BillNo, SUM(Amount) AS totalAdvance 
                                               FROM advance 
                                               WHERE PatId='$patId' 
                                               GROUP BY BillNo");

            while ($advRow = mysqli_fetch_assoc($advanceQuery)) {
                if (!isset($patientAdvances[$patId])) {
                    $patientAdvances[$patId] = [];
                }
                $patientAdvances[$patId][] = [
                    'billNo' => $advRow['BillNo'],
                    'amount' => $advRow['totalAdvance']
                ];
            }
        }

        // Get final bills for IPD patients
        foreach ($ipdPatientIds as $patId) {
            $finalBillQuery = mysqli_query($db, "SELECT FinalBillNo, PayableAmount 
                                                FROM finalbill 
                                                WHERE PatientId='$patId'");

            while ($fbRow = mysqli_fetch_assoc($finalBillQuery)) {
                if (!isset($patientFinalBills[$patId])) {
                    $patientFinalBills[$patId] = [];
                }
                $patientFinalBills[$patId][] = [
                    'finalBillNo' => $fbRow['FinalBillNo'],
                    'amount' => $fbRow['PayableAmount']
                ];
            }
        }

        if ($ipdCount > 0 || $opdCount > 0) {
            echo json_encode([
                'success' => true,
                'ipdCount' => $ipdCount,
                'opdCount' => $opdCount,
                'ipdPatientIds' => $ipdPatientIds,
                'opdPatientIds' => $opdPatientIds,
                'ipdPatientNames' => $ipdPatientNames,
                'opdPatientNames' => $opdPatientNames,
                'patientBills' => $patientBills,
                'patientAdvances' => $patientAdvances,
                'patientFinalBills' => $patientFinalBills
            ]);
        } else {
            echo json_encode([
                'success' => false,
                'message' => 'No records found for the given MR ID!'
            ]);
        }
    } else {
        echo json_encode([
            'success' => false,
            'message' => 'MR ID must be exactly 10 digits!'
        ]);
    }
    exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<head>
    <title>VH-Admin</title>
    <link rel="icon" href="images/logo.png" type="image/x-icon" class="abc">
    <link rel="icon" type="image/icon" href="images/logo.png" />
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Quicksand:500,700" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../files/bower_components/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../files/assets/pages/waves/css/waves.min.css" type="text/css" media="all">
    <link rel="stylesheet" type="text/css" href="../files/assets/icon/feather/css/feather.css">
    <link rel="stylesheet" type="text/css" href="../files/assets/css/font-awesome-n.min.css">
    <link rel="stylesheet" href="../files/bower_components/chartist/css/chartist.css" type="text/css" media="all">
    <link rel="stylesheet" type="text/css" href="../files/assets/css/style.css">
    <link rel="stylesheet" type="text/css" href="../files/assets/css/widget.css">
    <style>
        .img-fluid {
            max-width: 66%;
            height: auto;
            margin-left: -47px;
        }

        .pcoded li.pcoded-hasmenu[dropdown-icon=style1]>a:after {
            content: none;
        }

        .pcoded[theme-layout=vertical] .pcoded-navbar .pcoded-item[item-border=true][item-border-style=solid] li>a {
            border-bottom-style: solid;
            height: 53px;
        }

        div#c1 {
            background-color: cadetblue;
        }

        div#c2 {
            background-color: slategrey;
        }

        div#c3 {
            background-color: salmon;
        }

        div#c4 {
            background-color: #a549a5;
        }

        .billing-details {
            margin-top: 20px;
        }

        .billing-card {
            margin-bottom: 15px;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }

        .billing-card h5 {
            margin-top: 0;
            color: #279480;
        }

        .bill-list {
            margin-top: 10px;
        }

        .bill-item {
            padding: 5px 0;
            border-bottom: 1px dashed #eee;
        }

        #result {
            border: none !important;
            padding: 0 !important;
        }

        .btn-primary {
            height: 2rem;
            width: 9rem;
            align-content: center;
            padding: 2px;
        }
    </style>
</head>

<body>
    <div class="loader-bg">
        <div class="loader-bar"></div>
    </div>

    <div id="pcoded" class="pcoded">
        <div class="pcoded-overlay-box"></div>
        <div class="pcoded-container navbar-wrapper">
            <nav class="navbar header-navbar pcoded-header">
                <div class="navbar-wrapper">
                    <div class="navbar-logo">
                        <a href="index.php">
                            <h5>Admin</h5>
                        </a>
                        <a class="mobile-menu" id="mobile-collapse" href="#!">
                            <i class="feather icon-menu icon-toggle-right"></i>
                        </a>
                        <a class="mobile-options waves-effect waves-light">
                            <i class="feather icon-more-horizontal"></i>
                        </a>
                    </div>
                    <div class="navbar-container container-fluid">
                        <ul class="nav-left">
                            <li class="header-search">
                                <div class="main-search morphsearch-search">
                                    <div class="input-group">
                                        <input type="text" class="form-control" placeholder="Enter Keyword">
                                    </div>
                                </div>
                            </li>
                        </ul>
                        <ul class="nav-right">
                            <li class="header-notification">
                                <div class="dropdown-primary dropdown">
                                    <ul class="show-notification notification-view dropdown-menu" data-dropdown-in="fadeIn" data-dropdown-out="fadeOut">
                                        <li></li>
                                        <li></li>
                                        <li></li>
                                    </ul>
                                </div>
                            </li>
                            <li class="user-profile header-notification">
                                <div class="dropdown-primary dropdown">
                                    <div class="dropdown-toggle" data-toggle="dropdown">
                                        <img src="../files/assets/images/avatar-4.jpg" class="img-radius" alt="User-Profile-Image">
                                        <span>Admin</span>
                                        <i class="feather icon-chevron-down"></i>
                                    </div>
                                    <ul class="show-notification profile-notification dropdown-menu" data-dropdown-in="fadeIn" data-dropdown-out="fadeOut">
                                        <li>
                                            <a href="logout.php">
                                                <i class="feather icon-log-out"></i> Logout
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>

            <div class="pcoded-main-container">
                <div class="pcoded-wrapper">
                    <nav class="pcoded-navbar">
                        <div class="nav-list">
                            <div class="pcoded-inner-navbar main-menu">
                                <div class="pcoded-navigation-label">Navigation</div>
                                <ul class="pcoded-item pcoded-left-item">
                                    <li class="pcoded-hasmenu">
                                        <a href="index.php" class="waves-effect waves-dark">
                                            <span class="pcoded-micon"><i class="feather icon-home"></i></span>
                                            <span class="pcoded-mtext">Dashboard</span>
                                        </a>
                                    </li>
                                    <li class="pcoded-hasmenu">
                                        <a href="opddoctor.php" class="waves-effect waves-dark">
                                            <span class="pcoded-micon"><i class="feather icon-home"></i></span>
                                            <span class="pcoded-mtext">Consultant Charges</span>
                                        </a>
                                    </li>
                                    <li class="pcoded-hasmenu">
                                        <a href="PatientDetails.php" class="waves-effect waves-dark">
                                            <span class="pcoded-micon"><i class="fa fa-registered"></i></span>
                                            <span class="pcoded-mtext">Patient Details</span>
                                        </a>
                                    </li>
                                    <li class="pcoded-hasmenu">
                                        <a id="text" href="DailyTrans.php">
                                            <span class="pcoded-micon"><i class="fa fa-registered"></i></span>
                                            <span class="pcoded-mtext">Daily Transactions</span>
                                        </a>
                                    </li>
                                    <li class="pcoded-hasmenu">
                                        <a href="StaffDetails.php" class="waves-effect waves-dark">
                                            <span class="pcoded-micon"><i class="fa fa-registered"></i></span>
                                            <span class="pcoded-mtext">Staff Details</span>
                                        </a>
                                    </li>
                                    <li class="pcoded-hasmenu">
                                        <a href="javascript:void(0)" class="waves-effect waves-dark">
                                            <span class="pcoded-micon"><i class="fa fa-users"></i></span>
                                            <span class="pcoded-mtext">Users</span>
                                        </a>
                                        <ul class="pcoded-submenu">
                                            <li class="">
                                                <a href="CreateUsers.php" class="waves-effect waves-dark">
                                                    <span class="pcoded-mtext">Create Billing Users</span>
                                                </a>
                                            </li>
                                            <li class="">
                                                <a href="ViewUsers.php" class="waves-effect waves-dark">
                                                    <span class="pcoded-mtext">View Billing Users</span>
                                                </a>
                                            </li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </nav>

                    <div class="pcoded-content">
                        <div class="page-header card">
                            <div class="row align-items-end">
                                <div class="col-lg-8">
                                    <div class="page-header-title">
                                        <i class="feather icon-inbox bg-c-blue"></i>
                                        <div class="d-inline">
                                            <h5>MEDICAL REPORT</h5>
                                            <button class="btn btn-primary" onclick="history.go(-1)">Back</button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="page-header-breadcrumb">
                                        <ul class="breadcrumb breadcrumb-title">
                                            <li class="breadcrumb-item">
                                                <a href="index.php"><i class="feather icon-home"></i></a>
                                            </li>
                                            <li class="breadcrumb-item"><a href="#!">Home</a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="pcoded-inner-content">
                            <div class="main-body">
                                <div class="page-wrapper">
                                    <div class="page-body">
                                        <div class="card">
                                            <div class="card-block">
                                                <form method="POST" action="" onsubmit="return validateForm()" name="checkForm">
                                                    <h2 style="text-align: center;font-weight: bold;color:#fff;background-color: #279480;padding:10px;">MEDICAL REPORT</h2>
                                                    <div class="form-group">
                                                        <!-- <label for="mrId">MR ID</label> -->
                                                        <input class="form-control" type="text" name="mrId" id="mrId" value="<?php echo $_POST['mrId'] ?? ''; ?>" placeholder="Enter 10-digit MEDICAL RECORD ID">
                                                    </div>
                                                    <!-- <button type="submit" class="btn btn-primary">Proceed</button> -->
                                                </form>
                                                <br><br>
                                                <div id="result"></div>
                                                <div id="billing-details"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script>
        $(document).ready(function() {
            $('#mrId').on('input', function() {
                var mrId = $(this).val();
                if (mrId.length === 10) {
                    $.ajax({
                        url: '',
                        type: 'POST',
                        data: {
                            mrId: mrId
                        },
                        dataType: 'json',
                        success: function(response) {
                            console.log('Success : ', response);
                            if (response.success) {
                                var ipdList = response.ipdPatientIds.length > 0 ? '<p>IPD Patient IDs : ' + response.ipdPatientIds.join(', ') + '</p>' : '';
                                var opdList = response.opdPatientIds.length > 0 ? '<p>OPD Patient IDs : ' + response.opdPatientIds.join(', ') + '</p>' : '';

                                $('#result').html(`
                            <button class="btn btn-success" onclick="exportToCSV()">Export to csv</button></br></br>
                            <div class="alert alert-success" role="alert">
                                <h4 class="alert-heading">Patient Admission Details</h4>
                                <p>IPD Admissions: ${response.ipdCount}</p>
                                ${ipdList}
                                <p>OPD Admissions: ${response.opdCount}</p>
                                ${opdList}
                            </div>
                        `);

                                // Build detailed billing information
                                var billingDetails = '';

                                // IPD Patients billing information
                                if (response.ipdPatientIds.length > 0) {
                                    billingDetails += '<div class="billing-details">';
                                    billingDetails += '<h4>IPD Patient Billing Details</h4>';

                                    response.ipdPatientIds.forEach(function(patId, index) {
                                        billingDetails += `<div class="billing-card">`;
                                        billingDetails += `<h5>Patient ID: ${patId} - Name: ${response.ipdPatientNames[index]}</h5>`;

                                        // Advance Payments
                                        if (response.patientAdvances[patId]) {
                                            billingDetails += `<div class="bill-list">`;
                                            billingDetails += `<h6>Advance Bills : ${response.patientAdvances[patId].length}</h6>`;
                                            response.patientAdvances[patId].forEach(function(adv) {
                                                billingDetails += `<div class="bill-item">Bill No: ${adv.billNo} - Amount: ₹${adv.amount}</div>`;
                                            });
                                            billingDetails += `</div>`;
                                        }

                                        // Regular Bills
                                        if (response.patientBills[patId]) {
                                            billingDetails += `<div class="bill-list">`;
                                            billingDetails += `<h6>Consolidate Bills : ${response.patientBills[patId].length}</h6>`;
                                            response.patientBills[patId].forEach(function(bill) {
                                                billingDetails += `<div class="bill-item">Bill No: ${bill.billNo} - Amount: ₹${bill.amount}</div>`;
                                            });
                                            billingDetails += `</div>`;
                                        }

                                        // Final Bills
                                        if (response.patientFinalBills[patId]) {
                                            billingDetails += `<div class="bill-list">`;
                                            billingDetails += `<h6>Final Bills : ${response.patientFinalBills[patId].length}</h6>`;
                                            response.patientFinalBills[patId].forEach(function(final) {
                                                billingDetails += `<div class="bill-item">Final Bill No: ${final.finalBillNo} - Amount: ₹${final.amount}</div>`;
                                            });
                                            billingDetails += `</div>`;
                                        }

                                        billingDetails += `</div>`;
                                    });

                                    billingDetails += '</div>';
                                }

                                // OPD Patients billing information
                                if (response.opdPatientIds.length > 0) {
                                    billingDetails += '<div class="billing-details">';
                                    billingDetails += '<h4>OPD Patient Billing Details</h4>';

                                    response.opdPatientIds.forEach(function(patId, index) {
                                        billingDetails += `<div class="billing-card">`;
                                        billingDetails += `<h5>Patient ID: ${patId} - Name: ${response.opdPatientNames[index]}</h5>`;

                                        // Regular Bills
                                        if (response.patientBills[patId]) {
                                            billingDetails += `<div class="bill-list">`;
                                            billingDetails += `<h6>Bills : ${response.patientBills[patId].length}</h6>`;
                                            response.patientBills[patId].forEach(function(bill) {
                                                billingDetails += `<div class="bill-item">Bill No: ${bill.billNo} - Amount: ₹${bill.amount}</div>`;
                                            });
                                            billingDetails += `</div>`;
                                        } else {
                                            billingDetails += `<div class="bill-list">No bills found</div>`;
                                        }

                                        billingDetails += `</div>`;
                                    });

                                    billingDetails += '</div>';
                                }

                                $('#billing-details').html(billingDetails);
                            } else {
                                $('#result').html(`
                            <div class="alert alert-danger" role="alert">
                                ${response.message}
                            </div>
                        `);
                                $('#billing-details').html('');
                            }
                        },
                        error: function(xhr, status, error) {
                            console.error(xhr.responseText);
                            $('#result').html(`
                        <div class="alert alert-danger" role="alert">
                            An error occurred while fetching data.
                        </div>
                    `);
                            $('#billing-details').html('');
                        }
                    });
                } else {
                    $('#result').html('');
                    $('#billing-details').html('');
                }
            });
        });

        function validateForm() {
            var mrId = document.forms["checkForm"]["mrId"].value;
            if (mrId == "") {
                alert("MR ID must be filled out");
                return false;
            }
            if (mrId.length != 10) {
                alert("MR ID must be exactly 10 digits");
                return false;
            }
            return true;
        }
    </script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <script>
        // Function to convert billing details to CSV format
        function exportToCSV() {
            // Get MR ID
            const mrId = $('#mrId').val();

            // Check if we have data to export
            if ($('#billing-details').html() === '') {
                alert('No data to export. Please search for a valid MR ID first.');
                return;
            }

            // Create CSV header
            let csvContent = 'data:text/csv;charset=utf-8,';
            csvContent += 'Patient Type,Patient ID,Patient Name,Bill Type,Bill No,Amount\n';

            // Extract data from the displayed billing details
            $('.billing-card').each(function() {
                const patientType = $(this).parent().find('h4').text().includes('IPD') ? 'IPD' : 'OPD';
                const patientId = $(this).find('h5').text().split(' - ')[0].replace('Patient ID: ', '');
                const patientName = $(this).find('h5').text().split(' - ')[1].replace('Name: ', '');

                // Process each bill list
                $(this).find('.bill-list').each(function() {
                    const billType = $(this).find('h6').text().split(':')[0].trim();

                    // Process each bill item
                    $(this).find('.bill-item').each(function() {
                        const billText = $(this).text();
                        const billNo = billText.split('-')[0].replace('Bill No: ', '').replace('Final Bill No: ', '').trim();
                        const amount = billText.split('-')[1].replace('Amount: ₹', '').trim();

                        // Add row to CSV
                        csvContent += `${patientType},${patientId},${patientName},${billType},${billNo},${amount}\n`;
                    });
                });
            });

            // Create download link
            const encodedUri = encodeURI(csvContent);
            const link = document.createElement('a');
            link.setAttribute('href', encodedUri);
            link.setAttribute('download', `MR_Report_${mrId}_${new Date().toISOString().slice(0,10)}.csv`);
            document.body.appendChild(link);

            // Trigger download
            link.click();
            document.body.removeChild(link);
        }

        // Add export button when document is ready
        $(document).ready(function() {
            // Create export button and add it after the form
            const exportButton = $('<button type="button" id="exportButton" class="btn btn-success" style="display:none; margin-top:10px;"><i class="fa fa-download"></i> Export to CSV</button>');
            $('form[name="checkForm"]').after(exportButton);

            // Add click event to export button
            $('#exportButton').on('click', exportToCSV);

            // Modify the AJAX success handler to show/hide export button
            const originalAjaxSuccess = $.ajax;
            $.ajax = function(params) {
                const originalSuccess = params.success;

                if (originalSuccess) {
                    params.success = function(response) {
                        originalSuccess(response);

                        // Show export button if there's data to export
                        if (response.success && (response.ipdCount > 0 || response.opdCount > 0)) {
                            $('#exportButton').show();
                        } else {
                            $('#exportButton').hide();
                        }
                    };
                }

                return originalAjaxSuccess.apply(this, arguments);
            };
        });
    </script>
    <script type="a0935012553127c718007911-text/javascript" src="../files/bower_components/jquery/js/jquery.min.js"></script>
    <script type="a0935012553127c718007911-text/javascript" src="../files/bower_components/jquery-ui/js/jquery-ui.min.js"></script>
    <script type="a0935012553127c718007911-text/javascript" src="../files/bower_components/popper.js/js/popper.min.js"></script>
    <script type="a0935012553127c718007911-text/javascript" src="../files/bower_components/bootstrap/js/bootstrap.min.js"></script>
    <script src="../files/assets/pages/waves/js/waves.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script type="a0935012553127c718007911-text/javascript" src="../files/bower_components/jquery-slimscroll/js/jquery.slimscroll.js"></script>
    <script type="a0935012553127c718007911-text/javascript" src="../files/bower_components/modernizr/js/modernizr.js"></script>
    <script type="a0935012553127c718007911-text/javascript" src="../files/bower_components/modernizr/js/css-scrollbars.js"></script>
    <script src="../files/assets/pages/waves/js/waves.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/bower_components/datatables.net/js/jquery.dataTables.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/bower_components/datatables.net-buttons/js/dataTables.buttons.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/assets/pages/data-table/js/jszip.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/assets/pages/data-table/js/pdfmake.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/assets/pages/data-table/js/vfs_fonts.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/bower_components/datatables.net-buttons/js/buttons.print.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/bower_components/datatables.net-buttons/js/buttons.html5.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/bower_components/datatables.net-bs4/js/dataTables.bootstrap4.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/bower_components/datatables.net-responsive/js/dataTables.responsive.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/bower_components/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/assets/pages/data-table/js/data-table-custom.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/assets/js/pcoded.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/assets/js/vertical/vertical-layout.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script src="../files/assets/js/jquery.mCustomScrollbar.concat.min.js" type="a0935012553127c718007911-text/javascript"></script>
    <script type="a0935012553127c718007911-text/javascript" src="../files/assets/js/script.js"></script>

    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-23581568-13" type="a0935012553127c718007911-text/javascript"></script>
    <script type="a0935012553127c718007911-text/javascript">
        window.dataLayer = window.dataLayer || [];

        function gtag() {
            dataLayer.push(arguments);
        }
        gtag('js', new Date());

        gtag('config', 'UA-23581568-13');
    </script>
    <script src="rocket-loader.min.js" data-cf-settings="a0935012553127c718007911-|49" defer=""></script>
</body>

</html>