VERO/prepareIdentificatorSummary.php
2026-03-04 10:12:09 +01:00

48 lines
1.9 KiB
PHP

<?php
/*
Test des Skripts
$identificatorArray = [
[ "fieldId" => "identificator_select1", "fieldValue" => "DOI", "fieldType" => "select", "inputType" => "text", "isSelected" => 1 ],
[ "fieldId" => "identificatorinput1", "fieldValue" => "10.1000/190", "fieldType" => "input", "inputType" => "text", "isSelected" => 1 ],
[ "fieldId" => "identificator_select2", "fieldValue" => "URN", "fieldType" => "select", "inputType" => "text", "isSelected" => 1 ],
[ "fieldId" => "identificatorinput2", "fieldValue" => "urn:nbn:de:bvb:91-diss20060308-141754149", "fieldType" => "input", "inputType" => "text", "isSelected" => 1 ]
] ;
*/
// print_r($identificatorArray);
$identificatorDataHTML = '<div class="container mt-4">
<h4>Identifikatoren</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>
';
for ($c = 0; $c < count($identificatorArray); $c++) {
$pid = $identificatorArray[$c]['fieldValue'];
$c++;
$content = $identificatorArray[$c]['fieldValue'];
if (strcmp(trim($pid), trim($content)) == 0) continue;
if ((strlen($pid) == 0) || (strlen($content) == 0)) continue;
$identificatorDataHTML .= ' <tr>
<td>' .$pid .'</td>
<td>' .$content .'</td>
</tr>';
}
$identificatorDataHTML .= ' </tbody>
</table>
</div>';
// echo $identificatorDataHTML; exit;
?>