I am using Chronoforms 4 and the DB Multi Record Loader to display a table of records. Everything is working great except I can't figure out how to alphabetize the table based on the "Company Name" field — in my code below that is $detail['q1_company_name']
Here is the Custom Code I'm using. I've also attached a screenshot of what the front-end output looks like.
Here is the Custom Code I'm using. I've also attached a screenshot of what the front-end output looks like.
<h1>Edit GOSheet Records</h1><table>
<tr>
<td width="250"><b>Company</b></td>
<td width="200"><b>Product Type</b></td>
<td width="200"><b>Plan Type</b></td>
<td width="225"><b>Movement Type</b></td>
<td width="200"><b>Date Created</b></td>
<td width="200"><b>Last Modified</b></td>
<td width="100"><b>User ID</b></td>
</tr>
<?php
foreach($form->data['UserDetails'] as $detail):
?>
<tr>
<td width="500"><a href="index.php?option=com_chronoforms&chronoform=trexadd&token=<?php echo $detail['cf_uid']; ?>"><?php echo $detail['q1_company_name']; ?></a> </td>
<td width="200"><?php echo $detail['q1_product_type']; ?></td>
<td width="200"><?php echo $detail['q1_plan_type']; ?></td>
<td width="225"><?php echo $detail['q1_movement_type']; ?></td>
<td width="200"><?php echo $detail['cf_created']; ?></td>
<td width="200"><?php echo $detail['cf_modified']; ?></td>
<td width="100"><?php echo $detail['cf_user_id']; ?></td>
</tr>
<?php
endforeach;
?>
</table>