@extends('layouts.admin') @section('title') {{ $contract->subject }} @endsection @php $avatar = \App\Models\Utility::get_file('avatars/'); $attachments = \App\Models\Utility::get_file('contract_attechment/'); $logo_path = \App\Models\Utility::get_file('/'); @endphp @push('css') @endpush @push('theme-script') @endpush @section('action-button')
@php $editstatus = App\Models\Contract::editstatus(); @endphp @if (\Auth::user()->type == 'client') @endif
@if (Auth::user()->type == 'owner') @endif @if (\Auth::user()->type == 'owner' && $contract->owner_signature == null) @endif @if (\Auth::user()->type == 'owner' || $contract->client == Auth::user()->id) @endif @if (\Auth::user()->type == 'owner' && $contract->owner_signature == null) @endif @if (\Auth::user()->type == 'client' && $contract->status == 'accept') @endif @endsection @section('content')
{{ __('General') }}

{{ __('Detail of your Contract.') }}

{{ __('Attachment') }}

{{ __('You can manage your attachment here') }}

{{ __('Comment') }}

{{ __('You can manage your comment here.') }}

{{ __('Notes') }}

{{ __('You can manage your notes rate here.') }}

{{ __('Total Attachment') }}
{{ count($contract->taskFiles) }}
{{ __('Total Comment') }}
{{ count($contract->comment) }}
{{ __('Total Notes') }}
{{ count($contract->note) }}
{{ __('Client Name') }}
{{ !empty($contract->clientdetail) ? $contract->clientdetail->name : '' }}
{{ __('Project Name') }}
{{ !empty($contract->getprojectname) ? $contract->getprojectname->title : '-' }}
{{ __('Value') }}
{{ Auth::user()->priceFormat($contract->value) }}
{{ __('Contract Type') }}
{{ !empty($contract->ContractType) ? $contract->ContractType->name : '-' }}
{{ __('Start Date') }}
{{ Auth::user()->dateFormat($contract->start_date) }}
{{ __('End Date') }}
{{ Auth::user()->dateFormat($contract->end_date) }}
{{ __('Description ') }}
{{ Form::open(['route' => ['contract.contract_description.store', $contract->id]]) }}
@if ($contract->status == 'accept')
{{ Form::submit(__('Save Changes'), ['class' => 'btn btn-sm btn-primary rounded-pill']) }}
@endif {{ Form::close() }}
{{ __('Upload File') }}
@if ($contract->status == 'accept')
@endif
@foreach ($contract->taskFiles as $file)
{{ $file->name }}

{{ $file->file_size }}

@if ($contract->status == 'accept') @if ($contract->client == Auth::user()->id) @if (Auth::user()->id == $file->created_by) @auth('web') {!! Form::open([ 'method' => 'GET', 'route' => ['contracts.file.delete', $file->id], 'id' => 'delete-Attachments-' . $file->id, ]) !!} {!! Form::close() !!} @endauth @else @endif @else @auth('web') {!! Form::open([ 'method' => 'GET', 'route' => ['contracts.file.delete', $file->id], 'id' => 'delete-Attachments-' . $file->id, ]) !!} {!! Form::close() !!} @endauth @endif @endif
@endforeach
{{ __('Comments') }}
@if(Utility::plancheck()['enable_chatgpt'] == 'on') @endif
@if($contract->status == 'accept')
@csrf
@endif
@foreach ($contract->comment as $comment)
@php $user = App\Models\user::find($comment->user_id); @endphp @if($user->avatar) {{ $user->name }} @else img_avatar }} title="{{ $user->name }}"> @endif

{{ $comment->comment }}

@if($contract->status == 'accept') @if ($contract->client == Auth::user()->id) @if (Auth::user()->id == $comment->created_by)
{!! Form::open([ 'method' => 'GET', 'route' => ['comment_store.destroy', $comment->id], 'id' => 'delete-comment-' . $comment->id, ]) !!} {!! Form::close() !!}
@else @endif @else
{!! Form::open([ 'method' => 'GET', 'route' => ['comment_store.destroy', $comment->id], 'id' => 'delete-comment-' . $comment->id, ]) !!} {!! Form::close() !!}
@endif @endif
@endforeach
{{ __('Notes') }}
@if ($contract->status == 'accept') @if (Utility::plancheck()['enable_chatgpt'] == 'on') @endif {{ Form::open(['route' => ['note_store.store', $contract->id]]) }}
{{ Form::submit(__('Add'), ['class' => 'btn btn-sm btn-primary rounded-pill']) }}
{{ Form::close() }} @endif
@foreach ($contract->note as $note)
@php $user = App\Models\user::find($note->user_id); @endphp

{{ $note->note }}

{{ $note->created_at->diffForHumans() }}
@if ($contract->status == 'accept') @if ($contract->client == Auth::user()->id) @if (Auth::user()->id == $note->created_by) {!! Form::open([ 'method' => 'GET', 'route' => ['note_store.destroy', $note->id], 'id' => 'delete-note-' . $note->id, ]) !!} {!! Form::close() !!} @endif @else {!! Form::open([ 'method' => 'GET', 'route' => ['note_store.destroy', $note->id], 'id' => 'delete-note-' . $note->id, ]) !!} {!! Form::close() !!} @endif @endif
@endforeach
@endsection @push('script') @endpush