-
Notifications
You must be signed in to change notification settings - Fork 0
/
public-student-list.php
202 lines (155 loc) · 5.93 KB
/
public-student-list.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
<?php session_start();
include'connect.php';
$std=" select s.student_id , s.student_name ,s.school_id,s.date_of_birth,s.address,s.email,s.class_id,s.gender,c.class,c.section from student as s, classes as c where s.class_id=c.class_id";
if(isset($_POST['submit'])) {
if($_POST['select']=='6th') { //<=========== 'select'
$std=" select s.student_id , s.student_name,s.school_id ,s.date_of_birth,s.address,s.email,s.class_id,s.gender,c.class,c.section from student as s,classes as c where (class_id='CL0601' or class_id='CL0602' or class_id='CL0603' or class_id='CL0604') ";
}
elseif($_POST['select']=='7th') { //<=========== 'select'
$std=" select student_id , student_name,s.school_id ,date_of_birth,address,email,class_id,gender,c.class,c.section from student where
(class_id='CL0701' or class_id='CL0702' or class_id='CL0703' or class_id='CL0704') ";
}
elseif($_POST['select']=='8th'){
$std=" select student_id , student_name,s.school_id ,date_of_birth,address,email,class_id,gender,c.class,c.section from
student where class_id='CL0801' or class_id='CL0802' or class_id='CL0803' or class_id='CL0804' ";
}
elseif($_POST['select']=='9th'){
$std=" select student_id , student_name,s.school_id ,date_of_birth,address,email,class_id,gender,c.class,c.section
from student where class_id='CL0901' or class_id='CL0902' or class_id='CL0903' or class_id='CL0904' ";
}
elseif($_POST['select']=='10th'){
$std=" select student_id , student_name ,date_of_birth,address,email,class_id,gender,c.class,c.section from student where class_id='CL1001' or class_id='CL1002' or class_id='CL1003' or class_id='CL1004' ";
}
else{
}
$result=mysqli_query($con,$std) or die(mysqli_error);
$counter=mysqli_num_rows($result);
}
$result=mysqli_query($con,$std) or die(mysqli_error);
$counter=mysqli_num_rows($result);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
<title>Preskool - Students</title>
<link rel="shortcut icon" href="assets/img/favicon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,500;0,600;0,700;1,400&display=swap">
<link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/plugins/fontawesome/css/fontawesome.min.css">
<link rel="stylesheet" href="assets/plugins/fontawesome/css/all.min.css">
<link rel="stylesheet" href="assets/plugins/datatables/datatables.min.css">
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<div class="main-wrapper">
<?php include 'public-menu.php';?>
<div class="page-wrapper">
<div class="content container-fluid">
<div class="page-header">
<div class="row align-items-center">
<!-- <div class="col">
<h3 class="page-title">Students</h3>
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="teacher-dashboard.php">Dashboard</a></li>
<li class="breadcrumb-item active">Students</li>
</ul>
</div> -->
<!-- <div class="col-auto text-end float-end ms-auto">
<a href="#" class="btn btn-outline-primary me-2"><i class="fas fa-download"></i> Download</a>
<a href="add-student.php" class="btn btn-primary"><i class="fas fa-plus"></i></a>
</div> -->
</div>
</div>
<div>
<form class="filteroption" action="" method="post">
<select id="select" class="form-control form-select" name="select" >
<option value="6th" >6</option>
<option value="7th" >7</option>
<option value="8th" >8</option>
<option value="9th" >9</option>
<option value="10th" >10</option>
<option value=0 selected="selected">select class</option>
</select>
<br>
<input class="btn btn-primary" type="submit" name="submit" value="submit">
</form>
</div>
<br>
<div class="row">
<div class="col-sm-12">
<div class="card card-table">
<div class="card-body">
<div class="table-responsive">
<table id="myTable" class="table table-hover table-center mb-0 datatable">
<thead>
<tr>
<th>Name</th>
<th>Class</th>
<th>Section</th>
<th>School</th>
<!-- <th class="text-end">Action</th> -->
</tr>
</thead>
<tbody>
<?php
foreach ($result as $data)
{
$stdname=$data['student_name'];
$student_id=$data['student_id'];
$date=$data['date_of_birth'];
$class=$data['class'];
$clas=$data['school_id'];
$class_id=$data['class_id'];
$section = $data['section'];
$addres=$data['address'];
$mail=$data['email'];
$sql6=mysqli_query($con,"select school_name from school_info where school_id='$clas' ");
$sql4=mysqli_fetch_assoc($sql6);
$scl=$sql4['school_name'];
echo
'<tr>
<td>'.$student_id.'</td>
<td>
<a href="public-student-view.php?student_id='.$student_id.'&class_id='.$class_id.'">'.$stdname.'</a>
</h2>
</td>
<td>'.$class.'</td>
<td>'.$scl.'</td>
<td class="text-end">';
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="assets/js/jquery-3.6.0.min.js"></script>
<script src="assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="assets/plugins/datatables/datatables.min.js"></script>
<script src="assets/js/script.js"></script>
<script>
const searchFun = () => {
let filter = document.getElementById('class').value;
let myTable = document.getElementById('myTable');
let tr = myTable.getElementsByTagName('tr');
for(var i=0;i<tr.length;i++){
let td = tr[i].getElementsByTagName('td')[2];
if(td){
let textvlaue = td.textContent || td.innerHTML;
if(textvlaue.toUpperCase().indexOf(filter)>-1){
tr[i].style.display = "";
}
else{
tr[i].style.display = "none";
}
}
}
}
</script>
</body>
</html>