@extends('layouts.admin') @php $isEdit = isset($notification) ? true : false; $isScheduled = ($isEdit && $notification->scheduled_date != null) ? 1 : 0; @endphp @section('css') @endsection @section('content')
{{ Form::open(['route' => $routes, 'method' => 'POST' ,'id' => 'ajaxSave' , 'class' => 'd-flex __notification_form'])}}
@if($isEdit) @method('PUT') {!! Form::hidden('resend',$resend ? 1 :0) !!} @endif
{{Form::label('user_type', __('notifications.users'), ['class' => 'control-label mb-2'])}}
{!! __('notifications.all') !!}{!! Form::radio('user_type',0, $isEdit && $notification->user_type == 0 ? 1 : 1 ,['class' => 'mx-2'])!!}
{!! __('notifications.private') !!}{!! Form::radio('user_type',1, $isEdit && $notification->user_type == 1 ? 1 : 0 ,['class' => 'mx-2'])!!}
{!! __('notifications.company') !!}{!! Form::radio('user_type',2, $isEdit && $notification->user_type == 2 ? 1 : 0 ,['class' => 'mx-2'])!!}
{{Form::label('send_to', __('notifications.send_to'), ['class' => 'control-label mb-2'])}}
{!! Form::select('send_to',pushType(), $isEdit ? $notification->send_to : 0,['class' => 'form-control' ])!!}
@if(array_key_exists('4',pushType()))
send_to != '4' ) style="display: none" @endif>
{{Form::label('users_ids[]', __('notifications.select_users'), ['class' => 'control-label mb-2'])}}
@php $uid = ''; if(isset($notification)){ $uid = "?uids=" . $notification->users_ids; } @endphp {!! Form::select('users_ids[]',[], null ,['class' => 'form-control select2-ajax-search' ,'multiple' ,'autofocus','data-select2-id' => "users-selection", 'data-form_id' => '__notification_form' , 'data-url' => route($select2Route).$uid])!!}
@endif
{{Form::label('title', __('notifications.__title'), ['class' => 'control-label mb-2'])}}
{{ Form::text('title', $isEdit ? $notification->title : '', ['class' => 'form-control emojiArea'])}}
{{Form::label('message', __('notifications.message'), ['class' => 'control-label mb-2'])}}
{{ Form::textarea('message', $isEdit ? $notification->message : '', ['class' => 'form-control emojiArea','rows'=>3])}}