@extends('layouts.app') @section('page-title')

{{ __($pageTitle) }}

@endsection @push('head-script') @endpush @section('content')
@lang('modules.expenses.addExpense')
{!! Form::open(['id'=>'createExpense','class'=>'ajax-form','method'=>'POST']) !!}
@if(in_array('projects', $modules))
@endif
@lang('app.selectFile') @lang('app.change') @lang('app.remove')
@if(count($fields) > 0)

@lang('modules.projects.otherInfo')

@foreach($fields as $field)
@if( $field->type == 'text') @elseif($field->type == 'password') @elseif($field->type == 'number') @elseif($field->type == 'textarea') @elseif($field->type == 'radio')
@foreach($field->values as $key=>$value) @endforeach
@elseif($field->type == 'select') {!! Form::select('custom_fields_data['.$field->name.'_'.$field->id.']', $field->values, isset($editUser)?$editUser->custom_fields_data['field_'.$field->id]:'',['class' => 'form-control gender']) !!} @elseif($field->type == 'checkbox')
@foreach($field->values as $key => $value) @endforeach
@elseif($field->type == 'date') @endif
@endforeach
@endif
{!! Form::close() !!}
{{--Ajax Modal--}} {{--Ajax Modal Ends--}} @endsection @push('footer-script') @endpush {{-- var employees = @json($employees); var allProjects = @json($projects); $('#user_id').change(function (e) { // get projects of selected users var opts = ''; var employee = employees.filter(function (item) { return item.id == e.target.value }); var role = ''; $.each( employee, function() { role = employee[0].user_other_role; }); if(role == 'admin'){ allProjects.forEach(project => { opts += `` }) } else { employee[0].user.projects.forEach(project => { opts += `` }) } $('#project_id').html(''+opts) }); --}}