<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('answers_checklist_schedule'); ?></div>
            <?php if ($permissions->hasPermission('add_checklist_schedule_answers')) { ?>
            <div class="col-xs-12 p-0 m-b-10 trusted_computer_button_div">  
                <div class="floatingContainer ">
                    <a href="" id="add_checklist_schedule_answers" data-target="#checklist-schedule-answers-modal" data-toggle="modal" >
                        <div class="actionButton bg-success-dark" >
                            <p class="floatingText"><span class="floatingTextBG"><?php echo CommonLanguage::getMessage('add_checklist_answers') ?></span></p>
                        </div>
                    </a>
                </div>
            </div>
            <?php } ?>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-12">
                    <div class="table-responsive">
                        <table class="table table-bordered maintenance-table" id="tableWithSearch">
                            <thead>
                                <tr>
                                    <th><?php print CommonLanguage::getMessage('schedule_checklist') ?></th>
                                    <th><?php print CommonLanguage::getMessage('line') ?></th>
                                    <th><?php print CommonLanguage::getMessage('product') ?></th>
                                    <th><?php print CommonLanguage::getMessage('part') ?></th>
                                    <th><?php print CommonLanguage::getMessage('checklist_name') ?></th>
                                    <th><?php print CommonLanguage::getMessage('date_time') ?></th>
                                    <th><?php print CommonLanguage::getMessage('Action') ?></th>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){
        $('#tableWithSearch').on('click', '.delete_checklist_schedule_answers', function () {
            var entry_value = $(this).parents('div.Action').attr('data-id')
            IncludeDeleteModal(common_delete_modal, {answer_main_id: entry_value}, function () {
                RebuildDataTable($('.panel-heading .panel-title').html(), [0,1,2,3,4,5], 'MaintenanceAjax/getChecklistScheduleAnswerList');
            }, "MaintenanceAjax/deleteAnswers");
        });
        RebuildDataTable($('.panel-heading .panel-title').html(), [0,1,2,3], 'MaintenanceAjax/getChecklistScheduleAnswerList');
    });
</script>
<?php include 'Views/Maintenance/checklist-schedule-answers-modal.php';