<?
// téléchargement du fichier
header('Content-disposition: attachment; filename=curatorGFF.gff'); 
header('Content-Type: application/force-download');

include ("connection.php");


$id=$_GET["id"];

$requete="SELECT * from \"PROMOTER\" where \"PROMOTER_ID\"='$id'";
$stmt=pg_query($c,$requete);
$row=pg_fetch_array($stmt);

$abs_begin=$row["ABS_BEGIN"];
$abs_end=$row["ABS_END"];


$requete="select * from \"GENE\" where \"GENE_ID\"=(SELECT \"GENE_ID\" from \"GENE_REGULATION\" where \"PROMOTER_ID\"='$id')";
$stmt=pg_query($c,$requete);
$row=pg_fetch_array($stmt);

$scaffold=$row["SCAFFOLD_ID"];

$requete="SELECT \"NAME\" from \"MOL_ENTITY\" where \"MOL_ID\"='$id'";
$stmt=pg_query($c,$requete);
$row=pg_fetch_array($stmt);

$name=$row["NAME"];


$GFF="";

$GFF="#GFF generated by ANISEED CURATOR\n#\n#\n";

$GFF.="$scaffold\tibdml\treg\t$abs_begin\t$abs_end\t.\t.\t.\tname \"$name\"";



print $GFF;
















?>