

@extends('../shared/default')

@section('content')
    <div class="row">
                	<div id="breadcrumb" class="col-xs-12">
                		<a href="#" class="show-sidebar">
                			<i class="fa fa-bars"></i>
                		</a>
                		<ol class="breadcrumb pull-left">
                			<li><a href="{{ route('log.index')  }}">Logs</a></li>
                		</ol>
                	</div>
                </div>

<div class="col-xs-12">
                        		<div class="box">
                        			<div class="box-header">
                        				<div class="box-name">
                        					<i class="fa fa-table"></i>
                        					<span>Logs</span>
                        				</div>
                        				<div class="no-move"></div>
                        			</div>
                        			<div class="box-content no-padding table-responsive">
                        				<table class="table table-bordered table-striped table-hover table-heading table-datatable" id="datatable-2">
                        					<thead>
                        						<tr>
                        						    <th><label><input type="text" name="search_employee_name" value="Employee" class="search_init" /></label></th>
                                                    <th><label><input type="text" name="search_guard" value="Guard" class="search_init" /></label></th>
                        							<th><label><input type="text" name="search_date_log" value="Date" class="search_init" /></label></th>
                        							<th><label><input type="text" name="search_time_log" value="Time" class="search_init" /></label></th>
                        							<th class="col-md-2"><label><input type="text" name="search_in_out" value="IN/OUT" class="search_init" /></label></th>
                        							<th id="delete"/>
                        						</tr>
                        					</thead>
                        					<tbody>
                        					@foreach($logs as $log)
                                                    <tr>
                                                        <td>{{ $log->employee->first_name ."  ". $log->employee->last_name}} </td>
                                                         <td>ee</td>
                                                        <td>{{ $log->date_log->toDateString() }}</td>
                                                        <td>{{ $log->date_log->toTimeString() }}</td>
                                                        @if($log->in_out == 0)
                                                            <td style="text-align:center" class="success">IN</td>
                                                        @else
                                                            <td style="text-align:center" class="danger">OUT</td>
                                                        @endif
                                                        <td style="text-align:center; display: block;  padding-bottom: 6%;">
                                                            {!! Form::open(array('method' => 'DELETE', 'route' => array('log.destroy' , $log))) !!}
                                                                <button type="submit" class="btn btn-default btn-app-sm" style="cursor: pointer;"><i class="fa fa-trash"></i></button>
                                                            {!! Form::close() !!}
                                                        </td>
                                                    </tr>
                                            @endforeach

                        					</tbody>
                        					<tfoot>
                        						<tr>
                        							<th>Employee</th>
                        							<th>Guard</th>
                        							<th>Date</th>
                        							<th>Time</th>
                        							<th>IN/OUT</th>
                        							<th>Delete</th>
                        						</tr>
                        					</tfoot>
                        				</table>
                        			</div>
                        		</div>
                        	</div>




 @stop