@extends('layouts.master')

@section('content')
<div class="content">
    <div class="row" style="min-height: 500px">
        <form action="{{ url('admin/grade_structure/store') }}" enctype="multipart/form-data" method="POST" role="form">
        <div class="col-md-8 col-md-offset-2">
            <header class="panel-heading" style="height:50px;">
                <div class="pull-left">
                    {{$title}}
                </div>
                <div>
                     @if(\Auth::user()->utype==1)
                        <a href="{{ url('admin/grade_structure') }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-list"></i> Grade Structure List</a> <br><br>
                    @endif
                </div>
            </header>
        </div>
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-body">
                    {{ csrf_field() }}
                    <div class="col-md-10 col-md-offset-1">
                        <div class="form-group {{ $errors->has('grade') ? 'has-error' : '' }}">
                            <label for="grade">Grade <i class="text-danger">*</i></label>
                            <select name="grade" id="grade" class="form-control">
                                <option disabled="" selected="" value="">Choice One..</option>
                                @foreach($grade as $row)
                                <option value="{{$row->id}}" @if (old('grade') == $row->id) selected="selected" @endif>{{$row->name}}</option>
                                @endforeach
                            </select>
                            <lebel class="text-danger"> {{ $errors->first('grade') }}</lebel>
                        </div>
                    </div>
                    <div class="col-md-10 col-md-offset-1">
                        <div class="form-group {{ $errors->has('payroll_head') ? 'has-error' : '' }}">
                            <label for="payroll_head">Payroll Head  <i class="text-danger">*</i></label>
                            <select name="payroll_head" id="payroll_head" class="form-control">
                                <option disabled="" selected="" value="">Choice One..</option>
                                @foreach($head as $row)
                                <option value="{{$row->id}}" @if (old('payroll_head') == $row->id) selected="selected" @endif>{{$row->name}}</option>
                                @endforeach
                            </select>
                            <lebel class="text-danger"> {{ $errors->first('payroll_head') }}</lebel>
                        </div>
                    </div>
                    <div class="col-md-10 col-md-offset-1">
                        <div class="form-group {{ $errors->has('amount') ? 'has-error' : '' }}">
                            <label for="amount">Amount <i class="text-danger">*</i></label>
                            <input type='text' name="amount" id="amount" class="form-control" value="{{ old('amount') }}" placeholder="Amount">
                            <lebel class="text-danger"> {{ $errors->first('amount') }}</lebel>
                        </div>
                    </div>
                    <div class="col-md-10 col-md-offset-1" style="margin-top: 30px;">
                        <a href="{{ url('admin/grade_structure') }}" class="btn btn-default pull-left">
                            <span class="btn-icon"> 
                                <i class="fa fa-times"></i>
                            </span>
                            Cancel
                        </a>
                        <button type="submit" class="btn btn-inline btn-success pull-right">
                            <span class="btn-icon"> 
                                <i class="fa fa-save"></i>
                            </span>
                            Submit
                        </button>
                    </div>
                </div>
            </div>
        </div>

        </form>
    </div>
</div>
@stop


@section('script')
@if(Session::has('msg'))
    <div class="alert alert-success center-block msg_alt" >
        <a class="close" data-dismiss="alert" href="#">&times;</a>
        <strong><i class="fa fa-check"></i></strong>&nbsp;
    {{Session::get('msg')}}
    </div>
@endif

@stop