

<div class="row">
    <div class="col-sm-4"></div>
    <div class="col-sm-4" style="text-align: center;">
        <button type="button" class="btn btn-success generate-att">Generate</button>
    </div>
    <div class="col-sm-4"></div>
</div>
<br/>

<div class="row">
    <div class="col-sm-12 show-data">

    </div>
</div>

<style>
    .Table_List {
        font-size: 12px;
        text-align: center;
    }

    .top_row {
        font-family: khmeros, Verdana, Arial, Helvetica, sans-serif;
        font-size: 12px;
        font-weight: bold;
        text-align: center;
        color: #212121;
    }

    tbody, thead {
        display: table-row-group;
        vertical-align: middle;
        border-color: inherit;
    }
</style>

<script>
    $(function () {
        $('.generate-att').on('click',function () {
            getAtt();
        });

        checkAll('ch-em-id-all','ch-em-id');
        //checkAll('ded_miss_all','ded_miss');
    });

    function getAtt() {

        
        var emp_id          = $('[name="emp_id[]"]').val();
        var month_year      = $('[name="month_year"]').val();
        var from_date       = $('[name="from_date"]').val();
        var to_date         = $('[name="to_date"]').val();
        var branch_id       = $('[name="branch_id[]"]').val();
        var department_id   = $('[name="department_id[]"]').val();
        var position_id     = $('[name="position_id[]"]').val();

        if(month_year != "" && from_date != "" && to_date !="")
        {
            $.ajax({
                url: '{{route("hr.get-generate-attendance")}}',
                type: 'GET',
                async: false,
                dataType: 'html',
                data: {
                    emp_id: emp_id,
                    branch_id: branch_id,
                    department_id: department_id,
                    position_id: position_id,
                    month_year: month_year,
                    from_date: from_date,
                    to_date: to_date
                },
                success: function (d) {
                    $('.show-data').html(d);
                },
                error: function (d) {
                    alert('error');
                    $('.my-modal').hide();
                }
            });
        }
        else
        {
            alert('Please select month, from date, to date!');
        }
    }
</script>

