I need to customize the registration history form template beyond what the adminstration can already do and need to request only specific custom fields on this page, I know I can use the the custom field in admin options but I need more... choices
the page: [Edit Registrant]
?option=com_eventbooking&task=edit_registrant&cid[]=9&from=history
the template file:
com_eventbooking/views/registrant/tmpl/default.php
the core function currently being used to dynamically get 'ALL the custom-field records' in edit mode from the eb admin options:
Code:
<?php
if (isset($this->jcFields)) {
if ($this->jcFields->getTotal()) {
echo $this->jcFields->renderCustomFieldsEdit($this->item->id);
}
}
?>
the code above pulls 'all the records', I only want to pull selected custom fields. ie. field ID 8 and 13
in addition to the standard Billing Fields I have added about 15 custom fields for the signup page, but I want it to only display maybe two of these custom fields once the user is logged in.
For example I have 2 new custom fields:
(custom form field id

Bus Transportation Required?: Yes / No
(custom form field id 13) How Many People require seat on Bus: QTY box
I have coded these above out (hidden) from my main registration sign-up page so they don't appear when someone initially registers as I would like the customer to comeback to site / login and then fill out additional forms fields.
What PHP function / my SQL call would I use to pull specifc fields bases on the field ID only for the end-user to edit in history?
Example (not working)
Code:
// Get custom Field # 8 only - Bus Transportation
<?php
if (isset($this->jcFields)) {
if ($this->jcFields->getTotal()) {
echo $this->jcFields->renderCustomFieldsEditMYCHOICE($this->item->id, 8); // Get custom Field # 8 only - Bus Transportation
}
}
?>
// Get custom Field # 8 only - Bus Transportation
<?php
if (isset($this->jcFields)) {
if ($this->jcFields->getTotal()) {
echo $this->jcFields->renderCustomFieldsEditMYCHOICE($this->item->id, 13); // Get custom Field # 13 only - Bus Seat QTY
}
}
?>
this code below is an example of what I am using on the sign-up page to allow me to pull custom field #5 (Dinner Preferences) so I can place is where I need it (hardcoded):
Code:
<?php // BOF Custom DB # for Dinner Preferences (5)
if ($this->customField) {
$fields = $this->fieldsList;
$fieldsOutput = $this->fieldsOutput;
foreach ($fields as $field)
{
// BEG: Custom DB # for Dinner Preferences (5)
if ($field->id == '5') {
// END: Lee
if ($field->depend_on_field_id)
{
$masterFieldValues = (array)$this->fieldAssoc[$field->depend_on_field_id]->field_values;
$dependOnOptions = explode(',', $field->depend_on_options);
if (count(array_intersect($masterFieldValues, $dependOnOptions)))
{
$displayStyle = '';
}
else
{
$displayStyle = 'style="display:none"';
}
}
else
{
$displayStyle = '';
}
switch ($field->field_type) {
case FIELD_TYPE_HEADING :
?>
<div class="control-group" id="field_<?php echo $field->name; ?>" <?php echo $displayStyle; ?>>
<label class="control-label"><?php echo JText::_($field->title) ; ?></label>
</div>
<?php
break ;
case FIELD_TYPE_MESSAGE :
?>
<div class="control-group" id="field_<?php echo $field->name; ?>" <?php echo $displayStyle; ?>>
<?php echo $field->description ; ?>
</div>
<?php
break ;
default:
?>
<div class="control-group" id="field_<?php echo $field->name; ?>" <?php echo $displayStyle; ?>>
<label class="control-label" for="<?php echo $field->name ; ?>">
<?php echo JText::_($field->title); ?>
<?php
if ($field->required)
{
echo '<span class="required">*</span>' ;
}
if (strlen(trim($field->description)))
{
?>
<p class="field_description"><?php echo $field->description ; ?></p>
<?php
}
?>
</label>
<div class="controls">
<?php echo $fieldsOutput[$field->name]; ?>
</div>
</div>
<?php
}
} // Lee
}
}
?>