@extends('backend._partials.app')
@section('maincontent')

    <div class="col-md-12">
        <div class="card">
            <div class="header">
                <h4 class="title" style="display: inline;">Event Type</h4>
                <button @if(Helper::hasPermit('event-type.create')) data-toggle="modal" data-target="#modal" onclick="loadModal('event-type/create')" @else title="You are not permitted" disabled @endif class="btn btn-info btn-fill pull-right">NEW <i class="fa fa-plus" aria-hidden="true"></i> </button>
            </div>
            <div class="content">
                <div class="fresh-datatables">
                    <table id="datatable" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%" style="width:100%">
                        <thead>
                        <tr>
                            <th>Sl</th>
                            <th>Title</th>
                            <th>Office Status</th>
                            <th>Holiday Count</th>
                            <th>Created By</th>
                            <th>Created At</th>
                            <th>Updated By</th>
                            <th>Updated At</th>
                            <th>Action</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php $i=0;  ?>
                        @foreach($result as $val)
                            <tr>

                                <td>{{++$i}}</td>
                                <td>{{$val->title}}</td>
                                <td>@if($val->office_status==1) Open @else Close @endif</td>
                                <td>@if($val->holiday_count==1) Yes @else No @endif</td>
                                <td>{{$val->createdBy->first_name. " ". $val->createdBy->last_name}}</td>
                                <td>{{$val->created_at}}</td>
                                <td>{{$val->updatedBy->first_name. " ". $val->updatedBy->last_name}}</td>
                                <td>{{$val->updated_at}}</td>

                                <td class="text-center">
                                    <a class="btn btn-simple btn-warning btn-icon" @if(Helper::hasPermit('event-type.edit')) data-toggle="modal" data-target="#modal" onclick="loadModalEdit('event-type',{{$val->id}},'edit')" title="Edit" @else title="You are not permitted" disabled @endif><i class="fa fa-edit"></i></a>
                                    <a class="btn btn-simple btn-danger btn-icon remove" @if(Helper::hasPermit('clientEventTypeDelete')) onclick="deleteConfirm('clientEventTypeDelete',{{$val->id}})" title="Delete" @else title="You are not permitted" disabled @endif><i class="fa fa-times"></i></a>
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    @include('backend._partials.ajax')
@endsection