This repository has been archived on 2025-03-31. You can view files and clone it, but cannot push or open issues or pull requests.
php-frs/prep_form.php

31 lines
587 B
PHP

<?php
use \Frs\FieldDefinition;
// FOR TESTING:
if (!isset($action)) {
$action = 'hotel';
$debug = true;
}
$skey = 'form_' . $action;
$fd = new FieldDefinition($action);
$placeholders = array(
'USER_NAME' => $data['user']['name_first'] . ' ' . $data['user']['name_last'],
'USER_EMAIL' => $data['user']['email'],
);
$fd->addFieldValues($_SESSION[$skey], $placeholders);
$by_group = $fd->getGroups();
// Convert hash to list for Mustache compatibility
$by_group = array_values($by_group);
if ($debug) {
print_r($by_group);
}
$data['form_data'] = $by_group;