present()->signaturecode; if ($tokenid != $tokensignatureon) { header("Location: declaration.php?idtrf=$idtrf&tokenresult=ko"); } else { // update trf details` if (isset($_POST["formdeclaration"])) { if ($sndrpt == 'N') { $UpdateQuery = new WA_MySQLi_Query($cmctrfdb); $UpdateQuery->Action = "update"; $UpdateQuery->Table = "data_td"; $UpdateQuery->bindColumn("signnametd", "s", "$clientname", "WA_DEFAULT"); $UpdateQuery->bindColumn("signedontd", "s", "$datetrf", "WA_DEFAULT"); $UpdateQuery->bindColumn("statustd", "s", "Signed", "WA_DEFAULT"); $UpdateQuery->addFilter("iddata_td", "=", "i", "" . ($idtd) . ""); $UpdateQuery->execute(); $UpdateGoTo = ""; if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : ""; $UpdateQuery->redirect($UpdateGoTo); } } ?> setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'"); $trfnumberfinal->execute(); $idcertn = $trfnumberfinal->getColumnVal("idcertification"); $idarticletype = $trfnumberfinal->getColumnVal("idarticletype"); $appformn = $trfnumberfinal->getColumnVal("trfnumber"); $ntrfmail = $trfnumberfinal->getColumnVal("trfnumber");; $revnumb = $trfnumberfinal->getColumnVal("revtrf"); ?> getColumnVal("idcertification") ?> prepare($sql); $stmt->bind_param("i", $idtd); // "i" indica che l'id è un intero $stmt->execute(); $result = $stmt->get_result(); $row = $result->fetch_assoc(); $statustd = $row['statustd']; $idtrftd = $row['idtrf']; $tdnumber = $row['tdnumber']; $tdrev = $row['td_rev']; $trfmod = $row['trfmod']; $stmt->close(); $conn->close(); ?> setQuery("SELECT * FROM certificationtype WHERE certificationtype.idcertificationtype='$idcert'"); $certname->execute(); ?> setQuery("SELECT * FROM chemicalagent ORDER BY chemicalagent.name_chemicalagent"); $chemicalagentlist->execute(); ?> TRF <?php echo $ownercompanyname; ?>

100%
$value) { $cookies .= $key . '=' . $value . '; '; } $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 15); // Timeout leggermente più lungo curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_COOKIE, $cookies); // Invia i cookie di sessione // Aggiungi gestione degli errori cURL $response = curl_exec($ch); if (curl_errno($ch)) { $error_msg = curl_error($ch); error_log("cURL error: " . $error_msg, 3, "../logfile.log"); // Sostituisci con il percorso del tuo file di log } else { // Registra la risposta per debug error_log("cURL response: " . $response, 3, "../logfile.log"); // Sostituisci con il percorso del tuo file di log } curl_close($ch); } $checkpdffiles = new WA_MySQLi_RS("checkpdffiles", $cmctrfdb, 1); $checkpdffiles->setQuery("SELECT * FROM `data_td` WHERE data_td.iddata_td='$idtd'"); $checkpdffiles->execute(); $path = 'tdpdf'; $filename1 = $checkpdffiles->getColumnVal("pdffilenametd"); $file1 = $path . "/" . $filename1; //Now include the following following files based //on the correct file path. Third file is required only if you want to enable SMTP. require 'phpmailer/src/Exception.php'; require 'phpmailer/src/PHPMailer.php'; require 'phpmailer/src/SMTP.php'; //mail to client $mail = new PHPMailer(true); try { $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = $mailhost; // Specify main and backup server $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = $mailusername; // SMTP username $mail->Password = $mailpassword; // SMTP password $mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted $mail->Port = $mailport; $mmessage = "mailtf"; include('include/mailhtml.php'); // Email body content //$trfnmbmail = $appformn . 'r' . $revnumb; $htmlContent = $mailmessage1; $mail->From = $fromaddresssmail; $mail->FromName = 'CIMAC Technical File System'; $mail->addAddress($emailuser); // Add a recipient $mail->addAttachment($file1); // Add attachments // Optional name $mail->Subject = "Technical File:" . $tdnumber; $mail->Body = $htmlContent; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; if ($adminconfirm == 'N') { $mail->send(); } // echo 'Message has been sent'; } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } } ?>