HSF717 WHS Induction Checklist – View All Records

HSF717 WHS Induction Checklist – View All Records

Add New Record

[php]

$form_id = 17;
$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]Status[/td][td]Name[/td][td]Dept/Co.[/td][td]Induction Date[/td][td]Inducted By[/td][td]Position[/td][td]Induction Items Completed[/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]';

echo $sub->get_field( 1349 );

echo '[/td][td]';
echo $sub->get_field( 1350 );
echo '[/td][td]';
echo $sub->get_field( 1351 );
echo '[/td][td]';
echo $sub->get_field( 1352 );
echo '[/td][td]';
echo $sub->get_field( 1353 );
echo '[/td][td]';
echo $sub->get_field( 1354 );
echo "[/td][td class='left']";

$checkboxes = $sub->get_field( 1357 );
echo '[ul]';
foreach($checkboxes as $key => $value){
echo '[li]' . strip_tags(html_entity_decode($value)) . '[/li]';
}
echo '[/ul]';
echo '[/td][/tr]';

}
echo '[/table]';
[/php]