\n"; $lignes = organize_line($fields); foreach($lignes as $champ=>$value) { switch($champ){ case 'TI': //Titre principal $titre = $value; break; case 'PL': //Editeur $editeur = $value; break; case 'AU': //Auteur principal $auteur = explode(", ",$value); break; case 'IS': //ISBN/ISSN $code = $value; $pos = strpos($code,"("); $endcode = substr($code,$pos); $code = trim(substr($code,0,$pos)); if(isISBN($code)){ $infos_isbn=$code." ".$endcode; } elseif(isISSN($code)){ $infos_issn=$code." ".$endcode; } else $error = "wrong ISBN/ISSN \n"; break; case 'DP': //Date de publication $date = $value; if($date){ $date_elt = explode(' ',$date); if($date_elt[0]) $year = $date_elt[0]; if($date_elt[2]) $day = $date_elt[2]; if($date_elt[1]) { $mois = $date_elt[1]; switch($mois){ case 'Jan': $month = "01"; break; case 'Feb': $month = "02"; break; case 'Mar': $month = "03"; break; case 'Apr': $month = "04"; break; case 'May': $month = "05"; break; case 'Jun': $month = "06"; break; case 'Jul': $month = "07"; break; case 'Aug': $month = "08"; break; case 'Sep': $month = "09"; break; case 'Oct': $month = "10"; break; case 'Nov': $month = "11"; break; case 'Dec': $month = "12"; break; } } if($year && $month && $day) $date_sql = $year."-".$month."-".$day; else if($year && $month) $date_sql = $year."-".$month."-01"; else if($year) $date_sql = $year."-01-01"; } break; case 'IP': //Numéro de bulletin $bull_num = $value; break; case 'VI': //Volume $bull_vol = $value; break; case 'AB': //Résumé $resume = $value; break; case 'JT': //Titre du pério $perio_title = $value; break; case 'LA': //Langue $langue = $value; break; case 'TT': //Titre parallele $titre_parallele = $value; break; case 'PG': //Pagination $pagination = $value; break; case 'PMID': //Pubmed ID $pubmed_id = $value; break; case 'PT': //Document Type $doc_type = $value; break; case 'AID': //DOI $ids = explode(",",$value); if(is_array($ids)){ for($i=0;$i"; $data.="\n"; } if($langue){ $data.="\n"; $data.=" ".htmlspecialchars($langue,ENT_QUOTES,$charset)."\n"; $data.="\n"; } if($titre){ $data.="\n"; $data.=" ".htmlspecialchars($titre,ENT_QUOTES,$charset)."\n"; if($titre_parallele) $data.=" ".htmlspecialchars($titre_parallele,ENT_QUOTES,$charset)."\n"; $data.="\n"; } if($editeur){ $data.="\n"; if($editeur) $data.=" ".htmlspecialchars($editeur,ENT_QUOTES,$charset)."\n"; $data.="\n"; } if($pagination){ $data.="\n"; $data.=" ".htmlspecialchars($pagination,ENT_QUOTES,$charset)."\n"; $data.="\n"; } if($resume){ $data.="\n"; $data.=" ".htmlspecialchars($resume,ENT_QUOTES,$charset)."\n"; $data.="\n"; } if($perio_title){ $data.="\n"; $data.=" ".htmlspecialchars($perio_title,ENT_QUOTES,$charset)."\n"; if($infos_issn) $data.=" ".htmlspecialchars($infos_issn,ENT_QUOTES,$charset)."\n"; $data.=" lnk:perio\n"; $data.="\n"; } if($bull_num || $bull_vol || $date || $date_sql){ $data.="\n"; if($bull_num && $bull_vol) $data.=" "."vol. ".htmlspecialchars($bull_vol,ENT_QUOTES,$charset).", no. ".htmlspecialchars($bull_num,ENT_QUOTES,$charset)."\n"; else if($bull_num && !$bull_vol) $data.=" no. ".htmlspecialchars($bull_num,ENT_QUOTES,$charset)."\n"; else if(!$bull_num && $bull_vol) $data.=" vol. ".htmlspecialchars($bull_vol,ENT_QUOTES,$charset)."\n"; if($date){ $data.=" ".htmlspecialchars($date,ENT_QUOTES,$charset)."\n"; } if($date_sql){ $data.=" ".htmlspecialchars($date_sql,ENT_QUOTES,$charset)."\n"; } $data.=" lnk:bull\n"; $data.="\n"; } if($collectivite){ if($auteur){ for($i=0;$i\n"; $data.="\n"; } } $coll = explode(",",$collectivite,2); $data.="\n"; $data.=" ".htmlspecialchars($coll[0],ENT_QUOTES,$charset)."\n"; $data.=" ".htmlspecialchars($coll[1],ENT_QUOTES,$charset)."\n"; $data.="\n"; } else if($auteur){ $data.="\n"; $data.=" ".htmlspecialchars($auteur[0],ENT_QUOTES,$charset)."\n"; $data.="\n"; if($auteur){ for($i=1;$i\n"; $data.="\n"; } } } if($doc_type){ switch($doc_type){ case 'Abstracts': case 'Meeting Abstracts': $doctype = "Abstract"; break; case 'Academic Dissertations': $doctype = "Thesis"; break; case 'Annual Reports': case 'Technical Report': $doctype = "Report"; break; case 'Book Reviews': case 'Review': $doctype = "Review"; break; case 'Classical Article': case 'Corrected and Republished Article': case 'Journal Article': case 'Newspaper Article': $doctype = "Article"; break; case 'Comment': case 'Published Erratum': $doctype = "Erratum"; break; case 'Congresses': $doctype = "Conference Proceedings"; break; case 'Database': $doctype = "Database"; break; case 'Dictionary': $doctype = "Dictionary"; break; case 'Directory': $doctype = "Directory"; break; case 'Editorial': $doctype = "Editorial"; break; case 'Encyclopedias': $doctype = "Encyclopedia"; break; case 'Letter': $doctype = "Letter"; break; case 'Unpublished Works': $doctype = "Preprint"; break; default: $doctype = "Article"; break; } if($doctype){ $data.="\n"; $data.=" ".htmlspecialchars($doctype,ENT_QUOTES,$charset)."\n"; $data.=" Sub-Type\n"; $data.=" subtype\n"; $data.="\n"; } } if($doi){ $data.="\n"; $data.=" ".htmlspecialchars($doi,ENT_QUOTES,$charset)."\n"; $data.=" DOI id\n"; $data.=" pmi_doi_identifier\n"; $data.="\n"; } if($pubmed_id){ $data .="\n"; $data.=" http://www.ncbi.nlm.nih.gov/pubmed/$pubmed_id\n"; $data.="\n"; $data.="\n"; $data.=" ".htmlspecialchars($pubmed_id,ENT_QUOTES,$charset)."\n"; $data.=" Numéro PUBMED\n"; $data.=" pmi_xref_dbase_id\n"; $data.="\n"; } $data .= "\n"; if (!$error) { $r['VALID'] = true; }else { $r['VALID']=false; } $r['ERROR'] = $error; $r['DATA'] = $data; return $r; } ?>