<?php

/* Testdaten
$subjectArray = [
	[ 'fieldId' => 'subjectinput1', 'fieldValue' => 'Schlagwort 1', 'fieldType' => 'input', 'inputType' => 'text', 'isSelected' => 1 ], 
	[ 'fieldId' => 'subjectinput2', 'fieldValue' => 'Schlagwort 2', 'fieldType' => 'input', 'inputType' => 'text', 'isSelected' => 1 ], 
	[ 'fieldId' => 'subjectinput3', 'fieldValue' => 'Schlagwort 3', 'fieldType' => 'input', 'inputType' => 'text', 'isSelected' => 1 ]
];	
 */

// print_r($subjectArray) ; exit;

$subjectDataHTML = '<div class="container mt-4">
			      <h4>Freie Schlagworte</h4>
                              <table class="table table-striped table-bordered" >
                                  <thead style="background-color:#14416b;">
                                      <tr>
                                          <th style="width: 20%;"><h5>Feldbezeichnung</h5></th>
                                          <th style="width: 80%;"><h5>Inhalt</h5></th>
                                      </tr>
                                 </thead>
                                 <tbody>
';


foreach ($bibliographicArray as $content)  {
        switch ($content['fieldId'])  {
            case 'subjectinput1': $i=1;
            case 'subjectinput2': $i=2;
            case 'subjectinput3': $i=3;
            case 'subjectinput4': $i=4;
            case 'subjectinput5': $i=5;
            case 'subjectinput6': $i=6;
            case 'subjectinput7': $i=7;
            case 'subjectinput8': $i=8;
            case 'subjectinput9': $i=9;
                                 if (strlen($content['fieldValue'])) {
                                        $bibliographicDataHTML .= '   <tr>
                                                                          <td>Schlagwort ${i}</td>
                                                                          <td> ' .$content['fieldValue'] .'</td>
                                                                      </tr>';
                                    }
                                break;
       }
}

$subjectDataHTML .= '	</tbody>
        		     </table>
    			   </div>'; 

