96 lines
3.2 KiB
PHP
96 lines
3.2 KiB
PHP
<head>
|
|
<meta charset="UTF-8">
|
|
</head>
|
|
<?php require_once('../../Connections/cmctrfdb.php'); ?>
|
|
<?php require_once('../../webassist/mysqli/rsobj.php');
|
|
require_once('../../webassist/mysqli/queryobj.php'); ?>
|
|
<?php
|
|
//global variable
|
|
include('../include/generalsettings.php');
|
|
// start fpdf
|
|
|
|
//include('../languages/' . $_SESSION['langselect'] . '/pdflang.php');
|
|
|
|
|
|
//include('include/headscript.php');
|
|
?>
|
|
<?php
|
|
if (isset($_GET["idtrf"])) {
|
|
$idtrf = $_GET["idtrf"];
|
|
}
|
|
if (isset($_POST["idtrf"])) {
|
|
$idtrf = $_POST["idtrf"];
|
|
}
|
|
//zip creation
|
|
include('../datarecover/parsedatajson.php');
|
|
|
|
|
|
//variable creation for json
|
|
$trfnumber = $trfData['trfnumber'];
|
|
$idtrfdetails = $trfData['idtrfdetails'];
|
|
$revision = $trfData['revtrf'];
|
|
$descriptionart = $trfData['sample_description'];
|
|
$model = $trfData['namemodelarticle'];
|
|
$articletype = $trfData['name_articletype'];
|
|
$modeldesc = $model . ' - ' . $descriptionart;
|
|
$measurerange = $trfData['measurefrom'] . '-' . $trfData['measureto'];
|
|
$reportlanguage = $trfData['languagereport'];
|
|
$certificatelanguage = $trfData['languagecertificate'];
|
|
//$certificationlanguage = $trfData['certification'];
|
|
$prevreportnumber = $trfData['previousreportnumber'];
|
|
$revisionfor = $trfData['revisionfor'];
|
|
$virusprotection = $trfData['virus_protection'];
|
|
$esd = $trfData['esd'];
|
|
$headercertid = $contactsinfoData['fmcode'];
|
|
$headertestid = $contactsinfoDatatest['fmcode'];
|
|
$headerbillingid = $contactsinfoDatabilling['fmcode'];
|
|
|
|
// Itera sui risultati della query e popola $identificationPartsDetails
|
|
$identificationPartsDetails = [];
|
|
while ($row = mysqli_fetch_assoc($identparts)) {
|
|
$identificationPartsDetails[] = [
|
|
'article-identificationparts' => $row['article_identificationparts'],
|
|
'color-identificationsparts' => $row['color_identificationparts'],
|
|
'description-identificationparts' => $row['description_identificationparts'],
|
|
];
|
|
}
|
|
|
|
// Itera sui risultati della query e popola $standards
|
|
$standardsDetails = [];
|
|
while ($rowstd = mysqli_fetch_assoc($stdinfo)) {
|
|
$standardsDetails[] = [
|
|
'standard_name' => $rowstd['standardname'],
|
|
'standard_code' => $rowstd['standardcode'],
|
|
];
|
|
}
|
|
|
|
|
|
// Preparazione dei dati per la conversione in JSON
|
|
$dataToConvertToJson = [
|
|
'idtrf' => $idtrfdetails,
|
|
'trfnumber' => $trfnumber,
|
|
'revision' => $revision,
|
|
'descriptionart' => $trfData['sample_description'],
|
|
'article-type' => $trfData['name_articletype'],
|
|
'model-description' => $modeldesc,
|
|
'measurerange' => $trfData['measurefrom'] . '-' . $trfData['measureto'],
|
|
'client_certification' => $headercertid,
|
|
'client_test' => $headertestid,
|
|
'client_billing' => $headerbillingid,
|
|
'reportlanguage' => $reportlanguage,
|
|
'certificatelanguage' => $certificatelanguage,
|
|
'certificate_renew_review' => $prevreportnumber,
|
|
'revisionwhy' => $revisionfor,
|
|
];
|
|
|
|
// Aggiungi i dettagli delle parti di identificazione all'array principale
|
|
$dataToConvertToJson['identification-parts-details'] = $identificationPartsDetails;
|
|
$dataToConvertToJson['standards-details'] = $standardsDetails;
|
|
|
|
// Conversione dei dati in JSON
|
|
$jsonData = json_encode($dataToConvertToJson, JSON_PRETTY_PRINT);
|
|
|
|
|
|
// Output the JSON
|
|
echo $jsonData;
|