-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_pdf.php
125 lines (107 loc) · 4.61 KB
/
generate_pdf.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
<?php
include 'Source/connect.php';
include('Module/Login/session.php');
$start_date = $_POST['StartDate'];
$end_date = $_POST['EndDate'];
?>
<html>
<head>
<title>ManPro App</title>
<!-- Bootstrap Core CSS -->
<link href="css/css/bootstrap.css" rel="stylesheet"/>
<link href="css/css/bootstrap-select.css" rel="stylesheet"/>
<link href="css/css/bootstrap-datetimepicker.css" rel="stylesheet"/>
<link href="css/css/bootstrap-table.css" rel="stylesheet"/>
<!-- Custom CSS -->
<link href="css/css/simple-sidebar.css" rel="stylesheet"/>
<link href="css/css/style.css" rel="stylesheet"/>
<link href="../../css/css/loginstyle.css" rel="stylesheet"/>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- jQuery -->
<script src="../../Script/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="../../Script/bootstrap.min.js"></script>
<script src="../../Script/bootstrap-select.js"></script>
<script src="../../Script/moment.min.js"></script>
<script src="../../Script/moment-with-locales.js"></script>
<script src="../../Script/bootstrap-datetimepicker.js"></script>
<script src="../../Script/bootstrap-table.js"></script>
<script >
$(document).ready(function(){
$('#buttonsubmit').click(function() {
$("#formlogin").submit();
});
window.print();
});
$(document).keyup(function(event){
if(event.keyCode == 13){
$("#buttonsubmit").click();
}
});
</script>
</head>
<body>
<? // SQL query to fetch project name.
$sql_project_name = "SELECT PROJECT.ProjectName FROM PROJECT, CLIENT, USER_LOGIN
WHERE PROJECT.ProjectID = CLIENT.ProjectID
AND PROJECT.ProjectID = USER_LOGIN.ClientID
AND USER_LOGIN.Username = '$login_session'";
$result_project = $conn->query($sql_project_name);
while($row_project = $result_project->fetch_array()){
?>
<h1 class="text-center">Project   <? echo $row_project[0]; ?></h1>
<h2 class="text-center">For Date Range between <? echo $start_date; ?> and <? echo $end_date; ?></h2>
<?
}
?>
<h2 class="text-center">Task Progress Breakdown</h2>
<table id="table1" class="table table-striped" data-search="true" data-pagination="true">
<thead id="headtable">
<th width="10%" class="text-center">Task</th>
<th width="10%" class="text-center">Start</th>
<th width="10%" class="text-center">Due</th>
<th width="10%" class="text-center">Status</th>
<th width="5%" class="text-center">Finished On</th>
</thead>
<tbody>
<? // SQL query to fetch information of registerd users and finds user match.
$sql_init = "SELECT PROJECT.ProjectID FROM PROJECT, CLIENT, USER_LOGIN
WHERE PROJECT.ProjectID = CLIENT.ProjectID
AND PROJECT.ProjectID = USER_LOGIN.ClientID
AND USER_LOGIN.Username = '$login_session'";
$result_init = $conn->query($sql_init);
$row_init = $result_init->fetch_array();
$sql = "SELECT DISTINCT TASK.Description AS 'Task', TASK.StartDate AS 'Start', TASK.DueDate AS 'Due', IF(
TASK.FlagStatus='C','Completed', IF(
TASK.FlagStatus='L','Late',IF(
TASK.FlagStatus='O','Ongoing', IF(
TASK.FlagStatus='U','Upcoming','N/A'))))
AS 'Task Status', IF(
TASK.FinishDate IS NULL,'N/A',TASK.FinishDate)
AS 'Finished on'
FROM TASK, WORKS_ON
WHERE TASK.TaskID = WORKS_ON.TaskID
AND WORKS_ON.ProjectID = $row_init[0]
AND TASK.StartDate BETWEEN '$start_date' AND '$end_date'";
$result = $conn->query($sql);
while($row = $result->fetch_array()){
?>
<tr>
<td class="text-center"><?php echo $row[0];?></td>
<td class="text-center"><?php echo $row[1];?></td>
<td class="text-center"><?php echo $row[2];?></td>
<td class="text-center"><?php echo $row[3];?></td>
<td class="text-center"><?php echo $row[4];?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</body>
</html>