forked from adi0311/ApplicationTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhod_pend_stud.php
More file actions
141 lines (138 loc) · 5.76 KB
/
hod_pend_stud.php
File metadata and controls
141 lines (138 loc) · 5.76 KB
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
<?php
session_start();
if(isset($_SESSION['IS_AUTHENTICATED']) && $_SESSION['IS_AUTHENTICATED'] == 1){
$link = mysqli_connect('localhost', 'root', '');
if(!$link){
die('Failed to connect to server: ' . mysqli_error($link));
}
$db = mysqli_select_db($link,'file tracking');
if(!$db){
die("Unable to select database");
}
$user_id = $_SESSION['USER_ID'];
$qry1 = "SELECT roll_no,strdate,purpose,type from application_student where status='HOD' and result='pending' and roll_no in (SELECT roll_no from student where dept_id=(SELECT dept_id FROM department WHERE hod_id='$user_id'))";
$result1 = mysqli_query($link,$qry1);
$qry = "SELECT name FROM faculty WHERE faculty_id = '$user_id'";
//Execute query
$result = mysqli_query($link,$qry);
//Check whether the query was successful or not
$count = mysqli_num_rows($result);
if($count==1){
$info=mysqli_fetch_array($result);
$name=$info["name"];
}
echo'<html>
<head>
<link rel="stylesheet" type="text/css" href="semantic.min.css">
<link rel="stylesheet" type="text/css" href="semantic.css">
<link rel="stylesheet" type="text/css" href="semantic.min.js">
<link rel="stylesheet" type="text/css" href="semantic.js">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<meta charset="utf-8">
</head>
<body>
<div class="ui secondary inverted segment">
<div class="ui inverted secondary menu">
<a class="active item">
Home
</a>
<a class=" right aligned item" href="/ApplicationTracker/logout.php">
Logout
</a>
</div>
</div>
<div class="ui stackable four column grid">
<div class="two wide column">
</div>
<div class="column">
<div class="ui segment">
<div class="ui small image" style="display:block;">
<svg width="150" height="200">
<image xlink:href="14.jpg" x="0" y="0" width="100%" height="100%"></image>
</svg>
<br>
<div>
<h4>'.$name.'</h4>
</div>
</div>
</div>
<div class="ui vertical steps" style="display:block;">
<a href="/ApplicationTracker/show_stat_fac.php"><div class="ui step">
Leave Status
</div></a>
<a href="/ApplicationTracker/leave_fac.php"><div class="ui step">
Create Leave
</div></a>';
$qry2 = "SELECT name FROM department WHERE hod_id = '$user_id'";
//Execute query
$result2 = mysqli_query($link,$qry2);
//Check whether the query was successful or not
$count2 = mysqli_num_rows($result2);
if($count2==1){
echo'<a href="/ApplicationTracker/hod_pend_stud.php"><div class="ui active step">
Pending Leave Student
</div></a>
<a href="/ApplicationTracker/hod_pend_fac.php"><div class="ui step">
Pending Leave Faculty
</div></a>
<a href="/ApplicationTracker/hod_approv.php"><div class="ui step">
Approved/Rejected Leaves
</div></a>';
}
echo '</div>
</div>
<div class="ui padded segment eight wide column">
<div class="column">
<div class="ui dividing header">
Pending Leave of Student
</div>
<br>
<table class="ui unstackable table"><thead><th>Roll no.</th><th>Start Date</th><th>Purpose</th><th>Type</th></thead><tbody>';
if($result1){
$init=0;
while($info=mysqli_fetch_array($result1)){
echo '<tr class="clickable-row" data-href="/ApplicationTracker/hod_application.php?roll_no='.$info['roll_no'].'&strdate='.$info['strdate'].'">
<td>'.$info['roll_no'].'</td>
<td>'.$info['strdate'].'</td>
<td>'.$info['purpose'].'</td>
<td>'.$info['type'].'</td></tr></a>';
$init += 1;
}
}
echo '</tbody></table>
</div>
</div>
<div class="two wide column">
</div>
</div>
<script>
function change()
{
var k;
for(var i = 0; i < 100; i++)
{
var k = document.getElementById(i.toString(10)).innerHTML;
if(k == "pending")
{
$("#"+i.toString(10)).addClass("ui yellow message");
}
else if(k == "casual")
{
$("#"+i.toString(10)).addClass("positive");
}
}
}
</script>
<script>
$(document).ready(function($)
{
$(".clickable-row").click(function()
{
window.location = $(this).data("href");
});
});
</script>
</body>
</html>';
}
?>