<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('line_list'); ?></div>
            <?php if ($permissions->hasPermission('add_line')) { ?>
            <div class="col-xs-12 p-0 m-b-10">  
                <div class="floatingContainer ">
                    <a href="" id="new_line" data-target="#add-edit-line-modal" data-toggle="modal" >
                        <div class="actionButton bg-success-dark text-white" >
                            <p class="floatingText"><span class="floatingTextBG"><?php echo CommonLanguage::getMessage('add_line') ?></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('line_name') ?></th>
                                    <th><?php print CommonLanguage::getMessage('machine') ?></th>
                                    <th><?php print CommonLanguage::getMessage('Action') ?></th>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){
        RebuildDataTable($('.panel-heading .panel-title').html(), [0,1], 'MaintenanceAjax/getLineList');
        $('#tableWithSearch').on('click', '.delete_line', function () {
            var entry_value = $(this).attr('data-id')
            IncludeDeleteModal(common_delete_modal, {line_id: entry_value}, function () {
                RebuildDataTable($('.panel-heading .panel-title').html(), [0,1], 'MaintenanceAjax/getLineList');
            }, "MaintenanceAjax/deleteLine");
        });
    });
</script>
<?php
    include 'Views/Maintenance/add-edit-line-modal.php';