-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_db.php
171 lines (149 loc) · 4.76 KB
/
show_db.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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
require_once('includes/config.php');
if (isset($_GET['cat']) && isset($_GET['table'])) {
$cat = $_GET['cat'];
$table = $_GET['table'];
if ($table === 'plant') {
$table = 'dbpr';
} elseif ($table === 'algea') {
$table = 'fbpa';
} elseif ($table === 'latest') {
$table = 'ldbpr';
} elseif ($table === 'cbdb') {
$table = 'cbdb';
}
elseif ($table === 'co19pdb') {
$table = 'co19pdb';
}elseif ($table === 'cdbptms') {
$table = 'cdbptms';
} else {
$table = 'db_table';
}
$query = "Select * from $table where db_category = '$cat' ORDER BY LENGTH(db_name)";
// $query = "Select * from dbpr where db_category = '$cat' order by db_date";
$result = mysqli_query($conn, $query);
// echo "<pre>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php require_once("includes/head-tag-elements.php"); ?>
<style>
.dbbox{
font-size: 1.2rem !important;
color black;
}
.db-box{
background-color: white;
}
.dbbox:hover{
background-color: #f5f5f5!important;
text-decoration: none;
}
.db-box:hover{
background-color: #f5f5f5!important;
box-shadow: 0 12px 7px 0px #C2FF4F!important;
transition: box-shadow .5s , background-color .5s;
}
</style>
</head>
<body>
<div id="wrapper">
<?php
require_once("includes/header.php");
require_once("includes/nav.php");
?>
<div id="main-content">
<div id="sidebar">
<div id="categories" class="boxed">
<div class="row py-3">
<div class="col">
<h2 class="text-center">Our Services</h2>
</div>
</div>
<?php require_once('includes/sidenav.php'); ?>
<div style="border:2px solid silver; height: auto; width:100%; border-radius: 10px; margin-top: 10px; margin-bottom: 10px;">
<div><img width="100%" src="images/news_table.gif" /></div>
<marquee behavior="scroll" direction="up" onmouseover="this.setAttribute('scrollamount', 0, 0);this.stop();" onmouseout="this.setAttribute('scrollamount', 6, 0);this.start();" height='250px'>
<p align=center>
<?php require_once("includes/news.php"); ?>
</p>
</marquee>
</div>
</div>
</div>
<div id="posts">
<div class="post">
<p> </p>
<div class="meta">
<p class="date">
<h2 class="title"><?php ($cat == 'ppoi') ? print('Protein Protein & Other Interaction (PP&OI)') : (print( $cat. " Data Base")) ?></h2>
</p>
</div>
<div class="story">
<div class="alert alert-info alert-dismissible">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Info!</strong> Tap on one of the database below to read more about the database being searched. It contains the name of the database, the type of the database, and a link to the official website.
</div>
<p>
<?php
$cat_name = $_GET['cat'];
$table = $_GET['table'];
if ($table === 'plant') {
$table = 'plant_cat_table';
} elseif ($table === 'algea') {
$table = 'fbpa_cat';
} elseif ($table === 'latest') {
$table = 'ldbpr_cat';
} elseif ($table === 'cbdb') {
$table = 'cbdb_cat';
} elseif ($table === 'co19pdb') {
$table = 'co19pdb_cat';
}elseif ($table === 'cdbptms') {
$table = 'cdbptms_cat';
}
else {
$table = 'categories';
}
$query2 = "Select * from $table where cat_name = '$cat_name'";
$result2 = mysqli_query($conn, $query2);
if ($result2) {
while ($row = mysqli_fetch_array($result2)) {
echo $row['cat_desc'];
}
}
?>
</p>
</div>
</div>
</div>
<div id=posts>
<div class="container">
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xm-12">
<div class="" style="display:flex; flex-wrap: wrap; justify-content: center;">
<?php
$table = $_GET['table'];
while ($row = mysqli_fetch_array($result)) {
echo '
<div class=" col-sm-12 col-md-12 col-lg-4 col-xl-3 col-xm-12" style="width:100%">
<a class="dbbox" href="show_desc.php?q=' . $row['db_id'] . '&table=' . $table . '">
<p class="db-box p-4 m-3 border rounded text-capitalize text-center">'
. $row['db_name'] .
'</p>
</a>
</div>';
}
?>
</div>
</div>
</div>
</div>
</div>
<?php require_once('includes/footer.php'); ?>
</div>
</div>
<script type="text/javascript" src="js/nav.js"></script>
</body>
</html>