<?php
session_start();
require_once(__DIR__ . "/../../config/db.php");
include(__DIR__ . "/../layouts/header.php");
?>

    <link href="/Content/zelma-v2-beta-mobile-css" rel="stylesheet"/>
    <link href="/Content/jquery.daterangepicker" rel="stylesheet"/>
    <link href="/Content/zelma-v2-beta-mobile-daterangepicker" rel="stylesheet"/>
    <link href="/Content/Theme/zelma-v2-beta-mobile-<?= $config['theme']; ?>-css" rel="stylesheet"/>

</head>
<body data-online-id="DRtoiYOia/b5qnFsIyrWkaGb0wMITNaV4qPalojPseS1QFi2k6i58w=="
      data-route="history/dwithdrawal" style="--expand-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/expand.gif?v=20241125);
      --collapse-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/collapse.gif?v=20241125);
      --play-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/play.png?v=20241125);
      --desktop-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/desktop-white.png?v=20241125);
      --jquery-ui-444444-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_444444_256x240.png?v=20241125);
      --jquery-ui-555555-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_555555_256x240.png?v=20241125);
      --jquery-ui-ffffff-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_ffffff_256x240.png?v=20241125);
      --jquery-ui-777620-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_777620_256x240.png?v=20241125);
      --jquery-ui-cc0000-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_cc0000_256x240.png?v=20241125);
      --jquery-ui-777777-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_777777_256x240.png?v=20241125);">


<?php include(__DIR__ . "/../layouts/navbar.php"); ?>

<div class="reporting-form-container">
    <div class="reporting-nav-bar">
    <a href="/mobile/pending-transactions" data-active="false">
        MENUNGGU
    </a>
    <a href="/mobile/history/deposit" data-active="false">
        DEPOSIT
    </a>
    <a href="/mobile/history/withdrawal" data-active="true">
        PENARIKAN
    </a>
    <a href="/mobile/history/transaction" data-active="false">
        PENYESUAIAN
    </a>
    <a href="/mobile/history/consolidate" data-active="false">
        RIWAYAT TARUHAN
    </a>
</div>

    <div class="reporting-scroll-container">
        <table class="table grid_table">
            <thead>
                <tr>
                    <th scope="col">Nomor Tiket</th>
                    <th scope="col">Jumlah</th>
                    <th scope="col">Tujuan</th>
                    <th scope="col">Tanggal/Waktu (WIB)</th>
                    <th scope="col">Status</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($transaction as $trx): ?>
                    <tr>
                        <td><?= $trx['trxid']; ?></td>
                        <td><?= htmlspecialchars(number_format($trx['Amount'], 0, ',', '.')); ?></td>
                        <td><?= $trx['ToAccount']; ?></td>
                        <td><?php echo htmlspecialchars((new DateTime($trx['updated_at']))->setTimezone(new DateTimeZone('Asia/Jakarta'))->format('d-M-Y H:i:s T'));
                            ?></td>
                        <td>
                            <?php
                            if ($trx['status'] == '0') {
                                echo '<label data-ticket-status="PEN">Pending</label>';
                            } elseif ($trx['status'] == '1') {
                                echo '<label data-ticket-status="SUC">Success</label>';
                            } elseif ($trx['status'] == '2') {
                                echo '<label data-ticket-status="REJ">Tolak</label>';
                            } else {
                                echo '<label data-ticket-status="PRO">Proses</label>';
                            }
                            ?>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
        </div>
    </div>

<?php
include(__DIR__.'/../layouts/footer.php');
include(__DIR__.'/../layouts/sidebar.php');
?>

<div id="popup_modal" class="modal popup-modal" role="dialog" data-title="" aria-label="Popup Modal">
    <div class="modal-dialog">
        <div class="modal-content" style="--desktop-popup-alert-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/<?= $config['theme']; ?>/desktop/layout/popup/alert.png?v=20241125);;--desktop-popup-notification-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/<?= $config['theme']; ?>/desktop/layout/popup/notification.png?v=20241125);;--mobile-popup-alert-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/<?= $config['theme']; ?>/mobile/layout/popup/alert.png?v=20241125);;--mobile-popup-notification-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/<?= $config['theme']; ?>/mobile/layout/popup/notification.png?v=20241125);;--event-giveaway-popper-src: url(//d33egg70nrp50s.cloudfront.net/Images/giveaway/popper.png?v=20241125);">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="popup_modal_title">
                    
                </h4>
            </div>
            <div class="modal-body" id="popup_modal_body">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal" id="popup_modal_dismiss_button">
                    OK
                </button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal" id="popup_modal_cancel_button" style="display: none">
                    Tidak
                </button>
                <button type="button" class="btn btn-primary" id="popup_modal_confirm_button" style="display: none">
                    Ya
                </button>
            </div>
        </div>
    </div>
</div>

<script src='/bundles/zelma-v2-beta-mobile-js' defer></script>

    <script type="text/javascript">
        window.addEventListener('DOMContentLoaded', () => {
            initializeCurrency({
                conversionRate: 1000,
                locale: "id",
                thousandSeparator: "."
            });
        });
    </script>

    
    <script src='/bundles/Reporting/history-page-js' defer></script>



        <script type="text/javascript">
        navigator.serviceWorker.getRegistrations().then(registrations => {
            for (const registration of registrations) {
                registration.unregister();
            }
        });
    </script>

    <div class="search-popup-container" id="search_popup_container"></div>

    <script src='/bundles/reserve-js' defer></script>

</body>
</html>
