} } } } //POST data evaluation if (isset($_POST['hidden_action'])) { $problems = ""; if ($_POST['hidden_action'] == "searchName") { $barcode = $_POST["input_result_barcode_matnr"]; if (strlen($barcode) == 12) { $barcode = "0" . $barcode; } switch (strlen($barcode)) { case 13: //Barcode $checksum = buildChecksum(substr($barcode, 0, 12)); if ($checksum == substr($barcode, -1)) { $matnr = substr($barcode, 5, -1); } else { $problems = gettext("Bad barcode checksum"); } break; case 7: $matnr = $_POST["input_result_barcode_matnr"]; break; default: $problems = gettext("Invalid matriculation number format"); break; } if (empty($problems)) { $eoDatabase = exam_organization_database::getInstance();
function printRightLabel($name, $forename, $matrNr, $room, $place) { global $y, $pdf, $style, $exam_name, $semester, $date, $IDcounter; $pdf->SetFont('helvetica', '', 12); $pdf->MultiCell(90, 5, $exam_name, 0, 'C', 0, 0, X2, $y, true); $pdf->MultiCell(90, 5, $date . ' (' . $semester . ')', 0, 'C', 0, 0, X2, $y + 5, true); $pdf->SetFont('helvetica', 'B', 12); $pdf->MultiCell(90, 5, $name . ', ' . $forename . ' (' . $matrNr . ')', 0, 'C', 0, 0, X2, $y + 13, true); $pdf->SetFont('helvetica', '', 10); $pdf->MultiCell(90, 5, gettext("room") . ' ' . $room . ', ' . gettext("place") . ' ' . $place, 0, 'C', 0, 0, X2, $y + 18, true); $checksum = buildChecksum('00000' . $matrNr); $pdf->write1DBarcode('00000' . $matrNr . $checksum, 'EAN13', X2 + 45, $y + 25, 38, 20, 0.4, $style, 'C'); $pdf->SetFont('helvetica', 'B', 20); $pdf->MultiCell(20, 5, ++$IDcounter, 0, 'C', 0, 0, X2 + 7, $y + 28, true); }