<?php /* app/Views/undepositedfunds/left/main_view_selector.php */ ?>

<div class="container-fluid text-navy p-3">
    <?php if (!isset($isConnected) || !$isConnected): ?>
        <div class="mb-3">
            <a href="<?= base_url('qboauth/connect?redirect=undepositedfunds') ?>" class="btn btn-success text-white">Connect to QuickBooks</a>
        </div>
    <?php endif; ?>

    <form id="viewSelectorForm" method="post" action="#">
        <!-- Row for "Select View" dropdown -->
        <div class="form-row">
            <div class="col-sm-2 select-view-col">
                <label>Select View</label>
                <select id="viewModeSelect" name="view_mode" class="form-control">
                    <option value="manage" selected>Manage Undeposited Funds</option>
                    <option value="pull">Pull Undeposited Funds from QB</option>
                    <option value="fetch_sr">Fetch Sales Receipts</option>
                    <option value="fetch_journal">Fetch Journal Entries</option>
                </select>
            </div>
        </div>
    </form>

    <!-- Wrapper for left-side actions -->
    <div id="pullQBDataWrapper" style="margin-top: 20px; display: none;">
        <button id="makeBankDepositBtn" class="btn btn-secondary mb-2" type="button">
            Make Bank Deposit
        </button>

        <button id="depositHistoryBtn" class="btn btn-secondary mb-2" type="button">
            Deposit History
        </button>

        <!-- Date selector injected when "Pull" mode is chosen -->
        <div id="dateSelectorContainer"></div>
    </div>
</div>
