@extends('adminlte::page') @section('content')
<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;
  }
  .jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content div {
    color: rgb(0, 49, 79);
    font-weight: 500;
    padding-left: 5px;
    text-align: left;
}
.text-left{
    text-align: left !important;
}
.form-control:disabled, .form-control[readonly] {
    background-color: transparent !important;
    opacity: 1 !important;
}
.table-inv-head td {
    border: none;
}

.table th {
    vertical-align: middle !important;
}

table tr:nth-child(even), table tr:hover {
    background: none;
}

.table > thead > tr > th {
    border: 1px solid white;
    text-align: center;
}
</style>
<?php Fun::lang()?>
<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="#">Operation</a></li>
            <li><a href="#">Manage Edit House</a></li>
            <li><a href="#">Show</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>Edit House List</h3>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="box-body table-responsive">
                        
            <table id="datatable_edit_house" width="100%" class="table table-striped table-bordered table-hover nowrap">
                <thead>
                    <tr>
                        <th>NO</th>
                        <th>Date</th>
                        <th>Contract Date</th>
                        <th>Contract Number</th>
                        <th>Client</th>
                        <th>Project</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>

        </div>
    </div>
    @endsection
    @section('js')
        <script>
            $(document).ready(function() {
            
                $('#datatable_edit_house').DataTable({
                    ordering: false,
                    "serverSide": true,
                    "lengthMenu": [
                    [20, 25, 50, 100, 500],
                    [20, 25, 50, 100, 500]
                ],
                    ajax: "{{ route('edit_house.index') }}",
                    columns: [
                    {
                        data: 'DT_RowIndex'
                    },{
                        data: 'date'
                    }
                    ,{
                        data: 'contract_date'
                    }
                    ,{
                        data: 'contract_number'
                    }
                    ,{
                        data: 'client_id'
                    }
                    ,{
                        data: 'project_name'
                    },
                    {
                        data: 'action'
                    } 
                ],
                "initComplete": function(settings, json) {
                    $('#main-spinner').hide();
                }
                });
                $.fn.dataTable.ext.errMode = 'throw';
                
            });
            $(document).on("focus",".date_picker",function(){
                $(this).datepicker({
                    dateFormat: 'dd-mm-yy',
                    changeMonth: true
                });
            });
            function set_to_completed(obj){
                var id = $(obj).data("id");
                $.confirm({
                    title:'Are you sure ?',
                    content:'',
                    theme:'modern',
                    buttons:{
                        cancel:{
                            btnClass:'btn btn-warning',
                            text:'Cancel',
                            action:function () {

                            }
                        },
                        submit:{
                            btnClass:'btn btn-success',
                            text:'Yes',
                            action:function () {
                                window.location.replace('{{route("set_to_complete_task")}}?id='+id);
                            }
                        },
                    },
                });
            }
        </script>
    @endsection