-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsindex.php
130 lines (102 loc) · 3.49 KB
/
sindex.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Student Manegment</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<br>
<a href="admin/login.php" class="btn btn-primary" style="float: right;">Admin Login</a><br><br>
<h3 class="text-center">Welcome to Student Management System</h3><br><br>
<div class="row justify-content-center">
<div class="col-6">
<form action="" method="post">
<table class="table table-bordered table-striped ">
<tr>
<td colspan="2" class="text-center"><label for="student"><b>Student Information</b></label>
</td>
</tr>
<tr>
<td><label for="choose">Choose Class</label></td>
<td>
<select name="choose" id="choose" class="form-control">
<option value="">Select Option</option>
<option value="class-1">class 1</option>
<option value="class-2">class 2</option>
<option value="class-3">class 3</option>
<option value="class-4">class 4</option>
<option value="class-5">class 5</option>
<option value="class-6">class 6</option>
<option value="class-7">class 7</option>
<option value="class-8">class 8</option>
</select>
</td>
</tr>
<tr>
<td><label for="roll">Roll</label></td>
<td><input class="form-control" type="text" name="roll" pattern="[0-9]{6}" placeholder="roll"></td>
</tr>
<tr>
<td colspan="2" class="text-center"><input class="btn btn-info" type="submit" value="Show Info" name="show_info"></td>
</tr>
</table>
</form>
</div>
</div>
<br><br>
<?php
require_once('admin/dbcon.php');
if (isset($_POST['show_info'])) {
$choose = $_POST['choose'];
$roll = $_POST['roll'];
$result = mysqli_query($db, "SELECT * FROM `student_info` WHERE `class` ='$choose' and `roll` ='$roll'");
if (mysqli_num_rows($result) == 1) {
$row=mysqli_fetch_assoc($result);
?>
<div class="row justify-content-center">
<div class="col-sm-6">
<table class="table table-bordered table-striped table-hover">
<tr>
<td rowspan="5">
<img src="admin/images/<?php echo $row['photo']; ?>" style="width: 200px; height: 220px;" alt="">
</td>
<td>Name</td>
<td><?php echo ucwords($row['name']); ?></td>
</tr>
<tr>
<td>Roll</td>
<td><?php echo $row['roll']; ?></td>
</tr>
<tr>
<td>Class</td>
<td><?php echo ucwords($row['class']); ?></td>
</tr>
<tr>
<td>City</td>
<td><?php echo ucwords($row['city']); ?></td>
</tr>
<tr>
<td>P.Contact</td>
<td><?php echo $row['pcontact']; ?></td>
</tr>
</table>
</div>
</div>
<?php
}
else
{ ?>
<script>
alert("No Found Data");
</script>
<?php }} ?>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>