-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload.php
More file actions
122 lines (107 loc) · 3.1 KB
/
load.php
File metadata and controls
122 lines (107 loc) · 3.1 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
<?php
session_start();
include('connect.php');
if(!isset($_SESSION['userid']))
header('location:message.php');
if(isset($_GET['cert']))
{
$type=$_GET['cert'];
$q1="select year(CURDATE())";
$q2="select month(CURDATE())";
$q3="select dayofmonth(CURDATE())";
$r1=mysqli_query($con,$q1);
$r2=mysqli_query($con,$q2);
$r3=mysqli_query($con,$q3);
if($r1&&$r2&&$r3)
{
$row1=mysqli_fetch_array($r1);
$row2=mysqli_fetch_array($r2);
$row3=mysqli_fetch_array($r3);
$year=$row1[0];
$month=$row2[0];
$date=$row3[0];
//$fdate=$year.'-'.$month.'-'.$date;
}
if($_GET['his']==1)
{
if($type=="BOTH")
$q="select * from history limit 50";
else
$q="select * from history where doctype='$type'";
}
if($_GET['his']==0)
{
if($type=="BOTH")
$q="select * from history where date(`time`)=curdate()";
else
$q="select * from history where date(`time`)=curdate() and doctype='$type'";
}
else if($_GET['his']==2)
{
if($type=="BOTH")
$q="select * from history where date(`time`) between curdate()-interval 1 WEEK and curdate()";
else
$q="select * from history where date(`time`) between curdate()- interval 1 week and curdate() and doctype='$type'";
}
else if($_GET['his']==3)
{
$date=1;
$fdate=$year.'-'.$month.'-'.$date;
if($type=="BOTH")
$q="select * from history where date(`time`) >= '$fdate'";
else
$q="select * from history where date(`time`) >= '$fdate' and doctype='$type'";
}
else if($_GET['his']==4)
{
if($type=="BOTH")
$q="select * from history where date(`time`) >= (curdate()-interval 1 MONTH)";
else
$q="select * from history where date(`time`) >= (curdate()-interval 1 MONTH) and doctype='$type'";
}
else if($_GET['his']==5)
{
$date=1;
$month=1;
$fdate=$year.'-'.$month.'-'.$date;
if($type=="BOTH")
$q="select * from history where date(`time`) >= '$fdate'";
else
$q="select * from history where date(`time`) >= '$fdate' and doctype='$type'";
}
else if($_GET['his']==6)
{
$year=$year-1;
$fdate=$year.'-'.$month.'-'.$date;
if($type=="BOTH")
$q="select * from history where date(`time`) >= '$fdate'";
else
$q="select * from history where date(`time`) >= '$fdate' and doctype=$type";
}
else if($_GET['his']==7)
{
$date1=$_GET['date1'];
$date2=$_GET['date2'];
if($type=="BOTH")
$q="select * from history where date(`time`) >= '$date1' and date(`time`)<='$date2'";
else
$q="select * from history where date(`time`) >= '$date1' and date(`time`)<='$date2' and doctype='$type'";
}
?>
<table class="table" style="width:50%;font-size:13px;border:1px solid">
<tr bgcolor="#073350" style="color:white"><th>Date</th><th>ROLL NO.</th><th>CERTIFICATE</th><th>TYPE</th><th>ISSUE / REISSUE</th></tr>
<?php
$r=mysqli_query($con,$q);
if($r)
{
while($row=mysqli_fetch_array($r))
{
$rows=explode(' ',$row[4]);
$row[4]=$rows[0];
echo "<tr id='hover'><td>".$row[4]."</td><td>".$row[0]."</td><td>".$row[3]."</td><td>".$row[1]."</td>";
echo"<td>".$row[2]."</td></tr>";
}
}
?>
</table>
<?php } ?>