<?php
require ROOT . "/pages/start.php"; ?>
<style>
    #upload_file {
        display: none;
    }
</style>
<?php
require ROOT . "/pages/header.php";

_selectNoParam(
    $stj,
    $coj,
    "SELECT YEAR(ognoo) FROM `ui_exp` GROUP BY YEAR(ognoo)  ORDER BY YEAR(ognoo) ASC",
    $loop_jil
);

?>

<main id="main" class="main p-3">
    <section class="section">
        <div class="row">
            <div class="col">
                <h3>ҮЙЛДВЭРЧНИЙ ЭВЛЭЛИЙН ЗАРДАЛ</h3>
            </div>
        </div>
        <?php include "balance.php"; ?>
        <div class="card">
            <div class="card-body">
                <div class="btn-group w-100 mb-4 justify-content-center " role="group">
                    <?php while (_fetch($stj)) { ?>
                    <input type="radio" class="btn-check" id="jil<?=$loop_jil?>" autocomplete="off" name="user_role" value="<?=$loop_jil?>" checked="">
                    <label class="btn btn-outline-primary d-flex align-items-center justify-content-center" for="jil<?=$loop_jil?>">
                        <?=$loop_jil?>
                    </label>
                    <?php } ?>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    
                </div>
            </div>
        </div>
    </section>
</main><!-- End #main -->

<?php require ROOT . "/pages/footer.php"; ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
<script>
    $('#sumKr').html('<?= $sumcredit ?>');
    $('#sumTug').html('<?= formatMoney($sumdun) ?> (Норм хасаагүй дүн)');

    function del(id, title, image) {
        var r = confirm(title + " мэдээг устгахдаа итгэлтэй байна уу!")
        if (r) {
            $.ajax({
                url: "ajax",
                type: "POST",
                data: {
                    mode: "deposit",
                    id: id,
                    jil: jil
                },
                error: function(xhr, textStatus, errorThrown) {
                    //console.log("Алдаа гарлаа");
                },
                beforeSend: function() {
                    //console.log("Түр хүлээнэ үү");
                },
                success: function(data) {
                    window.location.reload();
                },
                async: true
            });
        }
    }
</script>
<?php require ROOT . "/pages/end.php";
?>
