-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaxa_search_result.php
More file actions
128 lines (118 loc) · 6.35 KB
/
Copy pathtaxa_search_result.php
File metadata and controls
128 lines (118 loc) · 6.35 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
include('db.php');
$taxa = (isset($_POST['key'])) ? $_POST['key'] : "";
$taxaQuery = "select Taxa, NCBITaxaID, Domain, TaxaLevel from taxa where Taxa like ?;";
// echo $taxaQuery."<br/>".$taxa."<br/>";
$conn = connect();
$taxaStmt = $conn->prepare($taxaQuery);
$param = "%".$taxa."%";
$taxaStmt->bind_param("s", $param);
// $taxaStmt->execute();
// $taxaResult = $taxaStmt->get_result();
// echo $taxaResult->num_rows." ".$taxaResult->field_count."<br/>";
// $taxaRows = $taxaResult->fetch_all(MYSQLI_ASSOC);
$taxaRows = execute_and_fetch_assoc($taxaStmt);
$taxaStmt->close();
$taxaJSON = json_encode($taxaRows);
closeConnection($conn);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Taxa search result - MDPD</title>
<link rel="icon" href="resource/pulmonomics_lab_logo.png" type="image/x-icon">
<link rel = "stylesheet" type = "text/css" href = "css/main.css" />
<script type = "text/javascript" src = "js/taxa_search_result.js"></script>
<script>
var dataJSON = '<?php echo $taxaJSON; ?>';
initializeData(dataJSON);
</script>
</head>
<body>
<div class = "section_header">
<center><p class="title">MDPD - Microbiome Database of Pulmonary Diseases</p></center>
</div>
<div class = "section_menu">
<center>
<table cellpadding="3px">
<tr class="nav">
<td class="nav"><a href="index.php" class="side_nav">Home</a></td>
<td class="nav"><a href="browse.php" class="side_nav">Browse</a></td>
<td class="nav"><a href="analysis.php" class="side_nav">Analysis</a></td>
<td class="nav"><a href="statistics.php" class="side_nav">Statistics</a></td>
<td class="nav"><a href="about.php" class="side_nav">About</a></td>
<td class="nav"><a href="help.html" class="side_nav">Help</a></td>
<td class="nav"><a href="submission.php" class="side_nav">Submit data</a></td>
<td class="nav"><a href="team.html" class="side_nav">Team</a></td>
</tr>
</table>
</center>
</div>
<!--<div class = "section_left"></div>-->
<div class = "section_middle">
<?php
if (count($taxaRows) < 1)
echo "<br/><center>No taxa found in the database containing \"".$taxa."\".</center>";
else {
?>
<?php echo "<p>Total number of taxa found in the database containing \"$taxa\" = ". count($taxaRows)."</p>";?>
<table border="0" style="width:100%; border:3px solid #004d99;">
<tr>
<td style="width:25%;">
Go to Page:
<input id="page_no_top" type="number" size="2" min="1" style="width:50px;" />
<button type="button" class="round" onclick="goto_page('result_display', 'page_no_top')" />Go</button>
</td>
<td style="width:15%;text-align:right;">
<button type="button" class="round" onclick="displayFirstPage('result_display')">First</button>
<button type="button" class="round" onclick="displayPrevPage('result_display')">Prev</button>
</td>
<td style="width:20%;">
<p id="pages_top" style="text-align:center;"></p>
</td>
<td style="width:15%;">
<button type="button" class="round" onclick="displayNextPage('result_display')">Next</button>
<button type="button" class="round" onclick="displayLastPage('result_display')">Last</button>
</td>
<td style="width:25%;"></td>
</tr>
</table>
<div id="result_display">
</div>
<table border="0" style="width:100%; border:3px solid #004d99;">
<tr>
<td style="width:25%;">
Go to Page:
<input id="page_no_bottom" type="number" size="2" min="1" style="width:50px;" />
<button type="button" class="round" onclick="goto_page('result_display', 'page_no_bottom')" />Go</button>
</td>
<td style="width:15%;text-align:right;">
<button type="button" class="round" onclick="displayFirstPage('result_display')">First</button>
<button type="button" class="round" onclick="displayPrevPage('result_display')">Prev</button>
</td>
<td style="width:20%;">
<p id="pages_bottom" style="text-align:center;"></p>
</td>
<td style="width:15%;">
<button type="button" class="round" onclick="displayNextPage('result_display')">Next</button>
<button type="button" class="round" onclick="displayLastPage('result_display')">Last</button>
</td>
<td style="width:25%;"></td>
</tr>
</table>
<script>
displayFirstPage('result_display');
</script>
<?php
}
?>
<br/><hr/>
<p style="font-size:0.9em;text-align:center;">
© 2025 Bose Institute. All rights reserved. For queries, please contact Dr. Sudipto Saha
(<a style="color:#003325;" href="mailto:ssaha4@jcbose.ac.in">ssaha4@jcbose.ac.in</a>,
<a style="color:#003325;" href="mailto:ssaha4@gmail.com">ssaha4@gmail.com</a>).
</p>
</div>
</body>
</html>