@extends('layouts.app')


@section('title')
Employee Attendace Setting
@stop

    @section('breadcrumb')
    <ol class="breadcrumb pull-right">
        <li><a href="{{ route('home') }}"><i class="fa fa-dashboard"></i> Home</a></li>

        <li class="active">Add Newtork</li>
    </ol>
    @stop

        @section('css')

        <style type="text/css">
            label {
                display: inline-block;
                max-width: 100%;
                margin-bottom: 5px;
                font-weight: 700
            }
        </style>
        @stop

            @section('content')

            <div class="container-fluid">
                <!--.row-->
                <div class="row">



                    <div class="white-box">
                        <h3 class="box-title m-b-0"><i class="icon-user fa-fw"></i> Hrm Setting</h3>
                        @if(!empty($hrm_setting))
                            <form class="form-horizontal"
                                action="{{ route('hrm.setting.update', ['id'=> $hrm_setting->id]) }}"
                                method="POST" autocomplete="off">

                                {{ csrf_field() }}

                                <input type="hidden" value="{{ $hrm_setting->id }}" name="id">
                                <div class="form-group">
                                    <label for="exampleInputuname" class="col-sm-2 control-label">Checkin <span
                                            style="color: red">*</span></label>
                                    <div class="col-sm-10">
                                        <div class="input-group">
                                            <div class="input-group-addon"><i class="ti-user"></i></div>
                                            <input type="time" class="form-control" name="checkin"
                                                value="{{ $hrm_setting->checkin }}" id="exampleInputuname"
                                                placeholder="Enter Checkin Time">
                                            @if($errors->has('checkin'))
                                                <span class="help-block">
                                                    <strong>{{ $errors->first('checkin') }}</strong>
                                                </span>
                                            @endif
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputuname" class="col-sm-2 control-label"> Checkout <span
                                            style="color: red">*</span></label>
                                    <div class="col-sm-10" >
                                        <div class="input-group">
                                            <div class="input-group-addon"><i class="ti-user"></i></div>
                                            <input type="time" class="form-control" name="checkout"
                                                value="{{ $hrm_setting->checkout }}" id="exampleInputuname"
                                                placeholder="Enter Checkout Time">
                                            @if($errors->has('checkout'))
                                                <span class="help-block">
                                                    <strong>{{ $errors->first('checkout') }}</strong>
                                                </span>
                                            @endif
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="exampleInputuname" class="col-sm-2 control-label">Late Fine <span
                                            style="color: red">*</span></label>
                                    <div class="col-sm-10" >
                                        <div class="input-group">
                                            <div class="input-group-addon"><i class="ti-user"></i></div>
                                            <input type="integer" class="form-control" name="late_fine"
                                                value="{{ $hrm_setting->late_fine }}" id="exampleInputuname"
                                                placeholder="Enter Late Fine">
                                            @if($errors->has('late_fine'))
                                                <span class="help-block">
                                                    <strong>{{ $errors->first('late_fine') }}</strong>
                                                </span>
                                            @endif
                                        </div>
                                    </div>
                                </div>

                                @php

                                    $offday = explode(',', $hrm_setting->weekend_day);



                                @endphp

                                <div class="form-group">
                                    <label for="exampleInputuname" class="col-sm-2 control-label">Weekends <span
                                            style="color: red">*</span></label>
                                    <div class="col-sm-10">
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                <?= ( in_array('Sun', $offday)) ? 'checked' : '' ?> value="Sun"
                                                id="Sunday" style="zoom: 1.5;">
                                            <label class="form-check-label" name for="flexCheckDefault">
                                                Sunday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                <?= ( in_array('Mon', $offday)) ? 'checked' : '' ?> value="Mon"
                                                id="monday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Monday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                <?= ( in_array('Tue', $offday)) ? 'checked' : '' ?> value="Tue"
                                                id="tuesday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Tuesday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                <?= ( in_array('Wed', $offday)) ? 'checked' : '' ?> value="Wed"
                                                id="wednesday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Wednesday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                <?= ( in_array('Thu', $offday)) ? 'checked' : '' ?> value="Thu"
                                                id="thursday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Thursday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                <?= ( in_array('Fri', $offday)) ? 'checked' : '' ?> value="Fri"
                                                id="friday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Friday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                <?= ( in_array('Sat', $offday)) ? 'checked' : '' ?> value="Sat"
                                                id="saturaday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Saturday
                                            </label>
                                        </div>
                                    </div>
                                </div>


                                <div class=" col-sm-4">&nbsp;</div>
                                <div class=" col-sm-4">
                                    <div class="form-group">
                                        <button type="submit" class="btn btn-info waves-effect waves-light m-t-10"
                                            style="width: 100%">Save</button>
                                    </div>
                                </div>
                            </form>


                        @else
                            <form class="form-horizontal"
                                action="{{ route('create.hrm.setting.attendance') }}"
                                method="POST" autocomplete="off">

                                {{ csrf_field() }}

                                <input type="hidden" value="{{ 'id' }}" name="id">
                                <div class="form-group">
                                    <label for="exampleInputuname" class="col-sm-2 control-label">Checkin <span
                                            style="color: red">*</span></label>
                                    <div class="col-sm-10">
                                        <div class="input-group">
                                            <div class="input-group-addon"><i class="ti-user"></i></div>
                                            <input type="time" class="form-control" name="checkin"
                                                id="exampleInputuname" placeholder="Enter Checkin Time">
                                            @if($errors->has('checkin'))
                                                <span class="help-block">
                                                    <strong>{{ $errors->first('checkin') }}</strong>
                                                </span>
                                            @endif
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputuname" class="col-sm-2 control-label"> Checkout <span
                                            style="color: red">*</span></label>
                                    <div class="col-sm-10">
                                        <div class="input-group">
                                            <div class="input-group-addon"><i class="ti-user"></i></div>
                                            <input type="time" class="form-control" name="checkout"
                                                id="exampleInputuname" placeholder="Enter Checkout Time">
                                            @if($errors->has('checkout'))
                                                <span class="help-block">
                                                    <strong>You have not entered time or entered the time after checkin.</strong>
                                                </span>
                                            @endif
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="exampleInputuname" class="col-sm-2 control-label">Late Fine <span
                                            style="color: red">*</span></label>
                                    <div class="col-sm-10">
                                        <div class="input-group">
                                            <div class="input-group-addon"><i class="ti-user"></i></div>
                                            <input type="integer" class="form-control" name="late_fine"
                                                id="exampleInputuname" placeholder="Enter Late Fine">
                                            @if($errors->has('late_fine'))
                                                <span class="help-block">
                                                    <strong>{{ $errors->first('late_fine') }}</strong>
                                                </span>
                                            @endif
                                        </div>
                                    </div>
                                </div>

                               

                                <div class="form-group">
                                    <label for="exampleInputuname" class="col-sm-2 control-label">Weekends <span
                                            style="color: red">*</span></label>
                                    <div class="col-sm-10">
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                               value="Sun"
                                                id="Sunday" style="zoom: 1.5;">
                                            <label class="form-check-label" name for="flexCheckDefault">
                                                Sunday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                value="Mon"
                                                id="monday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Monday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                              value="Tue"
                                                id="tuesday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Tuesday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                value="Wed"
                                                id="wednesday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Wednesday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                value="Thu"
                                                id="thursday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Thursday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                value="Fri"
                                                id="friday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Friday
                                            </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="checkbox" name="day[]"
                                                value="Sat"
                                                id="saturaday" style="zoom: 1.5;">
                                            <label class="form-check-label" for="flexCheckChecked">
                                                Saturday
                                            </label>
                                        </div>
                                    </div>
                                </div>


                                <div class=" col-sm-4">&nbsp;</div>
                                <div class=" col-sm-4">
                                    <div class="form-group">
                                        <button type="submit" class="btn btn-info waves-effect waves-light m-t-10"
                                            style="width: 100%">Save</button>
                                    </div>
                                </div>
                            </form>
                        @endif


                    </div>
                </div>
            </div>
            <!--./row-->
            </div>
            <!-- /.container-fluid -->

            @stop


                @section('js')

                <script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/jquery.inputmask.bundle.js"></script>

                <script type="text/javascript">
                    $(document).ready(function () {

                                $("#Sunday").click(function () {
                                    1

                                    $("#Sunday").value(1);

                                    $("#Saturaday").click(function () {

                                        $("#Saturaday").value(1);

                                    });
                                });
                </script>



                @stop