forked from codeb1ooded/RTI_Automation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompleted_rti.php
More file actions
132 lines (125 loc) · 3.75 KB
/
completed_rti.php
File metadata and controls
132 lines (125 loc) · 3.75 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
<?php
session_start();
$account_type = $_SESSION['login_access'];
?>
<html>
<head>
<title>Completed RTI</title>
<link rel="stylesheet" href="css/prev_rti.css">
<link rel="stylesheet" href="css/background.css">
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<script src="bootstrap/jQuery/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<meta charset="utf-8">
</head>
<body>
<div class='container'>
<?php
include 'config_database.php';
$query=" SELECT * FROM add_rti order by date_of_receipt_cio";
$res=mysqli_query($conn,$query);
echo "<br><h2>COMPLETED RTIs</h2><br>" ;
if($account_type == 'Admin') {
echo "<table class='table table-bordered'><tr>
<th>ID</th>
<th>Applicant Name</th>
<th>Phone Number</th>
<th>View Details</th></tr>";
while($r=mysqli_fetch_assoc($res)){
if($r['archive']==1) {
$query1 = "SELECT COUNT(*) AS total FROM info_about_reply where id=".$r['id'].";";
$res1 = mysqli_query($conn, $query1);
$values = mysqli_fetch_assoc($res1);
$num_rows = $values['total'];
if($num_rows>0) {
$query1 = "SELECT * FROM info_about_reply where id=".$r['id'].";";
$res1 = mysqli_query($conn,$query1);
$s = mysqli_fetch_assoc($res1);
$now = time();
$your_date = strtotime("$s[reply_date]");
$datediff = $now - $your_date;
$d4 = floor($datediff/(60*60*24));
if( $d4 <= 30 ) {
echo "<tr>
<td>".$r['id']."</td>
<td>".$r['name']."</td>
<td>".$r['phone_no']."</td>
<td><a href='compid.php?id=".$r['id']."'>View</a></td> </tr>";
}
else {
$sql="UPDATE add_rti SET closed=1 WHERE id=".$r['id'];
mysqli_query($conn,$sql);
}
}
}
}
echo "</table>";
}
else if($account_type != 'Admin'){
$dept = $_SESSION['department'];
$i=0;
$m='';
if($dept == 'Admin')
$m='Ad';
if($dept == 'Examination')
$m='Ex';
if($dept == 'Human Resource')
$m='HR';
if($dept == 'Academics')
$m='Ac';
$query=" SELECT * FROM t2 WHERE map='".$m."' order by id;";
$data=mysqli_query($con,$query);
$data2=mysqli_num_rows($data);
echo "<table class='table table-bordered>" ;
echo "<tr>
<th>ID</th>
<th>Applicant Name</th>
<th>Date of Receipt</th>
<th>Last date</th>
<th>Days left</th>
<th>Mark as completed</th></tr>";
while($data2!=0) {
$data3=mysqli_fetch_array($data);
$i=$data3['id'];
$quer="SELECT * FROM add_rti WHERE id=".$i." order by date_of_receipt_cio;";
$res=mysqli_query($con,$quer);
$v=mysqli_num_rows($res);
while($v!=0) {
$r=mysqli_fetch_array($res);
if($r['archive']==1) {
$query1= "SELECT COUNT(*) AS total FROM info_about_reply where id=".$r['id'].";";
$res1 = mysqli_query($conn, $query1);
$values = mysqli_fetch_assoc($res1);
$num_rows = $values['total'];
if($num_rows>0) {
$query1="SELECT * FROM info_about_reply where id=".$r['id'].";";
$res1=mysqli_query($conn,$query1);
$s=mysqli_fetch_assoc($res1);
$now = time();
$your_date = strtotime("$s[reply_date]");
$datediff = $now - $your_date;
$d4=floor($datediff/(60*60*24));
if($d4<=30) {
echo "<tr>
<td>".$r['id']."</td>
<td>".$r['name']."</td>
<td>".$r['phone_no']."</td>
<td><a href='compid.php?id=".$r['id']."'>View</a></td> </tr>";
}
else {
$sql="UPDATE add_rti SET closed=1 WHERE id=".$r['id'];
mysqli_query($conn,$sql);
}
}
}
$v--;
}
$data2--;
}
echo "</table>";
}
?>
<br><a href="select_option.php" class=btn >Back</a>
</div>
</body>
</html>