<script type="text/javascript">
    $(".modal-title").text("My Report :: {{$date}}");
    $(".modal-dialog").addClass('modal-lg');
</script>
<div class="content">
    <div class="row">
        <div class="col-md-5">
            <label>IN / OUT:</label>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>Sl</th>
                    <th>IN</th>
                    <th>OUT</th>
                    <th>Duration</th>
                    <th>OUT Message</th>
                </tr>
                </thead>
                <tbody>
                <?php $i=0; $totalDuration=0; $noRecord=0; ?>
                @forelse($result as $value)
                    <tr>
                        <td>{{++$i}}</td>
                        <td>{{Helper::onlyTime($value->in_time)}}</td>
                        <td>@if($value->out_time !=null) {{Helper::onlyTime($value->out_time)}} @endif</td>
                        <td>{{Helper::secondsToTime($value->time_calc)}}</td>
                        <td>{{$value->out_comment}}</td>
                        <?php $totalDuration+=$value->time_calc; ?>
                    </tr>
                @empty
                    <?php $noRecord=1; ?>
                    <tr>
                        <td colspan="5" class="text-center">No records found</td>
                    </tr>
                @endforelse
                @if($noRecord==0)
                <tr>
                    <td colspan="4" align="right">Total</td>
                    <td>{{Helper::secondsToTime($totalDuration)}}</td>
                </tr>
                    @endif
                </tbody>
            </table>
        </div>
        <div class="col-md-7">
            {!! Form::open(['url'=>'taskUpdate']) !!}
            {!! Form::hidden('date',$date) !!}
            <div class="form-group">
                <label>Daily Task:</label>
                <textarea rows="4" class="form-control" placeholder="Whole day's task summary" id="task_submission" name="details">{{@$task->details}}</textarea>

            </div>
            <div class="form-group">
                <label>Next Task:</label>
                <textarea class="form-control" name="next_task" id="next_task" placeholder="Next day task">{{@$task->next_task}}</textarea>

            </div>
            <div class="form-group">
                <label>Comments:</label>
                <textarea class="form-control" name="comment" placeholder="If you have leave early or make late write a short note for the reason">{{@$task->comment}}</textarea>

            </div>
            <div class="form-group text-center">
                <button class="btn btn-primary btn-fill btn-wd" type="submit">UPDATE</button>
            </div>
            {!! Form::close() !!}
        </div>
    </div>
</div>
<script>
    CKEDITOR.replace( 'task_submission',{
        height: '120px',
        toolbarGroups : [
            { name: 'basicstyles', groups: [ 'Bold', 'Italic' ] },
            { name: 'paragraph',   groups: [ 'list' ] },
        ]
    });
    CKEDITOR.replace( 'next_task',{
        height: '100',
        toolbarGroups : [
            { name: 'basicstyles', groups: [ 'Bold', 'Italic' ] },
            { name: 'paragraph',   groups: [ 'list' ] },
        ]
    });
</script>