-
Notifications
You must be signed in to change notification settings - Fork 0
/
topbar.php
157 lines (138 loc) · 6.72 KB
/
topbar.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
mysqli_report(MYSQLI_REPORT_OFF);
require_once('mysql_connect.php');
?>
<!DOCTYPE html>
<HTML>
<head>
<title>CHART</title>
<!-- CSS -->
<link rel="stylesheet" href="css/bootstrap.css" type="text/css" charset="utf-8"></link>
<link rel="stylesheet" href="css/jquery-ui.css" type="text/css" charset="utf-8"></link>
<link rel="stylesheet" href="css/jquery.qtip.min.css" type="text/css" charset="utf-8"></link>
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8"></link>
<!-- JAVASCRIPT -->
<!-- <script src="js/jquery.js" type="text/javascript" charset="utf-8"></script> -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="js/jquery-ui.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="js/jquery.hoverIntent.minified.js"></script>
<script src="js/jquery.dropdown.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.fixedheadertable.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.qtip.min.js" type="text/javascript" charset="utf-8"></script>
<style>
iframe#externalSite.externalSite {
width: 95%;
height:95%;
font-size:1em;
line-height:1.2em;
list-style:circle;
}
</style>
<script type="text/javascript" charset="utf-8">
$(function() {
$('.opener').click(function(e) {
e.preventDefault();
var $this = $(this);
var horizontalPadding = 30;
var verticalPadding = 30;
$('<div id="outerdiv"><iframe id="externalSite" class="externalSite" src="report_generate.php" />').dialog({
title: ($this.attr('title')) ? $this.attr('title') : 'My Report Generator',
autoOpen: true,
width: 400,
height: 500,
modal: true,
resizable: true,
autoResize: true,
overlay: {
opacity: 0.9,
background: "black"
}
}).width(400 - horizontalPadding).height(500 - verticalPadding);
});
});
</script>
</head>
<body>
<?php
$clientID = $_REQUEST['clientID'] ?? null;
$staffID = $_REQUEST['staffID'] ?? null;
$query = "SELECT j.created AS datetime,
c.name AS coopname,
j.TeamNote as teamnotes,
CONCAT(s.firstname,\" \",s.lastname) AS consultant,
j.StaffID AS staffID
FROM journal j, staff s, clients c
WHERE j.ClientID = c.id AND j.StaffID = s.id
HAVING staffID = $staffID";
// echo "<br><br><br><br>" . $query;
$result = mysqli_query($dbc, $query);
echo "<div class='banner'>\n";
echo "<div class='track_btn'><ul class='dropdown'><li class='narrow'><a href='#'>TRACK!</a><ul class='sub_menu narrow'>";
$clientr = mysqli_query($dbc, "SELECT * FROM clients LEFT JOIN staff_clients ON clients.id=staff_clients.clientID WHERE staff_clients.staffID='{$userinfo['id']}' ORDER BY clients.name");
while ($clientRow = mysqli_fetch_assoc($clientr)) {
$ccode = ($clientRow['code'] == '') ? acronymize($clientRow['name']) : $clientRow['code'];
$color = ($clientRow['active'] == 0) ? ' inactive' : '';
echo "<li class='narrow$color'><a href='entry.php?clientID=".$clientRow['id']."'>$ccode</a></li>";
}
echo "</ul></li></ul></div>";
$greetings = array("Welcome","Bienvenidos","Hello","Hiya","Wilkommen","Shalom","Bon jour","Howdy","Lookin' good","Hola","Konichiwa","Aloha","Mahalo","Bienvenue");
$greeting = array_rand($greetings);
echo "<div id='user_btn'>".$greetings[$greeting]." <a href='staff_profile.php?staffID={$userinfo['id']}'>".$userinfo['firstname']."</a>!";
//echo "<span style='font-size:8.5px; color: #88888;' >cID: $clientID</span>";
$rcolor = (REPORT_READY) ? "green" : "red";
$rpt_title = (REPORT_READY) ? "Reports are ready to go. Get to it!" : "Reports not yet ready, sorry";
echo "— Reports: <a href='#' title='".$rpt_title."'><img src='images/".$rcolor."dot.gif' alt='Report readiness indicator' height=12 border=0 class='dot_bg' /></a></div>";
echo "<div class='top_btns'> <ul class='dropdown'>";
echo "<li><a href='#'>OPTIONS</a>
<ul class=\"sub_menu\">\n";
if (REPORT_READY) {
// if(($report) || ($admin)){
echo "<li><a href='#' class='opener'>Generate ".($admin?"Full":"My")." Quarterly Report</a></li>\n";
// }
} else {
echo "<li><b>Reports Arent Ready Yet.</b></li>\n";
}
$client = "";
if(!empty($clientID)){
if(!$client) {
$c = mysqli_query($dbc, "SELECT * FROM clients WHERE id='".$clientID."'");
if(mysqli_num_rows($c)>0)$client=mysqli_fetch_array($c);
}
if($clientID){
// echo "<li><a href='dashboard.php?clientID=".$client['id']."'>View all for $client[name]</a></li>\n";
// if ($userinfo['id'] == $staffID || ($admin))
echo "<li><a href='client_profile.php?clientID=".$client['id']."'>Edit Client Profile</a></li>\n";
echo "<li><a href='client_export.php?clientID=".$client['id']."' target='_blank'>Export Client Data</a></li>\n";
}
}
if($admin){
// if (!$_GET['staffID']) echo "<li><a href='client_profile.php?clientID=$clientID>Edit Client Profileeeee</a></li>\n";
echo "<li><a href='client_assign.php'>Edit Staff Assignments</a></li>\n";
echo "<li><a href='report_profile.php'>Edit Report Profile</a></li>\n";
// echo "<li><a href='attendance.php'>Event Attendance</a></li>\n";
}
// echo "<li><a href='entry.php".(isset($_REQUEST['clientID'])?"?clientID=".$_REQUEST['clientID']:'')."'>Track Hours</a></li>\n";
echo "<li><a href='https://docs.google.com/forms/d/1tHqDyIvhF_Ygj3kjhxedHnpJWbKFAbbg93Rm6IgvyBE/viewform' target='_BLANK'>Submit an issue/request</a></li>";
echo "<li><a href='https://github.com/joelbrock/CHART/commits/master' target='_BLANK'>Changelog</a></li>";
echo "<li><a href='logout.php'>Logout.</a>";
echo "</ul></li>";
echo "<li><a href='#'>CONSULTANTS</a>
<ul class=\"sub_menu\">\n";
$staffr = mysqli_query($dbc, "SELECT * FROM staff WHERE active = 1 ORDER BY firstname");
if ($admin) echo "<li><a href='dashboard.php?staffID=SUPERALL'>--Super ALL --</a></li>\n";
echo "<li><a href='dashboard.php?staffID=ALL'>-- ALL --</a></li>\n";
while ($staffRow = mysqli_fetch_assoc($staffr)) {
$fullname = $staffRow['firstname'] . " " . $staffRow['lastname'];
echo "<li><a href=dashboard.php?staffID=" . $staffRow['id'] . ">" . $fullname . "</a></li>\n";
}
echo "</ul></li>";
echo "<li><a href='#'>CLIENTS</a>
<ul class=\"sub_menu\">\n";
$clientr = mysqli_query($dbc, "SELECT * FROM clients".($userinfo['admin']!='1'?" LEFT JOIN staff_clients ON clients.id=staff_clients.clientID WHERE staff_clients.staffID='{$userinfo['id']}' AND active = 1 ORDER BY clients.name":' WHERE active = 1 ORDER BY clients.name'));
while ($clientRow = mysqli_fetch_assoc($clientr)) {
echo "<li><a href=dashboard.php?clientID=" . $clientRow['id'] . ">" . ucwords($clientRow['name']) . "</a></li>\n";
}
echo "</ul></li></ul></div></div>";
echo "</p></div>\n";
?>