@extends('layouts.app') @section('title', 'Acknowledge Document Management') @section('content')

{{ isset($document) && $document->id ? 'Edit' : 'Create' }} Acknowledge Document {{ isset($document) && $document->id ? 'Update existing' : 'Create new' }} policy & procedure document

@if(session('success'))

Success!

{{ session('success') }}
@endif @if(session('error'))

Error!

{{ session('error') }}
@endif

{{ isset($document) && $document->id ? 'Edit' : 'Create' }} Policy & Procedure Document

@csrf @if(isset($document) && $document->id) @endif
* @if ($errors->has('title')) {{ $errors->first('title') }} @endif
* @if ($errors->has('type')) {{ $errors->first('type') }} @endif
@if ($errors->has('is_active')) {{ $errors->first('is_active') }} @endif Only active documents will be shown to users for signing
*
@php $selectedRoles = old('roles', (isset($document) && $document->roles) ? $document->roles : []); // Normalize roles to strings for comparison $selectedRoles = array_map('strval', $selectedRoles); $isAllRolesSelected = empty($selectedRoles) || in_array('1', $selectedRoles) || in_array(1, $selectedRoles); @endphp
@if ($errors->has('roles')) {{ $errors->first('roles') }} @endif Select which user roles this document applies to. "All" is selected by default.
Select companies for this document. "All" is selected by default, but can be removed to select specific companies only. @if ($errors->has('companies')) {{ $errors->first('companies') }} @endif
@if(Auth::check() && Auth::user()->user_role == 1)

Accepted Parameters

You can use the following placeholders in your document content that will be automatically replaced when users view or sign the document:

  • [Agent Name] or [agent_name] - Will be replaced with the user's full name
  • [Agent Email] or [agent_email] - Will be replaced with the user's email address
  • [Company Name] or [company_name] - Will be replaced with the user's company name
  • [Super Admin Signature] or [super_admin_signature] - Will be replaced with the Super Admin signature image
@endif
* @if ($errors->has('content')) {{ $errors->first('content') }} @endif
@if(isset($document) && $document->id)

Document Information

Created: {{ $document->created_at->format('M d, Y g:i A') }}
Last Updated: {{ $document->updated_at->format('M d, Y g:i A') }}
Type: {{ $document->type ?? 'Policy and Procedures' }}
Created By: {{ $document->creator->first_name ?? 'Unknown' }} {{ $document->creator->last_name ?? '' }}
Status: @if($document->is_active) Active @else Inactive @endif
@if($document->pdf_path) PDF Generated: View PDF @endif

@endif
@endsection