-
Notifications
You must be signed in to change notification settings - Fork 0
/
view.php
213 lines (179 loc) · 7.11 KB
/
view.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php
session_start();
if(!$_SESSION['a_name'])
{
header('location:login.php?error=You are not administration');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View data</title>
<link rel="stylesheet" href="./css/bootstrap.min.css">
<link rel="stylesheet" href="./css/view.css">
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</head>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02"
aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item active">
<a class="nav-link" href="index.php">
<h2>Insert record</h2> <span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="logout.php">
<h2>Logout</h2>
</a>
</li>
</ul>
<form class="form-inline">
<input class="form-control mr-sm-2" type="search" name="search" placeholder="Enter Name OR Roll no">
<button class="btn btn-outline-success my-2 my-sm-0" name="submit" type="submit">Search</button>
</form>
</div>
</nav>
<body>
<center>
<tr>
<td>
<h2 class="inf">Welcome <font color="orange"><?php echo $_SESSION['a_name']; ?></label></font> you are
viewing all records</h2>
</td>
</tr>
</center>
<div id="form-wrapper" style="max-width:980px;margin:auto;">
<div class="formv">
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">Serial no</td>
<th scope="col">Student's name</td>
<th scope="col">Father's name</td>
<th scope="col">Roll no</td>
<th scope="col">Edit</td>
<th scope="col">Delete</td>
<th scope="col">Details</td>
</tr>
</thead>
<?php
$con=mysqli_connect('sql309.byethost7.com','b7_25814993','5f0v8wpz','b7_25814993_smanagement');
$query="select * from s_info";
$run=mysqli_query($con,$query);
$i=1;
while($row=mysqli_fetch_array($run))
{
$s_id=$row['s_id'];
$s_name=$row[1];
$s_father=$row[2];
$s_roll=$row[4];
?>
<tr>
<td><?php echo $i++; ?></td>
<td><?php echo $s_name; ?></td>
<td><?php echo $s_father; ?></td>
<td><?php echo $s_roll; ?></td>
<td><a href="edit.php?edit=<?php echo $s_id; ?>">Edit</a></td>
<td><a href="delete.php?del=<?php echo $s_id; ?>">Delete</a></td>
<td><a href="view.php?details=<?php echo $s_id; ?>">Details</a></td>
</tr>
<?php } ?>
</table></br>
</div>
</div>
<?php
$con=mysqli_connect('sql309.byethost7.com','b7_25814993','5f0v8wpz','b7_25814993_smanagement');
$s_details=@$_GET['details'];
$query="select * from s_info where s_id='$s_details'";
$run1=mysqli_query($con,$query);
while($row1=mysqli_fetch_array($run1))
{
$name=$row1[1];
$father=$row1[2];
$institution=$row1[3];
$roll=$row1[4];
$degree=$row1[5];
?>
<center>
<tr>
<th>
<h2>Details of student name <font color="orange"><?php echo $name; ?></font>
</h2>
</th>
</tr>
</center>
<div id="form-wrapper" style="max-width:980px;margin:auto;">
<div class="formv">
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">Student's name</td>
<th scope="col">Father's name</td>
<th scope="col">Institute</td>
<th scope="col">Roll no</td>
<th scope="col">Degree</td>
</tr>
<tr>
<td><?php echo $name; ?></td>
<td><?php echo $father; ?></td>
<td><?php echo $institution; ?></td>
<td><?php echo $roll; ?></td>
<td><?php echo $degree; ?></td>
</tr>
</thead>
</table></br>
</div>
</div>
<?php } ?>
</body>
</html>
<?php
if(isset($_GET['submit']))
{
$s_search=$_GET['search'];
$query3="select * from s_info where s_name='$s_search' OR s_roll='$s_search'";
$run3=mysqli_query($con,$query3);
while($row2=mysqli_fetch_assoc($run3)){
$name22=$row2['s_name'];
$father22=$row2['s_father'];
$institution22=$row2['s_institute'];
$roll22=$row2['s_roll'];
$degree22=$row2['s_degree'];
?>
<tr>
<td>
<center><h2>Your searched record of student <font color="orange"><?php echo $name22; ?></font> or roll <font color="orange"><?php echo $roll22; ?></font></center>
</h2>
</td>
</tr>
<div id="form-wrapper" style="max-width:980px;margin:auto;">
<div class="formv">
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">Student's name</td>
<th scope="col">Father's name</td>
<th scope="col">Institute</td>
<th scope="col">Roll no</td>
<th scope="col">Degree</td>
</tr>
<tr>
<td><?php echo $name22; ?></td>
<td><?php echo $father22; ?></td>
<td><?php echo $institution22; ?></td>
<td><?php echo $roll22; ?></td>
<td><?php echo $degree22; ?></td>
</tr></br>
</thead>
</table>
</div>
</div>
<?php }} ?>