@extends('main') @section('content')

@if(isset($craft)) Update @else Add @endif Craft Type

@if(isset($craft)) {!! Form::model($craft, ['method' => 'PATCH', 'action' => ['CraftTypeController@update', $craft->idCraft], 'class' => 'form-horizontal','files'=>true]) !!} @else {!! Form::open(['url' => 'crafts', 'class' => 'form-horizontal','files'=>true]) !!} @endif
{!! Form::select('type',['GI'=>'GI','NON-GI'=>'NON-GI'],null,['class' => 'form-control','required'=>'required','id'=>'gitype','onchange'=>'showParams()']) !!} @if($errors->has('type'))

{{ $errors->first('type') }}

@endif
{!! Form::text('name',null,['class' => 'form-control','minlength'=>'2','maxlength'=>'200','autocomplete'=>'off','required'=>'required']) !!} @if($errors->has('name'))

{{ $errors->first('name') }}

@endif
{!! Form::textarea('description',null,['class' => 'form-control','autocomplete'=>'off','size'=>'30x4']) !!} @if($errors->has('description'))

{{ $errors->first('description') }}

@endif
{!! Form::textarea('washing_instructions',null,['class' => 'form-control','autocomplete'=>'off','size'=>'30x4']) !!} @if($errors->has('washing_instructions'))

{{ $errors->first('washing_instructions') }}

@endif

@if(isset($craft))

Physical Test Parameter

{!! Form::select('physicalparams[]',PhysicalTestGI(),$craft->physicalParam->pluck('idTestParam')->toArray(),['class' => 'form-control show-tick ms select2','multiple'=>'multiple']) !!}

Lab Test Parameter

{!! Form::select('labparams[]',LabTestGI(),$craft->labTestParam->pluck('idTestParam')->toArray(),['class' => 'form-control show-tick ms select2','multiple'=>'multiple']) !!}
@else

Physical Test Parameter

{!! Form::select('physicalparams[]',PhysicalTestGI(),null,['class' => 'form-control show-tick ms select2','multiple'=>'multiple']) !!}

Lab Test Parameter

{!! Form::select('labparams[]',LabTestGI(),null,['class' => 'form-control show-tick ms select2','multiple'=>'multiple']) !!}
@endif
{!! Form::close() !!}

List Of Crafts

@foreach($crafts as $ph) @endforeach
S.No. GI/NON-GI Name Logo Physical Test Parameters Lab Test Parameters Action
{{ $i }} {{ $ph->type }} {{ $ph->name }} @foreach($ph->physicalParam as $pp) @php $aparameter = \App\TestParam::where('id','=',$pp->idTestParam)->first();@endphp {{$aparameter->param}}, @endforeach @foreach($ph->labtestParam as $lp) @php $bparameter = \App\TestParam::where('id','=',$lp->idTestParam)->first();@endphp {{$bparameter->param}}, @endforeach Edit Delete Label Display Information
@stop @section('script') @stop