26 lines
701 B
PHP
26 lines
701 B
PHP
<?php
|
|
require_once("../include/utilities.php");
|
|
require_once("../include/db.php");
|
|
require_once("../include/document.php");
|
|
|
|
if (!isset($_GET['equip']) && isset($_GET['search'])) {
|
|
// Serienr
|
|
$ret = db_search_lances("","","", $_GET['search']);
|
|
if (isset($ret[0]['id']))
|
|
$_GET['equip'] = $ret[0]['id'];
|
|
}
|
|
|
|
/*if (isset($_GET['calib']))
|
|
$calib = 0;
|
|
else
|
|
$calib = 1;*/
|
|
|
|
$last_cert = db_fetch_lance_reports($_GET['equip'], 1, 0, $_GET['i18n']);
|
|
|
|
if (is_array($last_cert)) {
|
|
// Download file
|
|
download_document($last_cert[0]['id'], "zkl_documenten");
|
|
} else {
|
|
header('Location: ' . "certificaten.php?unavailable=1&i18n=" . $_GET['i18n'] . "");
|
|
}
|