include("include/main.inc.php"); include("include/vettori_matline.inc.php"); include("include/functions.inc.php"); include("include/funcstat.inc.php"); $output = ''; $ultagg = ''; $idagente = 0; if (isset($_REQUEST['idagente'])) { $idagente = $_REQUEST['idagente']; } $utilizzo = ''; if (isset($_REQUEST['utilizzo'])) { $utilizzo = $_REQUEST['utilizzo']; } $interr = 'SELECT DENOMINAZIONE FROM m_sostanze WHERE IDAGENTE = ' . $idagente; $result = mysqli_query($conn, $interr); $row = mysqli_fetch_row($result); if ($utilizzo == 'A') { $interr = 'SELECT mat.*, ina.* FROM m_matrice as mat INNER JOIN m_inail as ina USING(codiceinail) WHERE mat.IDAGENTE = ' . $idagente . ' AND (mat.codutil = 1 OR mat.codutil = 2) ORDER BY mat.codiceinail'; $result = mysqli_query($conn, $interr); $titolo = '( presenza come materia prima o additivo )'; } if ($utilizzo == 'B') { $interr = 'SELECT mat.*, ina.* FROM m_matrice as mat INNER JOIN m_inail as ina USING(codiceinail) WHERE mat.IDAGENTE = ' . $idagente . ' AND mat.codutil = 3 ORDER BY mat.codiceinail'; $result = mysqli_query($conn, $interr); $titolo = '( presenza come contaminante )'; } if ($utilizzo == 'C') { $interr = 'SELECT mat.*, ina.* FROM m_matrice as mat INNER JOIN m_inail as ina USING(codiceinail) WHERE mat.IDAGENTE = ' . $idagente . ' ORDER BY mat.codiceinail'; $result = mysqli_query($conn, $interr); $titolo = ''; } $nr = mysqli_num_rows($result); $output .= '
';
$output .= ' ' . $row[0] . ' ';
if ($titolo) {
$output .= '' . $titolo . ' ';
}
$output .= ' |
'; if ($nr == 0) { $output .= 'Nella MATRICE non sono state trovate corrispondenze'; } else { $output .= 'Nella MATRICE sono state trovate ' . $nr . ' corrispondenze'; $output .= ''; } $output .= ' |
';
$output .= 'CODICE INAIL ' . $row['codiceinail'] . '';
$output .= ' ';
$output .= '![]() ![]() '; $output .= 'LAVORAZIONE : ' . $row['lavorazione']; $output .= ' ';
$output .= 'Agenti cancerogeni utilizzati nella lavorazione come materie prime o additivi - contaminanti - entrambi';
$output .= ' ';
$codparz = substr($row['codiceinail'], 0, 1 + $row['livello']);
$sql = 'SELECT a1.codiceinail FROM m_matrice as a1 INNER JOIN m_orgber as a2 USING(IDAGENTE) WHERE a1.codiceinail like "' . $codparz . '%"';
$dati = mysqli_query($conn, $sql);
$nr = mysqli_num_rows($dati);
if ($nr > 0) {
$output .= '';
$output .= 'Organi bersaglio associati alla lavorazione';
$output .= ' ';
}
$output .= ' |