<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<HTML lang=fr>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>i-CTI. Rapport d'import</title>
<LINK REL="ICON" type="image/x-icon" href="../../base/images/ctisante2.ico">
<LINK REL="SHORTCUT ICON" type="image/x-icon" href="../../base/images/ctisante2.ico">
</head>

<body>
<PRE>
	
<?php
	require_once("../../base/php/startSession.php");
	require_once("../../base/php/Environnement.php" );
	require_once( "../../base/php/Functions.php" );
	require_once("../../base/php/classDatabase.php");


	
	$import_id = @$_POST["import_id"];
	if ($import_id == "") {
		$import_id = @$_GET["import_id"];
	}
	$import_id = $import_id + 0;
	
	$dbname = @$_POST["dbname"];
	if ($dbname == "") {
		$dbname = @$_GET["dbname"];
	}
	
	$dbuser = @$_POST["dbuser"];
	if ($dbuser == "") {
		$dbuser = @$_GET["dbuser"];
	}
	
	$dbpassword = @$_POST["dbpassword"];
	if ($dbpassword == "") {
		$dbpassword = @$_GET["dbpassword"];
	}
	
	if ($dbname == "") {
        $database = new Database("iCTI");
	}
	else {
		$database = new Database("*NODEF_PG", "localhost", 5432, $dbname, $dbuser, $dbpassword);
	}
	
	
	$sqlcmd = "SELECT p_imports.oid, p_imports.texte, p_imports.date_import, p_imports.etat, p_imports.etat_en_cours,  
			finess, date_debut, date_fin, nb_rss, nb_rum, nb_rsf, nb_erreurs, nb_avertissements , 
			p_imports_data_rss.file_path AS rss_file_path, p_imports_data_rss.file_size AS rss_data_size, 
			p_imports_data_rsf.file_path AS rsf_file_path, p_imports_data_rsf.file_size AS rsf_data_size, 
			p_imports_data_zin.file_path AS zin_file_path, p_imports_data_zin.file_size AS zin_data_size, 
			p_imports_data_zou.file_path AS zou_file_path, p_imports_data_zou.file_size AS zou_data_size, 
			p_imports_data_zif.file_path AS zif_file_path, p_imports_data_zif.file_size AS zif_data_size, 
			p_imports_data_fcp.file_path AS fcp_file_path, p_imports_data_fcp.file_size AS fcp_data_size, 
			p_imports_data_med.file_path AS med_file_path, p_imports_data_med.file_size AS med_data_size, 
			p_imports_data_rssmed.file_path AS rssmed_file_path, p_imports_data_rssmed.file_size AS rssmed_data_size, 
			p_imports_data_rssnom.file_path AS rssnom_file_path, p_imports_data_rssnom.file_size AS rssnom_data_size, 
			p_imports_data_actmed.file_path AS actmed_file_path, p_imports_data_actmed.file_size AS actmed_data_size, 
			t_finess.texte, 
			p_imports_data_vsj.file_path AS vsj_file_path, p_imports_data_vsj.file_size AS vsj_data_size, 
			p_imports_data_vse.file_path AS vse_file_path, p_imports_data_vse.file_size AS vse_data_size, 
			p_imports_data_tsp.file_path AS tsp_file_path, p_imports_data_tsp.file_size AS tsp_data_size
			FROM pmsi.p_imports  
			LEFT JOIN pmsi.p_imports_data p_imports_data_rss ON (p_imports.oid = p_imports_data_rss.import_id AND p_imports_data_rss.data_type = 'RSS' AND p_imports_data_rss.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_rsf ON (p_imports.oid = p_imports_data_rsf.import_id AND p_imports_data_rsf.data_type = 'RSF' AND p_imports_data_rsf.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_zin ON (p_imports.oid = p_imports_data_zin.import_id AND p_imports_data_zin.data_type = 'ZIN' AND p_imports_data_zin.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_zou ON (p_imports.oid = p_imports_data_zou.import_id AND p_imports_data_zou.data_type = 'ZOU' AND p_imports_data_zou.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_zif ON (p_imports.oid = p_imports_data_zif.import_id AND p_imports_data_zif.data_type = 'ZIF' AND p_imports_data_zif.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_fcp ON (p_imports.oid = p_imports_data_fcp.import_id AND p_imports_data_fcp.data_type = 'FCP' AND p_imports_data_fcp.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_med ON (p_imports.oid = p_imports_data_med.import_id AND p_imports_data_med.data_type = 'MED' AND p_imports_data_med.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_rssmed ON (p_imports.oid = p_imports_data_rssmed.import_id AND p_imports_data_rssmed.data_type = 'RSSMED' AND p_imports_data_rssmed.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_rssnom ON (p_imports.oid = p_imports_data_rssnom.import_id AND p_imports_data_rssnom.data_type = 'RSSNOM' AND p_imports_data_rssnom.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_actmed ON (p_imports.oid = p_imports_data_actmed.import_id AND p_imports_data_actmed.data_type = 'ACTMED' AND p_imports_data_actmed.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_vsj ON (p_imports.oid = p_imports_data_vsj.import_id AND p_imports_data_vsj.data_type = 'VSJ' AND p_imports_data_vsj.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_vse ON (p_imports.oid = p_imports_data_vse.import_id AND p_imports_data_vse.data_type = 'VSE' AND p_imports_data_vse.data_num = 0) 
			LEFT JOIN pmsi.p_imports_data p_imports_data_tsp ON (p_imports.oid = p_imports_data_tsp.import_id AND p_imports_data_tsp.data_type = 'TSP' AND p_imports_data_tsp.data_num = 0) 
			LEFT JOIN base.t_finess ON (t_finess.code = p_imports.finess) 
			WHERE p_imports.oid = $import_id ";
	$result = @$database->exec($sqlcmd);
	
	$ok = FALSE;
	
	if ($result != false) {
	
		$record = $database->nextRecordInto();
		if ($record != FALSE) {
		
			$ok = TRUE;
		
			$oid = $record[0];
			$texte = utf8_decode(trim($record[1]));
			$date_import = trim($record[2]);
			$etat = trim($record[3]);
			$etat_en_cours = trim($record[4]);
			$finess = trim($record[5]);
			$date_debut = trim($record[6]);
			$date_fin = trim($record[7]);
			$nb_rss = trim($record[8]);
			$nb_rum = trim($record[9]);
			$nb_rsf = trim($record[10]);
			$nb_erreurs = trim($record[11]);
			$nb_avertissements = trim($record[12]);
			$rss_file_path = utf8_decode(trim($record[13]));
			$rss_data_size = $record[14] + 0;
			$rsf_file_path = utf8_decode(trim($record[15]));
			$rsf_data_size = $record[16] + 0;
			$zin_file_path = utf8_decode(trim($record[17]));
			$zin_data_size = $record[18] + 0;
			$zou_file_path = utf8_decode(trim($record[19]));
			$zou_data_size = $record[20] + 0;
			$zif_file_path = utf8_decode(trim($record[21]));
			$zif_data_size = $record[22] + 0;
			$fcp_file_path = utf8_decode(trim($record[23]));
			$fcp_data_size = $record[24] + 0;
			$med_file_path = utf8_decode(trim($record[25]));
			$med_data_size = $record[26] + 0;
			$rssmed_file_path = utf8_decode(trim($record[27]));
			$rssmed_data_size = $record[28] + 0;
			$rssnom_file_path = utf8_decode(trim($record[29]));
			$rssnom_data_size = $record[30] + 0;
			$actmed_file_path = utf8_decode(trim($record[31]));
			$actmed_data_size = $record[32] + 0;
			$finess_texte = trim($record[33]);
			$vsj_file_path = utf8_decode(trim($record[35]));
			$vsj_data_size = $record[36] + 0;
			$vse_file_path = utf8_decode(trim($record[37]));
			$vse_data_size = $record[38] + 0;
			$tsp_file_path = utf8_decode(trim($record[39]));
			$tsp_data_size = $record[40] + 0;
		}
		
	}
		
	
	
	if($ok == TRUE) {
	
		$etat_text = $etat;
		if ($etat == "C") {
			$etat = "Contrôlé";
		}
		if ($etat == "G") {
			$etat = "Généré";
		}
		
		echo "<BR><H2><U>RAPPORT DE L'IMPORT DES FICHIERS RSS/RSF</U></H2>";
		echo "<BR>";
		echo "<BR><H3>$finess_texte ($finess)</H3>";
		echo "<BR><H3>Import n° $import_id du $date_import (Expédié à ePMSI)</H3>";
		echo "<BR>";
		echo "<BR>Etat <B>$etat_text</B>";
		echo "<BR>";
		echo "<BR><U>Fichiers</U> :";
		

		if ($zin_file_path != "") {
			echo "<BR>    RSS IN.ZIP           : $zin_file_path ($zin_data_size octets)";
		}
		if ($zou_file_path != "") {
			echo "<BR>    RSS OUT.ZIP          : $zou_file_path ($zou_data_size octets)";
		}
		if ($zif_file_path != "") {
			echo "<BR>    RSF IN.ZIP           : $zif_file_path ($zif_data_size octets)";
		}
		
		
		if ($rss_file_path != "") {
			echo "<BR>    RSS                  : $rss_file_path ($rss_data_size octets)";
		}
		
		if ($rsf_file_path != "") {
			echo "<BR>    RSF                  : $rsf_file_path ($rsf_data_size octets)";
		}
		
		if ($fcp_file_path != "") {
			echo "<BR>    FICHCOMP             : $fcp_file_path ($fcp_data_size octets)";
		}
		
		if ($med_file_path != "") {
			echo "<BR>    Médecins             : $med_file_path ($med_data_size octets)";
		}
		
		if ($rssmed_file_path != "") {
			echo "<BR>    RSS - Médecins       : $rssmed_file_path ($rssmed_data_size octets)";
		}
		
		if ($rssnom_file_path != "") {
			echo "<BR>    RSS - Noms           : $rssnom_file_path ($rssnom_data_size octets)";
		}
		
		if ($actmed_file_path != "") {
			echo "<BR>    Actes - Médecins     : $actmed_file_path ($actmed_data_size octets)";
		}
		
		if ($vsj_file_path != "") {
			echo "<BR>    Valorisation Séjours : $vsj_file_path ($vsj_data_size octets)";
		}
		
		if ($vse_file_path != "") {
			echo "<BR>    Valorisation ACE     : $vse_file_path ($vse_data_size octets)";
		}
		
		if ($tsp_file_path != "") {
			echo "<BR>    FICHSUP transports   : $tsp_file_path ($tsp_data_size octets)";
		}
		

		echo "<BR>";
		echo "<BR><U>Contenu</U> :";
		echo "<BR>    Finess <B>$finess</B>";
		echo "<BR>    Période <B>$date_debut - $date_fin</B>";
		echo "<BR>    <B>$nb_rss</B> RSS";
		echo "<BR>    <B>$nb_rum</B> RUM";
		echo "<BR>    <B>$nb_rsf</B> RSF";
		echo "<BR>";
		echo "<BR><U>Contrôle</U> :";
		if ($nb_erreurs > 0) {
			echo "<BR>    <B>$nb_erreurs</B> erreur(s) grave(s)";
		}
		else {
			echo "<BR>    Aucune erreur grave";
		}
		if ($nb_avertissements > 0) {
			echo "<BR>    <B>$nb_avertissements</B> avertissement(s)";
		}
		else {
			echo "<BR>    Aucun avertissement";
		}
		
		
		if ($nb_erreurs > 0 || $nb_avertissements > 0) {

			$sqlcmd = "SELECT erreur_code,  erreur_texte, count(*) FROM ";
			$sqlcmd = $sqlcmd . "(SELECT ";
			$sqlcmd = $sqlcmd . "CASE  ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' AND erreur ILIKE '%aucun rsf pour%' THEN '1_1' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' AND champ ILIKE '%GHM%' THEN '1_2' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' AND champ ILIKE '%code postal%' THEN '1_3' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' AND champ ILIKE '%date naissance%' THEN '1_4' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' AND champ ILIKE '%diagnostic principal%' THEN '1_5' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' THEN '1_9' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%date naissance%' THEN '2_1' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%date%' THEN '2_2' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND erreur ILIKE '%aucun rum pour%' THEN '2_3' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%acte ccam%' THEN '2_4' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%phase ccam%' THEN '2_4' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%activité ccam%' THEN '2_4' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%sexe%' THEN '2_5' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%civilité%' THEN '2_5' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%code prise en charge%' THEN '2_5' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' THEN '2_9' ";
			$sqlcmd = $sqlcmd . "ELSE '9' END as erreur_code, ";


			$sqlcmd = $sqlcmd . "CASE  ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' AND erreur ILIKE '%aucun rsf pour%' THEN 'RSS : Pas de RSF pour le RSS' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' AND champ ILIKE '%GHM%' THEN 'RSS : GHM erroné' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' AND champ ILIKE '%code postal%' THEN 'RSS : Code postal erroné' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' AND champ ILIKE '%date naissance%' THEN 'RSS : Date naissance erronée' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' AND champ ILIKE '%diagnostic principal%' THEN 'RSS : Diagnostic principal erroné' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSS' THEN 'RSS : Autres erreurs' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%date naissance%' THEN 'RSF : Date naissance erronée' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%date%' THEN 'RSF : Date erronée' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND erreur ILIKE '%aucun rum pour%' THEN 'RSF : Pas de RUM pour le RSF' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%acte ccam%' THEN 'RSF : Acte CCAM erroné' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%phase ccam%' THEN 'RSF : Acte CCAM erroné' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%activité ccam%' THEN 'RSF : Acte CCAM erroné' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%sexe%' THEN 'RSF : Sexe, civilité, PEC erroné' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%civilité%' THEN 'RSF : Sexe, civilité, PEC erroné' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' AND champ ILIKE '%code prise en charge%' THEN 'RSF : Sexe, civilité, PEC erroné' ";
			$sqlcmd = $sqlcmd . "WHEN data_type = 'RSF' THEN 'RSF : Autres erreurs' ";
			$sqlcmd = $sqlcmd . "ELSE 'Autres erreurs' END as erreur_texte ";

			$sqlcmd = $sqlcmd . "FROM pmsi.p_imports_controles ";
			$sqlcmd = $sqlcmd . "WHERE import_id = $import_id ";
			$sqlcmd = $sqlcmd . ") subview ";

			$sqlcmd = $sqlcmd . "GROUP BY erreur_code, erreur_texte ";
			$sqlcmd = $sqlcmd . "ORDER BY erreur_code ";
			
			$result = $database->exec($sqlcmd);
			


			if ($result != false) {
			
				echo "<P> </P>";
				echo "<P><H3><U>Récapitulatif des erreurs et avertissements</U> :</H3>";
				echo "<TABLE width=100%>";
				echo "<TR><TH align=left> </TH><TH align=left>Nombre</TH></TR>";
			
				$ok = TRUE;
				
				$last_data_type = "";
				$last_no_ligne = -1;

				while ($ok == TRUE) {
					$ok = FALSE;
			
					$record = $database->nextRecordInto();
					if ($record != FALSE) {
					
						$ok = TRUE;
					
						$erreur_texte = trim($record[1]);
						$erreur_nb = $record[2];
						
						echo "<TR><TD align=left>$erreur_texte</TD><TD align=left>$erreur_nb</TD></TR>";
						
							
						
					}
					
				}
				
				echo "</TABLE>";
			
			}
			
			
			

		
		}
		
		if ($nb_erreurs > 0) {
			echo "<P> </P>";
			echo "<P><H3><U>Liste des erreurs graves</U> :</H3>";

			
			$sqlcmd = "SELECT data_type, no_ligne, champ, gravite, ligne, erreur, commentaire, position, longueur  ";
			$sqlcmd = $sqlcmd . "FROM pmsi.p_imports_controles  ";
			$sqlcmd = $sqlcmd . "WHERE import_id = $import_id AND gravite >= 4 ";
			$sqlcmd = $sqlcmd . "ORDER BY data_type, no_ligne ";
			
			$result = $database->exec($sqlcmd);
			

			if ($result != false) {
			
				$ok = TRUE;
				
				$last_data_type = "";
				$last_no_ligne = -1;

				while ($ok == TRUE) {
					$ok = FALSE;
			
					$record = $database->nextRecordInto();
					if ($record != FALSE) {
					
						$ok = TRUE;
					
						$data_type = trim($record[0]);
						$no_ligne = $record[1];
						$champ = trim($record[2]);
						$gravite = $record[3] + 0;
						$ligne = $record[4];
						$erreur = trim($record[5]);
						$commentaire = trim($record[6]);
						$position = $record[7] + 0;
						$position2 = $record[7] + 1;
						$longueur = $record[8] + 0;
						if ($position > 0 && $longueur == 0) {
							$longueur = 1;
						}

						if ($longueur > 0 && $position < strlen($ligne)) {
							$ligne = substr($ligne, 0, $position+$longueur) . "</U></B></SPAN>" . substr($ligne, $position+$longueur);
							$ligne = substr($ligne, 0, $position) . "<SPAN style=\"font-size:larger;color:red\"><B><U>" . substr($ligne, $position);
						}
						
						if ($data_type != $last_data_type) {
							$last_data_type = $data_type;
							$last_no_ligne = -1;
						}
						
						if ($no_ligne != $last_no_ligne) {
							echo "<BR>";
							if ($data_type != "FILE" && $data_type != "EXEC") {
								echo "<BR><U>$data_type ligne $no_ligne</U>";
							}
							else {
								if ($data_type == "FILE") {
									echo "<P> </P><U>FICHIERS</U>";
								}
								if ($data_type == "EXEC") {
									echo "<P> </P><U>EXECUTION</U>";
								}
							}
							echo "<BR>    $ligne";
							$last_no_ligne = $no_ligne;
						}
						
						$sred = "";
						$ered = "";
						if ($gravite >= 9) {
							$sred = "<SPAN style=\"font-size:large;color:red\"><B>";
							$ered = "</B></SPAN>";
						}

						if ($data_type != "FILE" && $data_type != "EXEC") {
							if ($longueur == 0) {
								echo "<BR>    Champ=$champ    Erreur=$sred$erreur$ered";
							}
							else {
								echo "<BR>    Champ=$champ (pos:$position2 lg:$longueur)   Erreur=$sred$erreur$ered";
							}
						}
						else {
							echo "<BR>    $sred$erreur$ered";
						}
						if ($commentaire != "") {
							echo " - $commentaire";
						}
						
							
						
					}
					
				}
			
			}
				
		}
		
		if ($nb_avertissements > 0) {
			echo "<P> </P>";
			echo "<P><H3><U>Liste des avertissements</U> :</H3>";
			echo "<BR>ATTENTION, ces avertissements peuvent cacher un décalage dans la ligne</BR> <BR>";
			
			$sqlcmd = "SELECT data_type, no_ligne, champ, gravite, ligne, erreur, commentaire, position, longueur  ";
			$sqlcmd = $sqlcmd . "FROM pmsi.p_imports_controles  ";
			$sqlcmd = $sqlcmd . "WHERE import_id = $import_id AND gravite > 0 AND gravite < 4 ";
			$sqlcmd = $sqlcmd . "ORDER BY gravite DESC, data_type, no_ligne ";

			$result = $database->exec($sqlcmd);
			

			if ($result != false) {
			
				$ok = TRUE;
				
				$last_data_type = "";
				$last_no_ligne = -1;

				while ($ok == TRUE) {
					$ok = FALSE;
			
					$record = $database->nextRecordInto();
					if ($record != FALSE) {
					
						$ok = TRUE;

						$data_type = trim($record[0]);
						$no_ligne = $record[1];
						$champ = trim($record[2]);
						$gravite = $record[3];
						$ligne = $record[4];
						$erreur = trim($record[5]);
						$commentaire = trim($record[6]);
						$position = $record[7] + 0;
						$position2 = $record[7] + 1;
						$longueur = $record[8] + 0;
						if ($position > 0 && $longueur == 0) {
							$longueur = 1;
						}
						
						if ($longueur > 0 && $position < strlen($ligne)) {
							$ligne = substr($ligne, 0, $position+$longueur) . "</U></B></SPAN>" . substr($ligne, $position+$longueur);
							$ligne = substr($ligne, 0, $position) . "<SPAN style=\"font-size:larger;color:red\"><B><U>" . substr($ligne, $position);
						}
						
						if ($data_type != $last_data_type) {
							$last_data_type = $data_type;
							$last_no_ligne = -1;
						}
						
						if ($no_ligne != $last_no_ligne) {
							echo "<BR>";
							if ($data_type != "FILE" && $data_type != "EXEC") {
								echo "<BR><U>$data_type ligne $no_ligne</U>";
							}
							else {
								if ($data_type == "FILE") {
									echo "<P> </P><U>FICHIERS</U>";
								}
								if ($data_type == "EXEC") {
									echo "<P> </P><U>EXECUTION</U>";
								}
							}
							echo "<BR>    $ligne";
							$last_no_ligne = $no_ligne;
						}
						
						if ($data_type != "FILE" && $data_type != "EXEC") {
							if ($longueur == 0) {
								echo "<BR>    Champ=$champ    Erreur=$erreur";
							}
							else {
								echo "<BR>    Champ=$champ (pos:$position2 lg:$longueur)   Erreur=$erreur";
							}
						}
						else {
							echo "<BR>    $erreur";
						}
						if ($commentaire != "") {
							echo " - $commentaire";
						}	
						
					}
					
				}
			
			}
				
		}

	}
	else {
		echo "<BR>Rapport n° $import_id inexistant";
	}

   

             

?>

</PRE>
</body>
</HTML>
