<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('schedule_checklist'); ?></div>
            <?php if ($permissions->hasPermission('new_checklist_schedule')) { ?>
            <div class="col-xs-12 p-0 m-b-10 trusted_computer_button_div">  
                <div class="floatingContainer ">
                    <a href="" id="new_checklist_schedule" data-target="#checklist-schedule-modal" data-toggle="modal" >
                        <div class="actionButton bg-success-dark" >
                            <p class="floatingText"><span class="floatingTextBG"><?php echo CommonLanguage::getMessage('new_checklist_schedule') ?></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('title') ?></th>
                                    <th><?php print CommonLanguage::getMessage('start_date') ?></th>
                                    <th><?php print CommonLanguage::getMessage('checklist_name') ?></th>
                                    <th><?php print CommonLanguage::getMessage('line') ?></th>
                                    <th><?php print CommonLanguage::getMessage('machine') ?></th>
                                    <th><?php print CommonLanguage::getMessage('part') ?></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_schedule_checklist', function () {
            var entry_value = $(this).parents('div.Action').attr('data-id')
            IncludeDeleteModal(common_delete_modal, {schedule_id: entry_value}, function () {
                RebuildDataTable($('.panel-heading .panel-title').html(), [0,1,2,3,4,5], 'MaintenanceAjax/getChecklistSchedule');
            }, "MaintenanceAjax/deleteChecklistSchedule");
        });
        RebuildDataTable($('.panel-heading .panel-title').html(), [0,1,2,3,4,5], 'MaintenanceAjax/getChecklistSchedule');
    });
</script>
<?php 
    include 'Views/Maintenance/checklist-schedule-modal.php';