Files
crm-ms1/v4_ci4/app/Views/dynamicforms/form.php
2026-05-27 11:44:10 -04:00

124 lines
3.9 KiB
PHP

<?php
$title = "Events";
$menu = "menus/men_list";
$header = "headers/hea_default";
$this->setVar('menu', $menu);
$this->setVar('header', $header);
$this->setVar('title', $title);
use App\Libraries\QrCodeService;
?>
<?= $this->extend('layouts/default') ?>
<?= $this->section('content') ?>
<div class="content relative lg:px-4 flex-grow">
form pas module
<!--:Prelaoder:-->
<div id="preloader" class="absolute inset-0 w-full h-[75vh] flex items-center justify-center z-50">
<div class="size-12 bg-white shadow-xl rounded-full flex items-center justify-center">
<div class="animate-spin rounded-full size-10 border-b-2 border-primary"></div>
</div>
</div>
<div id="readers-container" class="px-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4 mb-4">
</div>
<div id="readerstp-container" class="px-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4 mb-4">
</div>
<?php
?>
<div class="px-4" data-collapse-root>
<!-- Contenu collapsable -->
<div class="mt-2">
<div class="w-full lg:col-span-8">
<div class="rounded-xl bg-green-300 dark:bg-zinc-900 shadow-card overflow-hidden">
<div class="flex items-center justify-between p-4 pb-2">
<h1>Formulaire</h1>
</div>
<div class="overflow-x-auto px-2">
<?php if (isset($parentFormCode, $parentId)): ?>
<form method="post" action="<?= site_url('v4/dynamic/save/' . $code . '/' . $id . '/parent/' . $parentFormCode . '/' . $parentId) ?>">
<?php else: ?>
<form method="post" action="<?= site_url('v4/dynamic/save/' . $code . '/' . $id) ?>">
<?php endif; ?>
<table class="min-w-full text-sm text-left border border-zinc-200 dark:border-zinc-700 bg-white">
<tbody>
<?php foreach ($fields as $field): ?>
<tr class="border-b border-zinc-200 dark:border-zinc-700">
<td class="px-3 py-2 border-r border-zinc-200 dark:border-zinc-700 font-semibold w-1/3 bg-zinc-50">
<?= esc($field['label']) ?>
</td>
<td class="px-3 py-2">
<?= \App\Modules\DynamicForms\Libraries\FieldRenderer::render($field, $record) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="p-4 flex gap-2">
<button class="px-3 py-2 bg-primary text-white rounded-lg">
Sauvegarder
</button>
<a href="<?= \App\Libraries\Nav::back() ?>" class="px-3 py-2 bg-zinc-300 text-black rounded-lg">
Annuler
</a>
</div>
</form>
<?php if (!empty($childLists)): ?>
<div class="mt-6 space-y-4">
<?php foreach ($childLists as $childHtml): ?>
<?= $childHtml ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
<?= $this->endSection() ?>