-
Notifications
You must be signed in to change notification settings - Fork 3
/
agents_stats_v2.php
181 lines (176 loc) · 4.4 KB
/
agents_stats_v2.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<html>
<style type="text/css">
/* tables */
table.tablesorter {
font-family:arial;
background-color: #CDCDCD;
margin:10px 0pt 15px;
font-size: 8pt;
width: 100%;
text-align: left;
}
table.tablesorter thead tr th, table.tablesorter tfoot tr th {
background-color: #e6EEEE;
border: 1px solid #FFF;
font-size: 8pt;
padding: 4px;
}
table.tablesorter thead tr .header {
background-image: url(bg.gif);
background-repeat: no-repeat;
background-position: center right;
cursor: pointer;
}
table.tablesorter tbody td {
color: #3D3D3D;
padding: 3px;
background-color: #FFF;
vertical-align: top;
}
table.tablesorter tbody tr.odd td {
background-color:#F0F0F6;
}
table.tablesorter thead tr .headerSortUp {
background-image: url(asc.gif);
}
table.tablesorter thead tr .headerSortDown {
background-image: url(desc.gif);
}
table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
background-color: #8dbdd8;
}
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/jlocal/jquery-latest.js"></script>
<script type="text/javascript" src="/jlocal/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// call the tablesorter plugin
$("table").tablesorter({
});
});
</script>
<title>Agent Stats Report</title>
</head>
<?php
if ( isset($_GET["userid"]) ) {
$userid = "where Name='".$_GET["userid"]."'";
} else {
$userid = "";
}
echo "select * from agent_performance_report $userid;";
// $link = $mysql = mysqli_connect('192.168.100.59', 'cron', '1234', 'asteriskrcs', 3306) or die(mysql_error());
// echo "Agent Stats Report - This is a Daily Report";
// $result = mysqli_query($link, "select * from agent_performance_report $userid;");
// $totals2 = mysqli_query($link, "select sum(contacts)'contacts',sum(sales)'sales',sum(XFER)'XFER',sum(CBN)'CBN',sum(SCBN)'SCBN',sum(OBCalls)'OBCalls',sum(ManCalls)'ManCalls',sum(IBCalls)'IBCalls',
// SEC_TO_TIME(sum(TotalTime))'TotalTime',SEC_TO_TIME(sum(OffTime))'OffTime',SEC_TO_TIME(sum(TalkTime))'TalkTime',SEC_TO_TIME(sum(WaitTime))'WaitTime',
// SEC_TO_TIME(sum(WrapTime))'WrapTime',SEC_TO_TIME(sum(DeadTime))'DeadTime',SEC_TO_TIME(sum(ACW))'ACW'
// from agent_performance_report $userid;");
?>
<body>
<table class="tablesorter">
<thead>
<tr>
<th>Name</th>
<th>User Group</th>
<th>Date</th>
<th>Contacts</th>
<th>Sales</th>
<th>XFER</th>
<th>CBN</th>
<th>SCBN</th>
<th>OB</th>
<th>Man</th>
<th>IB</th>
<th>Total Time</th>
<th>Off</th>
<th>Talk</th>
<th>Wait</th>
<th>Wrap</th>
<th>Dead</th>
<th>AfterCallWork</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array( $result )) {
echo "<tr><td>";
echo $row['Name'];
echo "</td><td>";
echo $row['UserGroup'];
echo "</td><td>";
echo $row['Date'];
echo "</td><td>";
echo $row['Contacts'];
echo "</td><td>";
echo $row['Sales'];
echo "</td><td>";
echo $row['XFER'];
echo "</td><td>";
echo $row['CBN'];
echo "</td><td>";
echo $row['SCBN'];
echo "</td><td>";
echo $row['OBCalls'];
echo "</td><td>";
echo $row['ManCalls'];
echo "</td><td>";
echo $row['IBCalls'];
echo "</td><td>";
echo $row['TotalTime'];
echo "</td><td>";
echo $row['OffTime'];
echo "</td><td>";
echo $row['TalkTime'];
echo "</td><td>";
echo $row['WaitTime'];
echo "</td><td>";
echo $row['WrapTime'];
echo "</td><td>";
echo $row['DeadTime'];
echo "</td><td>";
echo $row['ACW'];
echo "</td></tr>";}
?>
</tbody>
<?php while($totals = mysqli_fetch_array( $totals2 )){
echo "<tfoot>";
echo "<tr><td>Name</td><td>UserGRoup</td><td>Date</td><td>";
echo $totals['contacts'];
echo "</td><td>";
echo $totals['sales'];
echo "</td><td>";
echo $totals['XFER'];
echo "</td><td>";
echo $totals['CBN'];
echo "</td><td>";
echo $totals['SCBN'];
echo "</td><td>";
echo $totals['OBCalls'];
echo "</td><td>";
echo $totals['ManCalls'];
echo "</td><td>";
echo $totals['IBCalls'];
echo "</td><td>";
echo $totals['TotalTime'];
echo "</td><td>";
echo $totals['OffTime'];
echo "</td><td>";
echo $totals['TalkTime'];
echo "</td><td>";
echo $totals['WaitTime'];
echo "</td><td>";
echo $totals['WrapTime'];
echo "</td><td>";
echo $totals['DeadTime'];
echo "</td><td>";
echo $totals['ACW'];
echo "</td></tr>";
echo "</td></tr>";}
echo "</tfoot>";
mysql_close()?>
</table>
</body>
</html>