-
Notifications
You must be signed in to change notification settings - Fork 0
/
dummy.php
148 lines (105 loc) · 6.03 KB
/
dummy.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
<!DOCTYPE html>
<head>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link type="text/css" rel="stylesheet" href="style2.css">
</head>
<body>
<div class="header">
<nav>
<img src="logoo.png" class="logo">
<h2 style="color:white;">CANCRISPR</h2>
<ul class="nav-links">
<li><a href="index.php">Home</a></li>
<li><a href="tool.php">Tools</a></li>
<li><a href="browse1.php">Browse(VISUALIZATION)</a></li>
<li><a href="search.php">Search</a></li>
<li><a href="wiki.php">Wiki Help</a></li>
</ul>
</nav>
<div class="content">
<h1>SEARCH</h2>
<form action="dummy.php" method="post">
<input type="text" name="keyword" placeholder="✎ Enter Screen Name or Target Gene Name to filter">
<button type="submit">Find</button>
</form>
</div>
<br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br><br><br><br>
<?php
//
$conn=mysqli_connect("localhost","root"," ","biodb");
if($conn){
echo "<center>Conection Established</center> <br><br><br>";
}
else{
echo "Connection not established";
}
//
if(isset($_POST["keyword"])){
echo "<br><br><br>";
$keyWord=$_POST["keyword"];
$sql2="Select * from cancer where ('$keyWord'=CRISPR_Screening OR '$keyWord'= Associated_Cancer OR '$keyWord'=Target_Gene);";
$result2=mysqli_query($conn,$sql2);
if(mysqli_num_rows($result2)>0){
$temp=array();//storing the screen_name for secondary table
$i=0;//counter
echo "<center><table style='border:2px solid black;border-collapse:collapse;'>";
echo "<tr>";
echo "<th style='padding:7px;border:2px solid black;text-align:center;background-color:rgb(87,164,226);'>Screen Name</th>";
echo "<th style='padding:7px;border:2px solid black;text-align:center;background-color:rgb(87,164,226);'>Target Gene</th>";
echo "<th style='padding:7px;border:2px solid black;text-align:center;background-color:rgb(87,164,226);'>Associated Cancers</th>";
echo "</tr>";
while($rows2=mysqli_fetch_assoc($result2)){
echo "<tr>";
echo "<td style='padding:7px;border:2px solid black;text-align:center;background-color:pink;'>";
echo $rows2["CRISPR_Screening"];
echo "</td>";
echo "<td style='padding:7px;border:2px solid black;text-align:center;background-color:yellow;'>";
echo $rows2["Target_Gene"];
echo "</td>";
echo "<td style='padding:7px;border:2px solid black;text-align:center;background-color:lightgreen;'>";
echo $rows2["Associated_Cancer"];
echo "</td>";
echo "</tr>";
}
echo "</table></center>";
echo "<br> <br> <br> <br> <br> <br>";
}
else{
echo "0 results";
}
}
else{
$sql1="select * from cancer;";
$result1=mysqli_query($conn,$sql1);
if(mysqli_num_rows($result1)>0){
echo "<center><table style='border:2px solid black;border-collapse:collapse;'>";
echo "<tr>";
echo "<th style='padding:7px;border:2px solid black;text-align:center;background-color:rgb(87,164,226);'>CRISPR Screening</th>";
echo "<th style='padding:7px;border:2px solid black;text-align:center;background-color:rgb(87,164,226);'>Target Gene</th>";
echo "<th style='padding:7px;border:2px solid black;text-align:center;background-color:rgb(87,164,226);'>Asociated Cancers</th>";
echo "</tr>";
while($rows1=mysqli_fetch_assoc($result1)){
echo "<tr>";
echo "<td style='padding:7px;border:2px solid black;text-align:center;background-color:lightgreen;'>";
echo $rows1["CRISPR_Screening"];
echo "</td>";
echo "<td style='padding:7px;border:2px solid black;text-align:center;background-color:pink;'>";
echo $rows1["Target_Gene"];
echo "</td>";
echo "<td style='padding:7px;border:2px solid black;text-align:center;background-color:yellow;'>";
echo $rows1["Associated_Cancer"];
echo "</td>";
echo "</tr>";
}
echo "</table></center>";
echo "<br> <br> <br> <br> <br> <br>";
}
}
?>
</body>
</html>