@extends('layouts/gnr_layout') @section('title', '| Role') @section('content')
New Role
{!! Form::open(['url'=>'','class'=>'form-horizontal form-group']) !!}
{!! Form::label('name', 'Role Name:', ['class' => 'col-sm-2 control-label']) !!}
{!! Form::text('name', $value = null, ['class' => 'form-control', 'id' => 'name', 'type' => 'text', 'placeholder' => 'Enter Role Name']) !!}
{!! Form::label('module', 'Modules:', ['class' => 'col-sm-2 control-label']) !!}
@php $modules = DB::table('gnr_module')->select('id','name','code')->get(); $subFunctions = DB::table('gnr_sub_function')->select('id','subfunctionName')->get(); @endphp {{-- /////////// --}}
@foreach ($modules as $index => $module2)
@php $functions = DB::table('gnr_function')->where('moduleIdFK',$module2->id)->select('id','name')->orderBy('name')->get(); @endphp {{-- Print Functions --}}
@foreach($functions as $function)
{!! Form::label($function->name,$function->name,['class'=>'textBold']) !!}     {!! Form::checkbox('checkAll', null, false,['class'=>'checkAll']) !!} {!! Form::label($function->name,'Check/Uncheck All') !!}
@foreach($subFunctions as $subFunction) {!! Form::checkbox($function->name, $subFunction->id, false,['moduleId'=>$module2->id,'functionId'=>$function->id,'class'=>'checkItem']) !!} {!! Form::label($subFunction->subfunctionName,$subFunction->subfunctionName) !!}         @endforeach

@endforeach
{{-- End Print Functions --}}
@endforeach
{{-- form-group --}} {{-- ///////////// --}}
{!! Form::label('description', 'Description:', ['class' => 'col-sm-2 control-label']) !!}
{!! Form::textArea('description', $value = null, ['class' => 'form-control', 'id' => 'description','rows'=>'2', 'placeholder' => 'Enter Description']) !!}
{!! Form::button('Submit', ['id' => 'submitButton', 'class' => 'btn btn-info']) !!} Close
{!! Form::close() !!}
@endsection