<?= $this->extend('layouts/enterprise') ?>

<?= $this->section('content') ?>

<?= view('partials/workspace_hero', [
    'workspaceCrumbPill'    => 'Operations',
    'workspaceCrumbCurrent' => 'Capture Signature',
    'workspaceTitle'        => 'Capture Signature',
    'workspaceDesc'         => 'Record customer sign-off for a service visit or inspection.',
]) ?>

<article class="enterprise-settings-card" style="max-width:860px;">
    <div class="enterprise-settings-card__head">
        <i class="fa-solid fa-signature"></i>
        <h2 class="enterprise-settings-card__title">Signature Details</h2>
    </div>

    <?php if (session()->getFlashdata('errors')): ?>
        <div class="alert alert-danger py-2 small">
            <ul class="mb-0 ps-3">
                <?php foreach ((array) session()->getFlashdata('errors') as $err): ?>
                    <li><?= esc(is_array($err) ? implode(', ', $err) : $err) ?></li>
                <?php endforeach; ?>
            </ul>
        </div>
    <?php endif; ?>

    <form action="<?= base_url('operations/field-service/customer-signatures') ?>" method="post" novalidate>
        <?= csrf_field() ?>
        <?= $this->include('Modules\Operations\Views\field_service\customer_signatures\_form') ?>
        <div class="enterprise-settings-card__footer">
            <a href="<?= base_url('operations/field-service/customer-signatures') ?>" class="btn btn-outline-secondary">Cancel</a>
            <button type="submit" class="btn btn-primary">Capture Signature</button>
        </div>
    </form>
</article>

<?= $this->endSection() ?>
