setQuery("SELECT * FROM `trf-details`
LEFT JOIN auth_users ON `trf-details`.iduser=auth_users.id
LEFT JOIN article_type ON `trf-details`.idarticletype=article_type.idarticletype
LEFT JOIN certificationtype ON certificationtype.idcertificationtype=`trf-details`.idcertification
WHERE `trf-details`.idcompany='$idcompany'
AND `trf-details`.signedon <> ''
ORDER BY `trf-details`.trfnumber, `trf-details`.revtrf DESC");
$archivetrflist->execute(); ?>
setQuery("SELECT * FROM `trf-details`
LEFT JOIN article_type ON `trf-details`.idarticletype=article_type.idarticletype
LEFT JOIN certificationtype ON certificationtype.idcertificationtype=`trf-details`.idcertification
WHERE `trf-details`.idcompany='$idcompany'
AND `trf-details`.signedon =''
AND `trf-details`.revcs != 'Y'
ORDER BY `trf-details`.trfnumber");
$drafttrf->execute();
?>
moveNext();
}
$drafttrf->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
TRF N.
REV
Signed On
Description
Cert Type
Article type
Insert by
PDF1
PDF2
ZIP
ACTION
atEnd()) {
$current_trfnumber = $archivetrflist->getColumnVal("trfnumber");
$current_revtrf = $archivetrflist->getColumnVal("revtrf");
// Check if this is a new TRF number
if ($last_trfnumber !== $current_trfnumber) {
$last_trfnumber = $current_trfnumber;
$last_revtrf = $current_revtrf;
}
$wa_startindex = $archivetrflist->Index;
?>
hasRole('Admin')) || (Auth::user()->hasRole('CustomerService')) || (Auth::user()->hasRole('Superuser'))) : ?>
getColumnVal('idtrfdetails') contenga l'ID di interesse
$idtrfdetailschk = $archivetrflist->getColumnVal('idtrfdetails');
$ntrfdetailschk = $archivetrflist->getColumnVal('trfnumber');
$conn = new mysqli($servername, $username, $password, $dbname);
$query = "SELECT COUNT(*) AS count FROM data_td WHERE idtrf = ?";
$stmt = $conn->prepare($query); // Preparazione della query
$stmt->bind_param("i", $idtrfdetailschk); // "s" sta per string, usa "i" per numeri interi se il campo idtrf è di tipo intero
$stmt->execute(); // Esecuzione della query
$result = $stmt->get_result(); // Ottenimento del risultato
$rowcheck = $result->fetch_assoc(); // Estrazione dei dati
if ($rowcheck['count'] < 1) {
// Record esistente, uso il bottone che porta a techdossier_start.php e lo rendo arancione
$buttonColor = '#ff9800'; // Arancione
$onClick = "Swal.fire({
title: 'Sei sicuro di voler creare il Dossier Tecnico per il TRF N. " . $ntrfdetailschk . "?',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Sì, procedi!',
cancelButtonText: 'No, chiudi!'
}).then((result) => {
if (result.isConfirmed) {
window.location.href='techdossier_start.php?idtrftd=" . $idtrfdetailschk . "';
}
});";
} else {
// Nessun record, uso il bottone che porta a archivetd e lo rendo verde
$buttonColor = '#4CAF50'; // Verde
$onClick = "window.location.href='archivetd.php';";
}
?>
moveNext();
}
$archivetrflist->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>