@extends('Frontend.Layouts.modal') @section('modal_class', 'modal-md') @section('title') {!! trans('global.add_new') !!} @stop @section('body') {!!Form::open(['route' => 'alerts.store', 'method' => 'POST', 'class' => 'alert-form'])!!} {!!Form::hidden('id')!!}
{!!Form::label('name', trans('validation.attributes.name').'*:')!!} {!!Form::text('name', null, ['class' => 'form-control'])!!}
{!! Form::label('devices', trans('validation.attributes.devices').'*:') !!} {!! Form::select('devices[]',$devices , null, ['class' => 'form-control multiexpand', 'multiple' => 'multiple', 'data-live-search' => 'true', 'data-actions-box' => 'true']) !!}
{!! Form::label('type', trans('validation.attributes.type').':') !!} {!! Form::select('type', array_pluck($types, 'title', 'type'), null, ['class' => 'form-control']) !!}
@foreach($types as $type)
@if ( ! empty($type['attributes'])) @foreach($type['attributes'] as $attribute)
{!!Form::label($attribute['name'], $attribute['title'])!!} @if ($type['type'] == 'custom' && $attribute['type'] == 'multiselect') {!! Form::select($attribute['name'].'[]', array_pluck($attribute['options'], 'items', 'name'), $attribute['default'], ['class' => 'form-control multiexpand half', 'multiple' => 'multiple', 'data-live-search' => 'true', 'data-actions-box' => 'true']) !!} @elseif ($attribute['type'] == 'multiselect-group') {!! Form::select($attribute['name'].'[]', $attribute['options'], $attribute['default'], ['class' => 'form-control multiexpand', 'multiple' => 'multiple', 'data-live-search' => 'true', 'data-actions-box' => 'true']) !!} @elseif ($attribute['type'] == 'multiselect') {!! Form::select($attribute['name'].'[]', array_pluck($attribute['options'], 'title', 'id'), $attribute['default'], ['class' => 'form-control multiexpand', 'multiple' => 'multiple', 'data-live-search' => 'true', 'data-actions-box' => 'true']) !!} @elseif ($attribute['type'] == 'select') {!! Form::select($attribute['name'], array_pluck($attribute['options'], 'title', 'id'), $attribute['default'], ['class' => 'form-control', 'data-live-search' => 'true']) !!} @else {!! Form::text($attribute['name'], $attribute['default'], ['class' => 'form-control']) !!} @endif @if ( ! empty($attribute['description']))
{!! $attribute['description'] !!}
@endif
@endforeach @endif
@endforeach
@if (!empty($geofences))
{!! Form::hidden('zone', 0) !!}
{!! Form::checkbox('zone', 1) !!} {!! Form::label(null, trans('front.zone_in')) !!}
{!! Form::checkbox('zone', 2) !!} {!! Form::label(null, trans('front.zone_out')) !!}
{!!Form::select('zones[]', $geofences, null, ['class' => 'form-control multiexpand', 'multiple' => 'multiple', 'data-live-search' => 'true', 'data-actions-box' => 'true'])!!}
@else @endif
{!! Form::hidden('schedule', 0) !!}
{!! Form::checkbox('schedule', 1) !!} {!! Form::label(null, trans('validation.attributes.schedule')) !!}