-
Notifications
You must be signed in to change notification settings - Fork 3
/
stddetails.php
134 lines (110 loc) · 4.47 KB
/
stddetails.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
<?php
$dbhost="localhost";
$dbuser="root";
$dbpass="";
$dbname="gptw";
$conn=mysqli_connect($dbhost,$dbuser,$dbpass);
if (!$conn) {
die("connection not established". mysql_error());
}
mysqli_select_db($conn,$dbname);
?>
<!DOCTYPE HTML>
<html>
<head>
<title>SEARCH STUDENT</title>
<style type="text/css">
.a{background-color: #33ffff;height:125px;width:1335px;border-radius:15px;}
.b{color:red; }
.c{background-color: green;height:50px;width:1335px;border-radius:10px}
a{color: yellow}
.th{background-color:red;height:50px;width:100px;}
th{
color:black;
font-style:oblique;
background-color: orange;
height: 40px;
padding: 20px;
width: 200px
}
tr{
background-color:#33ffff;
padding: 30px
}
</style>
</head>
<body bgcolor="silver">
<!--header-->
<div class="a" align="center"><br><br>
<h2 class="b"><font color="blue" face="lucida handwriting">GOVT. POLYTECHNIC</font><font color="black"> ,</font><font face="Segoe Script"> WARANGAL</font></h2>
</div>
<div class="c" align="center"><br>
<a href="index.php">HOME </a> |
<a href="about.php">ABOUT </a> |
<a href="gallery.php">GALLERY</a> |
<a href="stdcorner.php">STUDENT CORNER</a> |
<a href="login.php">LOGIN</a> |
<a href="feedback.php">FEEDBACK</a> |
<a href="contact.php">CONTACT US</a>
</div>
<!--/header-->
<br>
<div align="center"><br>
<h2>SEARCH STUDENT</h2><br>
<div>
<form action="<?php $_php_self ?>" method="get">
PIN : <input type="text" name="pin" placeholder="Enter your PIN" value="<?php if(empty($pin)) echo ""; else{ echo $pin;} ?>">
<input type="submit" value="submit" /><br><br>OR<br><br>
BRANCH:<input type="text" name="b" placeholder="Enter branch code" value="<?php if(empty($branch1)) echo ""; else{ echo $branch1;} ?>"> <input type="submit" value="submit">
<?php
if(isset($_GET['pin'])){
if($pin = $_GET["pin"])
{
$query="SELECT * FROM students WHERE PIN='$pin'";
$result = mysqli_query($conn, $query);
}
if ($branch1 = $_GET['b']) {
$query = "SELECT * FROM students WHERE branch = '$branch1' ";
$result = mysqli_query($conn, $query);
}
?>
<br><br><table cellpadding="1" width="1000px">
<tr><th>PIN</th><th>NAME</th><th>BRANCH</th><th>YEAR</th><th>SEMESTER</th><th>PHONE</th><th>ADDRESS</th><th>PHOTO</th><th>RESULT</th></tr>
<?php
while($result2=mysqli_fetch_array($result,MYSQLI_ASSOC)){
$pin1 = $result2['PIN'];
$name = $result2['NAME'];
$branch = $result2['BRANCH'];
$year = $result2['YEAR'];
$semester = $result2['SEMESTER'];
$phno = $result2['PHONE'];
$address = $result2['ADDRESS'];
$photo = $result2['PHOTO'];
?>
<tr>
<td> <?php if(empty($pin1)){echo "";} else{echo $pin1;} ?></td>
<td><?php if(empty($name)){echo "";} else{echo $name;} ?></td>
<td><?php if(empty($branch)){echo "";} else{echo $branch;} ?></td>
<td><?php if(empty($year)){echo "";} else{echo $year;} ?></td>
<td><?php if(empty($semester)){echo "";} else{echo $semester;} ?></td>
<td><?php if(empty($phno)){echo "";} else{echo $phno;} ?></td>
<td><?php if(empty($address)){echo "";} else{echo $address;} ?></td>
<td><?php if(empty($photo)){echo "";} else{echo "<img src = 'images/$photo' height=90px width=90px>";} ?></td>
<td><a href="results.php"> <input type="button" value="VIEW RESULTS" style="color:black;font-weight:bold;background-color:silver;padding:10px"></a></td>
<?php
}
}
?>
<br><br><br></tr>
</table>
</form>
</div>
</div>
<!--footer-->
<br><br><br><br><br><br><br><br><br><br></b><div style="background-color:maroon;height:40px">
<p style="color:white" align="center">© 2018 GPTW . Designed by <b>Sathish kesoju</b> and <b>Rajesh Keshoju</b></p>
</div>
<!-- /footer-->
</body>
</html>
<?php mysqli_close($conn)?>