//get the parameter
$qtl=$_GET["qtl"];
trim($qtl);
$qtl=preg_replace("/'/",'',$qtl);
$sqlds="select * from QTL_info where QTL='".$qtl."'";
$re_ds=mysql_query($sqlds,$conn);
$fdsm=mysql_fetch_row($re_ds);
for ($i=0;$i
Your select this QTL:
";
echo "";
echo "| QTL | Chr | Peak (cM) | LOD | P Value | Range | Status | Phenotype | 
";
echo "
| $fdsm[0] | $fdsm[1] | $fdsm[2] | $fdsm[3] | $fdsm[4] | $fdsm[5] | $fdsm[6] | $fdsm[7] | 
";
echo "
";
$sqlm="select * from QTL_Genes where QTL='".$qtl."'";
$rem=mysql_query($sqlm,$conn);
$num=mysql_num_rows($rem);
echo "There are $num genes in the QTL region.
";
?>
// if list all or not
if( isset($_GET['listall']) ){
   $listall = intval( $_GET['listall'] );   
}
else{
   $listall = 1;
} 
// obtain the current page
if( isset($_GET['page']) ){
   $page = intval( $_GET['page'] );
}
else{
   $page = 1;
}
// list all genes in one page
if ($listall==0){	
	echo "
| GeneID | cM | Genome coordinates | Symbol, Name | 
";	
	while($rowf=mysql_fetch_row($rem)){
		for ($i=0;$i$rowf[5] | $rowf[2] | $rowf[3] | $rowf[4] | ";
	}
	echo "
";
	include("footer.php");
	exit(); 	
} 
// don't list all
// if the entry less than 50,list on the page.else list on several pages
// $num is total gene number of this dataset
$page_size=50; // if more than 50 genes, list 50 gene each page
$page_count=Count_Pages($num,$page_size);
// page_count >1 ,need list the page number
if($page_count>1){		
	$link="qtl=$qtl";
	List_Pages($page_count,$page,$link);
}
echo "| GeneID | cM | Genome coordinates | Symbol, Name | 
";	
$sqlf="select * from QTL_Genes where QTL='".$qtl."' limit ".($page-1)*$page_size.", $page_size";
$ref=mysql_query($sqlf,$conn);
while($rowf=mysql_fetch_row($ref)){			
	for ($i=0;$i$rowf[5] | $rowf[2] | $rowf[3] | $rowf[4] | ";
}
echo "
";
// page_count >1 ,need list the page number
if($page_count>1){		
	$link="qtl=$qtl";
	List_Pages($page_count,$page,$link);
}
?>