dbfdg @extends('layouts.admin') @php $attachments=\App\Models\Utility::get_file('contract_attechment'); @endphp @push('css-page') @endpush @section('page-title') {{ __('Contract Detail') }} @endsection @push('script-page') @endpush @section('breadcrumb') @endsection @section('action-btn')
@if((\Auth::user()->type=='company')) @endif @if((\Auth::user()->type=='company')) @elseif(\Auth::user()->type == 'client' && ($contract->status == 'accept')) @endif @php $status = App\Models\Contract::status(); @endphp @php $status = App\Models\Contract::status(); @endphp @if(\Auth::user()->type == 'client' ) @endif
@endsection @section('content')
{{ __('Attachment') }}

{{count($contract->files)}}

{{ __('Comment') }}

{{count($contract->comment)}}

{{ __('Notes') }}

{{count($contract->note)}}

{{ __('Contract Detail') }}

{{ __('Subject') }}
{{ $contract->subject}}
{{ __('Project') }}
{{ !empty($contract->projects)?$contract->projects->project_name:'-' }}
{{ __('Value') }}
{{ \Auth::user()->priceFormat($contract->value) }}
{{__('Type')}}
{{ !empty($contract->types)?$contract->types->name:'-' }}
{{__('Status')}}
{{$contract->status }}
{{__('Start Date')}}
{{ Auth::user()->dateFormat($contract->start_date) }}
{{__('End Date')}}
{{ Auth::user()->dateFormat($contract->end_date) }}
{{ __('Contract Description ') }}
{{ __('Contract Attachments') }}
@if(\Auth::user()->type=='company')
@elseif(\Auth::user()->type == 'client' && $contract->status=='accept' )
@endif
@foreach($contract->files as $file)
{{ $file->files }}

@if(!empty($file->files) && file_exists(storage_path('contract_attechment/' . $file->files))) {{ number_format(\File::size(storage_path('contract_attechment/' . $file->files)) / 1048576, 2) . ' ' . __('MB') }} @endif

@if ((\Auth::user()->type == 'company' && $contract->status == 'accept') || \Auth::user()->id == $file->user_id)
{!! Form::open(['method' => 'DELETE', 'route' => ['contracts.file.delete', $contract->id, $file->id]]) !!} {!! Form::close() !!}
@endif
@endforeach
{{ __('Comments') }}
@if(\Auth::user()->type == 'company')
@elseif(\Auth::user()->type == 'client' && $contract->status=='accept' )
@endif
@foreach($contract->comment as $comment) @php $user = \App\Models\User::find($comment->user_id); $logo=\App\Models\Utility::get_file('uploads/avatar/'); @endphp

{{ $comment->comment }}

{{$comment->created_at->diffForHumans()}}
@if ((\Auth::user()->type == 'company' && $contract->status == 'accept') || \Auth::user()->id == $comment->user_id)
{!! Form::open(['method' => 'DELETE', 'route' => ['comment_store.destroy', $comment->id]]) !!} {!! Form::close() !!}
@endif
@endforeach
{{ __('Notes') }}
@php $user = \App\Models\User::find(\Auth::user()->creatorId()); $plan= \App\Models\Plan::getPlan($user->plan); @endphp @if($plan->chatgpt == 1) @endif
@if(\Auth::user()->type == 'company')
{{ Form::open(['route' => ['note_store.store', $contract->id]]) }}
{{ Form::submit(__('Add'), ['class' => 'btn btn-primary']) }}
{{ Form::close() }}
@elseif(\Auth::user()->type == 'client' && $contract->status=='accept' )
{{ Form::open(['route' => ['note_store.store', $contract->id]]) }}
{{ Form::submit(__('Add'), ['class' => 'btn btn-primary']) }}
{{ Form::close() }}
@endif
@foreach($contract->note as $note) @php $user = \App\Models\User::find($note->user_id); $logo=\App\Models\Utility::get_file('uploads/avatar/'); @endphp

{{ $note->notes }}

{{$note->created_at->diffForHumans()}}
@if ((\Auth::user()->type == 'company' && $contract->status == 'accept') || \Auth::user()->id == $note->user_id)
{!! Form::open(['method' => 'DELETE', 'route' => ['note_store.destroy', $note->id]]) !!} {!! Form::close() !!}
@endif
@endforeach
@endsection