-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathviewopencreateddocumentsoffice.php
85 lines (46 loc) · 1.73 KB
/
viewopencreateddocumentsoffice.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
<?php
/* This page displays documents created by a particular office or committee of the user.
It is possible that a user may have multiple offices or committees.
*/
session_start();
require_once("db.php");
require_once("fxns.php");
check_usersignin();
$id = $_SESSION['id'];
$officeid = $_GET['officeid'];
if(!isset($_GET['orderby'])){
$viewby = 'creationdate';
} else {
$viewby = $_GET['orderby'];
}
display_header();
display_main();
get_officecreatorname($officeid);
check_user_office($id, $officeid);
$pagelink = "viewopencreateddocumentsoffice.php";
$othervalue = 'officeid='.$officeid;
$getopendocumentsthisoffice = "select id, name, creationdate from document where creatoroffice = $officeid and status = 'Open' order by ".$viewby." asc";
$process1 = $db->query($getopendocumentsthisoffice);
if($process1->num_rows >= 1){
start_table();
cell_blue_ctr_order('Document ID', "$pagelink", "$othervalue", 'id'); // ($value, $pagelink, $othervalue, $ordervalue)
cell_blue_ctr_order('Name of Document', "$pagelink", "$othervalue", 'name');
cell_blue_ctr_order('Date Created', "$pagelink", "$othervalue", 'creationdate');
//cell_blue_hdr_ctr('Document Initiator');
cell_blue_hdr_ctr('Action');
echo "</tr>";
while($row2=$process1->fetch_assoc()) {
echo "<tr>";
cell_ctr($row2['id']);
cell_lft($row2['name']);
cell_ctr($row2['creationdate']);
cell_ctr("<a href='documentactionb.php?did=".$row2['id']."&officeid=$officeid'>View Document</a>");
echo "</tr>";
}
end_table();
return;
} else {
echo "Congratulations! Looks like this office has no open document.";
return;
}
?>