1
|
<?php
|
2
|
# AST_timeonVDADall.php
|
3
|
#
|
4
|
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
5
|
#
|
6
|
# live real-time stats for the VICIDIAL Auto-Dialer all servers
|
7
|
#
|
8
|
# STOP=4000, SLOW=40, GO=4 seconds refresh interval
|
9
|
#
|
10
|
# CHANGELOG:
|
11
|
# 50406-0920 - Added Paused agents < 1 min
|
12
|
# 51130-1218 - Modified layout and info to show all servers in a vicidial system
|
13
|
# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
14
|
# 60511-1343 - Added leads and drop info at the top of the screen
|
15
|
# 60608-1539 - Fixed CLOSER tallies for active calls
|
16
|
# 60619-1658 - Added variable filtering to eliminate SQL injection attack threat
|
17
|
# - Added required user/pass to gain access to this page
|
18
|
# 60626-1453 - Added display of system load to bottom (Angelito Manansala)
|
19
|
# 60901-1123 - Changed display elements at the top of the screen
|
20
|
# 60905-1342 - Fixed non INCALL|QUEUE timer column
|
21
|
# 61002-1642 - Added TRUNK SHORT/FILL stats
|
22
|
# 61101-1318 - Added SIP and IAX Listen and Barge links option
|
23
|
# 61101-1647 - Added Usergroup column and user name option as well as sorting
|
24
|
# 61102-1155 - Made display of columns more modular, added ability to hide server info
|
25
|
# 61215-1131 - Added answered calls and drop percent taken from answered calls
|
26
|
# 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns
|
27
|
# 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu
|
28
|
# 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer)
|
29
|
# 70619-1339 - Added Status Category tally display
|
30
|
# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction
|
31
|
# 80227-0418 - Added priority to waiting calls display
|
32
|
# 80311-1550 - Added calls_today on all agents and wait time/in-group for inbound calls
|
33
|
# 80422-0033 - Added phonediaplay option, allow for toggle-sorting on sortable fields
|
34
|
# 80422-1001 - Fixed sort by phone login
|
35
|
# 80424-0515 - Added non_latin lookup from system_settings
|
36
|
# 80525-1040 - Added IVR status display and summary for inbound calls
|
37
|
# 80619-2047 - Added DISPO status for post-call-work while paused
|
38
|
# 80704-0543 - Added DEAD status for agents INCALL with no live call
|
39
|
# 80822-1222 - Added option for display of customer phone number
|
40
|
# 81011-0335 - Fixed remote agent display bug
|
41
|
# 81022-1500 - Added inbound call stats display option
|
42
|
# 81029-1023 - Changed drop percent calculation for multi-stat reports
|
43
|
# 81029-1706 - Added pause code display if enabled per campaign
|
44
|
# 81108-2337 - Added inbound-only section
|
45
|
# 90105-1153 - Changed monitor links to use 0 prefix instead of 6
|
46
|
# 90202-0108 - Changed options to pop-out frame, added outbound_autodial_active option
|
47
|
# 90310-0906 - Added admin header
|
48
|
# 90428-0727 - Changed listen and barge to use the API and manager must enter phone
|
49
|
# 90508-0623 - Changed to PHP long tags
|
50
|
# 90518-0930 - Fixed $CALLSdisplay static assignment bug for some links(bug #210)
|
51
|
# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion
|
52
|
# 90602-0405 - Added list mix display in statuses and order if active
|
53
|
# 90603-1845 - Fixed color coding bug
|
54
|
# 90627-0608 - Some Formatting changes, added in-group name display
|
55
|
# 90701-0657 - Fixed inbound=No calculation issues
|
56
|
# 90808-0212 - Fixed inbound only non-ALL bug, changed times to use agent last_state_change
|
57
|
# 90907-0915 - Added PARK status
|
58
|
# 90914-1154 - Added AgentOnly display column to waiting calls section
|
59
|
# 91102-2013 - Changed in-group color styles for incoming calls waiting
|
60
|
# 91204-1548 - Added ability to change agent in-groups and blended
|
61
|
# 100214-1127 - Added no-dialable-leads alert and in-groups stats option
|
62
|
# 100301-1229 - Added 3-WAY status for consultative transfer agents
|
63
|
# 100303-0930 - Added carrier stats display option
|
64
|
# 100424-0943 - Added realtime_block_user_info option
|
65
|
# 100709-1054 - Added system setting slave server option
|
66
|
# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
|
67
|
# 100805-0704 - Fixed minor bug in campaigns restrictions
|
68
|
# 100815-0002 - Added optional display of preset dials if presets are enabled in the campaign
|
69
|
# 100912-0839 - Changed several stats to limit to 2 or 3 decimal spaces
|
70
|
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
71
|
# 101024-0832 - Added Agent time stats option and agents-in-dispo counter
|
72
|
# 101109-1448 - Added Auto Hopper Level display (MikeC)
|
73
|
# 101216-1358 - Added functions to work with new realtime_report.php script
|
74
|
# 110218-1037 - Fixed query that was causing load spikes on systems with millions of log entries
|
75
|
# 110303-2125 - Added agent on-hook phone indication and RING status and color
|
76
|
# 110314-1735 - Fixed another query that was causing load spikes on systems with millions of log entries
|
77
|
#
|
78
|
|
79
|
$version = '2.4-65';
|
80
|
$build = '110314-1735';
|
81
|
|
82
|
header ("Content-type: text/html; charset=utf-8");
|
83
|
|
84
|
require("dbconnect.php");
|
85
|
require("functions.php");
|
86
|
|
87
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
88
|
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
89
|
$PHP_SELF=$_SERVER['PHP_SELF'];
|
90
|
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
91
|
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
92
|
if (isset($_GET["RR"])) {$RR=$_GET["RR"];}
|
93
|
elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];}
|
94
|
if (isset($_GET["inbound"])) {$inbound=$_GET["inbound"];}
|
95
|
elseif (isset($_POST["inbound"])) {$inbound=$_POST["inbound"];}
|
96
|
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
97
|
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
98
|
if (isset($_GET["groups"])) {$groups=$_GET["groups"];}
|
99
|
elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];}
|
100
|
if (isset($_GET["usergroup"])) {$usergroup=$_GET["usergroup"];}
|
101
|
elseif (isset($_POST["usergroup"])) {$usergroup=$_POST["usergroup"];}
|
102
|
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
103
|
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
104
|
if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];}
|
105
|
elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];}
|
106
|
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
107
|
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
108
|
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
109
|
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
110
|
if (isset($_GET["SIPmonitorLINK"])) {$SIPmonitorLINK=$_GET["SIPmonitorLINK"];}
|
111
|
elseif (isset($_POST["SIPmonitorLINK"])) {$SIPmonitorLINK=$_POST["SIPmonitorLINK"];}
|
112
|
if (isset($_GET["IAXmonitorLINK"])) {$IAXmonitorLINK=$_GET["IAXmonitorLINK"];}
|
113
|
elseif (isset($_POST["IAXmonitorLINK"])) {$IAXmonitorLINK=$_POST["IAXmonitorLINK"];}
|
114
|
if (isset($_GET["UGdisplay"])) {$UGdisplay=$_GET["UGdisplay"];}
|
115
|
elseif (isset($_POST["UGdisplay"])) {$UGdisplay=$_POST["UGdisplay"];}
|
116
|
if (isset($_GET["UidORname"])) {$UidORname=$_GET["UidORname"];}
|
117
|
elseif (isset($_POST["UidORname"])) {$UidORname=$_POST["UidORname"];}
|
118
|
if (isset($_GET["orderby"])) {$orderby=$_GET["orderby"];}
|
119
|
elseif (isset($_POST["orderby"])) {$orderby=$_POST["orderby"];}
|
120
|
if (isset($_GET["SERVdisplay"])) {$SERVdisplay=$_GET["SERVdisplay"];}
|
121
|
elseif (isset($_POST["SERVdisplay"])) {$SERVdisplay=$_POST["SERVdisplay"];}
|
122
|
if (isset($_GET["CALLSdisplay"])) {$CALLSdisplay=$_GET["CALLSdisplay"];}
|
123
|
elseif (isset($_POST["CALLSdisplay"])) {$CALLSdisplay=$_POST["CALLSdisplay"];}
|
124
|
if (isset($_GET["PHONEdisplay"])) {$PHONEdisplay=$_GET["PHONEdisplay"];}
|
125
|
elseif (isset($_POST["PHONEdisplay"])) {$PHONEdisplay=$_POST["PHONEdisplay"];}
|
126
|
if (isset($_GET["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_GET["CUSTPHONEdisplay"];}
|
127
|
elseif (isset($_POST["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_POST["CUSTPHONEdisplay"];}
|
128
|
if (isset($_GET["NOLEADSalert"])) {$NOLEADSalert=$_GET["NOLEADSalert"];}
|
129
|
elseif (isset($_POST["NOLEADSalert"])) {$NOLEADSalert=$_POST["NOLEADSalert"];}
|
130
|
if (isset($_GET["DROPINGROUPstats"])) {$DROPINGROUPstats=$_GET["DROPINGROUPstats"];}
|
131
|
elseif (isset($_POST["DROPINGROUPstats"])) {$DROPINGROUPstats=$_POST["DROPINGROUPstats"];}
|
132
|
if (isset($_GET["ALLINGROUPstats"])) {$ALLINGROUPstats=$_GET["ALLINGROUPstats"];}
|
133
|
elseif (isset($_POST["ALLINGROUPstats"])) {$ALLINGROUPstats=$_POST["ALLINGROUPstats"];}
|
134
|
if (isset($_GET["with_inbound"])) {$with_inbound=$_GET["with_inbound"];}
|
135
|
elseif (isset($_POST["with_inbound"])) {$with_inbound=$_POST["with_inbound"];}
|
136
|
if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"];}
|
137
|
elseif (isset($_POST["monitor_active"])) {$monitor_active=$_POST["monitor_active"];}
|
138
|
if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];}
|
139
|
elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];}
|
140
|
if (isset($_GET["CARRIERstats"])) {$CARRIERstats=$_GET["CARRIERstats"];}
|
141
|
elseif (isset($_POST["CARRIERstats"])) {$CARRIERstats=$_POST["CARRIERstats"];}
|
142
|
if (isset($_GET["PRESETstats"])) {$PRESETstats=$_GET["PRESETstats"];}
|
143
|
elseif (isset($_POST["PRESETstats"])) {$PRESETstats=$_POST["PRESETstats"];}
|
144
|
if (isset($_GET["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_GET["AGENTtimeSTATS"];}
|
145
|
elseif (isset($_POST["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_POST["AGENTtimeSTATS"];}
|
146
|
if (isset($_GET["RTajax"])) {$RTajax=$_GET["RTajax"];}
|
147
|
elseif (isset($_POST["RTajax"])) {$RTajax=$_POST["RTajax"];}
|
148
|
if (isset($_GET["RTuser"])) {$RTuser=$_GET["RTuser"];}
|
149
|
elseif (isset($_POST["RTuser"])) {$RTuser=$_POST["RTuser"];}
|
150
|
if (isset($_GET["RTpass"])) {$RTpass=$_GET["RTpass"];}
|
151
|
elseif (isset($_POST["RTpass"])) {$RTpass=$_POST["RTpass"];}
|
152
|
|
153
|
|
154
|
$report_name = 'Real-Time Main Report';
|
155
|
$db_source = 'M';
|
156
|
|
157
|
#############################################
|
158
|
##### START SYSTEM_SETTINGS LOOKUP #####
|
159
|
$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
|
160
|
$rslt=mysql_query($stmt, $link);
|
161
|
if ($DB) {echo "$stmt\n";}
|
162
|
$qm_conf_ct = mysql_num_rows($rslt);
|
163
|
if ($qm_conf_ct > 0)
|
164
|
{
|
165
|
$row=mysql_fetch_row($rslt);
|
166
|
$non_latin = $row[0];
|
167
|
$outbound_autodial_active = $row[1];
|
168
|
$slave_db_server = $row[2];
|
169
|
$reports_use_slave_db = $row[3];
|
170
|
}
|
171
|
##### END SETTINGS LOOKUP #####
|
172
|
###########################################
|
173
|
|
174
|
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
175
|
{
|
176
|
mysql_close($link);
|
177
|
$use_slave_server=1;
|
178
|
$db_source = 'S';
|
179
|
require("dbconnect.php");
|
180
|
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
181
|
}
|
182
|
|
183
|
if (!isset($DB)) {$DB=0;}
|
184
|
if (!isset($RR)) {$RR=40;}
|
185
|
if (!isset($group)) {$group='ALL-ACTIVE';}
|
186
|
if (!isset($usergroup)) {$usergroup='';}
|
187
|
if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes
|
188
|
if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name
|
189
|
if (!isset($orderby)) {$orderby='timeup';}
|
190
|
if (!isset($SERVdisplay)) {$SERVdisplay=0;} # 0=no, 1=yes
|
191
|
if (!isset($CALLSdisplay)) {$CALLSdisplay=1;} # 0=no, 1=yes
|
192
|
if (!isset($PHONEdisplay)) {$PHONEdisplay=0;} # 0=no, 1=yes
|
193
|
if (!isset($CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} # 0=no, 1=yes
|
194
|
if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes
|
195
|
if (!isset($with_inbound))
|
196
|
{
|
197
|
if ($outbound_autodial_active > 0)
|
198
|
{$with_inbound='Y';} # N=no, Y=yes, O=only
|
199
|
else
|
200
|
{$with_inbound='O';} # N=no, Y=yes, O=only
|
201
|
}
|
202
|
$ingroup_detail='';
|
203
|
|
204
|
if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group; $RR=40;}
|
205
|
else {$group = $groups[0];}
|
206
|
|
207
|
function get_server_load($windows = false)
|
208
|
{
|
209
|
$os = strtolower(PHP_OS);
|
210
|
if(strpos($os, "win") === false)
|
211
|
{
|
212
|
if(file_exists("/proc/loadavg"))
|
213
|
{
|
214
|
$load = file_get_contents("/proc/loadavg");
|
215
|
$load = explode(' ', $load);
|
216
|
return $load[0] . ' ' . $load[1] . ' ' . $load[2];
|
217
|
}
|
218
|
elseif(function_exists("shell_exec"))
|
219
|
{
|
220
|
$load = explode(' ', `uptime`);
|
221
|
return $load[count($load)-3] . ' ' . $load[count($load)-2] . ' ' . $load[count($load)-1];
|
222
|
}
|
223
|
else
|
224
|
{
|
225
|
return false;
|
226
|
}
|
227
|
}
|
228
|
elseif($windows)
|
229
|
{
|
230
|
if(class_exists("COM"))
|
231
|
{
|
232
|
$wmi = new COM("WinMgmts:\\\\.");
|
233
|
$cpus = $wmi->InstancesOf("Win32_Processor");
|
234
|
|
235
|
$cpuload = 0;
|
236
|
$i = 0;
|
237
|
while ($cpu = $cpus->Next())
|
238
|
{
|
239
|
$cpuload += $cpu->LoadPercentage;
|
240
|
$i++;
|
241
|
}
|
242
|
|
243
|
$cpuload = round($cpuload / $i, 2);
|
244
|
return "$cpuload%";
|
245
|
}
|
246
|
else
|
247
|
{
|
248
|
return false;
|
249
|
}
|
250
|
}
|
251
|
}
|
252
|
|
253
|
$load_ave = get_server_load(true);
|
254
|
|
255
|
$NOW_TIME = date("Y-m-d H:i:s");
|
256
|
$NOW_DAY = date("Y-m-d");
|
257
|
$NOW_HOUR = date("H:i:s");
|
258
|
$STARTtime = date("U");
|
259
|
$epochONEminuteAGO = ($STARTtime - 60);
|
260
|
$timeONEminuteAGO = date("Y-m-d H:i:s",$epochONEminuteAGO);
|
261
|
$epochFIVEminutesAGO = ($STARTtime - 300);
|
262
|
$timeFIVEminutesAGO = date("Y-m-d H:i:s",$epochFIVEminutesAGO);
|
263
|
$epochFIFTEENminutesAGO = ($STARTtime - 900);
|
264
|
$timeFIFTEENminutesAGO = date("Y-m-d H:i:s",$epochFIFTEENminutesAGO);
|
265
|
$epochONEhourAGO = ($STARTtime - 3600);
|
266
|
$timeONEhourAGO = date("Y-m-d H:i:s",$epochONEhourAGO);
|
267
|
$epochSIXhoursAGO = ($STARTtime - 21600);
|
268
|
$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO);
|
269
|
$epochTWENTYFOURhoursAGO = ($STARTtime - 86400);
|
270
|
$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO);
|
271
|
|
272
|
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
273
|
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
274
|
|
275
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
276
|
if ($DB) {echo "|$stmt|\n";}
|
277
|
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
278
|
$rslt=mysql_query($stmt, $link);
|
279
|
$row=mysql_fetch_row($rslt);
|
280
|
$auth=$row[0];
|
281
|
|
282
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
|
283
|
if ($DB) {echo "|$stmt|\n";}
|
284
|
$rslt=mysql_query($stmt, $link);
|
285
|
$row=mysql_fetch_row($rslt);
|
286
|
$reports_only_user=$row[0];
|
287
|
|
288
|
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
289
|
{
|
290
|
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
291
|
Header("HTTP/1.0 401 Unauthorized");
|
292
|
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
293
|
exit;
|
294
|
}
|
295
|
# and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) )
|
296
|
if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) )
|
297
|
{
|
298
|
$stmt="select phone_login from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active='Y';";
|
299
|
$rslt=mysql_query($stmt, $link);
|
300
|
if ($DB) {echo "$stmt\n";}
|
301
|
$row=mysql_fetch_row($rslt);
|
302
|
$monitor_phone = $row[0];
|
303
|
}
|
304
|
|
305
|
$stmt="SELECT realtime_block_user_info,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
306
|
if ($DB) {echo "|$stmt|\n";}
|
307
|
$rslt=mysql_query($stmt, $link);
|
308
|
$row=mysql_fetch_row($rslt);
|
309
|
$realtime_block_user_info = $row[0];
|
310
|
$LOGuser_group = $row[1];
|
311
|
|
312
|
$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
|
313
|
if ($DB) {echo "|$stmt|\n";}
|
314
|
$rslt=mysql_query($stmt, $link);
|
315
|
$row=mysql_fetch_row($rslt);
|
316
|
$LOGallowed_campaigns = $row[0];
|
317
|
$LOGallowed_reports = $row[1];
|
318
|
|
319
|
if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
320
|
{
|
321
|
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
322
|
Header("HTTP/1.0 401 Unauthorized");
|
323
|
echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
|
324
|
exit;
|
325
|
}
|
326
|
|
327
|
$LOGallowed_campaignsSQL='';
|
328
|
$whereLOGallowed_campaignsSQL='';
|
329
|
if ( (!preg_match("/ALL-/",$LOGallowed_campaigns)) )
|
330
|
{
|
331
|
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
332
|
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
333
|
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
334
|
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
335
|
}
|
336
|
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
337
|
|
338
|
$allactivecampaigns='';
|
339
|
$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;";
|
340
|
$rslt=mysql_query($stmt, $link);
|
341
|
if ($DB) {echo "$stmt\n";}
|
342
|
$groups_to_print = mysql_num_rows($rslt);
|
343
|
$i=0;
|
344
|
$LISTgroups[$i]='ALL-ACTIVE';
|
345
|
$i++;
|
346
|
$groups_to_print++;
|
347
|
while ($i < $groups_to_print)
|
348
|
{
|
349
|
$row=mysql_fetch_row($rslt);
|
350
|
$LISTgroups[$i] =$row[0];
|
351
|
$LISTnames[$i] =$row[1];
|
352
|
$allactivecampaigns .= "'$LISTgroups[$i]',";
|
353
|
$i++;
|
354
|
}
|
355
|
$allactivecampaigns .= "''";
|
356
|
|
357
|
$i=0;
|
358
|
$group_string='|';
|
359
|
$group_ct = count($groups);
|
360
|
while($i < $group_ct)
|
361
|
{
|
362
|
if ( (preg_match("/ $groups[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) )
|
363
|
{
|
364
|
$group_string .= "$groups[$i]|";
|
365
|
$group_SQL .= "'$groups[$i]',";
|
366
|
$groupQS .= "&groups[]=$groups[$i]";
|
367
|
}
|
368
|
|
369
|
$i++;
|
370
|
}
|
371
|
$group_SQL = eregi_replace(",$",'',$group_SQL);
|
372
|
|
373
|
### if no campaigns selected, display all
|
374
|
if ( ($group_ct < 1) or (strlen($group_string) < 2) )
|
375
|
{
|
376
|
$groups[0] = 'ALL-ACTIVE';
|
377
|
$group_string = '|ALL-ACTIVE|';
|
378
|
$group = 'ALL-ACTIVE';
|
379
|
$groupQS .= "&groups[]=ALL-ACTIVE";
|
380
|
}
|
381
|
|
382
|
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) )
|
383
|
{
|
384
|
$all_active = 0;
|
385
|
$group_SQL = "''";
|
386
|
$group_SQLand = "and FALSE";
|
387
|
$group_SQLwhere = "where FALSE";
|
388
|
}
|
389
|
elseif ( eregi('ALL-ACTIVE',$group_string) )
|
390
|
{
|
391
|
$all_active = 1;
|
392
|
$group_SQL = $allactivecampaigns;
|
393
|
$group_SQLand = "and campaign_id IN($allactivecampaigns)";
|
394
|
$group_SQLwhere = "where campaign_id IN($allactivecampaigns)";
|
395
|
}
|
396
|
else
|
397
|
{
|
398
|
$all_active = 0;
|
399
|
$group_SQLand = "and campaign_id IN($group_SQL)";
|
400
|
$group_SQLwhere = "where campaign_id IN($group_SQL)";
|
401
|
}
|
402
|
|
403
|
|
404
|
$stmt="select user_group from vicidial_user_groups;";
|
405
|
$rslt=mysql_query($stmt, $link);
|
406
|
if (!isset($DB)) {$DB=0;}
|
407
|
if ($DB) {echo "$stmt\n";}
|
408
|
$usergroups_to_print = mysql_num_rows($rslt);
|
409
|
$i=0;
|
410
|
while ($i < $usergroups_to_print)
|
411
|
{
|
412
|
$row=mysql_fetch_row($rslt);
|
413
|
$usergroups[$i] =$row[0];
|
414
|
$i++;
|
415
|
}
|
416
|
|
417
|
if (!isset($RR)) {$RR=4;}
|
418
|
|
419
|
$NFB = '<b><font size=6 face="courier">';
|
420
|
$NFE = '</font></b>';
|
421
|
$F=''; $FG=''; $B=''; $BG='';
|
422
|
|
423
|
$select_list = "<TABLE WIDTH=700 CELLPADDING=5 BGCOLOR=\"#EFEFEF\"><TR><TD VALIGN=TOP>Select Campaigns: <BR>";
|
424
|
$select_list .= "<SELECT SIZE=15 NAME=groups[] multiple>";
|
425
|
$o=0;
|
426
|
while ($groups_to_print > $o)
|
427
|
{
|
428
|
if (ereg("\|$LISTgroups[$o]\|",$group_string))
|
429
|
{$select_list .= "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";}
|
430
|
else
|
431
|
{$select_list .= "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";}
|
432
|
$o++;
|
433
|
}
|
434
|
$select_list .= "</SELECT>";
|
435
|
$select_list .= "<BR><font size=1>(To select more than 1 campaign, hold down the Ctrl key and click)<font>";
|
436
|
$select_list .= "</TD><TD VALIGN=TOP ALIGN=CENTER>";
|
437
|
$select_list .= "<a href=\"#\" onclick=\"closeDiv(\'campaign_select_list\');\">Close Panel</a><BR><BR>";
|
438
|
$select_list .= "<TABLE CELLPADDING=2 CELLSPACING=2 BORDER=0>";
|
439
|
|
440
|
$select_list .= "<TR><TD align=right>";
|
441
|
$select_list .= "Inbound: </TD><TD align=left><SELECT SIZE=1 NAME=with_inbound>";
|
442
|
$select_list .= "<option value=\"N\"";
|
443
|
if ($with_inbound=='N') {$select_list .= " selected";}
|
444
|
$select_list .= ">No</option>";
|
445
|
$select_list .= "<option value=\"Y\"";
|
446
|
if ($with_inbound=='Y') {$select_list .= " selected";}
|
447
|
$select_list .= ">Yes</option>";
|
448
|
$select_list .= "<option value=\"O\"";
|
449
|
if ($with_inbound=='O') {$select_list .= " selected";}
|
450
|
$select_list .= ">Only</option>";
|
451
|
$select_list .= "</SELECT></TD></TR>";
|
452
|
|
453
|
$select_list .= "<TR><TD align=right>";
|
454
|
$select_list .= "Monitor: </TD><TD align=left><SELECT SIZE=1 NAME=monitor_active>";
|
455
|
$select_list .= "<option value=\"\"";
|
456
|
if (strlen($monitor_active) < 2) {$select_list .= " selected";}
|
457
|
$select_list .= ">NONE</option>";
|
458
|
$select_list .= "<option value=\"MONITOR\"";
|
459
|
if ($monitor_active=='MONITOR') {$select_list .= " selected";}
|
460
|
$select_list .= ">MONITOR</option>";
|
461
|
$select_list .= "<option value=\"BARGE\"";
|
462
|
if ($monitor_active=='BARGE') {$select_list .= " selected";}
|
463
|
$select_list .= ">BARGE</option>";
|
464
|
$select_list .= "<option value=\"HIJACK\"";
|
465
|
if ($monitor_active=='HIJACK') {$select_list .= " selected";}
|
466
|
$select_list .= ">HIJACK</option>";
|
467
|
$select_list .= "</SELECT></TD></TR>";
|
468
|
|
469
|
$select_list .= "<TR><TD align=right>";
|
470
|
$select_list .= "Phone: </TD><TD align=left>";
|
471
|
$select_list .= "<INPUT type=text size=10 maxlength=20 NAME=monitor_phone VALUE=\"$monitor_phone\">";
|
472
|
$select_list .= "</TD></TR>";
|
473
|
$select_list .= "<TR><TD align=center COLSPAN=2> </TD></TR>";
|
474
|
|
475
|
if ($UGdisplay > 0)
|
476
|
{
|
477
|
$select_list .= "<TR><TD align=right>";
|
478
|
$select_list .= "Select User Group: </TD><TD align=left>";
|
479
|
$select_list .= "<SELECT SIZE=1 NAME=usergroup>";
|
480
|
$select_list .= "<option value=\"\">ALL USER GROUPS</option>";
|
481
|
$o=0;
|
482
|
while ($usergroups_to_print > $o)
|
483
|
{
|
484
|
if ($usergroups[$o] == $usergroup) {$select_list .= "<option selected value=\"$usergroups[$o]\">$usergroups[$o]</option>";}
|
485
|
else {$select_list .= "<option value=\"$usergroups[$o]\">$usergroups[$o]</option>";}
|
486
|
$o++;
|
487
|
}
|
488
|
$select_list .= "</SELECT></TD></TR>";
|
489
|
}
|
490
|
|
491
|
$select_list .= "<TR><TD align=right>";
|
492
|
$select_list .= "Dialable Leads Alert: </TD><TD align=left><SELECT SIZE=1 NAME=NOLEADSalert>";
|
493
|
$select_list .= "<option value=\"\"";
|
494
|
if (strlen($NOLEADSalert) < 2) {$select_list .= " selected";}
|
495
|
$select_list .= ">NO</option>";
|
496
|
$select_list .= "<option value=\"YES\"";
|
497
|
if ($NOLEADSalert=='YES') {$select_list .= " selected";}
|
498
|
$select_list .= ">YES</option>";
|
499
|
$select_list .= "</SELECT></TD></TR>";
|
500
|
|
501
|
$select_list .= "<TR><TD align=right>";
|
502
|
$select_list .= "Show Drop In-Group Row: </TD><TD align=left><SELECT SIZE=1 NAME=DROPINGROUPstats>";
|
503
|
$select_list .= "<option value=\"0\"";
|
504
|
if ($DROPINGROUPstats < 1) {$select_list .= " selected";}
|
505
|
$select_list .= ">NO</option>";
|
506
|
$select_list .= "<option value=\"1\"";
|
507
|
if ($DROPINGROUPstats=='1') {$select_list .= " selected";}
|
508
|
$select_list .= ">YES</option>";
|
509
|
$select_list .= "</SELECT></TD></TR>";
|
510
|
|
511
|
$select_list .= "<TR><TD align=right>";
|
512
|
$select_list .= "Show Carrier Stats: </TD><TD align=left><SELECT SIZE=1 NAME=CARRIERstats>";
|
513
|
$select_list .= "<option value=\"0\"";
|
514
|
if ($CARRIERstats < 1) {$select_list .= " selected";}
|
515
|
$select_list .= ">NO</option>";
|
516
|
$select_list .= "<option value=\"1\"";
|
517
|
if ($CARRIERstats=='1') {$select_list .= " selected";}
|
518
|
$select_list .= ">YES</option>";
|
519
|
$select_list .= "</SELECT></TD></TR>";
|
520
|
|
521
|
## find if any selected campaigns have presets enabled
|
522
|
$presets_enabled=0;
|
523
|
$stmt="select count(*) from vicidial_campaigns where enable_xfer_presets='ENABLED' $group_SQLand;";
|
524
|
$rslt=mysql_query($stmt, $link);
|
525
|
if ($DB) {$OUToutput .= "$stmt\n";}
|
526
|
$presets_enabled_count = mysql_num_rows($rslt);
|
527
|
if ($presets_enabled_count > 0)
|
528
|
{
|
529
|
$row=mysql_fetch_row($rslt);
|
530
|
$presets_enabled = $row[0];
|
531
|
}
|
532
|
if ($presets_enabled > 0)
|
533
|
{
|
534
|
$select_list .= "<TR><TD align=right>";
|
535
|
$select_list .= "Show Presets Stats: </TD><TD align=left><SELECT SIZE=1 NAME=PRESETstats>";
|
536
|
$select_list .= "<option value=\"0\"";
|
537
|
if ($PRESETstats < 1) {$select_list .= " selected";}
|
538
|
$select_list .= ">NO</option>";
|
539
|
$select_list .= "<option value=\"1\"";
|
540
|
if ($PRESETstats=='1') {$select_list .= " selected";}
|
541
|
$select_list .= ">YES</option>";
|
542
|
$select_list .= "</SELECT></TD></TR>";
|
543
|
}
|
544
|
|
545
|
$select_list .= "<TR><TD align=right>";
|
546
|
$select_list .= "Agent Time Stats: </TD><TD align=left><SELECT SIZE=1 NAME=AGENTtimeSTATS>";
|
547
|
$select_list .= "<option value=\"0\"";
|
548
|
if ($AGENTtimeSTATS < 1) {$select_list .= " selected";}
|
549
|
$select_list .= ">NO</option>";
|
550
|
$select_list .= "<option value=\"1\"";
|
551
|
if ($AGENTtimeSTATS=='1') {$select_list .= " selected";}
|
552
|
$select_list .= ">YES</option>";
|
553
|
$select_list .= "</SELECT></TD></TR>";
|
554
|
|
555
|
$select_list .= "</TABLE><BR>";
|
556
|
$select_list .= "<INPUT type=submit NAME=SUBMIT VALUE=SUBMIT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> ";
|
557
|
$select_list .= "</TD></TR>";
|
558
|
$select_list .= "<TR><TD ALIGN=CENTER>";
|
559
|
$select_list .= "<font size=1> </font>";
|
560
|
$select_list .= "</TD>";
|
561
|
$select_list .= "<TD NOWRAP align=right>";
|
562
|
$select_list .= "<font size=1>VERSION: $version BUILD: $build</font>";
|
563
|
$select_list .= "</TD></TR></TABLE>";
|
564
|
|
565
|
$open_list = "<TABLE WIDTH=250 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#EFEFEF\"><TR><TD ALIGN=CENTER><a href=\"#\" onclick=\"openDiv(\'campaign_select_list\');\"><font size=2>Choose Report Display Options</a></TD></TR></TABLE>";
|
566
|
|
567
|
?>
|
568
|
|
569
|
<HTML>
|
570
|
<HEAD>
|
571
|
|
572
|
<?php
|
573
|
|
574
|
if ($RTajax > 0)
|
575
|
{
|
576
|
echo "<!-- ajax-mode -->\n";
|
577
|
}
|
578
|
else
|
579
|
{
|
580
|
?>
|
581
|
<script language="Javascript">
|
582
|
|
583
|
window.onload = startup;
|
584
|
|
585
|
// function to detect the XY position on the page of the mouse
|
586
|
function startup()
|
587
|
{
|
588
|
hide_ingroup_info();
|
589
|
if (window.Event)
|
590
|
{
|
591
|
document.captureEvents(Event.MOUSEMOVE);
|
592
|
}
|
593
|
document.onmousemove = getCursorXY;
|
594
|
}
|
595
|
|
596
|
function getCursorXY(e)
|
597
|
{
|
598
|
document.getElementById('cursorX').value = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
|
599
|
document.getElementById('cursorY').value = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
|
600
|
}
|
601
|
|
602
|
var select_list = '<?php echo $select_list ?>';
|
603
|
var open_list = '<?php echo $open_list ?>';
|
604
|
var monitor_phone = '<?php echo $monitor_phone ?>';
|
605
|
var user = '<?php echo $PHP_AUTH_USER ?>';
|
606
|
var pass = '<?php echo $PHP_AUTH_PW ?>';
|
607
|
|
608
|
// functions to hide and show different DIVs
|
609
|
function openDiv(divvar)
|
610
|
{
|
611
|
document.getElementById(divvar).innerHTML = select_list;
|
612
|
document.getElementById(divvar).style.left = '43%';
|
613
|
}
|
614
|
function closeDiv(divvar)
|
615
|
{
|
616
|
document.getElementById(divvar).innerHTML = open_list;
|
617
|
document.getElementById(divvar).style.left = '50%';
|
618
|
}
|
619
|
function closeAlert(divvar)
|
620
|
{
|
621
|
document.getElementById(divvar).innerHTML = '';
|
622
|
}
|
623
|
// function to launch monitoring calls
|
624
|
|
625
|
function send_monitor(session_id,server_ip,stage)
|
626
|
{
|
627
|
// alert(session_id + "|" + server_ip + "|" + monitor_phone + "|" + stage + "|" + user);
|
628
|
var xmlhttp=false;
|
629
|
/*@cc_on @*/
|
630
|
/*@if (@_jscript_version >= 5)
|
631
|
// JScript gives us Conditional compilation, we can cope with old IE versions.
|
632
|
// and security blocked creation of the objects.
|
633
|
try {
|
634
|
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
|
635
|
} catch (e) {
|
636
|
try {
|
637
|
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
638
|
} catch (E) {
|
639
|
xmlhttp = false;
|
640
|
}
|
641
|
}
|
642
|
@end @*/
|
643
|
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
|
644
|
{
|
645
|
xmlhttp = new XMLHttpRequest();
|
646
|
}
|
647
|
if (xmlhttp)
|
648
|
{
|
649
|
var monitorQuery = "source=realtime&function=blind_monitor&user=" + user + "&pass=" + pass + "&phone_login=" + monitor_phone + "&session_id=" + session_id + '&server_ip=' + server_ip + '&stage=' + stage;
|
650
|
xmlhttp.open('POST', 'non_agent_api.php');
|
651
|
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
652
|
xmlhttp.send(monitorQuery);
|
653
|
xmlhttp.onreadystatechange = function()
|
654
|
{
|
655
|
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
|
656
|
{
|
657
|
// alert(xmlhttp.responseText);
|
658
|
var Xoutput = null;
|
659
|
Xoutput = xmlhttp.responseText;
|
660
|
var regXFerr = new RegExp("ERROR","g");
|
661
|
var regXFscs = new RegExp("SUCCESS","g");
|
662
|
if (Xoutput.match(regXFerr))
|
663
|
{alert(xmlhttp.responseText);}
|
664
|
if (Xoutput.match(regXFscs))
|
665
|
{alert("SUCCESS: calling " + monitor_phone);}
|
666
|
}
|
667
|
}
|
668
|
delete xmlhttp;
|
669
|
}
|
670
|
}
|
671
|
|
672
|
// function to change in-groups selected for a specific agent
|
673
|
function submit_ingroup_changes(temp_agent_user)
|
674
|
{
|
675
|
var temp_ingroup_add_remove_changeIndex = document.getElementById("ingroup_add_remove_change").selectedIndex;
|
676
|
var temp_ingroup_add_remove_change = document.getElementById('ingroup_add_remove_change').options[temp_ingroup_add_remove_changeIndex].value;
|
677
|
|
678
|
var temp_set_as_defaultIndex = document.getElementById("set_as_default").selectedIndex;
|
679
|
var temp_set_as_default = document.getElementById('set_as_default').options[temp_set_as_defaultIndex].value;
|
680
|
|
681
|
var temp_blendedIndex = document.getElementById("blended").selectedIndex;
|
682
|
var temp_blended = document.getElementById('blended').options[temp_blendedIndex].value;
|
683
|
|
684
|
var temp_ingroup_choices = '';
|
685
|
var txtSelectedValuesObj = document.getElementById('txtSelectedValues');
|
686
|
var selectedArray = new Array();
|
687
|
var selObj = document.getElementById('ingroup_new_selections');
|
688
|
var i;
|
689
|
var count = 0;
|
690
|
for (i=0; i<selObj.options.length; i++)
|
691
|
{
|
692
|
if (selObj.options[i].selected)
|
693
|
{
|
694
|
// selectedArray[count] = selObj.options[i].value;
|
695
|
temp_ingroup_choices = temp_ingroup_choices + '+' + selObj.options[i].value;
|
696
|
count++;
|
697
|
}
|
698
|
}
|
699
|
|
700
|
temp_ingroup_choices = temp_ingroup_choices + '+-';
|
701
|
|
702
|
// alert(session_id + "|" + server_ip + "|" + monitor_phone + "|" + stage + "|" + user);
|
703
|
var xmlhttp=false;
|
704
|
/*@cc_on @*/
|
705
|
/*@if (@_jscript_version >= 5)
|
706
|
// JScript gives us Conditional compilation, we can cope with old IE versions.
|
707
|
// and security blocked creation of the objects.
|
708
|
try {
|
709
|
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
|
710
|
} catch (e) {
|
711
|
try {
|
712
|
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
713
|
} catch (E) {
|
714
|
xmlhttp = false;
|
715
|
}
|
716
|
}
|
717
|
@end @*/
|
718
|
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
|
719
|
{
|
720
|
xmlhttp = new XMLHttpRequest();
|
721
|
}
|
722
|
if (xmlhttp)
|
723
|
{
|
724
|
var changeQuery = "source=realtime&function=change_ingroups&user=" + user + "&pass=" + pass + "&agent_user=" + temp_agent_user + "&value=" + temp_ingroup_add_remove_change + '&set_as_default=' + temp_set_as_default + '&blended=' + temp_blended + '&ingroup_choices=' + temp_ingroup_choices;
|
725
|
xmlhttp.open('POST', '../agc/api.php');
|
726
|
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
727
|
xmlhttp.send(changeQuery);
|
728
|
xmlhttp.onreadystatechange = function()
|
729
|
{
|
730
|
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
|
731
|
{
|
732
|
// alert(changeQuery);
|
733
|
var Xoutput = null;
|
734
|
Xoutput = xmlhttp.responseText;
|
735
|
var regXFerr = new RegExp("ERROR","g");
|
736
|
if (Xoutput.match(regXFerr))
|
737
|
{alert(xmlhttp.responseText);}
|
738
|
else
|
739
|
{
|
740
|
alert(xmlhttp.responseText);
|
741
|
hide_ingroup_info();
|
742
|
}
|
743
|
}
|
744
|
}
|
745
|
delete xmlhttp;
|
746
|
}
|
747
|
}
|
748
|
|
749
|
// function to display in-groups selected for a specific agent
|
750
|
function ingroup_info(agent_user,count)
|
751
|
{
|
752
|
var cursorheight = (document.REALTIMEform.cursorY.value - 0);
|
753
|
var newheight = (cursorheight + 10);
|
754
|
document.getElementById("agent_ingroup_display").style.top = newheight;
|
755
|
// alert(session_id + "|" + server_ip + "|" + monitor_phone + "|" + stage + "|" + user);
|
756
|
var xmlhttp=false;
|
757
|
/*@cc_on @*/
|
758
|
/*@if (@_jscript_version >= 5)
|
759
|
// JScript gives us Conditional compilation, we can cope with old IE versions.
|
760
|
// and security blocked creation of the objects.
|
761
|
try {
|
762
|
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
|
763
|
} catch (e) {
|
764
|
try {
|
765
|
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
766
|
} catch (E) {
|
767
|
xmlhttp = false;
|
768
|
}
|
769
|
}
|
770
|
@end @*/
|
771
|
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
|
772
|
{
|
773
|
xmlhttp = new XMLHttpRequest();
|
774
|
}
|
775
|
if (xmlhttp)
|
776
|
{
|
777
|
var monitorQuery = "source=realtime&function=agent_ingroup_info&stage=change&user=" + user + "&pass=" + pass + "&agent_user=" + agent_user;
|
778
|
xmlhttp.open('POST', 'non_agent_api.php');
|
779
|
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
780
|
xmlhttp.send(monitorQuery);
|
781
|
xmlhttp.onreadystatechange = function()
|
782
|
{
|
783
|
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
|
784
|
{
|
785
|
// alert(xmlhttp.responseText);
|
786
|
var Xoutput = null;
|
787
|
Xoutput = xmlhttp.responseText;
|
788
|
var regXFerr = new RegExp("ERROR","g");
|
789
|
if (Xoutput.match(regXFerr))
|
790
|
{alert(xmlhttp.responseText);}
|
791
|
else
|
792
|
{
|
793
|
document.getElementById("agent_ingroup_display").visibility = "visible";
|
794
|
document.getElementById("agent_ingroup_display").innerHTML = Xoutput;
|
795
|
}
|
796
|
}
|
797
|
}
|
798
|
delete xmlhttp;
|
799
|
}
|
800
|
}
|
801
|
|
802
|
// function to display in-groups selected for a specific agent
|
803
|
function hide_ingroup_info()
|
804
|
{
|
805
|
document.getElementById("agent_ingroup_display").visibility = "hidden";
|
806
|
document.getElementById("agent_ingroup_display").innerHTML = '';
|
807
|
}
|
808
|
|
809
|
|
810
|
|
811
|
</script>
|
812
|
|
813
|
<STYLE type="text/css">
|
814
|
<!--
|
815
|
.green {color: white; background-color: green}
|
816
|
.red {color: white; background-color: red}
|
817
|
.lightblue {color: black; background-color: #ADD8E6}
|
818
|
.blue {color: white; background-color: blue}
|
819
|
.midnightblue {color: white; background-color: #191970}
|
820
|
.purple {color: white; background-color: purple}
|
821
|
.violet {color: black; background-color: #EE82EE}
|
822
|
.thistle {color: black; background-color: #D8BFD8}
|
823
|
.olive {color: white; background-color: #808000}
|
824
|
.lime {color: white; background-color: #006600}
|
825
|
.yellow {color: black; background-color: yellow}
|
826
|
.khaki {color: black; background-color: #F0E68C}
|
827
|
.orange {color: black; background-color: orange}
|
828
|
.black {color: white; background-color: black}
|
829
|
.salmon {color: white; background-color: #FA8072}
|
830
|
|
831
|
.r1 {color: black; background-color: #FFCCCC}
|
832
|
.r2 {color: black; background-color: #FF9999}
|
833
|
.r3 {color: black; background-color: #FF6666}
|
834
|
.r4 {color: white; background-color: #FF0000}
|
835
|
.b1 {color: black; background-color: #CCCCFF}
|
836
|
.b2 {color: black; background-color: #9999FF}
|
837
|
.b3 {color: black; background-color: #6666FF}
|
838
|
.b4 {color: white; background-color: #0000FF}
|
839
|
<?php
|
840
|
$stmt="select group_id,group_color from vicidial_inbound_groups;";
|
841
|
$rslt=mysql_query($stmt, $link);
|
842
|
if ($DB) {echo "$stmt\n";}
|
843
|
$INgroups_to_print = mysql_num_rows($rslt);
|
844
|
if ($INgroups_to_print > 0)
|
845
|
{
|
846
|
$g=0;
|
847
|
while ($g < $INgroups_to_print)
|
848
|
{
|
849
|
$row=mysql_fetch_row($rslt);
|
850
|
$group_id[$g] = $row[0];
|
851
|
$group_color[$g] = $row[1];
|
852
|
echo " .csc$group_id[$g] {color: black; background-color: $group_color[$g]}\n";
|
853
|
$g++;
|
854
|
}
|
855
|
}
|
856
|
|
857
|
echo "\n-->\n
|
858
|
</STYLE>\n";
|
859
|
|
860
|
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
861
|
echo"<META HTTP-EQUIV=Refresh CONTENT=\"$RR; URL=$PHP_SELF?RR=$RR&DB=$DB$groupQS&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">\n";
|
862
|
echo "<TITLE>$report_name: $group</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
863
|
|
864
|
$short_header=1;
|
865
|
|
866
|
require("admin_header.php");
|
867
|
|
868
|
}
|
869
|
|
870
|
$stmt = "select count(*) from vicidial_campaigns where active='Y' and campaign_allow_inbound='Y' $group_SQLand;";
|
871
|
$rslt=mysql_query($stmt, $link);
|
872
|
if ($DB) {echo "$stmt\n";}
|
873
|
$row=mysql_fetch_row($rslt);
|
874
|
$campaign_allow_inbound = $row[0];
|
875
|
|
876
|
|
877
|
if ($RTajax < 1)
|
878
|
{
|
879
|
echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
880
|
|
881
|
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET NAME=REALTIMEform ID=REALTIMEform>\n";
|
882
|
echo "<INPUT TYPE=HIDDEN NAME=RR VALUE=\"$RR\">\n";
|
883
|
echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
|
884
|
echo "<INPUT TYPE=HIDDEN NAME=cursorX ID=cursorX>\n";
|
885
|
echo "<INPUT TYPE=HIDDEN NAME=cursorY ID=cursorY>\n";
|
886
|
echo "<INPUT TYPE=HIDDEN NAME=adastats VALUE=\"$adastats\">\n";
|
887
|
echo "<INPUT TYPE=HIDDEN NAME=SIPmonitorLINK VALUE=\"$SIPmonitorLINK\">\n";
|
888
|
echo "<INPUT TYPE=HIDDEN NAME=IAXmonitorLINK VALUE=\"$IAXmonitorLINK\">\n";
|
889
|
echo "<INPUT TYPE=HIDDEN NAME=usergroup VALUE=\"$usergroup\">\n";
|
890
|
echo "<INPUT TYPE=HIDDEN NAME=UGdisplay VALUE=\"$UGdisplay\">\n";
|
891
|
echo "<INPUT TYPE=HIDDEN NAME=UidORname VALUE=\"$UidORname\">\n";
|
892
|
echo "<INPUT TYPE=HIDDEN NAME=orderby VALUE=\"$orderby\">\n";
|
893
|
echo "<INPUT TYPE=HIDDEN NAME=SERVdisplay VALUE=\"$SERVdisplay\">\n";
|
894
|
echo "<INPUT TYPE=HIDDEN NAME=CALLSdisplay VALUE=\"$CALLSdisplay\">\n";
|
895
|
echo "<INPUT TYPE=HIDDEN NAME=PHONEdisplay VALUE=\"$PHONEdisplay\">\n";
|
896
|
echo "<INPUT TYPE=HIDDEN NAME=CUSTPHONEdisplay VALUE=\"$CUSTPHONEdisplay\">\n";
|
897
|
echo "<INPUT TYPE=HIDDEN NAME=DROPINGROUPstats VALUE=\"$DROPINGROUPstats\">\n";
|
898
|
echo "<INPUT TYPE=HIDDEN NAME=ALLINGROUPstats VALUE=\"$ALLINGROUPstats\">\n";
|
899
|
echo "<INPUT TYPE=HIDDEN NAME=CARRIERstats VALUE=\"$CARRIERstats\">\n";
|
900
|
echo "<INPUT TYPE=HIDDEN NAME=PRESETstats VALUE=\"$PRESETstats\">\n";
|
901
|
echo "<INPUT TYPE=HIDDEN NAME=AGENTtimeSTATS VALUE=\"$AGENTtimeSTATS\">\n";
|
902
|
echo "Real-Time Report \n";
|
903
|
echo "<span style=\"position:absolute;left:50%;top:22px;z-index:19;margin-left:-260px;\" id=campaign_select_list>\n";
|
904
|
echo "<TABLE WIDTH=250 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#EFEFEF\"><TR><TD ALIGN=CENTER>\n";
|
905
|
echo "<a href=\"#\" onclick=\"openDiv('campaign_select_list');\">Choose Report Display Options</a>";
|
906
|
echo "</TD></TR></TABLE>\n";
|
907
|
echo "</span>\n";
|
908
|
echo "<span style=\"position:absolute;left:10px;top:120px;z-index:18;\" id=agent_ingroup_display>\n";
|
909
|
echo " ";
|
910
|
echo "</span>\n";
|
911
|
echo "<a href=\"$PHP_SELF?RR=4000$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">STOP</a> | ";
|
912
|
echo "<a href=\"$PHP_SELF?RR=40$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">SLOW</a> | ";
|
913
|
echo "<a href=\"$PHP_SELF?RR=4$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">GO</a>";
|
914
|
if (eregi('ALL-ACTIVE',$group_string))
|
915
|
{
|
916
|
echo " <a href=\"./admin.php?ADD=10\">MODIFY</a> | \n";
|
917
|
}
|
918
|
else
|
919
|
{
|
920
|
echo " <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | \n";
|
921
|
}
|
922
|
echo "<a href=\"./AST_timeonVDADallSUMMARY.php?RR=$RR&DB=$DB&adastats=$adastats\">SUMMARY</a> </FONT>\n";
|
923
|
echo "\n\n";
|
924
|
}
|
925
|
|
926
|
if (!$group)
|
927
|
{echo "<BR><BR>please select a campaign from the pulldown above</FORM>\n"; exit;}
|
928
|
else
|
929
|
{
|
930
|
$multi_drop=0;
|
931
|
### Gather list of all Closer group ids for exclusion from stats
|
932
|
$stmt = "select group_id from vicidial_inbound_groups;";
|
933
|
$rslt=mysql_query($stmt, $link);
|
934
|
$ingroups_to_print = mysql_num_rows($rslt);
|
935
|
while ($ingroups_to_print > $c)
|
936
|
{
|
937
|
$row=mysql_fetch_row($rslt);
|
938
|
$ALLcloser_campaignsSQL .= "'$row[0]',";
|
939
|
$c++;
|
940
|
}
|
941
|
$ALLcloser_campaignsSQL = preg_replace("/,$/","",$ALLcloser_campaignsSQL);
|
942
|
if (strlen($ALLcloser_campaignsSQL)<2)
|
943
|
{$ALLcloser_campaignsSQL="''";}
|
944
|
if ($DB > 0) {echo "\n|$ALLcloser_campaignsSQL|$stmt|\n";}
|
945
|
|
946
|
|
947
|
##### INBOUND #####
|
948
|
if ( ( ereg('Y',$with_inbound) or ereg('O',$with_inbound) ) and ($campaign_allow_inbound > 0) )
|
949
|
{
|
950
|
### Gather list of Closer group ids
|
951
|
$stmt = "select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand;";
|
952
|
$rslt=mysql_query($stmt, $link);
|
953
|
$ccamps_to_print = mysql_num_rows($rslt);
|
954
|
$c=0;
|
955
|
while ($ccamps_to_print > $c)
|
956
|
{
|
957
|
$row=mysql_fetch_row($rslt);
|
958
|
$closer_campaigns = $row[0];
|
959
|
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
|
960
|
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
961
|
$closer_campaignsSQL .= "'$closer_campaigns',";
|
962
|
$c++;
|
963
|
}
|
964
|
$closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL);
|
965
|
}
|
966
|
if (strlen($closer_campaignsSQL)<2)
|
967
|
{$closer_campaignsSQL="''";}
|
968
|
|
969
|
if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
|
970
|
|
971
|
|
972
|
##### SHOW IN-GROUP STATS OR INBOUND ONLY WITH VIEW-MORE ###
|
973
|
if ( ($ALLINGROUPstats > 0) or ( (ereg('O',$with_inbound)) and ($adastats > 1) ) )
|
974
|
{
|
975
|
$stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL) order by campaign_id;";
|
976
|
|
977
|
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
978
|
|
979
|
$r=0;
|
980
|
$rslt=mysql_query($stmtB, $link);
|
981
|
$ingroups_to_print = mysql_num_rows($rslt);
|
982
|
if ($ingroups_to_print > 0)
|
983
|
{$ingroup_detail .= "<table cellpadding=0 cellspacing=0>";}
|
984
|
while ($ingroups_to_print > $r)
|
985
|
{
|
986
|
$row=mysql_fetch_row($rslt);
|
987
|
$callsTODAY = $row[0];
|
988
|
$dropsTODAY = $row[1];
|
989
|
$answersTODAY = $row[2];
|
990
|
$VSCcat1 = $row[3];
|
991
|
$VSCcat1tally = $row[4];
|
992
|
$VSCcat2 = $row[5];
|
993
|
$VSCcat2tally = $row[6];
|
994
|
$VSCcat3 = $row[7];
|
995
|
$VSCcat3tally = $row[8];
|
996
|
$VSCcat4 = $row[9];
|
997
|
$VSCcat4tally = $row[10];
|
998
|
$hold_sec_stat_one = $row[11];
|
999
|
$hold_sec_stat_two = $row[12];
|
1000
|
$hold_sec_answer_calls = $row[13];
|
1001
|
$hold_sec_drop_calls = $row[14];
|
1002
|
$hold_sec_queue_calls = $row[15];
|
1003
|
$ingroupdetail = $row[16];
|
1004
|
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
|
1005
|
{
|
1006
|
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
|
1007
|
$drpctTODAY = round($drpctTODAY, 2);
|
1008
|
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
|
1009
|
}
|
1010
|
else
|
1011
|
{$drpctTODAY=0;}
|
1012
|
|
1013
|
if ($callsTODAY > 0)
|
1014
|
{
|
1015
|
$AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY);
|
1016
|
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
|
1017
|
}
|
1018
|
else
|
1019
|
{$AVGhold_sec_queue_calls=0;}
|
1020
|
|
1021
|
if ($dropsTODAY > 0)
|
1022
|
{
|
1023
|
$AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY);
|
1024
|
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
|
1025
|
}
|
1026
|
else
|
1027
|
{$AVGhold_sec_drop_calls=0;}
|
1028
|
|
1029
|
if ($answersTODAY > 0)
|
1030
|
{
|
1031
|
$PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100);
|
1032
|
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
|
1033
|
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
|
1034
|
$PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100);
|
1035
|
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
|
1036
|
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
|
1037
|
$AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY);
|
1038
|
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
|
1039
|
if ($agent_non_pause_sec > 0)
|
1040
|
{
|
1041
|
$AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60);
|
1042
|
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
|
1043
|
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
|
1044
|
}
|
1045
|
else
|
1046
|
{$AVG_ANSWERagent_non_pause_sec=0;}
|
1047
|
}
|
1048
|
else
|
1049
|
{
|
1050
|
$PCThold_sec_stat_one=0;
|
1051
|
$PCThold_sec_stat_two=0;
|
1052
|
$AVGhold_sec_answer_calls=0;
|
1053
|
$AVG_ANSWERagent_non_pause_sec=0;
|
1054
|
}
|
1055
|
|
1056
|
if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';}
|
1057
|
else {$bgcolor='white';}
|
1058
|
$ingroup_detail .= "<TR bgcolor=\"$bgcolor\">";
|
1059
|
$ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2> </TD>";
|
1060
|
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>$ingroupdetail </B></TD>";
|
1061
|
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>CALLS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
1062
|
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>TMA 1:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_one% </TD>";
|
1063
|
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Answered Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_answer_calls </TD>";
|
1064
|
$ingroup_detail .= "</TR>";
|
1065
|
$ingroup_detail .= "<TR bgcolor=\"$bgcolor\">";
|
1066
|
$ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
1067
|
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>DROPS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY </TD>";
|
1068
|
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>TMA 2:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_two% </TD>";
|
1069
|
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Dropped Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_drop_calls </TD>";
|
1070
|
$ingroup_detail .= "</TR>";
|
1071
|
$ingroup_detail .= "<TR bgcolor=\"$bgcolor\">";
|
1072
|
$ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
1073
|
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>ANSWERS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $answersTODAY </TD>";
|
1074
|
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>DROP PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> $drpctTODAY% </TD>";
|
1075
|
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for All Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_queue_calls </TD>";
|
1076
|
$ingroup_detail .= "</TR>";
|
1077
|
|
1078
|
$r++;
|
1079
|
}
|
1080
|
|
1081
|
if ($ingroups_to_print > 0)
|
1082
|
{$ingroup_detail .= "</table>";}
|
1083
|
}
|
1084
|
|
1085
|
|
1086
|
##### DROP IN-GROUP ONLY TOTALS ROW ###
|
1087
|
$DROPINGROUPstatsHTML='';
|
1088
|
if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) )
|
1089
|
{
|
1090
|
$DIGcampaigns='';
|
1091
|
$stmtB="select drop_inbound_group from vicidial_campaigns where campaign_id IN($group_SQL) and drop_inbound_group NOT IN('---NONE---','');";
|
1092
|
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
1093
|
$rslt=mysql_query($stmtB, $link);
|
1094
|
$dig_to_print = mysql_num_rows($rslt);
|
1095
|
$dtp=0;
|
1096
|
while ($dig_to_print > $dtp)
|
1097
|
{
|
1098
|
$row=mysql_fetch_row($rslt);
|
1099
|
$DIGcampaigns .= "'$row[0]',";
|
1100
|
$dtp++;
|
1101
|
}
|
1102
|
$DIGcampaigns = preg_replace("/,$/",'',$DIGcampaigns);
|
1103
|
if (strlen($DIGcampaigns) < 2) {$DIGcampaigns = "''";}
|
1104
|
|
1105
|
$stmtB="select sum(calls_today),sum(drops_today),sum(answers_today) from vicidial_campaign_stats where campaign_id IN($DIGcampaigns);";
|
1106
|
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
1107
|
|
1108
|
$rslt=mysql_query($stmtB, $link);
|
1109
|
$row=mysql_fetch_row($rslt);
|
1110
|
$callsTODAY = $row[0];
|
1111
|
$dropsTODAY = $row[1];
|
1112
|
$answersTODAY = $row[2];
|
1113
|
if ( ($dropsTODAY > 0) and ($callsTODAY > 0) )
|
1114
|
{
|
1115
|
$drpctTODAY = ( ($dropsTODAY / $callsTODAY) * 100);
|
1116
|
$drpctTODAY = round($drpctTODAY, 2);
|
1117
|
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
|
1118
|
}
|
1119
|
else
|
1120
|
{$drpctTODAY=0;}
|
1121
|
|
1122
|
$DROPINGROUPstatsHTML .= "<TR BGCOLOR=\"#E6E6E6\">";
|
1123
|
$DROPINGROUPstatsHTML .= "<TD ALIGN=RIGHT COLSPAN=2><font size=2><B>DROP IN-GROUP STATS -</B></TD>";
|
1124
|
$DROPINGROUPstatsHTML .= "<TD ALIGN=RIGHT><font size=2><B>DROP PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> $drpctTODAY% </TD>";
|
1125
|
$DROPINGROUPstatsHTML .= "<TD ALIGN=RIGHT><font size=2><B>CALLS:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
1126
|
$DROPINGROUPstatsHTML .= "<TD ALIGN=RIGHT><font size=2><B>DROPS/ANSWERS:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
1127
|
$DROPINGROUPstatsHTML .= "</TR>";
|
1128
|
}
|
1129
|
|
1130
|
|
1131
|
##### CARRIER STATS TOTALS ###
|
1132
|
$CARRIERstatsHTML='';
|
1133
|
if ($CARRIERstats > 0)
|
1134
|
{
|
1135
|
$stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeTWENTYFOURhoursAGO\" group by dialstatus;";
|
1136
|
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
1137
|
$rslt=mysql_query($stmtB, $link);
|
1138
|
$car_to_print = mysql_num_rows($rslt);
|
1139
|
$ctp=0;
|
1140
|
while ($car_to_print > $ctp)
|
1141
|
{
|
1142
|
$row=mysql_fetch_row($rslt);
|
1143
|
$TFhour_status[$ctp] = $row[0];
|
1144
|
$TFhour_count[$ctp] = $row[1];
|
1145
|
$dialstatuses .= "'$row[0]',";
|
1146
|
$ctp++;
|
1147
|
}
|
1148
|
$dialstatuses = preg_replace("/,$/",'',$dialstatuses);
|
1149
|
|
1150
|
$CARRIERstatsHTML .= "<TR BGCOLOR=white><TD ALIGN=left COLSPAN=8>";
|
1151
|
$CARRIERstatsHTML .= "<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0 BGCOLOR=white>";
|
1152
|
$CARRIERstatsHTML .= "<TR BGCOLOR=\"#E6E6E6\">";
|
1153
|
$CARRIERstatsHTML .= "<TD ALIGN=LEFT><font size=2><B>CARRIER STATS: </B></TD>";
|
1154
|
$CARRIERstatsHTML .= "<TD ALIGN=LEFT><font size=2><B> HANGUP STATUS </B></TD>";
|
1155
|
$CARRIERstatsHTML .= "<TD ALIGN=CENTER><font size=2><B> 24 HOURS </B></TD>";
|
1156
|
$CARRIERstatsHTML .= "<TD ALIGN=CENTER><font size=2><B> 6 HOURS </B></TD>";
|
1157
|
$CARRIERstatsHTML .= "<TD ALIGN=CENTER><font size=2><B> 1 HOUR </B></TD>";
|
1158
|
$CARRIERstatsHTML .= "<TD ALIGN=CENTER><font size=2><B> 15 MIN </B></TD>";
|
1159
|
$CARRIERstatsHTML .= "<TD ALIGN=CENTER><font size=2><B> 5 MIN </B></TD>";
|
1160
|
$CARRIERstatsHTML .= "<TD ALIGN=CENTER><font size=2><B> 1 MIN </B></TD>";
|
1161
|
$CARRIERstatsHTML .= "</TR>";
|
1162
|
|
1163
|
if (strlen($dialstatuses) > 1)
|
1164
|
{
|
1165
|
$stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeSIXhoursAGO\" group by dialstatus;";
|
1166
|
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
1167
|
$rslt=mysql_query($stmtB, $link);
|
1168
|
$scar_to_print = mysql_num_rows($rslt);
|
1169
|
$print_sctp=0;
|
1170
|
while ($scar_to_print > $print_sctp)
|
1171
|
{
|
1172
|
$row=mysql_fetch_row($rslt);
|
1173
|
$print_ctp=0;
|
1174
|
while ($print_ctp < $ctp)
|
1175
|
{
|
1176
|
if ($TFhour_status[$print_ctp] == $row[0])
|
1177
|
{$SIXhour_count[$print_ctp] = $row[1];}
|
1178
|
$print_ctp++;
|
1179
|
}
|
1180
|
$print_sctp++;
|
1181
|
}
|
1182
|
|
1183
|
$stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEhourAGO\" group by dialstatus;";
|
1184
|
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
1185
|
$rslt=mysql_query($stmtB, $link);
|
1186
|
$scar_to_print = mysql_num_rows($rslt);
|
1187
|
$print_sctp=0;
|
1188
|
while ($scar_to_print > $print_sctp)
|
1189
|
{
|
1190
|
$row=mysql_fetch_row($rslt);
|
1191
|
$print_ctp=0;
|
1192
|
while ($print_ctp < $ctp)
|
1193
|
{
|
1194
|
if ($TFhour_status[$print_ctp] == $row[0])
|
1195
|
{$ONEhour_count[$print_ctp] = $row[1];}
|
1196
|
$print_ctp++;
|
1197
|
}
|
1198
|
$print_sctp++;
|
1199
|
}
|
1200
|
|
1201
|
$stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIFTEENminutesAGO\" group by dialstatus;";
|
1202
|
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
1203
|
$rslt=mysql_query($stmtB, $link);
|
1204
|
$scar_to_print = mysql_num_rows($rslt);
|
1205
|
$print_sctp=0;
|
1206
|
while ($scar_to_print > $print_sctp)
|
1207
|
{
|
1208
|
$row=mysql_fetch_row($rslt);
|
1209
|
$print_ctp=0;
|
1210
|
while ($print_ctp < $ctp)
|
1211
|
{
|
1212
|
if ($TFhour_status[$print_ctp] == $row[0])
|
1213
|
{$FTminute_count[$print_ctp] = $row[1];}
|
1214
|
$print_ctp++;
|
1215
|
}
|
1216
|
$print_sctp++;
|
1217
|
}
|
1218
|
|
1219
|
$stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIVEminutesAGO\" group by dialstatus;";
|
1220
|
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
1221
|
$rslt=mysql_query($stmtB, $link);
|
1222
|
$scar_to_print = mysql_num_rows($rslt);
|
1223
|
$print_sctp=0;
|
1224
|
while ($scar_to_print > $print_sctp)
|
1225
|
{
|
1226
|
$row=mysql_fetch_row($rslt);
|
1227
|
$print_ctp=0;
|
1228
|
while ($print_ctp < $ctp)
|
1229
|
{
|
1230
|
if ($TFhour_status[$print_ctp] == $row[0])
|
1231
|
{$FIVEminute_count[$print_ctp] = $row[1];}
|
1232
|
$print_ctp++;
|
1233
|
}
|
1234
|
$print_sctp++;
|
1235
|
}
|
1236
|
|
1237
|
$stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEminuteAGO\" group by dialstatus;";
|
1238
|
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
1239
|
$rslt=mysql_query($stmtB, $link);
|
1240
|
$scar_to_print = mysql_num_rows($rslt);
|
1241
|
$print_sctp=0;
|
1242
|
while ($scar_to_print > $print_sctp)
|
1243
|
{
|
1244
|
$row=mysql_fetch_row($rslt);
|
1245
|
$print_ctp=0;
|
1246
|
while ($print_ctp < $ctp)
|
1247
|
{
|
1248
|
if ($TFhour_status[$print_ctp] == $row[0])
|
1249
|
{$ONEminute_count[$print_ctp] = $row[1];}
|
1250
|
$print_ctp++;
|
1251
|
}
|
1252
|
$print_sctp++;
|
1253
|
}
|
1254
|
|
1255
|
|
1256
|
$print_ctp=0;
|
1257
|
while ($print_ctp < $ctp)
|
1258
|
{
|
1259
|
if (strlen($TFhour_count[$print_ctp])<1) {$TFhour_count[$print_ctp]=0;}
|
1260
|
if (strlen($SIXhour_count[$print_ctp])<1) {$SIXhour_count[$print_ctp]=0;}
|
1261
|
if (strlen($ONEhour_count[$print_ctp])<1) {$ONEhour_count[$print_ctp]=0;}
|
1262
|
if (strlen($FTminute_count[$print_ctp])<1) {$FTminute_count[$print_ctp]=0;}
|
1263
|
if (strlen($FIVEminute_count[$print_ctp])<1) {$FIVEminute_count[$print_ctp]=0;}
|
1264
|
if (strlen($ONEminute_count[$print_ctp])<1) {$ONEminute_count[$print_ctp]=0;}
|
1265
|
|
1266
|
$CARRIERstatsHTML .= "<TR>";
|
1267
|
$CARRIERstatsHTML .= "<TD BGCOLOR=white><font size=2> </TD>";
|
1268
|
$CARRIERstatsHTML .= "<TD BGCOLOR=\"#E6E6E6\" ALIGN=LEFT><font size=2> $TFhour_status[$print_ctp]</TD>";
|
1269
|
$CARRIERstatsHTML .= "<TD BGCOLOR=\"#E6E6E6\" ALIGN=CENTER><font size=2> $TFhour_count[$print_ctp] </TD>";
|
1270
|
$CARRIERstatsHTML .= "<TD BGCOLOR=\"#E6E6E6\" ALIGN=CENTER><font size=2> $SIXhour_count[$print_ctp] </TD>";
|
1271
|
$CARRIERstatsHTML .= "<TD BGCOLOR=\"#E6E6E6\" ALIGN=CENTER><font size=2> $ONEhour_count[$print_ctp] </TD>";
|
1272
|
$CARRIERstatsHTML .= "<TD BGCOLOR=\"#E6E6E6\" ALIGN=CENTER><font size=2> $FTminute_count[$print_ctp] </TD>";
|
1273
|
$CARRIERstatsHTML .= "<TD BGCOLOR=\"#E6E6E6\" ALIGN=CENTER><font size=2> $FIVEminute_count[$print_ctp] </TD>";
|
1274
|
$CARRIERstatsHTML .= "<TD BGCOLOR=\"#E6E6E6\" ALIGN=CENTER><font size=2> $ONEminute_count[$print_ctp] </TD>";
|
1275
|
$CARRIERstatsHTML .= "</TR>";
|
1276
|
$print_ctp++;
|
1277
|
}
|
1278
|
}
|
1279
|
else
|
1280
|
{
|
1281
|
$CARRIERstatsHTML .= "<TR><TD BGCOLOR=white colspan=7><font size=2>no log entries</TD></TR>";
|
1282
|
}
|
1283
|
$CARRIERstatsHTML .= "</TABLE>";
|
1284
|
$CARRIERstatsHTML .= "</TD></TR>";
|
1285
|
}
|
1286
|
|
1287
|
|
1288
|
##### PRESET STATS TOTALS ###
|
1289
|
$PRESETstatsHTML='';
|
1290
|
if ($PRESETstats > 0)
|
1291
|
{
|
1292
|
$PRESETstatsHTML .= "<TR BGCOLOR=white><TD ALIGN=left COLSPAN=8>";
|
1293
|
$PRESETstatsHTML .= "<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0 BGCOLOR=white>";
|
1294
|
$PRESETstatsHTML .= "<TR BGCOLOR=\"#E6E6E6\">";
|
1295
|
$PRESETstatsHTML .= "<TD ALIGN=LEFT><font size=2><B> AGENT DIAL PRESETS: </B></TD>";
|
1296
|
$PRESETstatsHTML .= "<TD ALIGN=LEFT><font size=2><B> PRESET NAMES </B></TD>";
|
1297
|
$PRESETstatsHTML .= "<TD ALIGN=LEFT><font size=2><B> CALLS </B></TD>";
|
1298
|
$PRESETstatsHTML .= "</TR>";
|
1299
|
$stmtB="select preset_name,xfer_count from vicidial_xfer_stats where preset_name!='' and preset_name is not NULL $group_SQLand order by preset_name;";
|
1300
|
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
1301
|
$rslt=mysql_query($stmtB, $link);
|
1302
|
$pre_to_print = mysql_num_rows($rslt);
|
1303
|
$ctp=0;
|
1304
|
while ($pre_to_print > $ctp)
|
1305
|
{
|
1306
|
$row=mysql_fetch_row($rslt);
|
1307
|
$PRESETstatsHTML .= "<TR>";
|
1308
|
$PRESETstatsHTML .= "<TD><font size=2> </TD>";
|
1309
|
$PRESETstatsHTML .= "<TD ALIGN=LEFT BGCOLOR=\"#E6E6E6\"><font size=2><B> $row[0] </B></TD>";
|
1310
|
$PRESETstatsHTML .= "<TD ALIGN=RIGHT BGCOLOR=\"#E6E6E6\"><font size=2> $row[1] </TD>";
|
1311
|
$PRESETstatsHTML .= "</TR>";
|
1312
|
$ctp++;
|
1313
|
}
|
1314
|
if ($ctp < 1)
|
1315
|
{
|
1316
|
$PRESETstatsHTML .= "<TR><TD BGCOLOR=white colspan=2><font size=2>no log entries</TD></TR>";
|
1317
|
}
|
1318
|
$PRESETstatsHTML .= "</TABLE>";
|
1319
|
$PRESETstatsHTML .= "</TD></TR>";
|
1320
|
}
|
1321
|
|
1322
|
|
1323
|
# http://server/goautodial-admin/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1
|
1324
|
|
1325
|
##### INBOUND ONLY ###
|
1326
|
if (ereg('O',$with_inbound))
|
1327
|
{
|
1328
|
$multi_drop++;
|
1329
|
|
1330
|
$stmt="select agent_pause_codes_active from vicidial_campaigns $group_SQLwhere;";
|
1331
|
|
1332
|
$stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);";
|
1333
|
|
1334
|
if (eregi('ALL-ACTIVE',$group_string))
|
1335
|
{
|
1336
|
$inboundSQL = "where campaign_id IN ($closer_campaignsSQL)";
|
1337
|
$stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;";
|
1338
|
}
|
1339
|
|
1340
|
$stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;";
|
1341
|
|
1342
|
|
1343
|
if ($DB > 0) {echo "\n|$stmt|$stmtB|$stmtC|\n";}
|
1344
|
|
1345
|
$rslt=mysql_query($stmt, $link);
|
1346
|
$row=mysql_fetch_row($rslt);
|
1347
|
$agent_pause_codes_active = $row[0];
|
1348
|
|
1349
|
$rslt=mysql_query($stmtC, $link);
|
1350
|
$row=mysql_fetch_row($rslt);
|
1351
|
$agent_non_pause_sec = $row[0];
|
1352
|
|
1353
|
$rslt=mysql_query($stmtB, $link);
|
1354
|
$row=mysql_fetch_row($rslt);
|
1355
|
$callsTODAY = $row[0];
|
1356
|
$dropsTODAY = $row[1];
|
1357
|
$answersTODAY = $row[2];
|
1358
|
$VSCcat1 = $row[3];
|
1359
|
$VSCcat1tally = $row[4];
|
1360
|
$VSCcat2 = $row[5];
|
1361
|
$VSCcat2tally = $row[6];
|
1362
|
$VSCcat3 = $row[7];
|
1363
|
$VSCcat3tally = $row[8];
|
1364
|
$VSCcat4 = $row[9];
|
1365
|
$VSCcat4tally = $row[10];
|
1366
|
$hold_sec_stat_one = $row[11];
|
1367
|
$hold_sec_stat_two = $row[12];
|
1368
|
$hold_sec_answer_calls = $row[13];
|
1369
|
$hold_sec_drop_calls = $row[14];
|
1370
|
$hold_sec_queue_calls = $row[15];
|
1371
|
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
|
1372
|
{
|
1373
|
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
|
1374
|
$drpctTODAY = round($drpctTODAY, 2);
|
1375
|
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
|
1376
|
}
|
1377
|
else
|
1378
|
{$drpctTODAY=0;}
|
1379
|
|
1380
|
if ($callsTODAY > 0)
|
1381
|
{
|
1382
|
$AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY);
|
1383
|
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
|
1384
|
}
|
1385
|
else
|
1386
|
{$AVGhold_sec_queue_calls=0;}
|
1387
|
|
1388
|
if ($dropsTODAY > 0)
|
1389
|
{
|
1390
|
$AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY);
|
1391
|
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
|
1392
|
}
|
1393
|
else
|
1394
|
{$AVGhold_sec_drop_calls=0;}
|
1395
|
|
1396
|
if ($answersTODAY > 0)
|
1397
|
{
|
1398
|
$PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100);
|
1399
|
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
|
1400
|
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
|
1401
|
$PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100);
|
1402
|
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
|
1403
|
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
|
1404
|
$AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY);
|
1405
|
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
|
1406
|
if ($agent_non_pause_sec > 0)
|
1407
|
{
|
1408
|
$AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60);
|
1409
|
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
|
1410
|
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
|
1411
|
}
|
1412
|
else
|
1413
|
{$AVG_ANSWERagent_non_pause_sec=0;}
|
1414
|
}
|
1415
|
else
|
1416
|
{
|
1417
|
$PCThold_sec_stat_one=0;
|
1418
|
$PCThold_sec_stat_two=0;
|
1419
|
$AVGhold_sec_answer_calls=0;
|
1420
|
$AVG_ANSWERagent_non_pause_sec=0;
|
1421
|
}
|
1422
|
|
1423
|
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
|
1424
|
echo "<TD ALIGN=RIGHT><font size=2><B>CALLS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
1425
|
echo "<TD ALIGN=RIGHT><font size=2><B>TMA 1:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_one% </TD>";
|
1426
|
echo "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Answered Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_answer_calls </TD>";
|
1427
|
echo "<TD ALIGN=RIGHT><font size=2><B> TIME:</B> </TD><TD ALIGN=LEFT><font size=2> $NOW_TIME </TD>";
|
1428
|
echo "";
|
1429
|
echo "</TR>";
|
1430
|
echo "<TR>";
|
1431
|
echo "<TD ALIGN=RIGHT><font size=2><B>DROPS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY </TD>";
|
1432
|
echo "<TD ALIGN=RIGHT><font size=2><B>TMA 2:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_two% </TD>";
|
1433
|
echo "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Dropped Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_drop_calls </TD>";
|
1434
|
echo "<TD ALIGN=RIGHT><font size=2> </TD><TD ALIGN=LEFT><font size=2> </TD>";
|
1435
|
echo "";
|
1436
|
echo "</TR>";
|
1437
|
echo "<TR>";
|
1438
|
echo "<TD ALIGN=RIGHT><font size=2><B>ANSWERS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $answersTODAY </TD>";
|
1439
|
echo "<TD ALIGN=RIGHT COLSPAN=2><font size=2><B>(Agent non-pause time / Answers)</B></TD>";
|
1440
|
echo "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for All Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_queue_calls </TD>";
|
1441
|
echo "<TD ALIGN=RIGHT><font size=2> </TD><TD ALIGN=LEFT><font size=2> </TD>";
|
1442
|
echo "";
|
1443
|
echo "</TR>";
|
1444
|
echo "<TR>";
|
1445
|
echo "<TD ALIGN=RIGHT><font size=2><B>DROP PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> $drpctTODAY% </TD>";
|
1446
|
echo "<TD ALIGN=RIGHT><font size=2><B>PRODUCTIVITY:</B></TD><TD ALIGN=LEFT><font size=2> $AVG_ANSWERagent_non_pause_sec </TD>";
|
1447
|
echo "<TD ALIGN=RIGHT><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
1448
|
echo "<TD ALIGN=RIGHT><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
1449
|
echo "";
|
1450
|
echo "</TR>";
|
1451
|
}
|
1452
|
|
1453
|
##### NOT INBOUND ONLY ###
|
1454
|
else
|
1455
|
{
|
1456
|
if (eregi('ALL-ACTIVE',$group_string))
|
1457
|
{
|
1458
|
$non_inboundSQL='';
|
1459
|
if (ereg('N',$with_inbound))
|
1460
|
{$non_inboundSQL = "and campaign_id NOT IN($ALLcloser_campaignsSQL)";}
|
1461
|
else
|
1462
|
{$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";}
|
1463
|
$multi_drop++;
|
1464
|
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where active='Y' $group_SQLand;";
|
1465
|
|
1466
|
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where calls_today > -1 $non_inboundSQL;";
|
1467
|
}
|
1468
|
else
|
1469
|
{
|
1470
|
if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";}
|
1471
|
|
1472
|
if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) )
|
1473
|
{
|
1474
|
$multi_drop++;
|
1475
|
if ($DB) {echo "with_inbound|$with_inbound|$campaign_allow_inbound\n";}
|
1476
|
|
1477
|
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix,auto_hopper_level from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);";
|
1478
|
|
1479
|
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);";
|
1480
|
}
|
1481
|
else
|
1482
|
{
|
1483
|
$stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level) from vicidial_campaigns where campaign_id IN($group_SQL);";
|
1484
|
|
1485
|
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN($group_SQL);";
|
1486
|
}
|
1487
|
}
|
1488
|
if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";}
|
1489
|
|
1490
|
$rslt=mysql_query($stmt, $link);
|
1491
|
$row=mysql_fetch_row($rslt);
|
1492
|
$DIALlev = $row[0];
|
1493
|
$DIALstatusA = $row[1];
|
1494
|
$DIALstatusB = $row[2];
|
1495
|
$DIALstatusC = $row[3];
|
1496
|
$DIALstatusD = $row[4];
|
1497
|
$DIALstatusE = $row[5];
|
1498
|
$DIALorder = $row[6];
|
1499
|
$DIALfilter = $row[7];
|
1500
|
$HOPlev = $row[8];
|
1501
|
$DIALmethod = $row[9];
|
1502
|
$maxDIALlev = $row[10];
|
1503
|
$DROPmax = $row[11];
|
1504
|
$targetDIFF = $row[12];
|
1505
|
$ADAintense = $row[13];
|
1506
|
$ADAavailonly = $row[14];
|
1507
|
$TAPERtime = $row[15];
|
1508
|
$CALLtime = $row[16];
|
1509
|
$DIALtimeout = $row[17];
|
1510
|
$DIALstatuses = $row[18];
|
1511
|
$agent_pause_codes_active = $row[19];
|
1512
|
$DIALmix = $row[20];
|
1513
|
$AHOPlev = $row[21];
|
1514
|
|
1515
|
|
1516
|
$stmt="select count(*) from vicidial_hopper $group_SQLwhere;";
|
1517
|
$rslt=mysql_query($stmt, $link);
|
1518
|
$row=mysql_fetch_row($rslt);
|
1519
|
$VDhop = $row[0];
|
1520
|
|
1521
|
$rslt=mysql_query($stmtB, $link);
|
1522
|
$row=mysql_fetch_row($rslt);
|
1523
|
$DAleads = $row[0];
|
1524
|
$callsTODAY = $row[1];
|
1525
|
$dropsTODAY = $row[2];
|
1526
|
$drpctTODAY = $row[3];
|
1527
|
$diffONEMIN = $row[4];
|
1528
|
$agentsONEMIN = $row[5];
|
1529
|
$balanceFILL = $row[6];
|
1530
|
$answersTODAY = $row[7];
|
1531
|
if ($multi_drop > 0)
|
1532
|
{
|
1533
|
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
|
1534
|
{
|
1535
|
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
|
1536
|
$drpctTODAY = round($drpctTODAY, 2);
|
1537
|
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
|
1538
|
}
|
1539
|
else
|
1540
|
{$drpctTODAY=0;}
|
1541
|
}
|
1542
|
$VSCcat1 = $row[8];
|
1543
|
$VSCcat1tally = $row[9];
|
1544
|
$VSCcat2 = $row[10];
|
1545
|
$VSCcat2tally = $row[11];
|
1546
|
$VSCcat3 = $row[12];
|
1547
|
$VSCcat3tally = $row[13];
|
1548
|
$VSCcat4 = $row[14];
|
1549
|
$VSCcat4tally = $row[15];
|
1550
|
$VSCagentcalls = $row[16];
|
1551
|
$VSCagentwait = $row[17];
|
1552
|
$VSCagentcust = $row[18];
|
1553
|
$VSCagentacw = $row[19];
|
1554
|
$VSCagentpause = $row[20];
|
1555
|
|
1556
|
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
|
1557
|
{
|
1558
|
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
|
1559
|
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
|
1560
|
}
|
1561
|
else {$diffpctONEMIN = '0.00';}
|
1562
|
|
1563
|
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats $group_SQLwhere;";
|
1564
|
$rslt=mysql_query($stmt, $link);
|
1565
|
$row=mysql_fetch_row($rslt);
|
1566
|
$balanceSHORT = $row[0];
|
1567
|
|
1568
|
if (ereg('DISABLED',$DIALmix))
|
1569
|
{
|
1570
|
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
1571
|
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
1572
|
}
|
1573
|
else
|
1574
|
{
|
1575
|
$stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $group_SQLand limit 1;";
|
1576
|
$rslt=mysql_query($stmt, $link);
|
1577
|
$Lmix_to_print = mysql_num_rows($rslt);
|
1578
|
if ($Lmix_to_print > 0)
|
1579
|
{
|
1580
|
$row=mysql_fetch_row($rslt);
|
1581
|
$DIALstatuses = "List Mix: $row[0]";
|
1582
|
$DIALorder = "List Mix: $row[0]";
|
1583
|
}
|
1584
|
}
|
1585
|
$DIALlev = sprintf("%01.3f", $DIALlev);
|
1586
|
$agentsONEMIN = sprintf("%01.2f", $agentsONEMIN);
|
1587
|
$diffONEMIN = sprintf("%01.2f", $diffONEMIN);
|
1588
|
|
1589
|
|
1590
|
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
|
1591
|
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $DIALlev </TD>";
|
1592
|
echo "<TD ALIGN=RIGHT><font size=2><B>TRUNK SHORT/FILL:</B></TD><TD ALIGN=LEFT><font size=2> $balanceSHORT / $balanceFILL </TD>";
|
1593
|
echo "<TD ALIGN=RIGHT><font size=2><B>FILTER:</B></TD><TD ALIGN=LEFT><font size=2> $DIALfilter </TD>";
|
1594
|
echo "<TD ALIGN=RIGHT><font size=2><B> TIME:</B> </TD><TD ALIGN=LEFT><font size=2> $NOW_TIME </TD>";
|
1595
|
echo "";
|
1596
|
echo "</TR>";
|
1597
|
|
1598
|
if ($adastats>1)
|
1599
|
{
|
1600
|
$min_link='<a href=\"$PHP_SELF?$groupQS&RR=4&DB=$DB&adastats=1\"><font size=1>- min </font></a>';
|
1601
|
if ($RTajax > 0)
|
1602
|
{$min_link='';}
|
1603
|
|
1604
|
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
1605
|
echo "<TD ALIGN=RIGHT>$min_link<font size=2> <B>MAX LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $maxDIALlev </TD>";
|
1606
|
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED MAX:</B></TD><TD ALIGN=LEFT><font size=2> $DROPmax% </TD>";
|
1607
|
echo "<TD ALIGN=RIGHT><font size=2><B>TARGET DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $targetDIFF </TD>";
|
1608
|
echo "<TD ALIGN=RIGHT><font size=2><B>INTENSITY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAintense </TD>";
|
1609
|
echo "</TR>";
|
1610
|
|
1611
|
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
1612
|
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL TIMEOUT:</B></TD><TD ALIGN=LEFT><font size=2> $DIALtimeout </TD>";
|
1613
|
echo "<TD ALIGN=RIGHT><font size=2><B>TAPER TIME:</B></TD><TD ALIGN=LEFT><font size=2> $TAPERtime </TD>";
|
1614
|
echo "<TD ALIGN=RIGHT><font size=2><B>LOCAL TIME:</B></TD><TD ALIGN=LEFT><font size=2> $CALLtime </TD>";
|
1615
|
echo "<TD ALIGN=RIGHT><font size=2><B>AVAIL ONLY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAavailonly </TD>";
|
1616
|
echo "</TR>";
|
1617
|
}
|
1618
|
|
1619
|
echo "<TR>";
|
1620
|
echo "<TD ALIGN=RIGHT><font size=2><B>DIALABLE LEADS:</B></TD><TD ALIGN=LEFT><font size=2> $DAleads </TD>";
|
1621
|
echo "<TD ALIGN=RIGHT><font size=2><B>CALLS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
1622
|
echo "<TD ALIGN=RIGHT><font size=2><B>AVG AGENTS:</B></TD><TD ALIGN=LEFT><font size=2> $agentsONEMIN </TD>";
|
1623
|
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL METHOD:</B></TD><TD ALIGN=LEFT><font size=2> $DIALmethod </TD>";
|
1624
|
echo "</TR>";
|
1625
|
|
1626
|
echo "<TR>";
|
1627
|
echo "<TD ALIGN=RIGHT><font size=2><B>HOPPER <font size=1>( min/auto )</font>:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev / $AHOPlev </TD>";
|
1628
|
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED / ANSWERED:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
1629
|
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
1630
|
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
1631
|
echo "</TR>";
|
1632
|
|
1633
|
echo "<TR>";
|
1634
|
echo "<TD ALIGN=RIGHT><font size=2><B>LEADS IN HOPPER:</B></TD><TD ALIGN=LEFT><font size=2> $VDhop </TD>";
|
1635
|
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> ";
|
1636
|
if ($drpctTODAY >= $DROPmax)
|
1637
|
{echo "<font color=red><B>$drpctTODAY%</B></font>";}
|
1638
|
else
|
1639
|
{echo "$drpctTODAY%";}
|
1640
|
echo " </TD>";
|
1641
|
|
1642
|
|
1643
|
echo "<TD ALIGN=RIGHT><font size=2><B>DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffpctONEMIN% </TD>";
|
1644
|
echo "<TD ALIGN=RIGHT><font size=2><B>ORDER:</B></TD><TD ALIGN=LEFT><font size=2> $DIALorder </TD>";
|
1645
|
echo "</TR>";
|
1646
|
|
1647
|
if ($AGENTtimeSTATS>0)
|
1648
|
{
|
1649
|
if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) )
|
1650
|
{
|
1651
|
$avgpauseTODAY = ($VSCagentpause / $VSCagentcalls);
|
1652
|
$avgpauseTODAY = round($avgpauseTODAY, 0);
|
1653
|
$avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY);
|
1654
|
}
|
1655
|
else
|
1656
|
{$avgpauseTODAY=0;}
|
1657
|
|
1658
|
if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) )
|
1659
|
{
|
1660
|
$avgwaitTODAY = ($VSCagentwait / $VSCagentcalls);
|
1661
|
$avgwaitTODAY = round($avgwaitTODAY, 0);
|
1662
|
$avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY);
|
1663
|
}
|
1664
|
else
|
1665
|
{$avgwaitTODAY=0;}
|
1666
|
|
1667
|
if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) )
|
1668
|
{
|
1669
|
$avgcustTODAY = ($VSCagentcust / $VSCagentcalls);
|
1670
|
$avgcustTODAY = round($avgcustTODAY, 0);
|
1671
|
$avgcustTODAY = sprintf("%01.0f", $avgcustTODAY);
|
1672
|
}
|
1673
|
else
|
1674
|
{$avgcustTODAY=0;}
|
1675
|
|
1676
|
if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) )
|
1677
|
{
|
1678
|
$avgacwTODAY = ($VSCagentacw / $VSCagentcalls);
|
1679
|
$avgacwTODAY = round($avgacwTODAY, 0);
|
1680
|
$avgacwTODAY = sprintf("%01.0f", $avgacwTODAY);
|
1681
|
}
|
1682
|
else
|
1683
|
{$avgacwTODAY=0;}
|
1684
|
|
1685
|
echo "<TR>";
|
1686
|
echo "<TD ALIGN=RIGHT><font size=2><B>AGENT AVG WAIT:</B></TD><TD ALIGN=LEFT><font size=2> $avgwaitTODAY </TD>";
|
1687
|
echo "<TD ALIGN=RIGHT><font size=2><B>AVG CUSTTIME:</B></TD><TD ALIGN=LEFT><font size=2> $avgcustTODAY </TD>";
|
1688
|
echo "<TD ALIGN=RIGHT><font size=2><B>AVG ACW:</B></TD><TD ALIGN=LEFT><font size=2> $avgacwTODAY </TD>";
|
1689
|
echo "<TD ALIGN=RIGHT><font size=2><B>AVG PAUSE:</B></TD><TD ALIGN=LEFT><font size=2> $avgpauseTODAY </TD>";
|
1690
|
echo "</TR>";
|
1691
|
}
|
1692
|
|
1693
|
echo "$DROPINGROUPstatsHTML\n";
|
1694
|
echo "$CARRIERstatsHTML\n";
|
1695
|
echo "$PRESETstatsHTML\n";
|
1696
|
}
|
1697
|
|
1698
|
echo "<TR>";
|
1699
|
echo "<TD ALIGN=LEFT COLSPAN=8>";
|
1700
|
if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) )
|
1701
|
{echo "<font size=2><B>$VSCcat1:</B> $VSCcat1tally \n";}
|
1702
|
if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) )
|
1703
|
{echo "<font size=2><B>$VSCcat2:</B> $VSCcat2tally \n";}
|
1704
|
if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) )
|
1705
|
{echo "<font size=2><B>$VSCcat3:</B> $VSCcat3tally \n";}
|
1706
|
if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) )
|
1707
|
{echo "<font size=2><B>$VSCcat4:</B> $VSCcat4tally \n";}
|
1708
|
echo "</TD></TR>";
|
1709
|
echo "<TR>";
|
1710
|
echo "<TD ALIGN=LEFT COLSPAN=8>";
|
1711
|
|
1712
|
echo "$ingroup_detail";
|
1713
|
|
1714
|
if ($RTajax < 1)
|
1715
|
{
|
1716
|
if ($adastats<2)
|
1717
|
{
|
1718
|
echo "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>+ VIEW MORE</font></a>";
|
1719
|
}
|
1720
|
else
|
1721
|
{
|
1722
|
echo "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=1&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>+ VIEW LESS</font></a>";
|
1723
|
}
|
1724
|
if ($UGdisplay>0)
|
1725
|
{
|
1726
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=0&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE USER GROUP</font></a>";
|
1727
|
}
|
1728
|
else
|
1729
|
{
|
1730
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=1&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>VIEW USER GROUP</font></a>";
|
1731
|
}
|
1732
|
if ($SERVdisplay>0)
|
1733
|
{
|
1734
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=0&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE SERVER INFO</font></a>";
|
1735
|
}
|
1736
|
else
|
1737
|
{
|
1738
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=1&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW SERVER INFO</font></a>";
|
1739
|
}
|
1740
|
if ($CALLSdisplay>0)
|
1741
|
{
|
1742
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE WAITING CALLS</font></a>";
|
1743
|
}
|
1744
|
else
|
1745
|
{
|
1746
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW WAITING CALLS</font></a>";
|
1747
|
}
|
1748
|
|
1749
|
if ($ALLINGROUPstats>0)
|
1750
|
{
|
1751
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=0&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE IN-GROUP STATS</font></a>";
|
1752
|
}
|
1753
|
else
|
1754
|
{
|
1755
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=1&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW IN-GROUP STATS</font></a>";
|
1756
|
}
|
1757
|
if ($PHONEdisplay>0)
|
1758
|
{
|
1759
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=0&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE PHONES</font></a>";
|
1760
|
}
|
1761
|
else
|
1762
|
{
|
1763
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=1&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW PHONES</font></a>";
|
1764
|
}
|
1765
|
if ($CUSTPHONEdisplay>0)
|
1766
|
{
|
1767
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=0&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE CUSTPHONES</font></a>";
|
1768
|
}
|
1769
|
else
|
1770
|
{
|
1771
|
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=1&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW CUSTPHONES</font></a>";
|
1772
|
}
|
1773
|
}
|
1774
|
|
1775
|
echo "</TD>";
|
1776
|
echo "</TR>";
|
1777
|
echo "</TABLE>";
|
1778
|
|
1779
|
echo "</FORM>\n\n";
|
1780
|
|
1781
|
##### check for campaigns with no dialable leads if enabled #####
|
1782
|
if ( ($with_inbound != 'O') and ($NOLEADSalert == 'YES') )
|
1783
|
{
|
1784
|
$NDLcampaigns='';
|
1785
|
$stmtB="select campaign_id from vicidial_campaign_stats where campaign_id IN($group_SQL) and dialable_leads < 1 order by campaign_id;";
|
1786
|
if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";}
|
1787
|
$rslt=mysql_query($stmtB, $link);
|
1788
|
$campaigns_to_print = mysql_num_rows($rslt);
|
1789
|
$ctp=0;
|
1790
|
while ($campaigns_to_print > $ctp)
|
1791
|
{
|
1792
|
$row=mysql_fetch_row($rslt);
|
1793
|
$NDLcampaigns .= " <a href=\"./admin.php?ADD=34&campaign_id=$row[0]\">$row[0]</a> ";
|
1794
|
$ctp++;
|
1795
|
if (preg_match("/0$|5$/",$ctp))
|
1796
|
{$NDLcampaigns .= "<BR>";}
|
1797
|
}
|
1798
|
if ($ctp > 0)
|
1799
|
{
|
1800
|
echo "<span style=\"position:absolute;left:0px;top:47px;z-index:15;\" id=no_dialable_leads_span>\n";
|
1801
|
echo "<TABLE WIDTH=700 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#E9E6EE\"><TR><TD ALIGN=CENTER>\n";
|
1802
|
echo "<BR><BR><BR><BR><a href=\"#\" onclick=\"closeAlert('no_dialable_leads_span');\">Close Alert</a>";
|
1803
|
echo "<BR><BR><BR><BR><BR><b>Campaigns with no dialable leads:<BR><BR>$NDLcampaigns<b><BR>";
|
1804
|
echo "<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> ";
|
1805
|
echo "</TD></TR></TABLE>\n";
|
1806
|
echo "</span>\n";
|
1807
|
}
|
1808
|
}
|
1809
|
}
|
1810
|
|
1811
|
|
1812
|
|
1813
|
###################################################################################
|
1814
|
###### INBOUND/OUTBOUND CALLS
|
1815
|
###################################################################################
|
1816
|
if ($campaign_allow_inbound > 0)
|
1817
|
{
|
1818
|
if (eregi('ALL-ACTIVE',$group_string))
|
1819
|
{
|
1820
|
$stmt="select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand";
|
1821
|
$rslt=mysql_query($stmt, $link);
|
1822
|
$closer_campaigns="";
|
1823
|
while ($row=mysql_fetch_row($rslt))
|
1824
|
{
|
1825
|
$closer_campaigns.="$row[0]";
|
1826
|
}
|
1827
|
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
|
1828
|
$closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns);
|
1829
|
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
1830
|
$closer_campaignsSQL = "'$closer_campaigns'";
|
1831
|
}
|
1832
|
$stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;";
|
1833
|
}
|
1834
|
else
|
1835
|
{
|
1836
|
$stmtB="from vicidial_auto_calls where status NOT IN('XFER') $group_SQLand order by queue_priority desc,campaign_id,call_time;";
|
1837
|
}
|
1838
|
if ($CALLSdisplay > 0)
|
1839
|
{
|
1840
|
$stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type,queue_priority,agent_only";
|
1841
|
}
|
1842
|
else
|
1843
|
{
|
1844
|
$stmtA = "SELECT status";
|
1845
|
}
|
1846
|
|
1847
|
|
1848
|
$k=0;
|
1849
|
$agentonlycount=0;
|
1850
|
$stmt = "$stmtA $stmtB";
|
1851
|
$rslt=mysql_query($stmt, $link);
|
1852
|
if ($DB) {echo "$stmt\n";}
|
1853
|
$parked_to_print = mysql_num_rows($rslt);
|
1854
|
if ($parked_to_print > 0)
|
1855
|
{
|
1856
|
$i=0;
|
1857
|
$out_total=0;
|
1858
|
$out_ring=0;
|
1859
|
$out_live=0;
|
1860
|
$in_ivr=0;
|
1861
|
while ($i < $parked_to_print)
|
1862
|
{
|
1863
|
$row=mysql_fetch_row($rslt);
|
1864
|
|
1865
|
if (eregi("LIVE",$row[0]))
|
1866
|
{
|
1867
|
$out_live++;
|
1868
|
|
1869
|
if ($CALLSdisplay > 0)
|
1870
|
{
|
1871
|
$CDstatus[$k] = $row[0];
|
1872
|
$CDcampaign_id[$k] = $row[1];
|
1873
|
$CDphone_number[$k] = $row[2];
|
1874
|
$CDserver_ip[$k] = $row[3];
|
1875
|
$CDcall_time[$k] = $row[4];
|
1876
|
$CDcall_type[$k] = $row[5];
|
1877
|
$CDqueue_priority[$k] = $row[6];
|
1878
|
$CDagent_only[$k] = $row[7];
|
1879
|
if (strlen($CDagent_only[$k]) > 0) {$agentonlycount++;}
|
1880
|
$k++;
|
1881
|
}
|
1882
|
}
|
1883
|
else
|
1884
|
{
|
1885
|
if (eregi("IVR",$row[0]))
|
1886
|
{
|
1887
|
$in_ivr++;
|
1888
|
|
1889
|
if ($CALLSdisplay > 0)
|
1890
|
{
|
1891
|
$CDstatus[$k] = $row[0];
|
1892
|
$CDcampaign_id[$k] = $row[1];
|
1893
|
$CDphone_number[$k] = $row[2];
|
1894
|
$CDserver_ip[$k] = $row[3];
|
1895
|
$CDcall_time[$k] = $row[4];
|
1896
|
$CDcall_type[$k] = $row[5];
|
1897
|
$CDqueue_priority[$k] = $row[6];
|
1898
|
$CDagent_only[$k] = $row[7];
|
1899
|
if (strlen($CDagent_only[$k]) > 0) {$agentonlycount++;}
|
1900
|
$k++;
|
1901
|
}
|
1902
|
}
|
1903
|
if (eregi("CLOSER",$row[0]))
|
1904
|
{$nothing=1;}
|
1905
|
else
|
1906
|
{$out_ring++;}
|
1907
|
}
|
1908
|
|
1909
|
$out_total++;
|
1910
|
$i++;
|
1911
|
}
|
1912
|
|
1913
|
##### MIDI alert audio file test #####
|
1914
|
# $test_midi=1;
|
1915
|
# if ($test_midi > 0)
|
1916
|
# {
|
1917
|
# # echo "<bgsound src=\"../goautodial-admin/up_down.mid\" loop=\"-1\">";
|
1918
|
# # echo "<embed src=\"../goautodial-admin/up_down.mid\" loop=\"-1\">";
|
1919
|
# echo "<object type=\"audio/x-midi\" data=\"../goautodial-admin/up_down.mid\" width=200 height=20>";
|
1920
|
# echo " <param name=\"src\" value=\"../goautodial-admin/up_down.mid\">";
|
1921
|
# echo " <param name=\"autoplay\" value=\"true\">";
|
1922
|
# echo " <param name=\"autoStart\" value=\"1\">";
|
1923
|
# echo " <param name=\"loop\" value=\"1\">";
|
1924
|
# echo " alt : <a href=\"../goautodial-admin/up_down.mid\">test.mid</a>";
|
1925
|
# echo "</object>";
|
1926
|
# }
|
1927
|
|
1928
|
if ($out_live > 0) {$F='<FONT class="r1">'; $FG='</FONT>';}
|
1929
|
if ($out_live > 4) {$F='<FONT class="r2">'; $FG='</FONT>';}
|
1930
|
if ($out_live > 9) {$F='<FONT class="r3">'; $FG='</FONT>';}
|
1931
|
if ($out_live > 14) {$F='<FONT class="r4">'; $FG='</FONT>';}
|
1932
|
|
1933
|
if ($campaign_allow_inbound > 0)
|
1934
|
{echo "$NFB$out_total$NFE current active calls \n";}
|
1935
|
else
|
1936
|
{echo "$NFB$out_total$NFE calls being placed \n";}
|
1937
|
|
1938
|
echo "$NFB$out_ring$NFE calls ringing \n";
|
1939
|
echo "$NFB$F $out_live $FG$NFE calls waiting for agents \n";
|
1940
|
echo "$NFB $in_ivr$NFE calls in IVR \n";
|
1941
|
}
|
1942
|
else
|
1943
|
{
|
1944
|
echo " NO LIVE CALLS WAITING \n";
|
1945
|
}
|
1946
|
|
1947
|
|
1948
|
|
1949
|
###################################################################################
|
1950
|
###### CALLS WAITING
|
1951
|
###################################################################################
|
1952
|
$agentonlyheader = '';
|
1953
|
if ($agentonlycount > 0)
|
1954
|
{$agentonlyheader = 'AGENTONLY';}
|
1955
|
$Cecho = '';
|
1956
|
$Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n";
|
1957
|
$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n";
|
1958
|
$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITY | $agentonlyheader\n";
|
1959
|
$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n";
|
1960
|
|
1961
|
$p=0;
|
1962
|
while($p<$k)
|
1963
|
{
|
1964
|
$Cstatus = sprintf("%-6s", $CDstatus[$p]);
|
1965
|
$Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]);
|
1966
|
$Cphone_number = sprintf("%-12s", $CDphone_number[$p]);
|
1967
|
$Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]);
|
1968
|
$Ccall_type = sprintf("%-10s", $CDcall_type[$p]);
|
1969
|
$Cqueue_priority = sprintf("%8s", $CDqueue_priority[$p]);
|
1970
|
$Cagent_only = sprintf("%8s", $CDagent_only[$p]);
|
1971
|
|
1972
|
$Ccall_time_S = ($STARTtime - $CDcall_time[$p]);
|
1973
|
$Ccall_time_MS = sec_convert($Ccall_time_S,'M');
|
1974
|
$Ccall_time_MS = sprintf("%7s", $Ccall_time_MS);
|
1975
|
|
1976
|
$G = ''; $EG = '';
|
1977
|
if ($CDcall_type[$p] == 'IN')
|
1978
|
{
|
1979
|
$G="<SPAN class=\"csc$CDcampaign_id[$p]\"><B>"; $EG='</B></SPAN>';
|
1980
|
}
|
1981
|
if (strlen($CDagent_only[$p]) > 0)
|
1982
|
{$Gcalltypedisplay = "$G$Cagent_only$EG";}
|
1983
|
else
|
1984
|
{$Gcalltypedisplay = '';}
|
1985
|
|
1986
|
$Cecho .= "| $G$Cstatus$EG | $G$Ccampaign_id$EG | $G$Cphone_number$EG | $G$Cserver_ip$EG | $G$Ccall_time_MS$EG | $G$Ccall_type$EG | $G$Cqueue_priority$EG | $Gcalltypedisplay \n";
|
1987
|
|
1988
|
$p++;
|
1989
|
}
|
1990
|
$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n";
|
1991
|
|
1992
|
if ($p<1)
|
1993
|
{$Cecho='';}
|
1994
|
|
1995
|
###################################################################################
|
1996
|
###### AGENT TIME ON SYSTEM
|
1997
|
###################################################################################
|
1998
|
|
1999
|
$agent_incall=0;
|
2000
|
$agent_ready=0;
|
2001
|
$agent_paused=0;
|
2002
|
$agent_dispo=0;
|
2003
|
$agent_dead=0;
|
2004
|
$agent_total=0;
|
2005
|
|
2006
|
$phoneord=$orderby;
|
2007
|
$userord=$orderby;
|
2008
|
$groupord=$orderby;
|
2009
|
$timeord=$orderby;
|
2010
|
$campaignord=$orderby;
|
2011
|
|
2012
|
if ($phoneord=='phoneup') {$phoneord='phonedown';}
|
2013
|
else {$phoneord='phoneup';}
|
2014
|
if ($userord=='userup') {$userord='userdown';}
|
2015
|
else {$userord='userup';}
|
2016
|
if ($groupord=='groupup') {$groupord='groupdown';}
|
2017
|
else {$groupord='groupup';}
|
2018
|
if ($timeord=='timeup') {$timeord='timedown';}
|
2019
|
else {$timeord='timeup';}
|
2020
|
if ($campaignord=='campaignup') {$campaignord='campaigndown';}
|
2021
|
else {$campaignord='campaignup';}
|
2022
|
|
2023
|
$Aecho = '';
|
2024
|
$Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group_string $NOW_TIME\n";
|
2025
|
|
2026
|
|
2027
|
$HDbegin = "+";
|
2028
|
$HTbegin = "|";
|
2029
|
$HDstation = "----------------+";
|
2030
|
$HTstation = " STATION |";
|
2031
|
$HDphone = "-------------+";
|
2032
|
$HTphone = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$phoneord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">PHONE</a> |";
|
2033
|
if ($RTajax > 0)
|
2034
|
{$HTphone = " <a href=\"#\" onclick=\"update_variables('orderby','phone');\">PHONE</a> |";}
|
2035
|
$HDuser = "------------------------+";
|
2036
|
|
2037
|
|
2038
|
$HTuser = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$userord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">USER</a> ";
|
2039
|
if ($RTajax > 0)
|
2040
|
{$HTuser = " <a href=\"#\" onclick=\"update_variables('orderby','user');\">USER</a> ";}
|
2041
|
if ($UidORname>0)
|
2042
|
{
|
2043
|
if ($RTajax > 0)
|
2044
|
{$HTuser .= "<a href=\"#\" onclick=\"update_variables('UidORname','');\">SHOW ID</a> ";}
|
2045
|
else
|
2046
|
{
|
2047
|
$HTuser .= "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=0&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">SHOW ID</a> ";
|
2048
|
}
|
2049
|
}
|
2050
|
else
|
2051
|
{
|
2052
|
if ($RTajax > 0)
|
2053
|
{$HTuser .= "<a href=\"#\" onclick=\"update_variables('UidORname','');\">SHOW NAME</a>";}
|
2054
|
else
|
2055
|
{
|
2056
|
$HTuser .= "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=1&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">SHOW NAME</a>";
|
2057
|
}
|
2058
|
}
|
2059
|
|
2060
|
$HTuser .= " INFO |";
|
2061
|
|
2062
|
|
2063
|
$HDusergroup = "--------------+";
|
2064
|
$HTusergroup = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$groupord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">USER GROUP</a> |";
|
2065
|
if ($RTajax > 0)
|
2066
|
{$HTusergroup = " <a href=\"#\" onclick=\"update_variables('orderby','group');\">USER GROUP</a> |";}
|
2067
|
$HDsessionid = "------------------+";
|
2068
|
$HTsessionid = " SESSIONID |";
|
2069
|
$HDbarge = "-------+";
|
2070
|
$HTbarge = " BARGE |";
|
2071
|
$HDstatus = "----------+";
|
2072
|
$HTstatus = " STATUS |";
|
2073
|
$HDcustphone = "-------------+";
|
2074
|
$HTcustphone = " CUST PHONE |";
|
2075
|
$HDserver_ip = "-----------------+";
|
2076
|
$HTserver_ip = " SERVER IP |";
|
2077
|
$HDcall_server_ip = "-----------------+";
|
2078
|
$HTcall_server_ip = " CALL SERVER IP |";
|
2079
|
$HDtime = "---------+";
|
2080
|
$HTtime = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$timeord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">MM:SS</a> |";
|
2081
|
if ($RTajax > 0)
|
2082
|
{$HTtime = " <a href=\"#\" onclick=\"update_variables('orderby','time');\">MM:SS</a> |";}
|
2083
|
$HDcampaign = "------------+";
|
2084
|
$HTcampaign = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$campaignord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">CAMPAIGN</a> |";
|
2085
|
if ($RTajax > 0)
|
2086
|
{$HTcampaign = " <a href=\"#\" onclick=\"update_variables('orderby','campaign');\">CAMPAIGN</a> |";}
|
2087
|
$HDcalls = "-------+";
|
2088
|
$HTcalls = " CALLS |";
|
2089
|
$HDpause = '';
|
2090
|
$HTpause = '';
|
2091
|
$HDigcall = "------+------------------";
|
2092
|
$HTigcall = " HOLD | IN-GROUP ";
|
2093
|
|
2094
|
if (!ereg("N",$agent_pause_codes_active))
|
2095
|
{
|
2096
|
$HDstatus = "----------";
|
2097
|
$HTstatus = " STATUS ";
|
2098
|
$HDpause = "-------+";
|
2099
|
$HTpause = " PAUSE |";
|
2100
|
}
|
2101
|
if ($PHONEdisplay < 1)
|
2102
|
{
|
2103
|
$HDphone = '';
|
2104
|
$HTphone = '';
|
2105
|
}
|
2106
|
if ($CUSTPHONEdisplay < 1)
|
2107
|
{
|
2108
|
$HDcustphone = '';
|
2109
|
$HTcustphone = '';
|
2110
|
}
|
2111
|
if ($UGdisplay < 1)
|
2112
|
{
|
2113
|
$HDusergroup = '';
|
2114
|
$HTusergroup = '';
|
2115
|
}
|
2116
|
if ( ($SIPmonitorLINK<1) and ($IAXmonitorLINK<1) and (!preg_match("/MONITOR|BARGE/",$monitor_active) ) )
|
2117
|
{
|
2118
|
$HDsessionid = "-----------+";
|
2119
|
$HTsessionid = " SESSIONID |";
|
2120
|
}
|
2121
|
if ( ($SIPmonitorLINK<2) and ($IAXmonitorLINK<2) and (!preg_match("/BARGE/",$monitor_active) ) )
|
2122
|
{
|
2123
|
$HDbarge = '';
|
2124
|
$HTbarge = '';
|
2125
|
}
|
2126
|
if ($SERVdisplay < 1)
|
2127
|
{
|
2128
|
$HDserver_ip = '';
|
2129
|
$HTserver_ip = '';
|
2130
|
$HDcall_server_ip = '';
|
2131
|
$HTcall_server_ip = '';
|
2132
|
}
|
2133
|
|
2134
|
|
2135
|
if ($realtime_block_user_info > 0)
|
2136
|
{
|
2137
|
$Aline = "$HDbegin$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n";
|
2138
|
$Bline = "$HTbegin$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n";
|
2139
|
}
|
2140
|
else
|
2141
|
{
|
2142
|
$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n";
|
2143
|
$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n";
|
2144
|
}
|
2145
|
$Aecho .= "$Aline";
|
2146
|
$Aecho .= "$Bline";
|
2147
|
$Aecho .= "$Aline";
|
2148
|
|
2149
|
if ($orderby=='timeup') {$orderSQL='vicidial_live_agents.status,last_call_time';}
|
2150
|
if ($orderby=='timedown') {$orderSQL='vicidial_live_agents.status desc,last_call_time desc';}
|
2151
|
if ($orderby=='campaignup') {$orderSQL='vicidial_live_agents.campaign_id,vicidial_live_agents.status,last_call_time';}
|
2152
|
if ($orderby=='campaigndown') {$orderSQL='vicidial_live_agents.campaign_id desc,vicidial_live_agents.status desc,last_call_time desc';}
|
2153
|
if ($orderby=='groupup') {$orderSQL='user_group,vicidial_live_agents.status,last_call_time';}
|
2154
|
if ($orderby=='groupdown') {$orderSQL='user_group desc,vicidial_live_agents.status desc,last_call_time desc';}
|
2155
|
if ($orderby=='phoneup') {$orderSQL='extension,server_ip';}
|
2156
|
if ($orderby=='phonedown') {$orderSQL='extension desc,server_ip desc';}
|
2157
|
if ($UidORname > 0)
|
2158
|
{
|
2159
|
if ($orderby=='userup') {$orderSQL='full_name,status,last_call_time';}
|
2160
|
if ($orderby=='userdown') {$orderSQL='full_name desc,status desc,last_call_time desc';}
|
2161
|
}
|
2162
|
else
|
2163
|
{
|
2164
|
if ($orderby=='userup') {$orderSQL='vicidial_live_agents.user';}
|
2165
|
if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';}
|
2166
|
}
|
2167
|
|
2168
|
if ( (eregi('ALL-ACTIVE',$group_string)) and (strlen($group_SQL) < 3) ) {$UgroupSQL = '';}
|
2169
|
else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";}
|
2170
|
if (strlen($usergroup)<1) {$usergroupSQL = '';}
|
2171
|
else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";}
|
2172
|
|
2173
|
$ring_agents=0;
|
2174
|
$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL order by $orderSQL;";
|
2175
|
$rslt=mysql_query($stmt, $link);
|
2176
|
if ($DB) {echo "$stmt\n";}
|
2177
|
$talking_to_print = mysql_num_rows($rslt);
|
2178
|
if ($talking_to_print > 0)
|
2179
|
{
|
2180
|
$i=0;
|
2181
|
while ($i < $talking_to_print)
|
2182
|
{
|
2183
|
$row=mysql_fetch_row($rslt);
|
2184
|
|
2185
|
$Aextension[$i] = $row[0];
|
2186
|
$Auser[$i] = $row[1];
|
2187
|
$Asessionid[$i] = $row[2];
|
2188
|
$Astatus[$i] = $row[3];
|
2189
|
$Aserver_ip[$i] = $row[4];
|
2190
|
$Acall_time[$i] = $row[5];
|
2191
|
$Acall_finish[$i] = $row[6];
|
2192
|
$Acall_server_ip[$i] = $row[7];
|
2193
|
$Acampaign_id[$i] = $row[8];
|
2194
|
$Auser_group[$i] = $row[9];
|
2195
|
$Afull_name[$i] = $row[10];
|
2196
|
$Acomments[$i] = $row[11];
|
2197
|
$Acalls_today[$i] = $row[12];
|
2198
|
$Acallerid[$i] = $row[13];
|
2199
|
$Alead_id[$i] = $row[14];
|
2200
|
$Astate_change[$i] = $row[15];
|
2201
|
$Aon_hook_agent[$i] = $row[16];
|
2202
|
$Aring_callerid[$i] = $row[17];
|
2203
|
$Aagent_log_id[$i] = $row[18];
|
2204
|
$Aring_note[$i] = ' ';
|
2205
|
|
2206
|
if ($Aon_hook_agent[$i] == 'Y')
|
2207
|
{
|
2208
|
$Aring_note[$i] = '*';
|
2209
|
$ring_agents++;
|
2210
|
if (strlen($Aring_callerid[$i]) > 18)
|
2211
|
{$Astatus[$i]="RING";}
|
2212
|
}
|
2213
|
|
2214
|
|
2215
|
### 3-WAY Check ###
|
2216
|
if ($Alead_id[$i]!=0)
|
2217
|
{
|
2218
|
$threewaystmt="select UNIX_TIMESTAMP(last_call_time) from vicidial_live_agents where lead_id='$Alead_id[$i]' and status='INCALL' order by UNIX_TIMESTAMP(last_call_time) desc";
|
2219
|
$threewayrslt=mysql_query($threewaystmt, $link);
|
2220
|
if (mysql_num_rows($threewayrslt)>1)
|
2221
|
{
|
2222
|
$Astatus[$i]="3-WAY";
|
2223
|
$srow=mysql_fetch_row($threewayrslt);
|
2224
|
$Acall_mostrecent[$i]=$srow[0];
|
2225
|
}
|
2226
|
}
|
2227
|
### END 3-WAY Check ###
|
2228
|
|
2229
|
$i++;
|
2230
|
}
|
2231
|
|
2232
|
$callerids='';
|
2233
|
$pausecode='';
|
2234
|
$stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;";
|
2235
|
$rslt=mysql_query($stmt, $link);
|
2236
|
if ($DB) {echo "$stmt\n";}
|
2237
|
$calls_to_list = mysql_num_rows($rslt);
|
2238
|
if ($calls_to_list > 0)
|
2239
|
{
|
2240
|
$i=0;
|
2241
|
while ($i < $calls_to_list)
|
2242
|
{
|
2243
|
$row=mysql_fetch_row($rslt);
|
2244
|
$callerids .= "$row[0]|";
|
2245
|
$VAClead_ids[$i] = $row[1];
|
2246
|
$VACphones[$i] = $row[2];
|
2247
|
$i++;
|
2248
|
}
|
2249
|
}
|
2250
|
|
2251
|
### Lookup phone logins
|
2252
|
$i=0;
|
2253
|
while ($i < $talking_to_print)
|
2254
|
{
|
2255
|
if (eregi("R/",$Aextension[$i]))
|
2256
|
{
|
2257
|
$protocol = 'EXTERNAL';
|
2258
|
$dialplan = eregi_replace('R/',"",$Aextension[$i]);
|
2259
|
$dialplan = eregi_replace("\@.*",'',$dialplan);
|
2260
|
$exten = "dialplan_number='$dialplan'";
|
2261
|
}
|
2262
|
if (eregi("Local/",$Aextension[$i]))
|
2263
|
{
|
2264
|
$protocol = 'EXTERNAL';
|
2265
|
$dialplan = eregi_replace('Local/',"",$Aextension[$i]);
|
2266
|
$dialplan = eregi_replace("\@.*",'',$dialplan);
|
2267
|
$exten = "dialplan_number='$dialplan'";
|
2268
|
}
|
2269
|
if (eregi('SIP/',$Aextension[$i]))
|
2270
|
{
|
2271
|
$protocol = 'SIP';
|
2272
|
$dialplan = eregi_replace('SIP/',"",$Aextension[$i]);
|
2273
|
$dialplan = eregi_replace("-.*",'',$dialplan);
|
2274
|
$exten = "extension='$dialplan'";
|
2275
|
}
|
2276
|
if (eregi('IAX2/',$Aextension[$i]))
|
2277
|
{
|
2278
|
$protocol = 'IAX2';
|
2279
|
$dialplan = eregi_replace('IAX2/',"",$Aextension[$i]);
|
2280
|
$dialplan = eregi_replace("-.*",'',$dialplan);
|
2281
|
$exten = "extension='$dialplan'";
|
2282
|
}
|
2283
|
if (eregi('Zap/',$Aextension[$i]))
|
2284
|
{
|
2285
|
$protocol = 'Zap';
|
2286
|
$dialplan = eregi_replace('Zap/',"",$Aextension[$i]);
|
2287
|
$exten = "extension='$dialplan'";
|
2288
|
}
|
2289
|
if (eregi('DAHDI/',$Aextension[$i]))
|
2290
|
{
|
2291
|
$protocol = 'Zap';
|
2292
|
$dialplan = eregi_replace('DAHDI/',"",$Aextension[$i]);
|
2293
|
$exten = "extension='$dialplan'";
|
2294
|
}
|
2295
|
|
2296
|
$stmt="select login from phones where server_ip='$Aserver_ip[$i]' and $exten and protocol='$protocol';";
|
2297
|
$rslt=mysql_query($stmt, $link);
|
2298
|
if ($DB) {echo "$stmt\n";}
|
2299
|
$phones_to_print = mysql_num_rows($rslt);
|
2300
|
if ($phones_to_print > 0)
|
2301
|
{
|
2302
|
$row=mysql_fetch_row($rslt);
|
2303
|
$Alogin[$i] = "$row[0]-----$i";
|
2304
|
}
|
2305
|
else
|
2306
|
{
|
2307
|
$Alogin[$i] = "$Aextension[$i]-----$i";
|
2308
|
}
|
2309
|
$i++;
|
2310
|
}
|
2311
|
|
2312
|
### Sort by phone if selected
|
2313
|
if ($orderby=='phoneup')
|
2314
|
{
|
2315
|
sort($Alogin);
|
2316
|
}
|
2317
|
if ($orderby=='phonedown')
|
2318
|
{
|
2319
|
rsort($Alogin);
|
2320
|
}
|
2321
|
|
2322
|
### Run through the loop to display agents
|
2323
|
$j=0;
|
2324
|
$agentcount=0;
|
2325
|
while ($j < $talking_to_print)
|
2326
|
{
|
2327
|
$n=0;
|
2328
|
$custphone='';
|
2329
|
while ($n < $calls_to_list)
|
2330
|
{
|
2331
|
if ( (ereg("$VAClead_ids[$n]", $Alead_id[$j])) and (strlen($VAClead_ids[$n]) == strlen($Alead_id[$j])) )
|
2332
|
{$custphone = $VACphones[$n];}
|
2333
|
$n++;
|
2334
|
}
|
2335
|
|
2336
|
$phone_split = explode("-----",$Alogin[$j]);
|
2337
|
$i = $phone_split[1];
|
2338
|
|
2339
|
if (eregi("READY|PAUSED",$Astatus[$i]))
|
2340
|
{
|
2341
|
$Acall_time[$i]=$Astate_change[$i];
|
2342
|
|
2343
|
if ($Alead_id[$i] > 0)
|
2344
|
{
|
2345
|
$Astatus[$i] = 'DISPO';
|
2346
|
$Lstatus = 'DISPO';
|
2347
|
$status = ' DISPO';
|
2348
|
}
|
2349
|
}
|
2350
|
if ($non_latin < 1)
|
2351
|
{
|
2352
|
$extension = eregi_replace('Local/',"",$Aextension[$i]);
|
2353
|
$extension = sprintf("%-14s", $extension);
|
2354
|
while(strlen($extension)>14) {$extension = substr("$extension", 0, -1);}
|
2355
|
}
|
2356
|
else
|
2357
|
{
|
2358
|
$extension = eregi_replace('Local/',"",$Aextension[$i]);
|
2359
|
$extension = sprintf("%-48s", $extension);
|
2360
|
while(mb_strlen($extension, 'utf-8')>14) {$extension = mb_substr("$extension", 0, -1,'utf8');}
|
2361
|
}
|
2362
|
|
2363
|
$phone = sprintf("%-12s", $phone_split[0]);
|
2364
|
$custphone = sprintf("%-11s", $custphone);
|
2365
|
$Luser = $Auser[$i];
|
2366
|
$user = sprintf("%-20s", $Auser[$i]);
|
2367
|
$Lsessionid = $Asessionid[$i];
|
2368
|
$sessionid = sprintf("%-9s", $Asessionid[$i]);
|
2369
|
$Lstatus = $Astatus[$i];
|
2370
|
$status = sprintf("%-6s", $Astatus[$i]);
|
2371
|
$Lserver_ip = $Aserver_ip[$i];
|
2372
|
$server_ip = sprintf("%-15s", $Aserver_ip[$i]);
|
2373
|
$call_server_ip = sprintf("%-15s", $Acall_server_ip[$i]);
|
2374
|
$campaign_id = sprintf("%-10s", $Acampaign_id[$i]);
|
2375
|
$comments= $Acomments[$i];
|
2376
|
$calls_today = sprintf("%-5s", $Acalls_today[$i]);
|
2377
|
|
2378
|
if (!ereg("N",$agent_pause_codes_active))
|
2379
|
{$pausecode=' ';}
|
2380
|
else
|
2381
|
{$pausecode='';}
|
2382
|
|
2383
|
if (eregi("INCALL",$Lstatus))
|
2384
|
{
|
2385
|
$stmtP="select count(*) from parked_channels where channel_group='$Acallerid[$i]';";
|
2386
|
$rsltP=mysql_query($stmtP,$link);
|
2387
|
$rowP=mysql_fetch_row($rsltP);
|
2388
|
$parked_channel = $rowP[0];
|
2389
|
|
2390
|
if ($parked_channel > 0)
|
2391
|
{
|
2392
|
$Astatus[$i] = 'PARK';
|
2393
|
$Lstatus = 'PARK';
|
2394
|
$status = ' PARK ';
|
2395
|
}
|
2396
|
else
|
2397
|
{
|
2398
|
if (!ereg("$Acallerid[$i]\|",$callerids))
|
2399
|
{
|
2400
|
$Acall_time[$i]=$Astate_change[$i];
|
2401
|
|
2402
|
$Astatus[$i] = 'DEAD';
|
2403
|
$Lstatus = 'DEAD';
|
2404
|
$status = ' DEAD ';
|
2405
|
}
|
2406
|
}
|
2407
|
|
2408
|
if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) )
|
2409
|
{$CM='A';}
|
2410
|
else
|
2411
|
{
|
2412
|
if (eregi("INBOUND",$comments))
|
2413
|
{$CM='I';}
|
2414
|
else
|
2415
|
{$CM='M';}
|
2416
|
}
|
2417
|
}
|
2418
|
else {$CM=' ';}
|
2419
|
|
2420
|
if ($UGdisplay > 0)
|
2421
|
{
|
2422
|
if ($non_latin < 1)
|
2423
|
{
|
2424
|
$user_group = sprintf("%-12s", $Auser_group[$i]);
|
2425
|
while(strlen($user_group)>12) {$user_group = substr("$user_group", 0, -1);}
|
2426
|
}
|
2427
|
else
|
2428
|
{
|
2429
|
$user_group = sprintf("%-40s", $Auser_group[$i]);
|
2430
|
while(mb_strlen($user_group, 'utf-8')>12) {$user_group = mb_substr("$user_group", 0, -1,'utf8');}
|
2431
|
}
|
2432
|
}
|
2433
|
if ($UidORname > 0)
|
2434
|
{
|
2435
|
if ($non_latin < 1)
|
2436
|
{
|
2437
|
$user = sprintf("%-20s", $Afull_name[$i]);
|
2438
|
while(strlen($user)>20) {$user = substr("$user", 0, -1);}
|
2439
|
}
|
2440
|
else
|
2441
|
{
|
2442
|
$user = sprintf("%-60s", $Afull_name[$i]);
|
2443
|
while(mb_strlen($user, 'utf-8')>20) {$user = mb_substr("$user", 0, -1,'utf8');}
|
2444
|
}
|
2445
|
}
|
2446
|
if (!eregi("INCALL|QUEUE|PARK|3-WAY",$Astatus[$i]))
|
2447
|
{$call_time_S = ($STARTtime - $Astate_change[$i]);}
|
2448
|
else if (eregi("3-WAY",$Astatus[$i]))
|
2449
|
{$call_time_S = ($STARTtime - $Acall_mostrecent[$i]);}
|
2450
|
else
|
2451
|
{$call_time_S = ($STARTtime - $Acall_time[$i]);}
|
2452
|
|
2453
|
$call_time_MS = sec_convert($call_time_S,'M');
|
2454
|
$call_time_MS = sprintf("%7s", $call_time_MS);
|
2455
|
$call_time_MS = " $call_time_MS";
|
2456
|
$G = ''; $EG = '';
|
2457
|
if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') )
|
2458
|
{
|
2459
|
if ($call_time_S >= 10) {$G='<SPAN class="thistle"><B>'; $EG='</B></SPAN>';}
|
2460
|
if ($call_time_S >= 60) {$G='<SPAN class="violet"><B>'; $EG='</B></SPAN>';}
|
2461
|
if ($call_time_S >= 300) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
|
2462
|
# if ($call_time_S >= 600) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
|
2463
|
}
|
2464
|
if ($Lstatus=='3-WAY')
|
2465
|
{
|
2466
|
if ($call_time_S >= 10) {$G='<SPAN class="lime"><B>'; $EG='</B></SPAN>';}
|
2467
|
}
|
2468
|
if ($Lstatus=='DEAD')
|
2469
|
{
|
2470
|
if ($call_time_S >= 21600)
|
2471
|
{$j++; continue;}
|
2472
|
else
|
2473
|
{
|
2474
|
$agent_dead++; $agent_total++;
|
2475
|
$G=''; $EG='';
|
2476
|
if ($call_time_S >= 10) {$G='<SPAN class="black"><B>'; $EG='</B></SPAN>';}
|
2477
|
}
|
2478
|
}
|
2479
|
if ($Lstatus=='DISPO')
|
2480
|
{
|
2481
|
if ($call_time_S >= 21600)
|
2482
|
{$j++; continue;}
|
2483
|
else
|
2484
|
{
|
2485
|
$agent_dispo++; $agent_total++;
|
2486
|
$G=''; $EG='';
|
2487
|
if ($call_time_S >= 10) {$G='<SPAN class="khaki"><B>'; $EG='</B></SPAN>';}
|
2488
|
if ($call_time_S >= 60) {$G='<SPAN class="yellow"><B>'; $EG='</B></SPAN>';}
|
2489
|
if ($call_time_S >= 300) {$G='<SPAN class="olive"><B>'; $EG='</B></SPAN>';}
|
2490
|
}
|
2491
|
}
|
2492
|
if ($Lstatus=='PAUSED')
|
2493
|
{
|
2494
|
if (!ereg("N",$agent_pause_codes_active))
|
2495
|
{
|
2496
|
$twentyfour_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-24,date("i"),date("s"),date("m"),date("d"),date("Y")));
|
2497
|
$stmtC="select sub_status from vicidial_agent_log where agent_log_id >= \"$Aagent_log_id[$i]\" and user='$Luser' order by agent_log_id desc limit 1;";
|
2498
|
$rsltC=mysql_query($stmtC,$link);
|
2499
|
$rowC=mysql_fetch_row($rsltC);
|
2500
|
$pausecode = sprintf("%-6s", $rowC[0]);
|
2501
|
$pausecode = "$pausecode ";
|
2502
|
}
|
2503
|
else
|
2504
|
{$pausecode='';}
|
2505
|
|
2506
|
if ($call_time_S >= 21600)
|
2507
|
{$j++; continue;}
|
2508
|
else
|
2509
|
{
|
2510
|
$agent_paused++; $agent_total++;
|
2511
|
$G=''; $EG='';
|
2512
|
if ($call_time_S >= 10) {$G='<SPAN class="khaki"><B>'; $EG='</B></SPAN>';}
|
2513
|
if ($call_time_S >= 60) {$G='<SPAN class="yellow"><B>'; $EG='</B></SPAN>';}
|
2514
|
if ($call_time_S >= 300) {$G='<SPAN class="olive"><B>'; $EG='</B></SPAN>';}
|
2515
|
}
|
2516
|
}
|
2517
|
# if ( (strlen($Acall_server_ip[$i])> 4) and ($Acall_server_ip[$i] != "$Aserver_ip[$i]") )
|
2518
|
# {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';}
|
2519
|
|
2520
|
if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) or (eregi("3-WAY",$status)) or (eregi("PARK",$status))) {$agent_incall++; $agent_total++;}
|
2521
|
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;}
|
2522
|
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) )
|
2523
|
{
|
2524
|
$G='<SPAN class="lightblue"><B>'; $EG='</B></SPAN>';
|
2525
|
if ($call_time_S >= 60) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';}
|
2526
|
if ($call_time_S >= 300) {$G='<SPAN class="midnightblue"><B>'; $EG='</B></SPAN>';}
|
2527
|
}
|
2528
|
|
2529
|
if ($Astatus[$i] == 'RING')
|
2530
|
{
|
2531
|
$agent_total++;
|
2532
|
$G=''; $EG='';
|
2533
|
if ($call_time_S >= 0) {$G='<SPAN class="salmon"><B>'; $EG='</B></SPAN>';}
|
2534
|
}
|
2535
|
|
2536
|
$L='';
|
2537
|
$R='';
|
2538
|
if ($SIPmonitorLINK>0) {$L=" <a href=\"sip:0$Lsessionid@$server_ip\">LISTEN</a>"; $R='';}
|
2539
|
if ($IAXmonitorLINK>0) {$L=" <a href=\"iax:0$Lsessionid@$server_ip\">LISTEN</a>"; $R='';}
|
2540
|
if ($SIPmonitorLINK>1) {$R=" | <a href=\"sip:$Lsessionid@$server_ip\">BARGE</a>";}
|
2541
|
if ($IAXmonitorLINK>1) {$R=" | <a href=\"iax:$Lsessionid@$server_ip\">BARGE</a>";}
|
2542
|
if ( (strlen($monitor_phone)>1) and (preg_match("/MONITOR|BARGE/",$monitor_active) ) )
|
2543
|
{$L=" <a href=\"javascript:send_monitor('$Lsessionid','$Lserver_ip','MONITOR');\">LISTEN</a>"; $R='';}
|
2544
|
if ( (strlen($monitor_phone)>1) and (preg_match("/BARGE/",$monitor_active) ) )
|
2545
|
{$R=" | <a href=\"javascript:send_monitor('$Lsessionid','$Lserver_ip','BARGE');\">BARGE</a>";}
|
2546
|
|
2547
|
if ($CUSTPHONEdisplay > 0) {$CP = " $G$custphone$EG |";}
|
2548
|
else {$CP = "";}
|
2549
|
|
2550
|
if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";}
|
2551
|
else {$UGD = "";}
|
2552
|
|
2553
|
if ($SERVdisplay > 0) {$SVD = " $G$server_ip$EG | $G$call_server_ip$EG |";}
|
2554
|
else {$SVD = "";}
|
2555
|
|
2556
|
if ($PHONEdisplay > 0) {$phoneD = "$G$phone$EG | ";}
|
2557
|
else {$phoneD = " ";}
|
2558
|
|
2559
|
$vac_stage='';
|
2560
|
$vac_campaign='';
|
2561
|
$INGRP='';
|
2562
|
if ($CM == 'I')
|
2563
|
{
|
2564
|
$stmt="select vac.campaign_id,vac.stage,vig.group_name from vicidial_auto_calls vac,vicidial_inbound_groups vig where vac.callerid='$Acallerid[$i]' and vac.campaign_id=vig.group_id LIMIT 1;";
|
2565
|
$rslt=mysql_query($stmt, $link);
|
2566
|
if ($DB) {echo "$stmt\n";}
|
2567
|
$ingrp_to_print = mysql_num_rows($rslt);
|
2568
|
if ($ingrp_to_print > 0)
|
2569
|
{
|
2570
|
$row=mysql_fetch_row($rslt);
|
2571
|
$vac_campaign = sprintf("%-20s", "$row[0] - $row[2]");
|
2572
|
$row[1] = eregi_replace(".*-",'',$row[1]);
|
2573
|
$vac_stage = sprintf("%-4s", $row[1]);
|
2574
|
}
|
2575
|
|
2576
|
$INGRP = " $G$vac_stage$EG | $G$vac_campaign$EG ";
|
2577
|
}
|
2578
|
|
2579
|
$agentcount++;
|
2580
|
|
2581
|
if ($realtime_block_user_info > 0)
|
2582
|
{
|
2583
|
$Aecho .= "|$UGD $G$sessionid$EG$L$R$Aring_note[$i]| $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n";
|
2584
|
}
|
2585
|
if ($realtime_block_user_info < 1)
|
2586
|
{
|
2587
|
$Aecho .= "| $G$extension$EG$Aring_note[$i]|$phoneD<a href=\"./user_status.php?user=$Luser\" target=\"_blank\">$G$user$EG</a> <a href=\"javascript:ingroup_info('$Luser','$j');\">+</a> |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n";
|
2588
|
}
|
2589
|
$j++;
|
2590
|
}
|
2591
|
|
2592
|
$Aecho .= "$Aline";
|
2593
|
$Aecho .= " $agentcount agents logged in on all servers\n";
|
2594
|
$Aecho .= " System Load Average: $load_ave \n\n";
|
2595
|
|
2596
|
# $Aecho .= " <SPAN class=\"orange\"><B> </SPAN> - Balanced call</B>\n";
|
2597
|
$Aecho .= " <SPAN class=\"lightblue\"><B> </SPAN> - Agent waiting for call</B>\n";
|
2598
|
$Aecho .= " <SPAN class=\"blue\"><B> </SPAN> - Agent waiting for call > 1 minute</B>\n";
|
2599
|
$Aecho .= " <SPAN class=\"midnightblue\"><B> </SPAN> - Agent waiting for call > 5 minutes</B>\n";
|
2600
|
$Aecho .= " <SPAN class=\"thistle\"><B> </SPAN> - Agent on call > 10 seconds</B>\n";
|
2601
|
$Aecho .= " <SPAN class=\"violet\"><B> </SPAN> - Agent on call > 1 minute</B>\n";
|
2602
|
$Aecho .= " <SPAN class=\"purple\"><B> </SPAN> - Agent on call > 5 minutes</B>\n";
|
2603
|
$Aecho .= " <SPAN class=\"khaki\"><B> </SPAN> - Agent Paused > 10 seconds</B>\n";
|
2604
|
$Aecho .= " <SPAN class=\"yellow\"><B> </SPAN> - Agent Paused > 1 minute</B>\n";
|
2605
|
$Aecho .= " <SPAN class=\"olive\"><B> </SPAN> - Agent Paused > 5 minutes</B>\n";
|
2606
|
$Aecho .= " <SPAN class=\"lime\"><B> </SPAN> - Agent in 3-WAY > 10 seconds</B>\n";
|
2607
|
$Aecho .= " <SPAN class=\"black\"><B> </SPAN> - Agent on a dead call</B>\n";
|
2608
|
|
2609
|
if ($ring_agents > 0)
|
2610
|
{
|
2611
|
$Aecho .= " <SPAN class=\"salmon\"><B> </SPAN> - Agent phone ringing</B>\n";
|
2612
|
$Aecho .= " <SPAN><B>* Denotes on-hook agent</B></SPAN>\n";
|
2613
|
}
|
2614
|
|
2615
|
if ($agent_ready > 0) {$B='<FONT class="b1">'; $BG='</FONT>';}
|
2616
|
if ($agent_ready > 4) {$B='<FONT class="b2">'; $BG='</FONT>';}
|
2617
|
if ($agent_ready > 9) {$B='<FONT class="b3">'; $BG='</FONT>';}
|
2618
|
if ($agent_ready > 14) {$B='<FONT class="b4">'; $BG='</FONT>';}
|
2619
|
|
2620
|
|
2621
|
echo "\n<BR>\n";
|
2622
|
|
2623
|
echo "$NFB$agent_total$NFE agents logged in \n";
|
2624
|
echo "$NFB$agent_incall$NFE agents in calls \n";
|
2625
|
echo "$NFB$B $agent_ready $BG$NFE agents waiting \n";
|
2626
|
echo "$NFB$agent_paused$NFE paused agents \n";
|
2627
|
echo "$NFB$agent_dead$NFE agents in dead calls \n";
|
2628
|
echo "$NFB$agent_dispo$NFE agents in dispo \n";
|
2629
|
|
2630
|
echo "<PRE><FONT SIZE=2>";
|
2631
|
echo "";
|
2632
|
echo "$Cecho";
|
2633
|
echo "$Aecho";
|
2634
|
}
|
2635
|
else
|
2636
|
{
|
2637
|
echo " NO AGENTS ON CALLS \n";
|
2638
|
echo "<PRE>$Cecho";
|
2639
|
}
|
2640
|
|
2641
|
echo "</PRE>";
|
2642
|
|
2643
|
if ($RTajax < 1)
|
2644
|
{
|
2645
|
echo "</TD></TR></TABLE>";
|
2646
|
}
|
2647
|
?>
|
2648
|
|
2649
|
<?php
|
2650
|
#echo "</TD></TR></TABLE>\n";
|
2651
|
#echo "</TD></TR></TABLE>\n";
|
2652
|
#echo "</TD></TR></TABLE>\n";
|
2653
|
#require("admin_footer.php");
|
2654
|
?>
|
2655
|
|
2656
|
</BODY></HTML>
|