HSF301 Preferred Contractors Listing – View All Records
Add New Record
[php]
$form_id = 15;
$args = array(
'form_id' => $form_id,
);
// This will return an array of sub objects.
$subs = Ninja_Forms()->subs()->get( $args );
echo '[table align="center"][tr][td]Business Details[/td][td]Business Type[/td][td]Contact Details[/td][/tr]';
// This is a basic example of how to interact with the returned objects.
// See other documentation for all the methods and properties of the submission object.
foreach ( $subs as $sub ) {
echo '[tr]';
$form_id = $sub->form_id;
//$user_id = $sub->user_id;
// Returns an array of [field_id] => [user_value] pairs
$all_fields = $sub->get_all_fields();
// Echoes out the submitted value for a field
echo '[td style="text-align:left;"]';
echo $sub->get_field( 1323 ) . '[br /]' . $sub->get_field( 1324 ) . '[br /]' . $sub->get_field( 1325 ) . '[br /]' . $sub->get_field( 1326 );
echo '[/td][td]';
echo $sub->get_field( 1309 ) . ' ' . $sub->get_field( 1327 );
echo '[/td][td style="text-align:left;"]';
echo $sub->get_field( 1332 ) . '[br /]' . $sub->get_field( 1333 ) . '[br /]' . $sub->get_field( 1334 ) . '[br /]' . $sub->get_field( 1335 );
echo '[/td][/tr]';
}
echo '[/table]';
[/php]