-
Notifications
You must be signed in to change notification settings - Fork 1
/
other_gene_ids.php
54 lines (42 loc) · 1.68 KB
/
other_gene_ids.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!-- <h3>Other Gene Versions</h3> -->
<div class="collapse_section pointer_cursor" data-toggle="collapse" data-target="#gene_ver_section" aria-expanded="true">
Other Gene Versions
</div>
<div id="gene_ver_section" class="collapse in">
<br>
<?php
// echo "\n\n<br><br><h1>GENE ID: $gene_id</h1><br><br>\n\n";
$gene_id_query = "SELECT * FROM gene join gene_version ON (gene.gene_version_id=gene_version.gene_version_id) JOIN gene_gene ON(gene_id=gene_id2) WHERE gene_id1='".pg_escape_string($gene_id)."' ORDER BY gene_version ASC";
// $gene_id_query = "SELECT * FROM gene JOIN gene_gene ON(gene_id=gene_id2) WHERE gene_id1='$gene_id' ORDER BY genome_version DESC, gene_name ASC";
$gid_res = pg_query($gene_id_query) or die('Query failed: ' . pg_last_error());
if ($gid_res) {
// Printing results in HTML
echo "<table class=\"table annot_table\">\n<tr><th>Gene Name</th><th>Version</th></tr>\n";
while ($line = pg_fetch_array($gid_res, null, PGSQL_ASSOC)) {
$old_gene_name = $line["gene_name"];
$gene_version = $line["gene_version"];
$version_class = str_replace(".","_",$gene_version);
echo "<tr><td><a href=\"search_output.php?search_keywords=$old_gene_name\" target=\"_blank\">$old_gene_name</a></td><td>$gene_version</td></tr>\n";
// echo "<tr class=\"v$version_class\"><td><a href=\"gene.php?name=$old_gene_name\" target=\"_blank\">$old_gene_name</a></td><td>$gene_version</td></tr>\n";
}
echo "</table>\n\n";
// Free resultset
pg_free_result($gid_res);
}
?>
<br>
</div>
<!-- <style>
.v3_1 {
background-color:#444
}
.v3_0 {
background-color:#666
}
.v2_5 {
background-color:#063
}
.vtair10 {
background-color:#066
}
</style> -->