<!DOCTYPE html>

<?php
	$constantid = "null";
	$spd = "null";
	if (isset ($_REQUEST['id'])) {$constantid = $_REQUEST['id'];};
	if (isset ($_REQUEST['specialdir'])) $spd = $_REQUEST['specialdir'];
?>
<title>View results of completed coexpression analysis</title>

<link href="css/coexpression.css" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.0.0/d3.min.js" charset="utf-8"></script>
</head>

<body>
	<div class="container">

		<!-- ======================================= -->

		<?php

		$target_file="http://coexpression.roslin.ed.ac.uk/view_results_feed.php?id=$constantid&specialdir=$spd";

		function import_file($this_link)
			{
			if ($fp = fopen($this_link, 'r')) {$content = '';
			  while ($line = fread($fp, 1024)) {$content .= $line;}
			}
			return $content;
			};

		function change_links($this_page)
			{
			$this_page = str_replace('/WWW/source/coexpression.roslin.ed.ac.uk/docs/results/', 'https://coexpression.roslin.ed.ac.uk/results/', $this_page);
			return $this_page;
			}

		if (isset($target_file))
			{
			try  { $imported_data = @import_file($target_file);}
			catch (Exx $e){}
			if (strlen($imported_data)>30) {echo change_links("$imported_data");}
			}
		?>

		<!-- ======================================= -->
	</div>

<script>
	console.log('target file: <? echo $target_file ?>')
</script>

</body>
</html>



