<?php
include("../sessionreserved.php");
include("../../db.php");

//estraggo i dettagli della visita
$result = mysql_query("
	SELECT *, 
	DATE_FORMAT(datavisita,'%d/%m/%Y') AS datavisitaOK,
	DATE_FORMAT(data_inizlav,'%d/%m/%Y') AS data_inizlavOK,
	DATE_FORMAT(data_finelav,'%d/%m/%Y') AS data_finelavOK,
	DATE_FORMAT(data_prossvisita,'%d/%m/%Y') AS data_prossvisitaOK
	
	FROM visite 
	LEFT JOIN visite_imp ON visite.idvisita = visite_imp.idvisita 
	WHERE visite.idvisita = '".$_GET['id']."'AND userid = '".$_SESSION['user']['id']."'");
if(mysql_num_rows($result) > 0){
$idvisita = mysql_result($result,0,'idvisita');
$userid = mysql_result($result,0,'userid'); 
$datavisita = mysql_result($result,0,'datavisitaOK');
$tipovisita = mysql_result($result,0,'tipovisita'); 
$tipovisita == 'aziendale' ? $aziendale = ' checked="checked"' : $aziendale = '';
$tipovisita == 'richiesta' ? $richiesta = ' checked="checked"' : $richiesta = '';
$tipovisita == 'pos' ? $pos = ' checked="checked"' : $pos = '';
$tipovisita == 'altro' ? $altro = ' checked="checked"' : $altro = '';

$tipoaltro = mysql_result($result,0,'tipoaltro'); 
$nvisita = mysql_result($result,0,'nvisita');
$nvisita == '1' ? $nvisita1 = ' checked="checked"' : $nvisita1 = '';
$nvisita == '2' ? $nvisita2 = ' checked="checked"' : $nvisita2 = '';
$nvisita == '3' ? $nvisita3= ' checked="checked"' : $nvisita3 = '';

mysql_result($result,0,'congiunta') == 1 ? $congiunta = ' checked="checked"' : $congiunta = '';
$congiuntadesc = mysql_result($result,0,'congiuntadesc');

$id_comune = mysql_result($result,0,'id_comune');
$id_strada = mysql_result($result,0,'id_strada');
$id_numero = mysql_result($result,0,'id_numero');

$cant_comune = mysql_result($result,0,'cant_comune');
$cant_strada = mysql_result($result,0,'cant_strada');
mysql_result($result,0,'lavpubblico') == 1 ? $lavpubblico1 = ' checked="checked"' : $lavpubblico2 = ' checked="checked"';

$commit_anagra = mysql_result($result,0,'commit_anagra'); 
$commit_piva = mysql_result($result,0,'commit_piva'); 
$commit_codfis = mysql_result($result,0,'commit_codfis'); 
$commit_via = mysql_result($result,0,'commit_via'); 
$commit_n = mysql_result($result,0,'commit_n'); 
$commit_comune = mysql_result($result,0,'commit_comune'); 
$commit_prov = mysql_result($result,0,'commit_prov'); 
$commit_tel = mysql_result($result,0,'commit_tel'); 
$codnat = mysql_result($result,0,'codnat'); 
$codtiponat = mysql_result($result,0,'codtiponat'); 
$partecip1 = mysql_result($result,0,'partecip1'); 
$partecip2 = mysql_result($result,0,'partecip2'); 
$partecip3 = mysql_result($result,0,'partecip3'); 
$partecip4 = mysql_result($result,0,'partecip4'); 
$partecip1_funz = mysql_result($result,0,'partecip1_funz'); 
$partecip2_funz = mysql_result($result,0,'partecip2_funz');
$partecip3_funz = mysql_result($result,0,'partecip3_funz'); 
$partecip4_funz = mysql_result($result,0,'partecip4_funz'); 
$note = nl2br(mysql_result($result,0,'note'));
	
mysql_result($result,0,'psc_vis') == 1 ? $psc_vis = ' checked="checked"' : $psc_vis2 = ' checked="checked"';
mysql_result($result,0,'psc_ido') == 1 ? $psc_ido = ' checked="checked"' : $psc_ido2 = ' checked="checked"'; 
mysql_result($result,0,'pos_vis') == 1 ? $pos_vis = ' checked="checked"' : $pos_vis2 = ' checked="checked"'; 
mysql_result($result,0,'pos_ido') == 1 ? $pos_ido = ' checked="checked"' : $pos_ido2 = ' checked="checked"'; 
mysql_result($result,0,'pss_vis') == 1 ? $pss_vis = ' checked="checked"' : $pss_vis2 = ' checked="checked"'; 
mysql_result($result,0,'pss_ido') == 1 ? $pss_ido = ' checked="checked"' : $pss_ido2 = ' checked="checked"';

mysql_result($result,0,'docinfo_vis') == 1 ? $docinfo_vis = ' checked="checked"' : $docinfo_vis2 = ' checked="checked"'; 
mysql_result($result,0,'docinfo_ido') == 1 ? $docinfo_ido = ' checked="checked"' : $docinfo_ido2 = ' checked="checked"'; 
mysql_result($result,0,'libretti_vis') == 1 ? $libretti_vis = ' checked="checked"' : $libretti_vis2 = ' checked="checked"'; 
mysql_result($result,0,'libretti_ido') == 1 ? $libretti_ido = ' checked="checked"' : $libretti_ido2 = ' checked="checked"'; 
mysql_result($result,0,'reginf_vis') == 1 ? $reginf_vis = ' checked="checked"' : $reginf_vis2 = ' checked="checked"'; 
 mysql_result($result,0,'reginf_ido') == 1 ? $reginf_ido = ' checked="checked"' : $reginf_ido2 = ' checked="checked"'; 
mysql_result($result,0,'duvri_vis') == 1 ? $duvri_vis = ' checked="checked"' : $duvri_vis2 = ' checked="checked"'; 
mysql_result($result,0,'duvri_ido') == 1 ? $duvri_ido = ' checked="checked"' : $duvri_ido2 = ' checked="checked"'; 
mysql_result($result,0,'dpi1_dist') == 1 ? $dpi1_dist = ' checked="checked"' : $dpi1_dist2 = ' checked="checked"'; 
mysql_result($result,0,'dpi1_form') == 1 ? $dpi1_form = ' checked="checked"' : $dpi1_form2 = ' checked="checked"'; 
mysql_result($result,0,'dpi2_dist') == 1 ? $dpi2_dist = ' checked="checked"' : $dpi2_dist2 = ' checked="checked"'; 
mysql_result($result,0,'dpi2_form') == 1 ? $dpi2_form = ' checked="checked"' : $dpi2_form2 = ' checked="checked"'; 
mysql_result($result,0,'dpi3_dist') == 1 ? $dpi3_dist = ' checked="checked"' : $dpi3_dist2 = ' checked="checked"'; 
mysql_result($result,0,'dpi3_form') == 1 ? $dpi3_form = ' checked="checked"' : $dpi3_form2 = ' checked="checked"'; 
mysql_result($result,0,'rchimico_vis') == 1 ? $rchimico_vis = ' checked="checked"' : $rchimico_vis2 = ' checked="checked"'; 
mysql_result($result,0,'rchimico_ido') == 1 ? $rchimico_ido = ' checked="checked"' : $rchimico_ido2 = ' checked="checked"'; 
mysql_result($result,0,'rvibraz_vis') == 1 ? $rvibraz_vis = ' checked="checked"' : $rvibraz_vis2 = ' checked="checked"'; 
mysql_result($result,0,'rvibraz_ido') == 1 ? $rvibraz_ido = ' checked="checked"' : $rvibraz_ido2 = ' checked="checked"'; 
mysql_result($result,0,'rrumore_vis') == 1 ? $rrumore_vis = ' checked="checked"' : $rrumore_vis2 = ' checked="checked"'; 
mysql_result($result,0,'rrumore_ido') == 1 ? $rrumore_ido = ' checked="checked"' : $rrumore_ido2 = ' checked="checked"'; 
mysql_result($result,0,'pimus_vis') == 1 ? $pimus_vis = ' checked="checked"' : $pimus_vis2 = ' checked="checked"'; 
mysql_result($result,0,'pimus_ido') == 1 ? $pimus_ido = ' checked="checked"' : $pimus_ido2 = ' checked="checked"'; 
mysql_result($result,0,'orario_vis') == 1 ? $orario_vis = ' checked="checked"' : $orario_vis2 = ' checked="checked"';
mysql_result($result,0,'orario_ido') == 1 ? $orario_ido = ' checked="checked"' : $orario_ido2 = ' checked="checked"'; 
mysql_result($result,0,'servizi_pres') == 1 ? $servizi_pres = ' checked="checked"' : $servizi_pres2 = ' checked="checked"'; 
mysql_result($result,0,'servizi_norma') == 1 ? $servizi_norma = ' checked="checked"' : $servizi_norma2 = ' checked="checked"'; 
mysql_result($result,0,'spogliat_pres') == 1 ? $spogliat_pres = ' checked="checked"' : $spogliat_pres2 = ' checked="checked"'; 
mysql_result($result,0,'spogliat_norma') == 1 ? $spogliat_norma = ' checked="checked"' : $spogliat_norma2 = ' checked="checked"'; 
mysql_result($result,0,'mensa_pres') == 1 ? $mensa_pres = ' checked="checked"' : $mensa_pres2 = ' checked="checked"'; 
mysql_result($result,0,'mensa_norma') == 1 ? $mensa_norma = ' checked="checked"' : $mensa_norma2 = ' checked="checked"'; 
mysql_result($result,0,'cassetta_pres') == 1 ? $cassetta_pres = ' checked="checked"' : $cassetta_pres2 = ' checked="checked"';
mysql_result($result,0,'cassetta_norma') == 1 ? $cassetta_norma = ' checked="checked"' : $cassetta_norma2 = ' checked="checked"'; 
mysql_result($result,0,'numeri_pres') == 1 ? $numeri_pres = ' checked="checked"' : $numeri_pres2 = ' checked="checked"'; 
mysql_result($result,0,'numeri_norma') == 1 ? $numeri_norma = ' checked="checked"' : $numeri_norma2 = ' checked="checked"';

$data_prossvisita = mysql_result($result,0,'data_prossvisitaOK'); 
$ora_prossvisita = substr(mysql_result($result,0,'ora_prossvisita'),0,5); 
mysql_result($result,0,'chiuso') == 1 ? $chiuso = ' checked="checked"' : $chiuso = '';
mysql_result($result,0,'completata') == 1 ? $completata = ' checked="checked"' : $completata = '';
$coord_x = mysql_result($result,0,'coord_x'); 
$coord_y = mysql_result($result,0,'coord_y'); 
$dataora = mysql_result($result,0,'dataora'); 
$codice = mysql_result($result,0,'codice'); 
if(!empty($codice))
	$codice = "CODICE ".$codice;

if(!$coord_x)
	$mapHide = ' display:none';
	
//impresa
$idvisitaimp = intval(mysql_result($result,0,'idvisitaimp')); 
$idvisitaimp > 0 ? $impHide = ' style="display:block"' : $impHide = '';
$idvisita = mysql_result($result,0,'idvisita'); 
$imp_anagrafica = mysql_result($result,0,'imp_anagrafica'); 
$imp_comune = mysql_result($result,0,'imp_comune'); 
$imp_prov = mysql_result($result,0,'imp_prov'); 
$imp_indirizzo = mysql_result($result,0,'imp_indirizzo'); 
$imp_numero = mysql_result($result,0,'imp_numero'); 
$imp_piva = mysql_result($result,0,'imp_piva'); 
$imp_codfisc = mysql_result($result,0,'imp_codfisc'); 

$imp_esterna = mysql_result($result,0,'imp_esterna');
$imp_esterna == 1 ? $EXT = ' checked="checked"' : $EXT = '';
$imp_esterna == 2 ? $INT = ' checked="checked"' : $INT = '';

$imp_assoc = mysql_result($result,0,'imp_assoc');
$imp_assoc == 'COL' ? $COL = ' checked="checked"' : $COL = '';
$imp_assoc == 'CNA' ? $CNA = ' checked="checked"' : $CNA = '';
$imp_assoc == 'CON' ? $CON = ' checked="checked"' : $CON = '';

$imp_tel = mysql_result($result,0,'imp_tel'); 
$imp_fax = mysql_result($result,0,'imp_fax'); 
$imp_email = mysql_result($result,0,'imp_email');  
$imp_attivita = mysql_result($result,0,'imp_attivita'); 
$ccnl = mysql_result($result,0,'ccnl'); 
$ccnl_altro = mysql_result($result,0,'ccnl_altro'); 
$tipologiacod = mysql_result($result,0,'tipologiacod');  
$lavorazionecod = mysql_result($result,0,'lavorazionecod'); 
$attivitacod = mysql_result($result,0,'attivitacod'); 
$rls = mysql_result($result,0,'rls'); 
$n_addetti = mysql_result($result,0,'n_addetti'); 
$n_operai = mysql_result($result,0,'n_operai'); 
$n_impiegati = mysql_result($result,0,'n_impiegati'); 
$n_apprendisti = mysql_result($result,0,'n_apprendisti'); 
$n_interinali = mysql_result($result,0,'n_interinali'); 
$n_parttime = mysql_result($result,0,'n_parttime'); 
$n_autonomi = mysql_result($result,0,'n_autonomi'); 
$n_addettipres = mysql_result($result,0,'n_addettipres'); 
$data_inizlav = mysql_result($result,0,'data_inizlavOK'); 
$data_finelav = mysql_result($result,0,'data_finelavOK');
if($data_inizlav == '00/00/0000')
	$data_inizlav = '';
if($data_finelav == '00/00/0000')
	$data_finelav = '';
if($data_prossvisita == '00/00/0000')
	$data_prossvisita = '';
if($ora_prossvisita == '00:00')
	$ora_prossvisita = '';
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Osservatorio Edile Biella - R.L.S.T. | Modulo visita</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/print.css" />
<script language="javascript">
function stampa(){
	if(document.all){
		parent.frames[0].focus();
		parent.frames[0].print();
	}else{
		parent.moduloprint.print();
	}
}
</script>
</head>

<body onload="stampa()">
<div id="mainContainer">
    <div id="mainContent" class="clearfix">
        <div class="form clearfix">
            <div class="row title">
            <strong>RAPPRESENTANTI dei LAVORATORI per la SICUREZZA TERRITORIALE<br />della PROVINCIA di BIELLA</strong>
            </div>
            <div class="row">
            <div align="right"><strong><?php echo $codice;?></strong></div>
            </div>
            <div class="sep"></div>
            <div class="row">
                Il signor <strong><?php echo $_SESSION['user']['anagrafica'];?></strong> 
                in qualit&agrave; di R.L.S.T. ha effettuato 
                in Data <input name="datavisita" type="text" id="datavisita" size="15" maxlength="10" value="<?=$datavisita;?>" />
            </div>
            <div class="row">
                <input<?=$aziendale;?> class="check" type="radio" name="tipovisita" value="aziendale" /> Visita aziendale &nbsp;&nbsp;
                <input<?=$richiesta;?> class="check" type="radio" name="tipovisita" value="richiesta" /> Visita richiesta &nbsp;&nbsp;
                <input<?=$pos;?> class="check" type="radio" name="tipovisita" value="pos" /> Visione P.O.S. &nbsp;&nbsp;
                <input<?=$altro;?> class="check" type="radio" name="tipovisita" value="altro" /> 
                altro <input type="text" name="tipoaltro" value="<?=$tipoaltro;?>" style="width:230px" />
            </div>
            <div class="row">
                Visita:&nbsp;&nbsp; 
                <input<?=$nvisita1;?> class="check" type="radio" name="nvisita" value="1" /> n. 1 &nbsp;&nbsp;
                <input<?=$nvisita2;?> class="check" type="radio" name="nvisita" value="2" /> n. 2 &nbsp;&nbsp;
                <input<?=$nvisita3;?> class="check" type="radio" name="nvisita" value="3" /> n. 3 &nbsp;&nbsp;
                <input<?=$congiunta;?> name="congiunta" type="checkbox" class="check" value="1" /> Visita congiunta 
                <input value="<?=$congiuntadesc;?>" type="text" name="congiuntadesc"  style="width:305px"  />
            </div>
            <div class="sep"></div>
            <div class="row">
                <strong>Cantiere:</strong><br /><br />
                Comune di
                <?php
                $result = mysql_query("SELECT * FROM civici_provbi GROUP BY Nome_Comun ORDER BY Nome_Comun");
                    while($row = mysql_fetch_array($result))
                        if($row['Codice_Com'] == $id_comune)
                            $comune = utf8_encode($row['Nome_Comun']);
                            
                ?>
                <input type="text"  style="width:170px" value="<?php echo $comune; ?>" />
                Via: 
                <?php
                if(!empty($id_comune)){
                    $result = mysql_query("SELECT * FROM civici_provbi WHERE Codice_Com = '".$id_comune."' GROUP BY ID_STRADA ORDER BY Via");
                    while($row = mysql_fetch_array($result))
                        if($row['ID_STRADA'] == $id_strada)
                            $via = utf8_encode($row['Via']);
                        
                 }
                ?>               
                 <input type="text"  style="width:280px" value="<?php echo $via; ?>" />
                <?php
                //elenco civici
                if(!empty($id_strada)){
                    $result = mysql_query("SELECT * FROM civici_provbi WHERE ID_STRADA = '".$id_strada."' GROUP BY NUMERO ORDER BY NUMERO");
                    if(mysql_num_rows($result) > 0)
                        while($row = mysql_fetch_array($result))
                            if($row['NUMERO'] == $id_numero && $id_numero <> '')
                                $n = utf8_encode($row['NUMERO']);
                    
                }
                
                ?>
                 n. <input type="text"  style="width:50px" value="<?php echo $n; ?>" />
             </div>
            <div class="row">
                Lavoro: &nbsp;&nbsp;
                <input<?=$lavpubblico1;?> class="check" type="radio" name="lavpubblico" value="1" /> pubblico
                <input<?=$lavpubblico2;?> class="check" type="radio" name="lavpubblico" value="0" /> privato
            </div>
            <div class="row">
                Committente <input value="<?=$commit_anagr;?>" type="text" name="commit_anagr" style="width:560px" />
            </div>
            <div class="row">
                P.iva <input value="<?=$commit_piva;?>" type="text" name="commit_piva"  style="width:283px" /> 
                C.f. <input value="<?=$commit_codfis;?>" type="text" name="commit_codfis"  style="width:284px" />
            </div>
            <div class="row">
                via <input value="<?=$commit_via;?>" type="text" name="commit_via"  style="width:250px" /> 
                n <input value="<?=$commit_n;?>" type="text" name="commit_n"  style="width:50px" /> 
                Comune <input value="<?=$commit_comune;?>" type="text" name="commit_comune"  style="width:225px" />
            </div>
            <div class="row">
                prov <input value="<?=$commit_prov;?>" type="text" name="commit_prov" style="width:50px" /> 
                tel <input value="<?=$commit_tel;?>" type="text" name="commit_tel"  style="width:525px" /> 
            </div>
            <div class="row">
                Natura dell'opera:
                <?php
                $result = mysql_query("SELECT * FROM natopera GROUP BY codnat ORDER BY nat");
                    while($row = mysql_fetch_array($result))
                        if($row['codnat'] == $codnat)
                            $natura = utf8_encode($row['nat']);
                ?>
                <input type="text" value="<?=$natura;?>"  style="width:530px" />
            </div>
            <div class="row">
                Dettaglio: 
                <?php
                $result = mysql_query("SELECT * FROM natopera WHERE codnat = '".$codnat."' AND codtiponat > 0 GROUP BY codtiponat ORDER BY tiponat");
                if(mysql_num_rows($result) > 0){
                    while($row = mysql_fetch_array($result))
                        if($row['codtiponat'] == $codtiponat)
                            $dett = utf8_encode($row['tiponat']);
                }
                ?>
                <input type="text" value="<?=$dettaglio;?>"  style="width:577px" />
            </div>
            
            <div class="sep"></div>
            
            <!-- impresa -->
                                         
           <div class="row">
                <strong>Impresa:</strong><br /><br />
                Ragione Sociale Impresa <input value="<?=$imp_anagrafica;?>" name="imp_anagrafica" type="text"  style="width:490px" />
           </div>
           <div class="row">
           
                Comune sede legale <input value="<?=$imp_comune;?>" name="imp_comune" type="text"  style="width:395px" />
                Provincia <input value="<?=$imp_prov;?>" name="imp_prov" type="text"  style="width:50px" />
            </div>
            <div class="row">
                via <input value="<?=$imp_indirizzo;?>" name="imp_indirizzo" type="text"  style="width:535px" /> 
                n. <input value="<?=$imp_imp_numero;?>" name="imp_numero" type="text"  style="width:50px" /> 
            </div>
            <div class="row">
               P.iva <input value="<?=$imp_piva;?>" name="imp_piva" type="text" style="width:283px" /> 
                C.f. <input value="<?=$imp_codfisc;?>" name="imp_codfisc" type="text" style="width:284px" />
            </div>
            <div class="row">
                Ditta: &nbsp;&nbsp;<input<?=$EXT;?> class="check" type="radio" name="imp_esterna" value="1" /> esterna &nbsp;&nbsp;
                    <input<?=$INT;?> class="check" type="radio" name="imp_esterna" value="2" /> iscritta a Cassa Edile &nbsp;&nbsp;&nbsp;&nbsp;
                associata: <input<?=$COL;?> class="check" type="radio" name="imp_assoc" value="COL" /> Collegio costruttori &nbsp;&nbsp;
                <input<?=$CNA;?> class="check" type="radio" name="imp_assoc" value="CNA" /> Cna &nbsp;&nbsp;
                <input<?=$CON;?> class="check" type="radio" name="imp_assoc" value="CON" /> Confartigianato
            </div>
            <div class="row">
                Tel <input value="<?=$imp_tel;?>" name="imp_telefono" type="text" style="width:140px" /> 
                Fax <input value="<?=$imp_fax;?>" name="imp_fax" type="text" style="width:140px" /> 
                E-Mail <input value="<?=$imp_email;?>" name="imp_email" maxlength="" type="text" style="width:247px" />
            </div>
            <div class="row">
                Attivit&agrave; svolta <input value="<?=$imp_attivita;?>" name="imp_attivita" type="text" style="width:555px" /> 
            </div>
           <div class="row">                
                CCNL edilizia: &nbsp;&nbsp;
                <input class="check" type="radio" name="ccnl" value="ind" /> ind &nbsp;&nbsp;
                <input class="check" type="radio" name="ccnl" value="art" /> art &nbsp;&nbsp;
                <input class="check" type="radio" name="ccnl" value="altro" /> altro 
                <input value="<?=$ccnl_altro;?>" type="text" name="ccnl_altro" style="width:395px" />
            </div>
           <div class="row">
                <strong>Specifica attivit&agrave; svolta in cantiere:</strong><br /><br />
                1) Tipologia: 
                <?php
                $result = mysql_query("SELECT * FROM attivitaspec GROUP BY tipologiacod");
                    while($row = mysql_fetch_array($result))
                        if($row['tipologiacod'] == $tipologiacod)
                            $spec = utf8_encode($row['tipologia']);
                ?>
                <input value="<?=$spec;?>" type="text" name="ccnl_altro" style="width:560px" />
            </div>
           <div class="row">
                2) Lavorazione: 
                <?php
                if(!empty($lavorazionecod)){
                    $result = mysql_query("SELECT * FROM attivitaspec WHERE lavorazionecod = '".$lavorazionecod."' AND lavorazione <> '' GROUP BY lavorazionecod");
                    if(mysql_num_rows($result) > 0)
                        while($row = mysql_fetch_array($result))
                            if($row['lavorazionecod'] == $lavorazionecod)
                                $lav = utf8_encode($row['lavorazione']);
                }
                ?>
                <input value="<?=$lav;?>" type="text" name="ccnl_altro" style="width:542px" />
            </div>
           <div class="row">
                3) Attivit&agrave;:
                <?php
                if(!empty($attivitacod)){						
                    $result = mysql_query("SELECT * FROM attivitaspec WHERE lavorazionecod = '".$lavorazionecod."' AND attivita <> '' GROUP BY attivitacod");
                    if(mysql_num_rows($result) > 0)
                        while($row = mysql_fetch_array($result))
                            if($row['attivitacod'] == $attivitacod)
                            $att = utf8_encode($row['attivita']);
                }
                ?>
                <input value="<?=$att;?>" type="text" name="ccnl_altro" style="width:570px" />
             </div>
            <div class="row">
                RLS int. Sign <input value="<?=$rls;?>" type="text" name="rls" style="width:560px" />
            </div>
            <div class="row">
                <table class="standard" cellspacing="0" cellpadding="0">
                  <tr>
                    <td>&nbsp;</td>
                    <td width="13%">n. addetti</td>
                    <td width="13%">operai</td>
                    <td width="13%">impiegati</td>
                    <td width="13%">apprendisti</td>
                    <td width="13%">interinali</td>
                    <td width="13%">part time</td>
                    <td width="13%">lav. autonomi</td>
                  </tr>
                  <tr>
                    <td>Totali</td>
                    <td><input value="<?=$n_addetti;?>" type="text" size="3" name="n_addetti" maxlength="4" /></td>
                    <td><input value="<?=$n_operai;?>" type="text" size="3" name="n_operai" maxlength="4" /></td>
                    <td><input value="<?=$n_impiegati;?>" type="text" size="3" name="n_impiegati" maxlength="4" /></td>
                    <td><input value="<?=$n_apprendisti;?>" type="text" size="3" name="n_apprendisti" maxlength="4" /></td>
                    <td><input value="<?=$n_interinali;?>" type="text" size="3" name="n_interinali" maxlength="4" /></td>
                    <td><input value="<?=$n_parttime;?>" type="text" size="3" name="n_parttime" maxlength="4" /></td>
                    <td><input value="<?=$n_autonomi;?>" type="text" size="3" name="n_autonomi" maxlength="4" /></td>
                  </tr>
                </table>
            </div>
            <div class="row">
                n. addetti presenti <input value="<?=$n_addetti;?>" type="text" size="10" name="n_addetti" maxlength="4" /> 
                Data inizio lavori <input value="<?=$data_inizlav;?>" type="text" size="15" name="data_inizlav" maxlength="10" /> 
                Data fine lavori <input value="<?=$data_finelav;?>" type="text" size="15" name="data_finelav" maxlength="10" />
            </div>
            
            <div class="row">
                <table class="standard" width="100%" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="34%">Partecipanti</td>
                    <td width="34%">Funzione</td>
                    <td width="32%">Firma</td>
                  </tr>
                  <tr>
                    <td><input value="<?=$partecip1;?>" type="text" size="40" name="partecip1" maxlength="100" /></td>
                    <td><input value="<?=$partecip1_funz;?>" type="text" size="40" name="partecip1_funz" maxlength="100" /></td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td><input value="<?=$partecip2;?>" type="text" size="40" name="partecip2" maxlength="100" /></td>
                    <td><input value="<?=$partecip2_funz;?>" type="text" size="40" name="partecip2_funz" maxlength="100" /></td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td><input value="<?=$partecip3;?>" type="text" size="40" name="partecip3" maxlength="100" /></td>
                    <td><input value="<?=$partecip3_funz;?>" type="text" size="40" name="partecip3_funz" maxlength="100" /></td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td><input value="<?=$partecip4;?>" type="text" size="40" name="partecip4" maxlength="100" /></td>
                    <td><input value="<?=$partecip4_funz;?>" type="text" size="40" name="partecip4_funz" maxlength="100" /></td>
                    <td>&nbsp;</td>
                  </tr>
                </table>
            </div>
            <div class="row newpage">
                <center><strong>Documenti Visionati</strong></center>
            </div>
            <div class="row">
                <table align="left" class="docVisionati" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="70">visionato</td>
                    <td>&nbsp;</td>
                    <td width="70">idoneo</td>
                  </tr>
                  <tr>
                    <td><input name="psc_vis" type="radio" class="check" value="1" /> si <input name="psc_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Piano di Sicurezza Cantiere</td>
                    <td><input name="psc_ido" type="radio" class="check" value="1" /> si <input name="psc_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="pos_vis" type="radio" class="check" value="1" /> si <input name="pos_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Piano Operativo Sicurezza</td>
                    <td><input name="pos_ido" type="radio" class="check" value="1" /> si <input name="pos_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="pss_vis" type="radio" class="check" value="1" /> si <input name="pss_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Piano Sost. Sicurezza</td>
                    <td><input name="pss_ido" type="radio" class="check" value="1" /> si <input name="pss_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="docinfo_vis" type="radio" class="check" value="1" /> si <input name="docinfo_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Documenti di info/formazione</td>
                    <td><input name="docinfo_ido" type="radio" class="check" value="1" /> si <input name="docinfo_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="libretti_vis" type="radio" class="check" value="1" /> si <input name="libretti_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Libretti/manuali</td>
                    <td><input name="libretti_ido" type="radio" class="check" value="1" /> si <input name="libretti_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="reginf_vis" type="radio" class="check" value="11" /> si <input name="reginf_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Registro infortuni</td>
                    <td><input name="reginf_ido" type="radio" class="check" value="1" /> si <input name="reginf_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="duvri_vis" type="radio" class="check" value="1" /> si <input name="duvri_vis" type="radio" class="check" value="0" /> no</td>
                    <td>D.u.v.r.i.</td>
                    <td><input name="duvri_ido" type="radio" class="check" value="1" /> si <input name="duvri_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td class="newline">distribuiti</td>
                    <td class="newline">&nbsp;</td>
                    <td class="newline">formazione</td>
                  </tr>
                  <tr>
                    <td><input name="dpi1_dist" type="radio" class="check" value="1" /> si <input name="dpi1_dist" type="radio" class="check" value="0" /> no</td>
                    <td>D.P.I. tipo 1</td>
                    <td><input name="dpi1_form" type="radio" class="check" value="1" /> si <input name="dpi1_form" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="dpi2_dist" type="radio" class="check" value="1" /> si <input name="dpi2_dist" type="radio" class="check" value="0" /> no</td>
                    <td>D.P.I. tipo 2</td>
                    <td><input name="dpi2_form" type="radio" class="check" value="1" /> si <input name="dpi2_form" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="dpi3_dist" type="radio" class="check" value="1" /> si <input name="dpi3_dist" type="radio" class="check" value="0" /> no</td>
                    <td>D.P.I. tipo 3</td>
                    <td><input name="dpi3_form" type="radio" class="check" value="1" /> si <input name="dpi3_form" type="radio" class="check" value="0" /> no</td>
                  </tr>
                </table>
                
                <table align="right" class="docVisionati" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="70">visionato</td>
                    <td>&nbsp;</td>
                    <td width="70">idoneo</td>
                  </tr>
                  <tr>
                    <td><input name="rchimico_vis" type="radio" class="check" value="1" /> si <input name="rchimico_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Rischio chimico</td>
                    <td><input name="rchimico_ido" type="radio" class="check" value="1" /> si <input name="rchimico_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="rvibraz_vis" type="radio" class="check" value="1" /> si <input name="rvibraz_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Rischio vibrazioni</td>
                    <td><input name="rvibraz_ido" type="radio" class="check" value="1" /> si <input name="rvibraz_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="rrumore_vis" type="radio" class="check" value="1" /> si <input name="rrumore_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Rischio rumore</td>
                    <td><input name="rrumore_ido" type="radio" class="check" value="1" /> si <input name="rrumore_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="pimus_vis" type="radio" class="check" value="1" /> si <input name="pimus_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Pimus</td>
                    <td><input name="pimus_ido" type="radio" class="check" value="1" /> si <input name="pimus_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="orario_vis" type="radio" class="check" value="1" /> si <input name="orario_vis" type="radio" class="check" value="0" /> no</td>
                    <td>Orario lavoro</td>
                    <td><input name="orario_ido" type="radio" class="check" value="1" /> si <input name="orario_ido" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td class="newline">presenti</td>
                    <td class="newline">&nbsp;</td>
                    <td class="newline">a norma</td>
                  </tr>
                  <tr>
                    <td><input name="servizi_pres" type="radio" class="check" value="1" /> si <input name="servizi_pres" type="radio" class="check" value="0" /> no</td>
                    <td>Servizi igienici</td>
                    <td><input name="servizi_norma" type="radio" class="check" value="1" /> si <input name="servizi_norma" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="spogliat_pres" type="radio" class="check" value="1" /> si <input name="spogliat_pres" type="radio" class="check" value="0" /> no</td>
                    <td>Spogliatoio/ricovero</td>
                    <td><input name="spogliat_norma" type="radio" class="check" value="1" /> si <input name="spogliat_norma" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="mensa_pres" type="radio" class="check" value="1" /> si <input name="mensa_pres" type="radio" class="check" value="0" /> no</td>
                    <td>Mensa</td>
                    <td><input name="mensa_norma" type="radio" class="check" value="1" /> si <input name="mensa_norma" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="cassetta_pres" type="radio" class="check" value="1" /> si <input name="cassetta_pres" type="radio" class="check" value="0" /> no</td>
                    <td>Cassetta pronto soccorso</td>
                    <td><input name="cassetta_norma" type="radio" class="check" value="1" /> si <input name="cassetta_norma" type="radio" class="check" value="0" /> no</td>
                  </tr>
                  <tr>
                    <td><input name="numeri_pres" type="radio" class="check" value="1" /> si <input name="numeri_pres" type="radio" class="check" value="0" /> no</td>
                    <td>Numeri utili</td>
                    <td><input name="numeri_norma" type="radio" class="check" value="1" /> si <input name="numeri_norma" type="radio" class="check" value="0" /> no</td>
                  </tr>
                </table>
            </div>
                <div class="row">
                	<center><strong>Note</strong></center>
                </div>
                <div class="row">
                	<div id="note"><?=$note;?></div>
                </div>
            <div class="row">
                Prossima visita per verifica: Giorno <input value="<?=$data_prossvisita;?>" name="data_prossvisita" type="text" id="data_prossvisita" size="15" maxlength="10" /> Ora <input value="<?=$ora_prossvisita;?>" name="ora_prossvisita" type="text" id="ora_prossvisita" size="10" maxlength="5" />
            </div>
            <div class="row">
                <input<?=$chiuso;?> name="chiuso" type="checkbox" class="check" value="1" /> Cantiere Chiuso 
            </div>
        </div>
    </div>
</div>
</body>
</html>