<?php
include("Views/HRM/CreateEmpAlert.php");
?>
<style>
    .table thead tr >th{
        background-color:#4c0870;
        color:#fff;
        text-align: center;
    }

    #error_list_row thead tr>th{
        background-color:#ba1d1d;
        text-align: center !important;
    }
    .table tbody tr >td,.table tbody tr >td input{

        text-align: center;
    }
    .table thead tr th[class*='sorting_'] {
        color: #fff;
    }
    #InputFile{
        width:227px;
        color:#fff;
    }
    #InputFile > input{
        position:absolute;
        cursor:pointer;
        left:0px;
        top:0px;
        width:100%;
        height:100%;
        opacity:0.01;
    }
</style>
<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <div class="panel-title"><?php print CommonLanguage::getMessage('viewEmployeeAlert'); ?></div>
            <div class="clearfix"></div>

            <?php
            if ($permissions->hasPermission('AddEmpAlert')) {
                echo Forms::FloatingAddButton('4c0870', '#CreateEmpAlert', CommonLanguage::getMessage('add'));
            }
            ?>
        </div>
        <div class="panel-body">




            <div class="table table-responsive">
                <table class="table table-bordered table-hover demo-table-search" id="tableWithSearch">
                    <thead>
                        <tr>
                            <th class="text-center" style="width:10%" ><?php print CommonLanguage::getMessage('employee_name'); ?></th>
                            <th class="text-center" style="width:5%"><?php print CommonLanguage::getMessage('Date'); ?></th>
                            <th class="text-center" style="width:5%"><?php print CommonLanguage::getMessage('type'); ?></th>
                            <th class="text-center" style="width:5%"><?php print CommonLanguage::getMessage('note'); ?></th>
                            <th class="text-center" style="width:5%"><?php print CommonLanguage::getMessage('Action'); ?></th>

                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>


        </div>
    </div>
</div>

<script>

    var title = <?php echo json_encode(CommonLanguage::getMessage('viewEmployeeAlert')); ?>,
            is_actual = <?php echo json_encode($is_actual)?>;
    $(function () {
        RebuildDataTable(title, [0, 1, 2, 3], 'HRMAjax/viewEmployeeAlert',{is_actual:is_actual});
        $("#tableWithSearch").on("click", ".Delete", function () {
            $.ajax({
                url: "HRMAjax/viewEmployeeAlert",
                method: "POST",
                data: {id: $(this).attr('data-id'), doc_id: $(this).attr('doc_id')},
                complete: function (v1, v2) {
                    if (v2 == 'success' && v1.responseText == 'OK') {
                        RebuildDataTable(title, [0, 1, 2, 3], 'HRMAjax/viewEmployeeAlert',{is_actual:is_actual});
                    }
                }
            });
        });
    });

</script>