File: /var/www/vhosts/creativefellows.nl/jhtaxatie.creativefellows.nl/views/inspections/new_rack.php
<?php
echo '<div class="row rapportages">';
/*
* Header
*/
echo '<div class="small-12 columns">';
echo '<h1 class="text-center progress-header">Stelling toevoegen <span id="progress-status">0</span><a href="'. $router->pathFor("inspection.dashboard") .'" class="previous-step"><i class="fa fa-home" aria-hidden="true"></i></a></h1>';
echo '</div>';
echo '<div class="small-12 columns">';
echo '<form class="default-form" action="'. $router->pathFor('inspection.rackpost',["id" => $inspection->getId()] ) .'" method="post" enctype="multipart/form-data" data-abide novalidate>';
/*
* Loop input groups Input elements
*/
$i = 0;
foreach($data["rack_fields"] as $group_name => $form_elements)
{
$keys = array_keys($data["rack_fields"]);
$button_label = isset($keys[$i+1]) ? "Volgende": "Toevoegen";
$button_type = isset($keys[$i+1]) ? "button" : "submit";
// section id
$section_id = $group_name == "Keuringspunten - Oude stelling" || $group_name == "Keuringspunten - Nieuwe stelling" ? 'group'.$form_elements[0]->formVersionId() : 'group'. $i;
$next_section_id = $group_name == "Keuringspunten - Oude stelling" || $group_name == "Keuringspunten - Nieuwe stelling" ? 'group'.$form_elements[0]->formVersionId() : 'group'. ($i+1);
echo '<div class="row form-group'. ($i != 0 ? " hidden" : "") .'" id="'. $section_id .'" >';//data-toggler="hidden"
echo '<div class="small-12 columns">';
echo '<h3 class="text-center text-yellow">'. ucfirst($group_name) .'</h3><br />';
echo '</div>';
/*
* Loop input elements
*/
if($group_name == "Keuringspunten - Oude stelling" || $group_name == "Keuringspunten - Nieuwe stelling")
{
echo '<div class="small-12 columns">';
echo '<div class="rack-columns">';
foreach($form_elements as $element)
{
echo $element->getInputElement();
}
echo '</div>';
echo '</div>';
}
else{
foreach($form_elements as $element)
{
echo $element->getInputElement();
}
}
/*
* (Navigation) Buttons
*/
echo '<div class="small-12 large-12 columns">';
echo '<div class="input-group-button">';
echo '<button type="'. $button_type .'" class="button expanded navigate-form" data-show="'. $next_section_id .'" data-hide="'. $section_id .'">'. $button_label .'</button>';
echo '</div>';
echo '</div>';
echo '</div>';
//if(!in_array($group_name,["Keuringspunten - Oude stelling","Keuringspunten - Nieuwe stelling"])){
$i++;
// }
}
echo '</form>';
echo '</div>';
echo '</div>';
//d($rack_fields);
?>