id_import = $id_imp;
}
function show_form(){
global $import_sug_form, $dbh, $charset, $msg;
global $catalog;
global $catalog_import;
global $explnumdoc_id;
if($explnumdoc_id){
$req = "select SUBSTRING(explnum_doc_data,1,250) as data, sugg_source, origine, type_origine from explnum_doc
join explnum_doc_sugg on num_explnum_doc=id_explnum_doc
left join suggestions on num_suggestion=id_suggestion
left join suggestions_origine so on so.num_suggestion=id_suggestion
where id_explnum_doc='".$explnumdoc_id."'";
$res = mysql_query($req,$dbh);
$expl = mysql_fetch_object($res);
$import_file = htmlentities($expl->data,ENT_QUOTES,$charset);
$import_sug_form = str_replace('!!explnum_id!!',$explnumdoc_id,$import_sug_form);
$source = $expl->sugg_source;
$origine = $expl->origine;
$type_origine = $expl->type_origine;
$import_sug_form = str_replace('!!origine_id!!',$origine,$import_sug_form);
$import_sug_form = str_replace('!!type_origine!!',$type_origine,$import_sug_form);
} else {
$import_sug_form = str_replace('!!explnum_id!!',"",$import_sug_form);
$import_file = " ";
$source = 0;
$import_sug_form = str_replace('!!origine_id!!',"",$import_sug_form);
$import_sug_form = str_replace('!!type_origine!!',"",$import_sug_form);
}
$import_sug_form = str_replace('!!import_file!!',$import_file,$import_sug_form);
$req = "select * from suggestions_source order by libelle_source";
$res= mysql_query($req,$dbh);
$option = "";
while(($src=mysql_fetch_object($res))){
if($src->id_source == $source) $selected="selected";
$option .= "";
$selected ="";
}
$selecteur = "";
$import_sug_form = str_replace('!!liste_source!!',$selecteur,$import_sug_form);
//Lecture des différents imports possibles
if (file_exists("./admin/convert/imports/catalog_subst.xml"))
$fic_catal = "./admin/convert/imports/catalog_subst.xml";
else
$fic_catal = "./admin/convert/imports/catalog.xml";
$catalog=array();
_parser_($fic_catal,array("ITEM"=>"_item_"),"CATALOG");
//Création de la liste des types d'import
$select_import="";
$import_sug_form = str_replace('!!liste_import!!',$select_import,$import_sug_form);
print $import_sug_form;
}
}
?>