@extends('adminlte::page') @section('content')
<?php Fun::lang()?>
<style>
  td.details-control {
      background: url(' {{ asset('images/details_open.png') }} ') no-repeat center center !important;
      cursor: pointer;
  }
  tr.shown td.details-control {
      background: url(' {{ asset('images/details_close.png') }} ') no-repeat center center !important;
  }
  .content-wrapper{
    height: 100% !important;
  }
</style>
<div class="title-page">
    <div class="page-bar">
        <ul class="page-breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Dashboard</a></li>
            <li><a href="#">Construction</a></li>
            <li><a href="#">Set Up Information</a></li>
            <li><a href="#">Category Task</a></li>
        </ul>
    </div>
</div>
    <div class="page">
        <div class="top-content">
            <div class="row">
                <div class="col-sm-12 col-xs-12">
                    <div class="title-page">
                        <div class="pull-left">
                            <h3>Category Task List</h3>
                        </div>
                    </div>
                    <div class="pull-right">
                        <a class="button_sm button_info" href="javascript:void(0)" id="filter-toggle-search"><span class="fa fa-plus"></span>  Filter Toggle</a>
                        @can('Category-Task-Create')
                        <a class="button_sm button_primary" href="{{route('task-working-construction.create_sub_task')}}"><span class="fa fa-plus"></span>  Create New</a>
                        @endcan
                    </div>
                </div>
            </div>
        </div>
        <div class="box-body table-responsive">
            <div class="row" id="toggle-seaching">
                <div class="col-md-6">
                    <div class="form-group">
                        <strong >Group Work :</strong>
                        {!! Form::select('group_work',$group_work_types,null, array('class' => 'form-control select2')) !!}
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <strong >Name :</strong>
                        {!! Form::text('work_name',null, array('class' => 'form-control')) !!}
                    </div>
                </div>
                <div class="col-md-12" style="text-align:right;margin-bottom:40px !important;">
                    <a class="button_sm button_success" href="javascript:void(0)" id="search-submit" onclick="searching()"><span class="fa fa-search"></span> Search</a>
                </div>
            </div>   
            <table id="datatable_task_group" width="100%" class="table table-striped table-bordered table-hover nowrap">
                <thead>
                    <tr>
                        <th>NO</th>
                        <th>Name</th>
                        <th>Group Work</th>
                        <th>Description</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                   
                </tbody>
            </table>

        </div>
    </div>
    @endsection
    @section('js')
    <script type="text/javascript">
            
            $(document).ready(function() {
                $('#main-spinner').show();
                 $('#datatable_task_group').DataTable({
                    ordering: false,
                    "serverSide": true,
                    "scrollY":"600px",
                    "scrollCollapse": true,
                    "lengthMenu": [
                    [20, 25, 50, 100, 500],
                    [20, 25, 50, 100, 500]
                ],
                    ajax: {
                        url:"{{ route('task-working-construction.index_sub_task') }}",
                        type:"GET",
                        data:function(d){
                            d.group_work = $("select[name=group_work]").val();
                            d.work_name = $("input[name=work_name]").val();
                        }
                    },
                    columns: [
                    {
                        data: 'DT_RowIndex'
                    }
                    , {
                        data: 'name'
                    }
                    , {
                        data: 'group_work'
                    }
                    ,{
                        data: 'description'
                    }
                    , {
                        data: 'action'
                    }, ],
                    "initComplete": function(settings, json) {
                        $('#main-spinner').hide();
                    }
                });

                $.fn.dataTable.ext.errMode = 'throw';
            });
            function searching(){
                $('#datatable_task_group').DataTable().draw(true);
            }
    </script>
    
    @endsection