-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfaculty-view.php
213 lines (147 loc) · 8.45 KB
/
faculty-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
require_once('Includes/header.php');
require_once('Includes/connection.php');
if(isset($_GET['saccess']))
{
echo '<div class="alert alert-danger text-center"><img src="images/pdenied.png" alt="X ">'."Please Logout first from this faculty account".'</div>';
}
if(isset($_SESSION['Faculty']))
{
$fac=$_SESSION['Faculty'];
$sql="select * from student_data";
mysqli_select_db($con,"student_management");
$res=mysqli_query($con,$sql);
}
else{
header("location:faculty-login.php?naccess");
}
?>
<div class="container" ng-app="app" ng-controller="search">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.0/angular.min.js"></script>
<div class="row">
<div class="col">
<div class="card bg-dark text-white mt-5">
<h3 class="text-center py-3">Student Details</h3>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="card">
<div class="card-title">
</div>
<div class="card-body">
<table class="table table-striped" >
<tr>
<div class="form-inline mb-3">
<input type="text" placeholder="Search name or regno. " class="form-control" ng-model="Searchtext" >
<!--<form action="search.php" method="POST">
<div class="form-inline mb-3">
<input type="text" placeholder="Search" class="form-control">
<button class="btn btn-success">Search</button>
</div>
</form>-->
<input type="text" placeholder="Search Skills " class="form-control" ng-model="SearchSkills" >
</div>
</tr>
<tr class="bg-success text-white">
<td>Regno</td>
<td>Name</td>
<td>Branch</td>
<td>Email</td>
<td>Skills</td>
<td >Operation</td>
<td >Generate LOR</td>
</tr>
<script>
var arrobj=[];
var a=angular.module("app",[]);
a.controller("search",function($scope){
<?php
while($row=mysqli_fetch_assoc($res))
{
//$i=0;
$skills="";
//unset($skills);
$StudentID= $row['Regno'];
$FName=$row['FName'];
$LName=$row['LName'];
$Branch=$row['Branch'];
$Email=$row['Email'];
$sql2="SELECT * FROM projects WHERE Regno='$StudentID'";
$res2=mysqli_query($con,$sql2);
while($row2=mysqli_fetch_assoc($res2)){
$m=$row2['Technologies'];
//array_push($skills,$m);
//$i++;
$skills=$skills.$m;
}
?>
arrobj.push({Reg:"<?php echo $StudentID?>",name:"<?php echo $FName.' '.$LName?>",branch:"<?php echo $Branch?>",email:"<?php echo $Email?>",skills:"<?php echo $skills;?>"});
$scope.arrobj=arrobj;
<?php
}
?>
$scope.SearchByNameAndReg=function(field){
if($scope.Searchtext==undefined && $scope.SearchSkills==undefined){
return true;
}
else{
if($scope.Searchtext!=undefined && $scope.SearchSkills!=undefined){
if((field.name.toLowerCase().indexOf($scope.Searchtext.toLowerCase()) != -1 || field.Reg.toLowerCase().indexOf($scope.Searchtext.toLowerCase()) != -1 ) && field.skills.toLowerCase().indexOf($scope.SearchSkills.toLowerCase()) != -1){
return true;
}
else{
return false;
}
}
else if($scope.Searchtext!=undefined ){
if(field.name.toLowerCase().indexOf($scope.Searchtext.toLowerCase()) != -1 || field.Reg.toLowerCase().indexOf($scope.Searchtext.toLowerCase()) != -1 ){
return true;
}
else{
return false;
}
}
else if($scope.SearchSkills!=undefined){
if(field.skills.toLowerCase().indexOf($scope.SearchSkills.toLowerCase()) != -1){
return true;
}
else{
return false;
}
}
}
// if($scope.SearchSkills!=undefined)
// {
// if(field.skills.toLowerCase().indexOf($scope.SearchSkills.toLowerCase()) != -1 ){
// return true;
// }
// else{
// return false;
// }
//}
}
});
</script>
<tr ng-repeat="i in arrobj | filter: SearchByNameAndReg">
<td id="reg">{{i.Reg}}</td>
<td>{{i.name}}</td>
<td>{{i.branch}}</td>
<td>{{i.email}}</td>
<td>{{i.skills}}</td>
<td><a href="view.php?success={{i.Reg}}" class="btn btn-success btn-sm">View</a></td>
<td><a href="faculty-LOR.php?success={{i.Reg}}&faculty=<?php echo $fac;?>" class="btn btn-success btn-sm">Generate LOR</a></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<?php require_once('Includes/footer.php');
?>