-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaper.php
148 lines (122 loc) · 3.92 KB
/
paper.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>
<html>
<head>
<title>paper</title>
<link rel="stylesheet" type="text/css" href="style.css">
<style type="text/css">
.grid-container {
display: grid;
grid-column-gap: 50px;
grid-template-columns: auto auto auto;
padding: 10px;
}
.grid-item {
background-color: white;
border: 1px solid rgba(0, 0, 0, 0.8);
padding: 20px;
font-size: 30px;
text-align: center;
box-shadow:20px 20px 50px grey;
}
input[type=button], input[type=submit] {
background-color: black;
border: none;
color: white;
padding: 16px 32px;
text-decoration: none;
margin: 4px 2px;
cursor: pointer;
}
.paperx{
padding-top: 50px;
background-color:yellow;
width:80%;
height:100px;
box-shadow:20px 20px 50px grey;
}
</style>
</head>
<body>
<ul>
<li><a class="active" href="index.html">Home</a></li>
<li><a href="paper.php">Sampale paper</a></li>
<li><a href="notes.php">notes</a></li>
<li><a href="#about">About us</a></li>
<li><a href="signin.php" class="signin">signin</a></li>
<li><a href="signup.php" class="signup">signup</a></li>
</ul>
<center>
<form action="<?php $_SERVER["PHP_SELF"]; ?>" method="POST">
<div class='paperx'>
<input type="submit" name="MCA" value="MCA">
<input type="submit" name="btech" value="btech">
<input type="submit" name="mtech" value="mtech">
<input type="submit" name="mba" value="mba">
<input type="submit" name="all" value="all">
</form>
</div>
</center>
<?php
require_once 'config.php';
/*
*/
?>
<?php
if(isset($_POST['MCA'])) {
mca();
}
if(isset($_POST['btech'])) {
btech();
}
if(isset($_POST['mtech'])) {
mtech();
}
if(isset($_POST['mba'])) {
mba();
}
if(isset($_POST['all'])) {
all();
}
function all(){
echo '<div class="grid-container">';
$result = mysql_query("SELECT photo,subject,branch FROM user ORDER BY photo ASC");
while($row= mysql_fetch_array($result)){
echo "<center><div class='grid-item'><a href='images/".$row['photo']."'><img src='images/".$row['photo']."' height = '300px' width = '300pxx'><p>".$row['subject']."</a></a></div></center>";
}
echo '</div>';
}
function btech(){
echo '<div class="grid-container">';
$btech = mysql_query("SELECT photo,subject,branch FROM user where branch = 'B.tech'");
while($row= mysql_fetch_array($btech)){
echo "<center><div class='grid-item'><a href='images/".$row['photo']."'><img src='images/".$row['photo']."' height = '300px' width = '300pxx'><p>".$row['subject']."</a></a></div></center>";
}
echo '</div>';
}
function mca(){
echo '<div class="grid-container">';
$mca = mysql_query("SELECT photo,subject,branch FROM user where branch = 'MCA'");
while($row= mysql_fetch_array($mca)){
echo "<center><div class='grid-item'><a href='images/".$row['photo']."'><img src='images/".$row['photo']."' height = '300px' width = '300pxx'><p>".$row['subject']."</a></a></div></center>";
}
echo '</div>';
}
function mtech(){
echo '<div class="grid-container">';
$mtech = mysql_query("SELECT photo,subject,branch FROM user where branch = 'M.tech'");
while($row= mysql_fetch_array($mtech)){
echo "<center><div class='grid-item'><a href='images/".$row['photo']."'><img src='images/".$row['photo']."' height = '300px' width = '300pxx'><p>".$row['subject']."</a></a></div></center>";
}
echo '</div>';
}
function mba(){
echo '<div class="grid-container">';
$mba = mysql_query("SELECT photo,subject,branch FROM user where branch = 'mba'");
while($row= mysql_fetch_array($mba)){
echo "<center><div class='grid-item'><a href='images/".$row['photo']."'><img src='images/".$row['photo']."' height = '300px' width = '300pxx'><p>".$row['subject']."</a></a></div></center>";
}
echo '</div>';
}
?>
</body>
</html>