added new closer/inbound service level report
started work on timeclock feature, added auto-generate UserIDs and shifts to admin.php git-svn-id: svn://192.168.202.10@864 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -108,6 +108,11 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
|
||||
21. Added collection of hangup reasons for inbound and outbound calls in the
|
||||
vicidial_log and vicidial_closer_log tables
|
||||
|
||||
22. The start of a new timeclock feature (not finished), including the addition
|
||||
of shifts to VICIDIAL user groups and the ability to auto-generate
|
||||
user IDs as you are adding users to the system.
|
||||
|
||||
23. Added a new inbound/closer report for showing service levels
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ if (length($ARGV[0])>1)
|
||||
if ($args =~ /--help/i)
|
||||
{
|
||||
print "allowed run time options:\n";
|
||||
print " [--all] = *DEFAULT* show GMT offset of records as they are inserted into hopper\n";
|
||||
print " [--db-only] = only backup the database\n";
|
||||
print " [--conf-only] = only backup the asterisk conf files\n";
|
||||
print " [--without-db] = do not backup the database\n";
|
||||
|
||||
@@ -2,27 +2,7 @@
|
||||
#
|
||||
# AST_conf_update.pl version 2.0.5 *DBI-version*
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# uses the Asterisk Manager interface and Net::MySQL to update whether a conference
|
||||
# is still in use or not. If not in use 3 times in a row the extension in the
|
||||
# conferences DB record is erased freeing that conference to be used again
|
||||
#
|
||||
# SUMMARY:
|
||||
# This program was designed for people using the Asterisk PBX with conferences
|
||||
#
|
||||
# This program should be in the cron running every minute (like AST_vm_update.pl)
|
||||
#
|
||||
# For this program to work you need to have the "asterisk" MySQL database
|
||||
# created with the conferences table in it, also make sure
|
||||
# that the account running this program has read/write/update/delete access
|
||||
# to that database
|
||||
#
|
||||
# It is recommended that you run this program on the local Asterisk machine
|
||||
#
|
||||
# If this script is run ever minute there is a theoretical limit of
|
||||
# 600 conferences that it can check due to the wait interval. If you have
|
||||
# more than this either change the cron when this script is run or change the
|
||||
# wait interval below
|
||||
# This script checks if there are channels in reserved conferences
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
@@ -30,6 +10,7 @@
|
||||
# 50823-1456 - Added commandline arguments for debug at runtime
|
||||
# 60717-1135 - changed to DBI by Marin Blu
|
||||
# 60717-1536 - changed to use /etc/astguiclient.conf for configs
|
||||
# 80506-1055 - Added check for vicidial_conferences in 3WAY
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -157,7 +138,116 @@ if ($sthArows > 0)
|
||||
$sthA->finish();
|
||||
|
||||
|
||||
######################################################################
|
||||
##### CHECK vicidial_conferences TABLE #####
|
||||
######################################################################
|
||||
@PTextensions=@MT; @PT_conf_extens=@MT; @PTmessages=@MT; @PTold_messages=@MT; @NEW_messages=@MT; @OLD_messages=@MT;
|
||||
$stmtA = "SELECT extension,conf_exten from vicidial_conferences where server_ip='$server_ip' and extension LIKE \"3WAY%\";";
|
||||
if ($DB) {print "|$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$rec_count=0;
|
||||
while ($sthArows > $rec_count)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$PTextensions[$rec_count] = "$aryA[0]";
|
||||
$PT_conf_extens[$rec_count] = "$aryA[1]";
|
||||
if ($DB) {print "|$PT_conf_extens[$rec_count]|$PTextensions[$rec_count]|\n";}
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if (!$telnet_port) {$telnet_port = '5038';}
|
||||
|
||||
### connect to asterisk manager through telnet
|
||||
$t = new Net::Telnet (Port => $telnet_port,
|
||||
Prompt => '/.*[\$%#>] $/',
|
||||
Output_record_separator => '',);
|
||||
#$fh = $t->dump_log("$telnetlog"); # uncomment for telnet log
|
||||
if (length($ASTmgrUSERNAMEsend) > 3) {$telnet_login = $ASTmgrUSERNAMEsend;}
|
||||
else {$telnet_login = $ASTmgrUSERNAME;}
|
||||
|
||||
$t->open("$telnet_host");
|
||||
$t->waitfor('/[01]\n$/'); # print login
|
||||
$t->print("Action: Login\nUsername: $telnet_login\nSecret: $ASTmgrSECRET\n\n");
|
||||
$t->waitfor('/Authentication accepted/'); # waitfor auth accepted
|
||||
|
||||
|
||||
$i=0;
|
||||
foreach(@PTextensions)
|
||||
{
|
||||
@list_channels=@MT;
|
||||
$t->buffer_empty;
|
||||
$COMMAND = "Action: Command\nCommand: Meetme list $PT_conf_extens[$i]\n\nAction: Ping\n\n";
|
||||
if ($DB) {print "|$PT_conf_extens[$i]|$COMMAND|\n";}
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/Response: Pong.*/');
|
||||
|
||||
|
||||
$j=0;
|
||||
$conf_empty[$i]=0;
|
||||
$conf_users[$i]='';
|
||||
foreach(@list_channels)
|
||||
{
|
||||
if($DB){print "|$list_channels[$j]|\n";}
|
||||
if ($list_channels[$j] =~ /No active conferences|No such conference/i)
|
||||
{$conf_empty[$i]++;}
|
||||
# if ($list_channels[$j] =~ /^User /i)
|
||||
# {
|
||||
# $userx = '';
|
||||
# $userx = $list_channels[$j];
|
||||
# $userx =~ s/User \#: //gi;
|
||||
# $conf_users[$i] .= "$userx|";
|
||||
# }
|
||||
$j++;
|
||||
}
|
||||
|
||||
if($DB){print "Meetme list $PT_conf_extens[$i]- Exten:|$PTextensions[$i]| Empty:|$conf_empty[$i]| ";}
|
||||
if (!$conf_empty[$i])
|
||||
{
|
||||
if($DB){print "CONFERENCE STILL HAS PARTICIPANTS, DOING NOTHING FOR THIS CONFERENCE\n";}
|
||||
if ($PTextensions[$i] =~ /Xtimeout\d$/i)
|
||||
{
|
||||
$PTextensions[$i] =~ s/Xtimeout\d$//gi;
|
||||
$stmtA = "UPDATE vicidial_conferences set extension='$PTextensions[$i]' where server_ip='$server_ip' and conf_exten='$PT_conf_extens[$i]';";
|
||||
if($DB){print STDERR "\n|$stmtA|\n";}
|
||||
$affected_rows = $dbhA->do($stmtA); # or die "Couldn't execute query:|$stmtA|\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$NEWexten[$i] = $PTextensions[$i];
|
||||
if ($PTextensions[$i] =~ /Xtimeout3$/i) {$NEWexten[$i] =~ s/Xtimeout3$/Xtimeout2/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout2$/i) {$NEWexten[$i] =~ s/Xtimeout2$/Xtimeout1/gi;}
|
||||
if ($PTextensions[$i] =~ /Xtimeout1$/i) {$NEWexten[$i] = '';}
|
||||
if ( ($PTextensions[$i] !~ /Xtimeout\d$/i) and (length($PTextensions[$i])> 0) ) {$NEWexten[$i] .= 'Xtimeout3';}
|
||||
|
||||
|
||||
$stmtA = "UPDATE vicidial_conferences set extension='$NEWexten[$i]' where server_ip='$server_ip' and conf_exten='$PT_conf_extens[$i]';";
|
||||
if($DB){print STDERR "\n|$stmtA|\n";}
|
||||
$affected_rows = $dbhA->do($stmtA); # or die "Couldn't execute query:|$stmtA|\n";
|
||||
}
|
||||
|
||||
$i++;
|
||||
### sleep for 10 hundredths of a second
|
||||
usleep(1*100*1000);
|
||||
}
|
||||
|
||||
$t->buffer_empty;
|
||||
@hangup = $t->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/");
|
||||
$t->buffer_empty;
|
||||
$ok = $t->close;
|
||||
|
||||
|
||||
sleep(5);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
######################################################################
|
||||
##### CHECK conferences TABLE #####
|
||||
######################################################################
|
||||
@PTextensions=@MT; @PT_conf_extens=@MT; @PTmessages=@MT; @PTold_messages=@MT; @NEW_messages=@MT; @OLD_messages=@MT;
|
||||
$stmtA = "SELECT extension,conf_exten from conferences where server_ip='$server_ip' and extension is NOT NULL and extension != '';";
|
||||
if ($DB) {print "|$stmtA|\n";}
|
||||
@@ -262,6 +352,3 @@ if($DB){print "DONE... Exiting... Goodbye... See you later... \n";}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -32,15 +32,15 @@ PHASE 1: INSTALLING ASTERISK
|
||||
mkdir /usr/src/asterisk
|
||||
cd /usr/src/asterisk
|
||||
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.27.tar.gz
|
||||
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.24.tar.gz
|
||||
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.25.tar.gz
|
||||
wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.7.tar.gz
|
||||
gunzip asterisk-1.2.27.tar.gz
|
||||
tar xvf asterisk-1.2.27.tar
|
||||
gunzip zaptel-1.2.24.tar.gz
|
||||
tar xvf zaptel-1.2.24.tar
|
||||
gunzip zaptel-1.2.25.tar.gz
|
||||
tar xvf zaptel-1.2.25.tar
|
||||
gunzip libpri-1.2.7.tar.gz
|
||||
tar xvf libpri-1.2.7.tar
|
||||
cd ./zaptel-1.2.24
|
||||
cd ./zaptel-1.2.25
|
||||
wget http://www.freedomphones.net/files/newt-0.51.6.tar.gz
|
||||
gunzip newt-0.51.6.tar.gz
|
||||
tar xvf newt-0.51.6.tar
|
||||
|
||||
@@ -505,16 +505,16 @@ rm -f /usr/lib/asterisk/modules/res_speech.so
|
||||
|
||||
mkdir /usr/src/asterisk-1.4
|
||||
cd /usr/src/asterisk-1.4
|
||||
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.4.18.tar.gz
|
||||
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.4.8.tar.gz
|
||||
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.4.19.tar.gz
|
||||
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.4.9.tar.gz
|
||||
wget http://ftp.digium.com/pub/libpri/releases/libpri-1.4.3.tar.gz
|
||||
gunzip asterisk-1.4.18.tar.gz
|
||||
tar xvf asterisk-1.4.18.tar
|
||||
gunzip zaptel-1.4.8.tar.gz
|
||||
tar xvf zaptel-1.4.8.tar
|
||||
gunzip zaptel-1.4.9.tar.gz
|
||||
tar xvf zaptel-1.4.9.tar
|
||||
gunzip libpri-1.4.3.tar.gz
|
||||
tar xvf libpri-1.4.3.tar
|
||||
cd ./zaptel-1.4.8
|
||||
cd ./zaptel-1.4.9
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
@@ -893,12 +893,12 @@ with the following patch:
|
||||
- cd /usr/src/asterisk
|
||||
A. if you want 1.2 release (reliable with new features):
|
||||
- wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.27.tar.gz
|
||||
- wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.24.tar.gz
|
||||
- wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.25.tar.gz
|
||||
- wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.5.tar.gz
|
||||
- gunzip asterisk-1.2.27.tar.gz
|
||||
- tar xvf asterisk-1.2.27.tar
|
||||
- gunzip zaptel-1.2.24.tar.gz
|
||||
- tar xvf zaptel-1.2.24.tar
|
||||
- gunzip zaptel-1.2.25.tar.gz
|
||||
- tar xvf zaptel-1.2.25.tar
|
||||
- gunzip libpri-1.2.5.tar.gz
|
||||
- tar xvf libpri-1.2.5.tar
|
||||
B. if you want latest SVN_1.2 version (release tree with new patches)
|
||||
@@ -923,7 +923,7 @@ with the following patch:
|
||||
edit this line at the top and just add a hash # in front of it as shown:
|
||||
#PBX_LIBS+=$(shell $(CROSS_COMPILE_BIN)gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
|
||||
|
||||
- cd ./zaptel-1.2.24
|
||||
- cd ./zaptel-1.2.25
|
||||
- make clean
|
||||
- make
|
||||
- make install
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
Timeclock process flow 2008-05-12
|
||||
|
||||
** THIS TIMECLOCK FUNCTIONALITY PROSESS IS PLANNED FOR THE 2.0.5 RELEASE **
|
||||
|
||||
This will outline the process I have thought through for adding a timeclock component to the VICIDIAL system. The objective is to add the following features to make VICIDIAL a more well-rounded product:
|
||||
- Allow vicidial users to clock-in to the system
|
||||
- Add a SHIFT section to administration
|
||||
- Allow restrictions of agent-login by shift
|
||||
- Allow ability to not allow agents to log-in to any VICIDIAL page(admin or agent) without clocking in.
|
||||
- Have reports showing all timeclock totals for various parameters(user-group/campaign/time-period/in-groups/etc...)
|
||||
- ability to allow managers to alter timeclock records with audit trail
|
||||
- reports showing user log activity outside of shift timeframes
|
||||
|
||||
|
||||
Description:
|
||||
|
||||
The first new feature to be added to help with the overall adoption of this feature is the ability to have the system optionally generate unique userIDs as users are entered into the system. For this purpose a new auto-generate option has been added to the add-a-new-user and copy-user functions. This auto-generate feature will take the auto_user_add_value field in the system_settings table and check to see if an agent with that ID exists in the system. If they do, then 7 will be added to the number and checked again until a non-used number is found.
|
||||
|
||||
To facilitate more workforce management, as is desired with the addition of a timeclock function to VICIDIAL, I have decided to add a SHIFT structure to the system as well. This should allow for scheduling of user_groups of agents and will have the ability to not allow them to login if they try to login outside of their scheduled hours. A shift will have a start time and a length(to make running over midnight easier) as well as a list of the days of the week that the shift applies. Each user-group can have multiple shifts activated for it, for instance you may want a Monday-Friday shift of 9AM-5PM and a Saturday shift of 10AM to 4PM. In this case the user-group would have two shifts selected. Some reports will also be viewable by shift as well.
|
||||
|
||||
|
||||
More to come...
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
The Database Changes:
|
||||
|
||||
# add field for auto-increment of users
|
||||
ALTER TABLE system_settings ADD auto_user_add_value INT(9) UNSIGNED default '101';
|
||||
UPDATE system_settings SET auto_user_add_value='2110';
|
||||
|
||||
# This table contains system shift information
|
||||
CREATE TABLE vicidial_shifts (
|
||||
shift_id VARCHAR(20) NOT NULL,
|
||||
shift_name VARCHAR(50),
|
||||
shift_start_time VARCHAR(4) default '0900',
|
||||
shift_length VARCHAR(5) default '16:00',
|
||||
shift_weekdays VARCHAR(7) default '0123456',
|
||||
index (shift_id)
|
||||
);
|
||||
|
||||
# add field for allowable shifts for user groups
|
||||
ALTER TABLE vicidial_user_groups ADD group_shifts TEXT;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# This table contains the log of timeclock activity
|
||||
CREATE TABLE vicidial_timeclock_log (
|
||||
timeclock_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
event_epoch INT(10) UNSIGNED NOT NULL,
|
||||
event_date TIMESTAMP NOT NULL,
|
||||
event VARCHAR(50) NOT NULL,
|
||||
user VARCHAR(20) NOT NULL,
|
||||
user_group VARCHAR(20) NOT NULL,
|
||||
ip_address VARCHAR(15),
|
||||
shift_id VARCHAR(20),
|
||||
notes VARCHAR(255),
|
||||
manager_user VARCHAR(20),
|
||||
manager_ip VARCHAR(15),
|
||||
index (user)
|
||||
);
|
||||
|
||||
# This table contains the current timeclock status of a user
|
||||
CREATE TABLE vicidial_timeclock_status (
|
||||
user VARCHAR(20) UNIQUE NOT NULL,
|
||||
user_group VARCHAR(20) NOT NULL,
|
||||
event_epoch INT(10) UNSIGNED,
|
||||
event_date TIMESTAMP,
|
||||
status VARCHAR(50),
|
||||
ip_address VARCHAR(15),
|
||||
shift_id VARCHAR(20),
|
||||
index (user)
|
||||
);
|
||||
|
||||
@@ -472,7 +472,8 @@ user_group VARCHAR(20) NOT NULL,
|
||||
group_name VARCHAR(40) NOT NULL,
|
||||
allowed_campaigns TEXT,
|
||||
qc_allowed_campaigns TEXT,
|
||||
qc_allowed_inbound_groups TEXT
|
||||
qc_allowed_inbound_groups TEXT,
|
||||
group_shifts TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_campaigns (
|
||||
@@ -943,7 +944,8 @@ vicidial_agent_disable ENUM('NOT_ACTIVE','LIVE_AGENT','EXTERNAL','ALL') default
|
||||
allow_sipsak_messages ENUM('0','1') default '0',
|
||||
admin_home_url VARCHAR(255) default '../vicidial/welcome.php',
|
||||
enable_agc_xfer_log ENUM('0','1') default '0',
|
||||
db_schema_version INT(8) UNSIGNED default '0'
|
||||
db_schema_version INT(8) UNSIGNED default '0',
|
||||
auto_user_add_value INT(9) UNSIGNED default '101',
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -1069,6 +1071,14 @@ alias_name VARCHAR(50),
|
||||
logins_list VARCHAR(255)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_shifts (
|
||||
shift_id VARCHAR(20) NOT NULL,
|
||||
shift_name VARCHAR(50),
|
||||
shift_start_time VARCHAR(4) default '0900',
|
||||
shift_length VARCHAR(5) default '16:00',
|
||||
shift_weekdays VARCHAR(7) default '0123456',
|
||||
index (shift_id)
|
||||
);
|
||||
|
||||
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
|
||||
|
||||
@@ -1083,6 +1093,9 @@ ALTER TABLE server_updater ENGINE=HEAP;
|
||||
ALTER TABLE web_client_sessions ENGINE=HEAP;
|
||||
|
||||
|
||||
UPDATE system_settings SET auto_user_add_value='1101';
|
||||
|
||||
|
||||
INSERT INTO vicidial_lists SET list_id='999',list_name='Default inbound list',campaign_id='TESTCAMP',active='N';
|
||||
|
||||
INSERT INTO system_settings (version,install_date) values('2.0.X', CURDATE());
|
||||
@@ -1116,4 +1129,5 @@ INSERT INTO vicidial_state_call_times SET state_call_time_id='utah',state_call_t
|
||||
INSERT INTO vicidial_state_call_times SET state_call_time_id='washington',state_call_time_state='WA',state_call_time_name='Washington 8am',sct_default_start='800',sct_default_stop='2100';
|
||||
INSERT INTO vicidial_state_call_times SET state_call_time_id='wyoming',state_call_time_state='WY',state_call_time_name='Wyoming 8am-8pm',sct_default_start='800',sct_default_stop='2000';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1083';
|
||||
UPDATE system_settings SET db_schema_version='1084';
|
||||
|
||||
|
||||
@@ -134,3 +134,19 @@ logins_list VARCHAR(255)
|
||||
);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1083';
|
||||
|
||||
ALTER TABLE system_settings ADD auto_user_add_value INT(9) UNSIGNED default '101';
|
||||
UPDATE system_settings SET auto_user_add_value='1101';
|
||||
|
||||
CREATE TABLE vicidial_shifts (
|
||||
shift_id VARCHAR(20) NOT NULL,
|
||||
shift_name VARCHAR(50),
|
||||
shift_start_time VARCHAR(4) default '0900',
|
||||
shift_length VARCHAR(5) default '16:00',
|
||||
shift_weekdays VARCHAR(7) default '0123456',
|
||||
index (shift_id)
|
||||
);
|
||||
|
||||
ALTER TABLE vicidial_user_groups ADD group_shifts TEXT;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1084';
|
||||
|
||||
@@ -111,6 +111,48 @@ Alias ID -<\/B> The ID of the alias used to allow for phone load balanced logins
|
||||
Alias Name -<\/B> The name used to describe a phones alias, Must be between 2 and 50 characters in length||
|
||||
Phones Logins List -<\/B> The comma separated list of phone logins used when an agent logs in using phone load balanced logins. The Agent application will find the active server with the fewest agents logged into it and place a call from that server to the agent upon login||
|
||||
PHONES WITHIN THIS PHONES ALIAS||
|
||||
Add New Shift||
|
||||
New Shift Addition||
|
||||
Modify Shift||
|
||||
Delete Shift||
|
||||
Shifts||
|
||||
Shift ID -<\/B> This is the short name of a Vicidial Shift Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters||
|
||||
Shift Name -<\/B> This is a more descriptive name of the Shift Definition. This is a short summary of the Shift definition. max 50 characters, minimum of 2 characters||
|
||||
Shift Start Time -<\/B> This is the time that the campaign shift begins. Must only be numbers, 9:30 AM would be 0930 and 5:00 PM would be 1700||
|
||||
Shift Length -<\/B> This is the time in Hours and Minutes that the campaign shift lasts. 8 hours would be 08:00 and 7 hours and 30 minutes would be 07:30||
|
||||
Shift Weekdays -<\/B> In this section you should choose the days of the week that this shift is active||
|
||||
Show Shifts||
|
||||
Add A New Shift||
|
||||
Shift ID: ||
|
||||
Shift Name: ||
|
||||
Shift Start Time: ||
|
||||
Shift End Time: ||
|
||||
SHIFT DEFINITION NOT ADDED||
|
||||
there is already a shift entry with this ID||
|
||||
Shift ID and name must be at least 2 characters in length||
|
||||
Shift Start Time must be 4 digits in length and be a valid time||
|
||||
Shift Length must be 5 characters in length and be 24 hours or less||
|
||||
SHIFT ADDED: ||
|
||||
MODIFY A SHIFT||
|
||||
USER GROUPS USING THIS SHIFT:||
|
||||
DELETE THIS SHIFT DEFINITION||
|
||||
MODIFY A SHIFT||
|
||||
SHIFT NOT DELETED||
|
||||
SHIFT DELETION CONFIRMATION: ||
|
||||
Click here to delete shift||
|
||||
SHIFT DELETION COMPLETED:||
|
||||
SHIFT MODIFIED||
|
||||
SHIFT LISTINGS:||
|
||||
Shift Weekdays: ||
|
||||
Sunday||
|
||||
Monday||
|
||||
Tuesday||
|
||||
Wednesday||
|
||||
Thursday||
|
||||
Friday||
|
||||
Saturday||
|
||||
Group Shifts: ||
|
||||
Group Shifts -<\/B> This is a selectable list of shifts that can restrict the agents login time on the system||
|
||||
|
||||
|
||||
############################################################ CLIENT
|
||||
|
||||
@@ -753,6 +753,181 @@ if ($ACTION=="RedirectXtraCX")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($ACTION=="RedirectXtraNeW")
|
||||
{
|
||||
if ($channel=="$extrachannel")
|
||||
{$ACTION="Redirect";}
|
||||
else
|
||||
{
|
||||
$row=''; $rowx='';
|
||||
$channel_liveX=1;
|
||||
$channel_liveY=1;
|
||||
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) or (strlen($session_id)<3) )
|
||||
{
|
||||
$channel_liveX=0;
|
||||
$channel_liveY=0;
|
||||
echo "One of these variables is not valid:\n";
|
||||
echo "Channel $channel must be greater than 2 characters\n";
|
||||
echo "ExtraChannel $extrachannel must be greater than 2 characters\n";
|
||||
echo "queryCID $queryCID must be greater than 14 characters\n";
|
||||
echo "exten $exten must be set\n";
|
||||
echo "ext_context $ext_context must be set\n";
|
||||
echo "ext_priority $ext_priority must be set\n";
|
||||
echo "session_id $session_id must be set\n";
|
||||
echo "\nRedirect Action not sent\n";
|
||||
if (ereg("SECOND|FIRST|DEBUG",$filename))
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
$fp = fopen ("./vicidial_debug.txt", "a");
|
||||
fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($exten == "NEXTAVAILABLE")
|
||||
{
|
||||
$stmt="SELECT conf_exten FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (strlen($row[0]) > 3)
|
||||
{
|
||||
$stmt="UPDATE vicidial_conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$exten = $row[0];
|
||||
|
||||
$stmt="UPDATE vicidial_conferences set extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$exten = $row[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$channel_liveX=0;
|
||||
echo "Cannot find empty conference on $server_ip, Redirect command not inserted\n";
|
||||
if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Cannot find empty conference on $server_ip";}
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;}
|
||||
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ( ($row[0]==0) && (!ereg("SECOND",$filename)) )
|
||||
{
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
$channel_liveX=0;
|
||||
echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n";
|
||||
if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $call_server_ip";}
|
||||
}
|
||||
}
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ( ($row[0]==0) && (!ereg("SECOND",$filename)) )
|
||||
{
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
$channel_liveY=0;
|
||||
echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n";
|
||||
if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $server_ip";}
|
||||
}
|
||||
}
|
||||
if ( ($channel_liveX==1) && ($channel_liveY==1) )
|
||||
{
|
||||
if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) )
|
||||
{
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "RedirectXtra command sent for Channel $channel and \nExtraChannel $extrachannel\n to $exten on $server_ip\n";
|
||||
if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten on $server_ip";}
|
||||
}
|
||||
else
|
||||
{
|
||||
$S='*';
|
||||
$D_s_ip = explode('.', $server_ip);
|
||||
if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
$dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten";
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "RedirectXtra command sent for Channel $channel on $call_server_ip and \nExtraChannel $extrachannel\n to $exten on $server_ip\n";
|
||||
if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($channel_liveX==1)
|
||||
{$ACTION="Redirect"; $server_ip = $call_server_ip;}
|
||||
if ($channel_liveY==1)
|
||||
{$ACTION="Redirect"; $channel=$extrachannel;}
|
||||
|
||||
}
|
||||
|
||||
if (ereg("SECOND|FIRST|DEBUG",$filename))
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
$fp = fopen ("./vicidial_debug.txt", "a");
|
||||
fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($ACTION=="RedirectXtra")
|
||||
{
|
||||
if ($channel=="$extrachannel")
|
||||
|
||||
@@ -0,0 +1,894 @@
|
||||
<?
|
||||
# AST_CLOSER_service_level.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 80509-0943 - First build
|
||||
# 80510-1500 - Added fixed scale hold time graph
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
||||
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
||||
if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
|
||||
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
$stmt="select group_id from vicidial_inbound_groups;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $groups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: black; background-color: #99FF99}
|
||||
.red {color: black; background-color: #FF9999}
|
||||
.orange {color: black; background-color: #FFCC99}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>VICIDIAL: VDAD Closer Service Level Stats</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
|
||||
echo " to <INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n";
|
||||
echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
$o=0;
|
||||
while ($groups_to_print > $o)
|
||||
{
|
||||
if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<SELECT SIZE=1 NAME=shift>\n";
|
||||
echo "<option selected value=\"$shift\">$shift</option>\n";
|
||||
echo "<option value=\"\">--</option>\n";
|
||||
echo "<option value=\"AM\">AM</option>\n";
|
||||
echo "<option value=\"PM\">PM</option>\n";
|
||||
echo "<option value=\"ALL\">ALL</option>\n";
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n\n";
|
||||
echo "PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ($shift == 'AM')
|
||||
{
|
||||
$time_BEGIN=$AM_shift_BEGIN;
|
||||
$time_END=$AM_shift_END;
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "15:15:00";}
|
||||
}
|
||||
if ($shift == 'PM')
|
||||
{
|
||||
$time_BEGIN=$PM_shift_BEGIN;
|
||||
$time_END=$PM_shift_END;
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "23:15:00";}
|
||||
}
|
||||
if ($shift == 'ALL')
|
||||
{
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "23:59:59";}
|
||||
}
|
||||
$query_date_BEGIN = "$query_date $time_BEGIN";
|
||||
$query_date_END = "$end_date $time_END";
|
||||
|
||||
|
||||
|
||||
echo "VICIDIAL: Closer Service-Level Stats $NOW_TIME\n";
|
||||
|
||||
echo "\n";
|
||||
echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- TOTALS\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $row[0]);
|
||||
if ( ($row[0] < 1) or ($row[1] < 1) )
|
||||
{$average_call_seconds = ' 0';}
|
||||
else
|
||||
{
|
||||
$average_call_seconds = ($row[1] / $row[0]);
|
||||
$average_call_seconds = round($average_call_seconds, 0);
|
||||
$average_call_seconds = sprintf("%10s", $average_call_seconds);
|
||||
}
|
||||
|
||||
echo "Total calls taken into this In-Group: $TOTALcalls\n";
|
||||
echo "Average Call Length for all Calls: $average_call_seconds seconds\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$DROPcalls = sprintf("%10s", $row[0]);
|
||||
if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
|
||||
{$DROPpercent = '0';}
|
||||
else
|
||||
{
|
||||
$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
|
||||
$DROPpercent = round($DROPpercent, 0);
|
||||
}
|
||||
|
||||
if ( ($row[0] < 1) or ($row[1] < 1) )
|
||||
{
|
||||
$average_hold_seconds = ' 0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$average_hold_seconds = ($row[1] / $row[0]);
|
||||
$average_hold_seconds = round($average_hold_seconds, 0);
|
||||
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
|
||||
}
|
||||
|
||||
echo "Total DROP Calls: $DROPcalls $DROPpercent%\n";
|
||||
echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n";
|
||||
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL QUEUE STATS
|
||||
|
||||
$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$QUEUEcalls = sprintf("%10s", $row[0]);
|
||||
if ( ($QUEUEcalls < 1) or ($TOTALcalls < 1) )
|
||||
{$QUEUEpercent = '0';}
|
||||
else
|
||||
{
|
||||
$QUEUEpercent = (($QUEUEcalls / $TOTALcalls) * 100);
|
||||
$QUEUEpercent = round($QUEUEpercent, 0);
|
||||
}
|
||||
|
||||
if ( ($row[0] < 1) or ($row[1] < 1) )
|
||||
{$average_queue_seconds = ' 0';}
|
||||
else
|
||||
{
|
||||
$average_queue_seconds = ($row[1] / $row[0]);
|
||||
$average_queue_seconds = round($average_queue_seconds, 2);
|
||||
$average_queue_seconds = sprintf("%10.2f", $average_queue_seconds);
|
||||
}
|
||||
|
||||
if ( ($TOTALcalls < 1) or ($row[1] < 1) )
|
||||
{$average_total_queue_seconds = ' 0';}
|
||||
else
|
||||
{
|
||||
$average_total_queue_seconds = ($row[1] / $TOTALcalls);
|
||||
$average_total_queue_seconds = round($average_total_queue_seconds, 2);
|
||||
$average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds);
|
||||
}
|
||||
|
||||
echo "Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n";
|
||||
echo "Average QUEUE Length for queue calls: $average_queue_seconds seconds\n";
|
||||
echo "Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n";
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### HOLD TIME, CALL AND DROP STATS
|
||||
|
||||
echo "\n";
|
||||
echo "---------- HOLD TIME, CALL AND DROP STATS\n";
|
||||
|
||||
echo "<FONT SIZE=0>";
|
||||
|
||||
$hi_hour_count=0;
|
||||
$hi_hold_count=0;
|
||||
$last_full_record=0;
|
||||
$i=0;
|
||||
$h=0;
|
||||
while ($i <= 96)
|
||||
{
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$avg_hold[$i] = $row[0];
|
||||
if ($avg_hold[$i] > $hi_hold_count) {$hi_hold_count = $avg_hold[$i];}
|
||||
$avg_hold[$i] = round($avg_hold[$i], 0);
|
||||
if (strlen($avg_hold[$i])<1) {$avg_hold[$i]=0; $max_hold[$i]=0;}
|
||||
$stmt="select max(queue_seconds) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$max_hold[$i] = $row[0];
|
||||
$max_hold[$i] = round($max_hold[$i], 0);
|
||||
if (strlen($max_hold[$i])<1) {$max_hold[$i]=0;}
|
||||
$i++;
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$avg_hold[$i] = $row[0];
|
||||
if ($avg_hold[$i] > $hi_hold_count) {$hi_hold_count = $avg_hold[$i];}
|
||||
$avg_hold[$i] = round($avg_hold[$i], 0);
|
||||
if (strlen($avg_hold[$i])<1) {$avg_hold[$i]=0; $max_hold[$i]=0;}
|
||||
$stmt="select max(queue_seconds) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$max_hold[$i] = $row[0];
|
||||
$max_hold[$i] = round($max_hold[$i], 0);
|
||||
if (strlen($max_hold[$i])<1) {$max_hold[$i]=0;}
|
||||
$i++;
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$avg_hold[$i] = $row[0];
|
||||
if ($avg_hold[$i] > $hi_hold_count) {$hi_hold_count = $avg_hold[$i];}
|
||||
$avg_hold[$i] = round($avg_hold[$i], 0);
|
||||
if (strlen($avg_hold[$i])<1) {$avg_hold[$i]=0; $max_hold[$i]=0;}
|
||||
$stmt="select max(queue_seconds) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$max_hold[$i] = $row[0];
|
||||
$max_hold[$i] = round($max_hold[$i], 0);
|
||||
if (strlen($max_hold[$i])<1) {$max_hold[$i]=0;}
|
||||
$i++;
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$avg_hold[$i] = $row[0];
|
||||
if ($avg_hold[$i] > $hi_hold_count) {$hi_hold_count = $avg_hold[$i];}
|
||||
$avg_hold[$i] = round($avg_hold[$i], 0);
|
||||
if (strlen($avg_hold[$i])<1) {$avg_hold[$i]=0; $max_hold[$i]=0;}
|
||||
$stmt="select max(queue_seconds) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$max_hold[$i] = $row[0];
|
||||
$max_hold[$i] = round($max_hold[$i], 0);
|
||||
if (strlen($max_hold[$i])<1) {$max_hold[$i]=0;}
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
if ($hi_hour_count < 1)
|
||||
{$hour_multiplier = 0;}
|
||||
else
|
||||
{
|
||||
$hour_multiplier = (20 / $hi_hour_count);
|
||||
#$hour_multiplier = round($hour_multiplier, 0);
|
||||
}
|
||||
if ($hi_hold_count < 1)
|
||||
{$hold_multiplier = 0;}
|
||||
else
|
||||
{
|
||||
$hold_multiplier = (20 / $hi_hold_count);
|
||||
#$hold_multiplier = round($hold_multiplier, 0);
|
||||
}
|
||||
|
||||
echo "<!-- HICOUNT CALLS: $hi_hour_count|$hour_multiplier -->";
|
||||
echo "<!-- HICOUNT HOLD: $hi_hold_count|$hold_multiplier -->\n";
|
||||
echo "GRAPH IN 15 MINUTE INCREMENTS OF AVERAGE HOLD TIME FOR CALLS TAKEN INTO THIS IN-GROUP\n";
|
||||
|
||||
$k=1;
|
||||
$Mk=0;
|
||||
$call_scale = '0';
|
||||
while ($k <= 22)
|
||||
{
|
||||
if ( ($k < 1) or ($hour_multiplier <= 0) )
|
||||
{$scale_num = 20;}
|
||||
else
|
||||
{
|
||||
$TMPscale_num=(23 / $hour_multiplier);
|
||||
$TMPscale_num = round($TMPscale_num, 0);
|
||||
$scale_num=($k / $hour_multiplier);
|
||||
$scale_num = round($scale_num, 0);
|
||||
}
|
||||
$tmpscl = "$call_scale$TMPscale_num";
|
||||
|
||||
if ( ($Mk >= 4) or (strlen($tmpscl)==23) )
|
||||
{
|
||||
$Mk=0;
|
||||
$LENscale_num = (strlen($scale_num));
|
||||
$k = ($k + $LENscale_num);
|
||||
$call_scale .= "$scale_num";
|
||||
}
|
||||
else
|
||||
{
|
||||
$call_scale .= " ";
|
||||
$k++; $Mk++;
|
||||
}
|
||||
}
|
||||
$k=1;
|
||||
$Mk=0;
|
||||
$hold_scale = '0';
|
||||
while ($k <= 22)
|
||||
{
|
||||
if ( ($k < 1) or ($hold_multiplier <= 0) )
|
||||
{$scale_num = 20;}
|
||||
else
|
||||
{
|
||||
$TMPscale_num=(23 / $hold_multiplier);
|
||||
$TMPscale_num = round($TMPscale_num, 0);
|
||||
$scale_num=($k / $hold_multiplier);
|
||||
$scale_num = round($scale_num, 0);
|
||||
}
|
||||
$tmpscl = "$hold_scale$TMPscale_num";
|
||||
|
||||
if ( ($Mk >= 4) or (strlen($tmpscl)==23) )
|
||||
{
|
||||
$Mk=0;
|
||||
$LENscale_num = (strlen($scale_num));
|
||||
$k = ($k + $LENscale_num);
|
||||
$hold_scale .= "$scale_num";
|
||||
}
|
||||
else
|
||||
{
|
||||
$hold_scale .= " ";
|
||||
$k++; $Mk++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "+-------------+-----------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
echo "| TIME | AVG HOLD TIME (sec) | (in seconds) | | CALLS HANDLED | | |\n";
|
||||
echo "| 15 MIN INT |$hold_scale| AVG | MAX | |$call_scale| DROPS | TOTAL |\n";
|
||||
echo "+-------------+-----------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
|
||||
$YY = '00';
|
||||
$ZZ = '15';
|
||||
$i=0;
|
||||
$h=4;
|
||||
$hour= -1;
|
||||
$no_lines_yet=1;
|
||||
$TOT_AVG=0;
|
||||
$TOT_lines=0;
|
||||
$TOT_MAX=0;
|
||||
$TOT_DROPS=0;
|
||||
$TOT_CALLS=0;
|
||||
|
||||
while ($i <= 96)
|
||||
{
|
||||
|
||||
$TOT_AVG = ($TOT_AVG + $avg_hold[$i]);
|
||||
if ($TOT_MAX < $max_hold[$i]) {$TOT_MAX = $max_hold[$i];}
|
||||
$TOT_DROPS = ($TOT_DROPS + $drop_count[$i]);
|
||||
$TOT_CALLS = ($TOT_CALLS + $hour_count[$i]);
|
||||
|
||||
$char_counter=0;
|
||||
$time = ' ';
|
||||
if ($h >= 4)
|
||||
{
|
||||
$hour++;
|
||||
$h=0;
|
||||
if ($hour < 10) {$hour = "0$hour";}
|
||||
$Stime="$hour:$YY";
|
||||
$Etime="$hour:$ZZ";
|
||||
$Sdate="$query_date";
|
||||
$Edate="$query_date";
|
||||
$time = "+$Stime-$Etime+";
|
||||
}
|
||||
if ($h == 1)
|
||||
{
|
||||
$Stime="$hour:15";
|
||||
$Etime="$hour:30";
|
||||
$Sdate="$query_date";
|
||||
$Edate="$query_date";
|
||||
$time = " $Stime-$Etime ";
|
||||
}
|
||||
if ($h == 2)
|
||||
{
|
||||
$Stime="$hour:30";
|
||||
$Etime="$hour:45";
|
||||
$Sdate="$query_date";
|
||||
$Edate="$query_date";
|
||||
$time = " $Stime-$Etime ";
|
||||
}
|
||||
if ($h == 3)
|
||||
{
|
||||
$Zhour=$hour;
|
||||
$Zhour++;
|
||||
if ($Zhour < 10) {$Zhour = "0$Zhour";}
|
||||
if ($Zhour > 23) {$Zhour = "00";}
|
||||
$Stime="$hour:45";
|
||||
$Etime="$Zhour:00";
|
||||
$Sdate="$query_date";
|
||||
$Edate="$query_date";
|
||||
$time = " $Stime-$Etime ";
|
||||
}
|
||||
|
||||
### BEGIN HOLD TIME TOTALS GRAPH ###
|
||||
$Ghour_count = $hour_count[$i];
|
||||
if ($Ghour_count > 0) {$no_lines_yet=0;}
|
||||
|
||||
$Gavg_hold = $avg_hold[$i];
|
||||
if ($Gavg_hold < 1)
|
||||
{
|
||||
if ( ($no_lines_yet) or ($i > $last_full_record) )
|
||||
{
|
||||
$do_nothing=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$SAtime[$TOT_lines] = "$Stime";
|
||||
$EAtime[$TOT_lines] = "$Etime";
|
||||
$SAdate[$TOT_lines] = "$Sdate $Stime:00";
|
||||
$EAdate[$TOT_lines] = "$Edate $Etime:00";
|
||||
$Aavg_hold[$TOT_lines] = $avg_hold[$i];
|
||||
$TOT_lines++;
|
||||
$avg_hold[$i] = sprintf("%5s", $avg_hold[$i]);
|
||||
$max_hold[$i] = sprintf("%5s", $max_hold[$i]);
|
||||
echo "|$time|";
|
||||
$k=0; while ($k <= 22) {echo " "; $k++;}
|
||||
echo "| $avg_hold[$i] | $max_hold[$i] |";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$SAtime[$TOT_lines] = "$Stime";
|
||||
$EAtime[$TOT_lines] = "$Etime";
|
||||
$SAdate[$TOT_lines] = "$Sdate $Stime:00";
|
||||
$EAdate[$TOT_lines] = "$Edate $Etime:00";
|
||||
$Aavg_hold[$TOT_lines] = $avg_hold[$i];
|
||||
$TOT_lines++;
|
||||
$no_lines_yet=0;
|
||||
$Xavg_hold = ($Gavg_hold * $hold_multiplier);
|
||||
$Yavg_hold = (19 - $Xavg_hold);
|
||||
|
||||
$avg_hold[$i] = sprintf("%5s", $avg_hold[$i]);
|
||||
$max_hold[$i] = sprintf("%5s", $max_hold[$i]);
|
||||
|
||||
echo "|$time|<SPAN class=\"orange\">";
|
||||
$k=0; while ($k <= $Xavg_hold) {echo "*"; $k++; $char_counter++;}
|
||||
if ($char_counter >= 22) {echo "H</SPAN>"; $char_counter++;}
|
||||
else {echo "*H</SPAN>"; $char_counter++; $char_counter++;}
|
||||
$k=0; while ($k <= $Yavg_hold) {echo " "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 22) {echo " "; $char_counter++;}
|
||||
echo "| $avg_hold[$i] | $max_hold[$i] |";
|
||||
}
|
||||
### END HOLD TIME TOTALS GRAPH ###
|
||||
|
||||
$char_counter=0;
|
||||
### BEGIN CALLS TOTALS GRAPH ###
|
||||
$Ghour_count = $hour_count[$i];
|
||||
if ($Ghour_count < 1)
|
||||
{
|
||||
if ( ($no_lines_yet) or ($i > $last_full_record) )
|
||||
{
|
||||
$do_nothing=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$hour_count[$i] = sprintf("%5s", $hour_count[$i]);
|
||||
echo " |";
|
||||
$k=0; while ($k <= 22) {echo " "; $k++;}
|
||||
echo "| $hour_count[$i] | |\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$no_lines_yet=0;
|
||||
$Xhour_count = ($Ghour_count * $hour_multiplier);
|
||||
$Yhour_count = (19 - $Xhour_count);
|
||||
|
||||
$Gdrop_count = $drop_count[$i];
|
||||
if ($Gdrop_count < 1)
|
||||
{
|
||||
$hour_count[$i] = sprintf("%5s", $hour_count[$i]);
|
||||
|
||||
echo " |<SPAN class=\"green\">";
|
||||
$k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;}
|
||||
if ($char_counter > 21) {echo "C</SPAN>"; $char_counter++;}
|
||||
else {echo "*C</SPAN>"; $char_counter++; $char_counter++;}
|
||||
$k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 22) {echo " "; $char_counter++;}
|
||||
echo "| 0 | $hour_count[$i] |\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$Xdrop_count = ($Gdrop_count * $hour_multiplier);
|
||||
|
||||
# if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
|
||||
|
||||
$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
|
||||
|
||||
$hour_count[$i] = sprintf("%5s", $hour_count[$i]);
|
||||
$drop_count[$i] = sprintf("%5s", $drop_count[$i]);
|
||||
|
||||
echo " |<SPAN class=\"red\">";
|
||||
$k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;}
|
||||
echo "D</SPAN><SPAN class=\"green\">"; $char_counter++;
|
||||
$k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;}
|
||||
echo "C</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 22) {echo " "; $char_counter++;}
|
||||
echo "| $drop_count[$i] | $hour_count[$i] |\n";
|
||||
}
|
||||
}
|
||||
### END CALLS TOTALS GRAPH ###
|
||||
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
$TOT_AVGraw = ($TOT_AVG / $TOT_lines);
|
||||
|
||||
$TOT_AVG = sprintf("%5s", $TOT_AVGraw);
|
||||
while (strlen($TOT_AVG)>5) {$TOT_AVG = ereg_replace(".$",'',$TOT_AVG);}
|
||||
$TOT_MAX = sprintf("%5s", $TOT_MAX);
|
||||
$TOT_DROPS = sprintf("%5s", $TOT_DROPS);
|
||||
$TOT_CALLS = sprintf("%5s", $TOT_CALLS);
|
||||
|
||||
|
||||
echo "+-------------+-----------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
echo "| TOTAL | $TOT_AVG | $TOT_MAX | | | $TOT_DROPS | $TOT_CALLS |\n";
|
||||
echo "+-------------------------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL HOLD TIME BREAKDONW IN SECONDS
|
||||
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL HOLD TIME BREAKDOWN IN SECONDS\n";
|
||||
/*
|
||||
$TOTALcalls = 0;
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n";
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by queue_seconds;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $reasons_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = ($TOTALcalls + $row[0]);
|
||||
|
||||
if ($row[1] == 0) {$hd_0 = ($hd_0 + $row[0]);}
|
||||
if ( ($row[1] > 0) and ($row[1] <= 5) ) {$hd_5 = ($hd_5 + $row[0]);}
|
||||
if ( ($row[1] > 5) and ($row[1] <= 10) ) {$hd10 = ($hd10 + $row[0]);}
|
||||
if ( ($row[1] > 10) and ($row[1] <= 15) ) {$hd15 = ($hd15 + $row[0]);}
|
||||
if ( ($row[1] > 15) and ($row[1] <= 20) ) {$hd20 = ($hd20 + $row[0]);}
|
||||
if ( ($row[1] > 20) and ($row[1] <= 25) ) {$hd25 = ($hd25 + $row[0]);}
|
||||
if ( ($row[1] > 25) and ($row[1] <= 30) ) {$hd30 = ($hd30 + $row[0]);}
|
||||
if ( ($row[1] > 30) and ($row[1] <= 35) ) {$hd35 = ($hd35 + $row[0]);}
|
||||
if ( ($row[1] > 35) and ($row[1] <= 40) ) {$hd40 = ($hd40 + $row[0]);}
|
||||
if ( ($row[1] > 40) and ($row[1] <= 45) ) {$hd45 = ($hd45 + $row[0]);}
|
||||
if ( ($row[1] > 45) and ($row[1] <= 50) ) {$hd50 = ($hd50 + $row[0]);}
|
||||
if ( ($row[1] > 50) and ($row[1] <= 55) ) {$hd55 = ($hd55 + $row[0]);}
|
||||
if ( ($row[1] > 55) and ($row[1] <= 60) ) {$hd60 = ($hd60 + $row[0]);}
|
||||
if ( ($row[1] > 60) and ($row[1] <= 90) ) {$hd90 = ($hd90 + $row[0]);}
|
||||
if ($row[1] > 90) {$hd99 = ($hd99 + $row[0]);}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$hd_0 = sprintf("%5s", $hd_0);
|
||||
$hd_5 = sprintf("%5s", $hd_5);
|
||||
$hd10 = sprintf("%5s", $hd10);
|
||||
$hd15 = sprintf("%5s", $hd15);
|
||||
$hd20 = sprintf("%5s", $hd20);
|
||||
$hd25 = sprintf("%5s", $hd25);
|
||||
$hd30 = sprintf("%5s", $hd30);
|
||||
$hd35 = sprintf("%5s", $hd35);
|
||||
$hd40 = sprintf("%5s", $hd40);
|
||||
$hd45 = sprintf("%5s", $hd45);
|
||||
$hd50 = sprintf("%5s", $hd50);
|
||||
$hd55 = sprintf("%5s", $hd55);
|
||||
$hd60 = sprintf("%5s", $hd60);
|
||||
$hd90 = sprintf("%5s", $hd90);
|
||||
$hd99 = sprintf("%5s", $hd99);
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
|
||||
echo "| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n";
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
|
||||
echo "| TIME | | % OF CALLS GROUPED BY HOLD TIME (SEC) | | AVERAGE TIME BEFORE ANSWER (SEC) |\n";
|
||||
echo "| 15 MIN INT | CALLS | 0 20 40 60 80 100 120 120+ | | AVG |0 20 40 60 80 100 120 |\n";
|
||||
echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
|
||||
|
||||
$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$records_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $records_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$qs[$i] = $row[0];
|
||||
$ut[$i] = $row[1];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$h=0;
|
||||
$APhd__0=0; $APhd_20=0; $APhd_40=0; $APhd_60=0; $APhd_80=0; $APhd100=0; $APhd120=0; $APhd121=0;
|
||||
$SAdate_count = count($SAdate);
|
||||
while ($h < $SAdate_count)
|
||||
{
|
||||
$avg_hold_scale=''; $calls=0;
|
||||
$hd__0=0; $hd_20=0; $hd_40=0; $hd_60=0; $hd_80=0; $hd100=0; $hd120=0; $hd121=0;
|
||||
$Phd__0=0; $Phd_20=0; $Phd_40=0; $Phd_60=0; $Phd_80=0; $Phd100=0; $Phd120=0; $Phd121=0;
|
||||
$SAdate_ARY = explode(' ',$SAdate[$h]);
|
||||
$SAday_ARY = explode('-',$SAdate_ARY[0]);
|
||||
$SAtime_ARY = explode(':',$SAdate_ARY[1]);
|
||||
$EAdate_ARY = explode(' ',$EAdate[$h]);
|
||||
$EAday_ARY = explode('-',$EAdate_ARY[0]);
|
||||
$EAtime_ARY = explode(':',$EAdate_ARY[1]);
|
||||
|
||||
$SAepoch = mktime($SAtime_ARY[0], $SAtime_ARY[1], $SAtime_ARY[2], $SAday_ARY[1], $SAday_ARY[2], $SAday_ARY[0]);
|
||||
$EAepoch = mktime($EAtime_ARY[0], $EAtime_ARY[1], $EAtime_ARY[2], $EAday_ARY[1], $EAday_ARY[2], $EAday_ARY[0]);
|
||||
|
||||
$i=0;
|
||||
while ($i < $records_to_print)
|
||||
{
|
||||
if ( ($ut[$i] >= $SAepoch) and ($ut[$i] < $EAepoch) )
|
||||
{
|
||||
$calls++;
|
||||
if ($qs[$i] == 0) {$hd__0++;}
|
||||
if ( ($qs[$i] > 0) and ($qs[$i] <= 20) ) {$hd_20++;}
|
||||
if ( ($qs[$i] > 20) and ($qs[$i] <= 40) ) {$hd_40++;}
|
||||
if ( ($qs[$i] > 40) and ($qs[$i] <= 60) ) {$hd_60++;}
|
||||
if ( ($qs[$i] > 60) and ($qs[$i] <= 80) ) {$hd_80++;}
|
||||
if ( ($qs[$i] > 80) and ($qs[$i] <= 100) ) {$hd100++;}
|
||||
if ( ($qs[$i] > 100) and ($qs[$i] <= 120) ) {$hd120++;}
|
||||
if ($qs[$i] > 120) {$hd121++;}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($hd__0 > 0) {$Phd__0 = round( ( ($hd__0 / $calls) * 100) );}
|
||||
if ($hd_20 > 0) {$Phd_20 = round( ( ($hd_20 / $calls) * 100) );}
|
||||
if ($hd_40 > 0) {$Phd_40 = round( ( ($hd_40 / $calls) * 100) );}
|
||||
if ($hd_60 > 0) {$Phd_60 = round( ( ($hd_60 / $calls) * 100) );}
|
||||
if ($hd_80 > 0) {$Phd_80 = round( ( ($hd_80 / $calls) * 100) );}
|
||||
if ($hd100 > 0) {$Phd100 = round( ( ($hd100 / $calls) * 100) );}
|
||||
if ($hd120 > 0) {$Phd120 = round( ( ($hd120 / $calls) * 100) );}
|
||||
if ($hd121 > 0) {$Phd121 = round( ( ($hd121 / $calls) * 100) );}
|
||||
$Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]);
|
||||
$calls = sprintf("%5s", $calls);
|
||||
$hd__0 = sprintf("%4s", $hd__0);
|
||||
$hd_20 = sprintf("%4s", $hd_20);
|
||||
$hd_40 = sprintf("%4s", $hd_40);
|
||||
$hd_60 = sprintf("%4s", $hd_60);
|
||||
$hd_80 = sprintf("%4s", $hd_80);
|
||||
$hd100 = sprintf("%4s", $hd100);
|
||||
$hd120 = sprintf("%4s", $hd120);
|
||||
$hd121 = sprintf("%4s", $hd121);
|
||||
$Phd__0 = sprintf("%4s", $Phd__0);
|
||||
$Phd_20 = sprintf("%4s", $Phd_20);
|
||||
$Phd_40 = sprintf("%4s", $Phd_40);
|
||||
$Phd_60 = sprintf("%4s", $Phd_60);
|
||||
$Phd_80 = sprintf("%4s", $Phd_80);
|
||||
$Phd100 = sprintf("%4s", $Phd100);
|
||||
$Phd120 = sprintf("%4s", $Phd120);
|
||||
$Phd121 = sprintf("%4s", $Phd121);
|
||||
|
||||
$ALLcalls = ($ALLcalls + $calls);
|
||||
$ALLhd__0 = ($ALLhd__0 + $hd__0);
|
||||
$ALLhd_20 = ($ALLhd_20 + $hd_20);
|
||||
$ALLhd_40 = ($ALLhd_40 + $hd_40);
|
||||
$ALLhd_60 = ($ALLhd_60 + $hd_60);
|
||||
$ALLhd_80 = ($ALLhd_80 + $hd_80);
|
||||
$ALLhd100 = ($ALLhd100 + $hd100);
|
||||
$ALLhd120 = ($ALLhd120 + $hd120);
|
||||
$ALLhd121 = ($ALLhd121 + $hd121);
|
||||
|
||||
if ( ($Aavg_hold[$h] < 1) or ($Aavg_hold[$h] > 119) )
|
||||
{
|
||||
if ($Aavg_hold[$h] < 1) {$avg_hold_scale = ' ';}
|
||||
if ($Aavg_hold[$h] > 119) {$avg_hold_scale = '<SPAN class="orange">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</SPAN>';}
|
||||
}
|
||||
else
|
||||
{
|
||||
$avg_hold_val = ( (32 / 120) * $Aavg_hold[$h] );
|
||||
$k=0;
|
||||
$blank=0;
|
||||
while ($k < 32)
|
||||
{
|
||||
if ($k <= $avg_hold_val)
|
||||
{
|
||||
if ($k < 1) {$avg_hold_scale .= '<SPAN class="orange">';}
|
||||
$avg_hold_scale .= 'x';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ($k > 0) and ($blank < 1) ) {$avg_hold_scale .= '</SPAN>';}
|
||||
$avg_hold_scale .= ' ';
|
||||
$blank++;
|
||||
}
|
||||
$k++;
|
||||
if ( ($k > 31) and ($blank < 1) ) {$avg_hold_scale .= '</SPAN>';}
|
||||
}
|
||||
}
|
||||
|
||||
$time = " $SAtime[$h]-$EAtime[$h] ";
|
||||
if (ereg(':00-',$time)) {$time = "+$SAtime[$h]-$EAtime[$h]+";}
|
||||
echo "|$time| $calls | $Phd__0 $Phd_20 $Phd_40 $Phd_60 $Phd_80 $Phd100 $Phd120 $Phd121 | | $Aavg_hold[$h] |$avg_hold_scale|\n";
|
||||
|
||||
$h++;
|
||||
}
|
||||
|
||||
if ($ALLhd__0 > 0) {$APhd__0 = round( ( ($ALLhd__0 / $ALLcalls) * 100) );}
|
||||
if ($ALLhd_20 > 0) {$APhd_20 = round( ( ($ALLhd_20 / $ALLcalls) * 100) );}
|
||||
if ($ALLhd_40 > 0) {$APhd_40 = round( ( ($ALLhd_40 / $ALLcalls) * 100) );}
|
||||
if ($ALLhd_60 > 0) {$APhd_60 = round( ( ($ALLhd_60 / $ALLcalls) * 100) );}
|
||||
if ($ALLhd_80 > 0) {$APhd_80 = round( ( ($ALLhd_80 / $ALLcalls) * 100) );}
|
||||
if ($ALLhd100 > 0) {$APhd100 = round( ( ($ALLhd100 / $ALLcalls) * 100) );}
|
||||
if ($ALLhd120 > 0) {$APhd120 = round( ( ($ALLhd120 / $ALLcalls) * 100) );}
|
||||
if ($ALLhd121 > 0) {$APhd121 = round( ( ($ALLhd121 / $ALLcalls) * 100) );}
|
||||
|
||||
$ALLcalls = sprintf("%5s", $ALLcalls);
|
||||
$APhd__0 = sprintf("%4s", $APhd__0);
|
||||
$APhd_20 = sprintf("%4s", $APhd_20);
|
||||
$APhd_40 = sprintf("%4s", $APhd_40);
|
||||
$APhd_60 = sprintf("%4s", $APhd_60);
|
||||
$APhd_80 = sprintf("%4s", $APhd_80);
|
||||
$APhd100 = sprintf("%4s", $APhd100);
|
||||
$APhd120 = sprintf("%4s", $APhd120);
|
||||
$APhd121 = sprintf("%4s", $APhd121);
|
||||
|
||||
$TOT_AVG = sprintf("%4s", $TOT_AVGraw);
|
||||
while (strlen($TOT_AVG)>4) {$TOT_AVG = ereg_replace(".$",'',$TOT_AVG);}
|
||||
|
||||
echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
|
||||
echo "| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $TOT_AVG |\n";
|
||||
echo "+-------------+-------+-----------------------------------------+ +------+\n";
|
||||
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
echo "\nRun Time: $RUNtime seconds\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -37,11 +37,29 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$non_latin = $row[0];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
@@ -256,7 +274,6 @@ echo "| 0 5 10 15 20 25 30 35 40 45 50 55
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by queue_seconds;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
@@ -303,7 +320,6 @@ $hd99 = sprintf("%5s", $hd99);
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
echo "| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n";
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
@@ -321,7 +337,6 @@ echo "| HANGUP REASON | CALLS |\n";
|
||||
echo "+----------------------+------------+\n";
|
||||
|
||||
$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by term_reason;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
@@ -387,7 +402,6 @@ while ($Cstatuses_to_print > $o)
|
||||
}
|
||||
|
||||
$stmt="select count(*),status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
@@ -599,7 +613,7 @@ else
|
||||
}
|
||||
|
||||
echo "<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
|
||||
echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN\n";
|
||||
echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS TAKEN INTO THIS IN-GROUP\n";
|
||||
|
||||
$k=1;
|
||||
$Mk=0;
|
||||
|
||||
@@ -37,11 +37,29 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$non_latin = $row[0];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
|
||||
@@ -715,6 +715,18 @@ if (isset($_GET["alias_name"])) {$alias_name=$_GET["alias_name"];}
|
||||
elseif (isset($_POST["alias_name"])) {$alias_name=$_POST["alias_name"];}
|
||||
if (isset($_GET["logins_list"])) {$logins_list=$_GET["logins_list"];}
|
||||
elseif (isset($_POST["logins_list"])) {$logins_list=$_POST["logins_list"];}
|
||||
if (isset($_GET["shift_id"])) {$shift_id=$_GET["shift_id"];}
|
||||
elseif (isset($_POST["shift_id"])) {$shift_id=$_POST["shift_id"];}
|
||||
if (isset($_GET["shift_name"])) {$shift_name=$_GET["shift_name"];}
|
||||
elseif (isset($_POST["shift_name"])) {$shift_name=$_POST["shift_name"];}
|
||||
if (isset($_GET["shift_start_time"])) {$shift_start_time=$_GET["shift_start_time"];}
|
||||
elseif (isset($_POST["shift_start_time"])) {$shift_start_time=$_POST["shift_start_time"];}
|
||||
if (isset($_GET["shift_length"])) {$shift_length=$_GET["shift_length"];}
|
||||
elseif (isset($_POST["shift_length"])) {$shift_length=$_POST["shift_length"];}
|
||||
if (isset($_GET["shift_weekdays"])) {$shift_weekdays=$_GET["shift_weekdays"];}
|
||||
elseif (isset($_POST["shift_weekdays"])) {$shift_weekdays=$_POST["shift_weekdays"];}
|
||||
if (isset($_GET["group_shifts"])) {$group_shifts=$_GET["group_shifts"];}
|
||||
elseif (isset($_POST["group_shifts"])) {$group_shifts=$_POST["group_shifts"];}
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
|
||||
@@ -872,6 +884,10 @@ $qc_finish = ereg_replace("[^0-9]","",$qc_finish);
|
||||
$qc_commit = ereg_replace("[^0-9]","",$qc_commit);
|
||||
$campaign_shift_start_time = ereg_replace("[^0-9]","",$campaign_shift_start_time);
|
||||
$campaign_day_start_time = ereg_replace("[^0-9]","",$campaign_day_start_time);
|
||||
$shift_start_time = ereg_replace("[^0-9]","",$shift_start_time);
|
||||
|
||||
### DIGITS and COLONS
|
||||
$shift_length = ereg_replace("[^\:0-9]","",$shift_length);
|
||||
|
||||
### DIGITS and DASHES
|
||||
$group_rank = ereg_replace("[^-0-9]","",$group_rank);
|
||||
@@ -1016,6 +1032,7 @@ $drop_inbound_group = ereg_replace("[^-\_0-9a-zA-Z]","",$drop_inbound_group);
|
||||
$afterhours_xfer_group = ereg_replace("[^-\_0-9a-zA-Z]","",$afterhours_xfer_group);
|
||||
$after_hours_action = ereg_replace("[^-\_0-9a-zA-Z]","",$after_hours_action);
|
||||
$alias_id = ereg_replace("[^-\_0-9a-zA-Z]","",$alias_id);
|
||||
$shift_id = ereg_replace("[^-\_0-9a-zA-Z]","",$shift_id);
|
||||
|
||||
### ALPHA-NUMERIC and underscore and dash and comma
|
||||
$logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list);
|
||||
@@ -1059,7 +1076,7 @@ $vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name);
|
||||
$vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description);
|
||||
$code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$code_name);
|
||||
$alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name);
|
||||
|
||||
$shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name);
|
||||
|
||||
### ALPHA-NUMERIC and underscore and dash and slash and at and dot
|
||||
$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group);
|
||||
@@ -1236,11 +1253,13 @@ $list_mix_container = ereg_replace(";","",$list_mix_container);
|
||||
# 80414-1505 - More work on QC, added vicidial_qc_codes
|
||||
# 80424-0442 - Added non_latin system_settings lookup at top to override dbconnect setting
|
||||
# 80505-0333 - Added phones_alias sections to allow for load-balanced-phone-logins
|
||||
# 80512-1529 - Added auto-generate of User ID feature
|
||||
# 80515-1345 - Added Shifts sub-section to Admin section
|
||||
#
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
|
||||
|
||||
$admin_version = '2.0.5-128';
|
||||
$build = '80505-0333';
|
||||
$admin_version = '2.0.5-130';
|
||||
$build = '80515-1345';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -1388,6 +1407,7 @@ if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";}
|
||||
if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";}
|
||||
if ($ADD==11111111) {$hh='filters'; echo "Add New Filter";}
|
||||
if ($ADD==111111111) {$hh='admin'; $sh='times'; echo "Add New Call Time";}
|
||||
if ($ADD==131111111) {$hh='admin'; $sh='times'; echo "Add New Shift";}
|
||||
if ($ADD==1111111111) {$hh='admin'; $sh='times'; echo "Add New State Call Time";}
|
||||
if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE";}
|
||||
if ($ADD==12111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE ALIAS";}
|
||||
@@ -1413,6 +1433,7 @@ if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";}
|
||||
if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";}
|
||||
if ($ADD==21111111) {$hh='filters'; echo "New Filter Addition";}
|
||||
if ($ADD==211111111) {$hh='admin'; $sh='times'; echo "New Call Time Addition";}
|
||||
if ($ADD==231111111) {$hh='admin'; $sh='times'; echo "New Shift Addition";}
|
||||
if ($ADD==2111111111) {$hh='admin'; $sh='times'; echo "New State Call Time Addition";}
|
||||
if ($ADD==21111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW PHONE";}
|
||||
if ($ADD==22111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW PHONE ALIAS";}
|
||||
@@ -1462,6 +1483,7 @@ if ($ADD==3111111) {$hh='scripts'; echo "Modify Script";}
|
||||
if ($ADD==31111111) {$hh='filters'; echo "Modify Filter";}
|
||||
if ($ADD==311111111) {$hh='admin'; $sh='times'; echo "Modify Call Time";}
|
||||
if ($ADD==321111111) {$hh='admin'; $sh='times'; echo "Modify Call Time State Definitions List";}
|
||||
if ($ADD==331111111) {$hh='admin'; $sh='times'; echo "Modify Shift";}
|
||||
if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Modify State Call Time";}
|
||||
if ($ADD==31111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE";}
|
||||
if ($ADD==32111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE ALIAS";}
|
||||
@@ -1490,6 +1512,7 @@ if ($ADD==411111) {$hh='usergroups'; echo "Modify Users Groups";}
|
||||
if ($ADD==4111111) {$hh='scripts'; echo "Modify Script";}
|
||||
if ($ADD==41111111) {$hh='filters'; echo "Modify Filter";}
|
||||
if ($ADD==411111111) {$hh='admin'; $sh='times'; echo "Modify Call Time";}
|
||||
if ($ADD==431111111) {$hh='admin'; $sh='times'; echo "Modify Shift";}
|
||||
if ($ADD==4111111111) {$hh='admin'; $sh='times'; echo "Modify State Call Time";}
|
||||
if ($ADD==41111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE";}
|
||||
if ($ADD==42111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE ALIAS";}
|
||||
@@ -1512,6 +1535,7 @@ if ($ADD==511111) {$hh='usergroups'; echo "Delete Users Group";}
|
||||
if ($ADD==5111111) {$hh='scripts'; echo "Delete Script";}
|
||||
if ($ADD==51111111) {$hh='filters'; echo "Delete Filter";}
|
||||
if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";}
|
||||
if ($ADD==531111111) {$hh='admin'; $sh='times'; echo "Delete Shift";}
|
||||
if ($ADD==5111111111) {$hh='admin'; $sh='times'; echo "Delete State Call Time";}
|
||||
if ($ADD==51111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";}
|
||||
if ($ADD==52111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";}
|
||||
@@ -1534,6 +1558,7 @@ if ($ADD==611111) {$hh='usergroups'; echo "Delete Users Group";}
|
||||
if ($ADD==6111111) {$hh='scripts'; echo "Delete Script";}
|
||||
if ($ADD==61111111) {$hh='filters'; echo "Delete Filter";}
|
||||
if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";}
|
||||
if ($ADD==631111111) {$hh='admin'; $sh='times'; echo "Delete Shift";}
|
||||
if ($ADD==6111111111) {$hh='admin'; $sh='times'; echo "Delete State Call Time";}
|
||||
if ($ADD==61111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";}
|
||||
if ($ADD==62111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";}
|
||||
@@ -1556,6 +1581,7 @@ if ($ADD==100000) {$hh='usergroups'; echo "User Groups";}
|
||||
if ($ADD==1000000) {$hh='scripts'; echo "Scripts";}
|
||||
if ($ADD==10000000) {$hh='filters'; echo "Filters";}
|
||||
if ($ADD==100000000) {$hh='admin'; $sh='times'; echo "Call Times";}
|
||||
if ($ADD==130000000) {$hh='admin'; $sh='times'; echo "Shifts";}
|
||||
if ($ADD==1000000000) {$hh='admin'; $sh='times'; echo "State Call Times";}
|
||||
if ($ADD==10000000000) {$hh='admin'; $sh='phones'; echo "PHONE LIST";}
|
||||
if ($ADD==12000000000) {$hh='admin'; $sh='phones'; echo "PHONE ALIAS LIST";}
|
||||
@@ -3006,6 +3032,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
|
||||
<BR>
|
||||
<B>Group Name -</B> This is the description of the vicidial user group max of 40 characters.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_user_groups-group_shifts">
|
||||
<BR>
|
||||
<B>Group Shifts -</B> This is a selectable list of shifts that can restrict the agents login time on the system.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_user_groups-allowed_campaigns">
|
||||
<BR>
|
||||
@@ -3115,6 +3146,32 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
|
||||
|
||||
|
||||
|
||||
<BR><BR><BR><BR>
|
||||
|
||||
<B><FONT SIZE=3>VICIDIAL_SHIFTS TABLE</FONT></B><BR><BR>
|
||||
<A NAME="vicidial_shifts-shift_id">
|
||||
<BR>
|
||||
<B>Shift ID -</B> This is the short name of a Vicidial Shift Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_shifts-shift_name">
|
||||
<B>Shift Name -</B> This is a more descriptive name of the Shift Definition. This is a short summary of the Shift definition. max 50 characters, minimum of 2 characters.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_shifts-shift_start_time">
|
||||
<B>Shift Start Time -</B> This is the time that the campaign shift begins. Must only be numbers, 9:30 AM would be 0930 and 5:00 PM would be 1700.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_shifts-shift_length">
|
||||
<B>Shift Length -</B> This is the time in Hours and Minutes that the campaign shift lasts. 8 hours would be 08:00 and 7 hours and 30 minutes would be 07:30.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_shifts-shift_weekdays">
|
||||
<B>Shift Weekdays -</B> In this section you should choose the days of the week that this shift is active.
|
||||
|
||||
|
||||
|
||||
|
||||
<BR><BR><BR><BR>
|
||||
|
||||
<B><FONT SIZE=3>VICIDIAL LIST LOADER FUNCTIONALITY</FONT></B><BR><BR>
|
||||
@@ -4169,10 +4226,103 @@ function scriptInsertField() {
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
<?
|
||||
|
||||
#### Javascript for auto-generate of user ID Button
|
||||
if ( ($ADD==1) or ($ADD=="1A") )
|
||||
{
|
||||
?>
|
||||
function user_auto()
|
||||
{
|
||||
var user_toggle = document.getElementById("user_toggle");
|
||||
var user_field = document.getElementById("user");
|
||||
if (user_toggle.value < 1)
|
||||
{
|
||||
user_field.value = 'AUTOGENERATEZZZZZZZZ';
|
||||
user_field.disabled = true;
|
||||
user_toggle.value = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
user_field.value = '';
|
||||
user_field.disabled = false;
|
||||
user_toggle.value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function user_submit()
|
||||
{
|
||||
var user_field = document.getElementById("user");
|
||||
user_field.disabled = false;
|
||||
document.userform.submit();
|
||||
}
|
||||
|
||||
<?
|
||||
}
|
||||
|
||||
### Javascript for shift end-time calculation and display
|
||||
if ( ($ADD==131111111) or ($ADD==331111111) )
|
||||
{
|
||||
?>
|
||||
function shift_time()
|
||||
{
|
||||
var start_time = document.getElementById("shift_start_time");
|
||||
var end_time = document.getElementById("shift_end_time");
|
||||
var length = document.getElementById("shift_length");
|
||||
|
||||
var start_time_hour=start_time.value.substring(0,2);
|
||||
var start_time_min=start_time.value.substring(2,4);
|
||||
var end_time_hour=end_time.value.substring(0,2);
|
||||
var end_time_min=end_time.value.substring(2,4);
|
||||
start_time_hour=(start_time_hour * 1);
|
||||
start_time_min=(start_time_min * 1);
|
||||
end_time_hour=(end_time_hour * 1);
|
||||
end_time_min=(end_time_min * 1);
|
||||
|
||||
if (start_time.value == end_time.value)
|
||||
{
|
||||
var shift_length = '24:00';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (start_time_hour > end_time_hour) || ( (start_time_hour == end_time_hour) && (start_time_min > end_time_min) ) )
|
||||
{
|
||||
var shift_hour = ( (24 - start_time_hour) + end_time_hour);
|
||||
var shift_minute = ( (60 - start_time_min) + end_time_min);
|
||||
if (shift_minute >= 60)
|
||||
{
|
||||
shift_minute = (shift_minute - 60);
|
||||
}
|
||||
else
|
||||
{
|
||||
shift_hour = (shift_hour - 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var shift_hour = (end_time_hour - start_time_hour);
|
||||
var shift_minute = (end_time_min - start_time_min);
|
||||
}
|
||||
if (shift_minute < 0)
|
||||
{
|
||||
shift_minute = (shift_minute + 60);
|
||||
shift_hour = (shift_hour - 1);
|
||||
}
|
||||
|
||||
if (shift_hour < 10) {shift_hour = '0' + shift_hour}
|
||||
if (shift_minute < 10) {shift_minute = '0' + shift_minute}
|
||||
var shift_length = shift_hour + ':' + shift_minute;
|
||||
}
|
||||
// alert(start_time_hour + '|' + start_time_min + '|' + end_time_hour + '|' + end_time_min + '|--|' + shift_hour + ':' + shift_minute + '|' + shift_length + '|');
|
||||
|
||||
length.value = shift_length;
|
||||
}
|
||||
|
||||
<?
|
||||
}
|
||||
echo "</script>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
echo "<!-- INTERNATIONALIZATION-LINKS-PLACEHOLDER-VICIDIAL -->\n";
|
||||
|
||||
$stmt="SELECT admin_home_url from system_settings;";
|
||||
@@ -4298,7 +4448,7 @@ if (strlen($admin_hh) > 1) {
|
||||
<?
|
||||
if (strlen($times_sh) > 1) {
|
||||
?>
|
||||
<TR BGCOLOR=<?=$times_color ?>><TD ALIGN=LEFT COLSPAN=10><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> <a href="<? echo $PHP_SELF ?>?ADD=100000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Show Call Times </a> | <a href="<? echo $PHP_SELF ?>?ADD=111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Add A New Call Time </a> | <a href="<? echo $PHP_SELF ?>?ADD=1000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Show State Call Times </a> | <a href="<? echo $PHP_SELF ?>?ADD=1111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Add A New State Call Time </a> </TD></TR>
|
||||
<TR BGCOLOR=<?=$times_color ?>><TD ALIGN=LEFT COLSPAN=10><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>><a href="<? echo $PHP_SELF ?>?ADD=100000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Show Call Times </a> | <a href="<? echo $PHP_SELF ?>?ADD=111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Add A New Call Time </a> | <a href="<? echo $PHP_SELF ?>?ADD=1000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Show State Call Times </a> | <a href="<? echo $PHP_SELF ?>?ADD=1111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Add A New State Call Time </a> | <a href="<? echo $PHP_SELF ?>?ADD=130000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Show Shifts </a> | <a href="<? echo $PHP_SELF ?>?ADD=131111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Add A New Shift </a></TD></TR>
|
||||
<? }
|
||||
if (strlen($phones_sh) > 1) {
|
||||
?>
|
||||
@@ -4363,10 +4513,11 @@ if ($ADD=="1")
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "<br>ADD A NEW USER<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<br>ADD A NEW USER<form action=$PHP_SELF method=POST name=userform id=userform>\n";
|
||||
echo "<input type=hidden name=ADD value=2>\n";
|
||||
echo "<input type=hidden name=user_toggle id=user_toggle value=0>\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user size=20 maxlength=10>$NWB#vicidial_users-user$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user id=user size=20 maxlength=10> <input type=button name=auto_user value=\"AUTO-GENERATE\" onClick=\"user_auto()\"> $NWB#vicidial_users-user$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Password: </td><td align=left><input type=text name=pass size=20 maxlength=10>$NWB#vicidial_users-pass$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Full Name: </td><td align=left><input type=text name=full_name size=20 maxlength=100>$NWB#vicidial_users-full_name$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Level: </td><td align=left><select size=1 name=user_level>";
|
||||
@@ -4395,7 +4546,7 @@ if ($ADD=="1")
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Login: </td><td align=left><input type=text name=phone_login size=20 maxlength=20>$NWB#vicidial_users-phone_login$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Pass: </td><td align=left><input type=text name=phone_pass size=20 maxlength=20>$NWB#vicidial_users-phone_pass$NWE</td></tr>\n";
|
||||
echo "</select>$NWB#vicidial_users-user_group$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=button name=SUBMIT value=SUBMIT onClick=\"user_submit()\"></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
}
|
||||
else
|
||||
@@ -4407,7 +4558,7 @@ if ($ADD=="1")
|
||||
|
||||
|
||||
######################
|
||||
# ADD=1 display the COPY USER FORM SCREEN
|
||||
# ADD=1A display the COPY USER FORM SCREEN
|
||||
######################
|
||||
|
||||
if ($ADD=="1A")
|
||||
@@ -4417,10 +4568,11 @@ if ($ADD=="1A")
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "<br>COPY USER<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<br>COPY USER<form action=$PHP_SELF method=POST name=userform id=userform>\n";
|
||||
echo "<input type=hidden name=ADD value=2A>\n";
|
||||
echo "<input type=hidden name=user_toggle id=user_toggle value=0>\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user size=20 maxlength=10>$NWB#vicidial_users-user$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user id=user size=20 maxlength=10> <input type=button name=auto_user value=\"AUTO-GENERATE\" onClick=\"user_auto()\"> $NWB#vicidial_users-user$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Password: </td><td align=left><input type=text name=pass size=20 maxlength=10>$NWB#vicidial_users-pass$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Full Name: </td><td align=left><input type=text name=full_name size=20 maxlength=100>$NWB#vicidial_users-full_name$NWE</td></tr>\n";
|
||||
|
||||
@@ -4442,7 +4594,7 @@ if ($ADD=="1A")
|
||||
}
|
||||
echo "$Uusers_list";
|
||||
echo "</select>$NWB#vicidial_users-user$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=button name=SUBMIT value=SUBMIT onClick=\"user_submit()\"></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
}
|
||||
else
|
||||
@@ -4939,6 +5091,46 @@ if ($ADD==1111111111)
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=131111111 display the ADD NEW SHIFT SCREEN
|
||||
######################
|
||||
|
||||
if ($ADD==131111111)
|
||||
{
|
||||
if ($LOGmodify_call_times==1)
|
||||
{
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "<br>ADD NEW SHIFT<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=231111111>\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Shift ID: </td><td align=left><input type=text name=shift_id size=22 maxlength=20> (no spaces or punctuation)$NWB#vicidial_shifts-shift_id$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Name: </td><td align=left><input type=text name=shift_name size=50 maxlength=50> (short description of the shift)$NWB#vicidial_shifts-shift_name$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Start Time: </td><td align=left><input type=text name=shift_start_time size=5 maxlength=4 id=shift_start_time>\n";
|
||||
echo " Shift End Time: <input type=text name=shift_end_time size=5 maxlength=4 id=shift_end_time>\n";
|
||||
echo "<input type=button name=shift_calc value=\"Calculate Shift Length\" onClick=\"shift_time();\"> $NWB#vicidial_shifts-shift_start_time$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Length: </td><td align=left><input type=text name=shift_length id=shift_length size=6 maxlength=5> $NWB#vicidial_shifts-shift_length$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Weekdays: <BR>$NWB#vicidial_shifts-shift_weekdays$NWE</td><td align=left>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"0\">Sunday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"1\">Monday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"2\">Tuesday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"3\">Wednesday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"4\">Thursday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"5\">Friday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"6\">Saturday<BR>\n";
|
||||
echo "</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "You do not have permission to view this page\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=11111111111 display the ADD NEW PHONE SCREEN
|
||||
######################
|
||||
@@ -5132,14 +5324,51 @@ if ($ADD=="2")
|
||||
{echo "<br>USER NOT ADDED - there is already a user in the system with this user number\n";}
|
||||
else
|
||||
{
|
||||
if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) )
|
||||
if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) )
|
||||
{
|
||||
echo "<br>USER NOT ADDED - Please go back and look at the data you entered\n";
|
||||
echo "<br>user id must be between 2 and 8 characters long\n";
|
||||
echo "<br>user id must be between 2 and 10 characters long\n";
|
||||
echo "<br>full name and password must be at least 2 characters long\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ereg('AUTOGENERA',$user))
|
||||
{
|
||||
$new_user=0;
|
||||
$auto_user_add_value=0;
|
||||
while ($new_user < 2)
|
||||
{
|
||||
if ($new_user < 1)
|
||||
{
|
||||
$stmt = "SELECT auto_user_add_value FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$ss_auav_ct = mysql_num_rows($rslt);
|
||||
if ($ss_auav_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auto_user_add_value = $row[0];
|
||||
}
|
||||
$new_user++;
|
||||
}
|
||||
$stmt = "SELECT count(*) FROM vicidial_users where user='$auto_user_add_value';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] < 1)
|
||||
{
|
||||
$new_user++;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<!-- AG: $auto_user_add_value -->\n";
|
||||
$auto_user_add_value = ($auto_user_add_value + 7);
|
||||
}
|
||||
}
|
||||
$user = $auto_user_add_value;
|
||||
echo "<br><B>user_id has been auto-generated: $user</B><br>\n";
|
||||
|
||||
$stmt="UPDATE system_settings SET auto_user_add_value='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
echo "<br><B>USER ADDED: $user</B>\n";
|
||||
|
||||
$stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass) values('$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass');";
|
||||
@@ -5172,14 +5401,53 @@ if ($ADD=="2A")
|
||||
{echo "<br>USER NOT ADDED - there is already a user in the system with this user number\n";}
|
||||
else
|
||||
{
|
||||
if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) )
|
||||
if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) )
|
||||
{
|
||||
echo "<br>USER NOT ADDED - Please go back and look at the data you entered\n";
|
||||
echo "<br>user id must be between 2 and 8 characters long\n";
|
||||
echo "<br>user id must be between 2 and 10 characters long\n";
|
||||
echo "<br>full name and password must be at least 2 characters long\n";
|
||||
echo "<!-- |$user|$pass|$full_name| -->\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ereg('AUTOGENERA',$user))
|
||||
{
|
||||
$new_user=0;
|
||||
$auto_user_add_value=0;
|
||||
while ($new_user < 2)
|
||||
{
|
||||
if ($new_user < 1)
|
||||
{
|
||||
$stmt = "SELECT auto_user_add_value FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$ss_auav_ct = mysql_num_rows($rslt);
|
||||
if ($ss_auav_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auto_user_add_value = $row[0];
|
||||
}
|
||||
$new_user++;
|
||||
}
|
||||
$stmt = "SELECT count(*) FROM vicidial_users where user='$auto_user_add_value';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] < 1)
|
||||
{
|
||||
$new_user++;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<!-- AG: $auto_user_add_value -->\n";
|
||||
$auto_user_add_value = ($auto_user_add_value + 7);
|
||||
}
|
||||
}
|
||||
$user = $auto_user_add_value;
|
||||
echo "<br><B>user_id has been auto-generated: $user</B><br>\n";
|
||||
|
||||
$stmt="UPDATE system_settings SET auto_user_add_value='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
|
||||
$stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit from vicidial_users where user=\"$source_user_id\";";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
@@ -5951,6 +6219,55 @@ $ADD=3111111111;
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=231111111 adds new shift definition to the system
|
||||
######################
|
||||
|
||||
if ($ADD==231111111)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
$stmt="SELECT count(*) from vicidial_shifts where shift_id='$shift_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{echo "<br>SHIFT DEFINITION NOT ADDED - there is already a shift entry with this ID\n";}
|
||||
else
|
||||
{
|
||||
$shift_length_test = eregi_replace(':','',$shift_length);
|
||||
if ( (strlen($shift_id) < 2) or (strlen($shift_name) < 2) or (strlen($shift_start_time) < 4) or (strlen($shift_start_time) > 4) or (strlen($shift_length) < 5) or (strlen($shift_length) > 5) or ($shift_start_time > 2359) or ($shift_length_test > 2400) )
|
||||
{
|
||||
echo "<br>SHIFT DEFINITION NOT ADDED - Please go back and look at the data you entered\n";
|
||||
echo "<br>Shift ID and name must be at least 2 characters in length\n";
|
||||
echo "<br>Shift Start Time must be 4 digits in length and be a valid time\n";
|
||||
echo "<br>Shift Length must be 5 characters in length and be 24 hours or less\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$p=0;
|
||||
$shift_weekdays_ct = count($shift_weekdays);
|
||||
while ($p <= $shift_weekdays_ct)
|
||||
{
|
||||
$SHIFT_weekdays .= "$shift_weekdays[$p]";
|
||||
$p++;
|
||||
}
|
||||
$stmt="INSERT INTO vicidial_shifts SET shift_id='$shift_id',shift_name='$shift_name',shift_start_time='$shift_start_time',shift_length='$shift_length',shift_weekdays='$SHIFT_weekdays';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>SHIFT ADDED: $shift_id</B>\n";
|
||||
|
||||
### LOG CHANGES TO LOG FILE ###
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
$fp = fopen ("./admin_changes_log.txt", "a");
|
||||
fwrite ($fp, "$date|ADD A NEW SHIFT ENTRY |$stmt|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
$ADD=331111111;
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=21111111111 adds new phone to the system
|
||||
######################
|
||||
@@ -7312,7 +7629,15 @@ if ($ADD==411111)
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value' where user_group='$OLDuser_group';";
|
||||
$p=0;
|
||||
$GROUP_shifts=' ';
|
||||
$group_shifts_ct = count($group_shifts);
|
||||
while ($p <= $group_shifts_ct)
|
||||
{
|
||||
$GROUP_shifts .= "$group_shifts[$p] ";
|
||||
$p++;
|
||||
}
|
||||
$stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts' where user_group='$OLDuser_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>USER GROUP MODIFIED</B>\n";
|
||||
@@ -7528,6 +7853,57 @@ $ADD=3111111111; # go to state call time modification form below
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=431111111 modify shift in the system
|
||||
######################
|
||||
|
||||
if ($ADD==431111111)
|
||||
{
|
||||
if ($LOGmodify_call_times==1)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$shift_length_test = eregi_replace(':','',$shift_length);
|
||||
if ( (strlen($shift_id) < 2) or (strlen($shift_name) < 2) or (strlen($shift_start_time) < 4) or (strlen($shift_start_time) > 4) or (strlen($shift_length) < 5) or (strlen($shift_length) > 5) or ($shift_start_time > 2359) or ($shift_length_test > 2400) )
|
||||
{
|
||||
echo "<br>SHIFT DEFINITION NOT MODIFIED - Please go back and look at the data you entered\n";
|
||||
echo "<br>Shift ID and name must be at least 2 characters in length\n";
|
||||
echo "<br>Shift Start Time must be 4 digits in length and be a valid time\n";
|
||||
echo "<br>Shift Length must be 5 characters in length and be 24 hours or less\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$p=0;
|
||||
$shift_weekdays_ct = count($shift_weekdays);
|
||||
while ($p <= $shift_weekdays_ct)
|
||||
{
|
||||
$SHIFT_weekdays .= "$shift_weekdays[$p]";
|
||||
$p++;
|
||||
}
|
||||
$shift_start_time = preg_replace('/\D/', '', $shift_start_time);
|
||||
$stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays' where shift_id='$shift_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>SHIFT MODIFIED</B>\n";
|
||||
|
||||
### LOG CHANGES TO LOG FILE ###
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
$fp = fopen ("./admin_changes_log.txt", "a");
|
||||
fwrite ($fp, "$date|MODIFY SHIFT ENTRY |$stmt|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "You do not have permission to view this page\n";
|
||||
exit;
|
||||
}
|
||||
$ADD=331111111; # go to shift modification form below
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=41111111111 modify phone record in the system
|
||||
######################
|
||||
@@ -8318,6 +8694,27 @@ if ($ADD==5111111111)
|
||||
$ADD='3111111111'; # go to state call time modification below
|
||||
}
|
||||
|
||||
######################
|
||||
# ADD=531111111 confirmation before deletion of shift record
|
||||
######################
|
||||
|
||||
if ($ADD==531111111)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) )
|
||||
{
|
||||
echo "<br>SHIFT NOT DELETED - Please go back and look at the data you entered\n";
|
||||
echo "<br>Shift ID must be at least 2 characters in length\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><B>SHIFT DELETION CONFIRMATION: $shift_id</B>\n";
|
||||
echo "<br><br><a href=\"$PHP_SELF?ADD=631111111&shift_id=$shift_id&CoNfIrM=YES\">Click here to delete shift $shift_id</a><br><br><br>\n";
|
||||
}
|
||||
|
||||
$ADD='331111111'; # go to call time modification below
|
||||
}
|
||||
|
||||
######################
|
||||
# ADD=51111111111 confirmation before deletion of phone record
|
||||
@@ -9052,7 +9449,7 @@ if ($ADD==611111111)
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
$fp = fopen ("./admin_changes_log.txt", "a");
|
||||
fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n");
|
||||
fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|$stmt|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
echo "<br><B>CALL TIME DELETION COMPLETED: $call_time_id</B>\n";
|
||||
@@ -9119,6 +9516,39 @@ $ADD='1000000000'; # go to call times list
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=631111111 delete shift record
|
||||
######################
|
||||
|
||||
if ($ADD==631111111)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) )
|
||||
{
|
||||
echo "<br>SHIFT NOT DELETED - Please go back and look at the data you entered\n";
|
||||
echo "<br>Shift ID must be at least 2 characters in length\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="DELETE from vicidial_shifts where shift_id='$shift_id' limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG CHANGES TO LOG FILE ###
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
$fp = fopen ("./admin_changes_log.txt", "a");
|
||||
fwrite ($fp, "$date|!DELETING SHIFT!!!!!|$PHP_AUTH_USER|$ip|$stmt|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
echo "<br><B>SHIFT DELETION COMPLETED: $shift_id</B>\n";
|
||||
echo "<br><br>\n";
|
||||
}
|
||||
|
||||
$ADD='130000000'; # go to shifts list
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=61111111111 delete phone record
|
||||
######################
|
||||
@@ -12084,6 +12514,7 @@ if ($ADD==311111)
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$user_group = $row[0];
|
||||
$group_name = $row[1];
|
||||
$GROUP_shifts = $row[5];
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "<br>MODIFY A USERS GROUP ENTRY<form action=$PHP_SELF method=POST>\n";
|
||||
@@ -12092,16 +12523,42 @@ if ($ADD==311111)
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Group: </td><td align=left><input type=text name=user_group size=15 maxlength=20 value=\"$user_group\"> (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Description: </td><td align=left><input type=text name=group_name size=40 maxlength=40 value=\"$group_name\"> (description of group)$NWB#vicidial_user_groups-group_name$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Allowed Campaigns: </td><td align=left>\n";
|
||||
echo "$campaigns_list";
|
||||
echo "$NWB#vicidial_user_groups-allowed_campaigns$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Allowed Campaigns: <BR>$NWB#vicidial_user_groups-allowed_campaigns$NWE</td><td align=left>\n";
|
||||
echo "$campaigns_list <BR> ";
|
||||
echo "</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>QC Allowed Campaigns: </td><td align=left>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Group Shifts: <BR>$NWB#vicidial_user_groups-group_shifts$NWE</td><td align=left>\n";
|
||||
$stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$shifts_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
while ($shifts_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$shift_id_value = $rowx[0];
|
||||
$shift_name_value = $rowx[1];
|
||||
echo "<input type=\"checkbox\" name=\"group_shifts[]\" value=\"$shift_id_value\"";
|
||||
$p=0;
|
||||
while ($p<100)
|
||||
{
|
||||
if (ereg(" $shift_id_value ", $GROUP_shifts))
|
||||
{
|
||||
echo " CHECKED";
|
||||
}
|
||||
$p++;
|
||||
}
|
||||
echo "> <a href=\"$PHP_SELF?ADD=331111111&shift_id=$shift_id_value\">$shift_id_value</a> - $shift_name_value<BR>\n";
|
||||
$o++;
|
||||
}
|
||||
echo " <BR> </td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>QC Allowed Campaigns: <BR>$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE</td><td align=left>\n";
|
||||
echo "$qc_campaigns_list";
|
||||
echo "$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>QC Allowed Inbound Groups: </td><td align=left>\n";
|
||||
echo " <BR> </td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>QC Allowed Inbound Groups: <BR>$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE</td><td align=left>\n";
|
||||
echo "$qc_groups_list";
|
||||
echo "$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE</td></tr>\n";
|
||||
echo " <BR> </td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
@@ -12589,6 +13046,116 @@ echo "You are not authorized to view this page. Please go back.";
|
||||
}
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=331111111 modify shift definition info in the system
|
||||
######################
|
||||
|
||||
if ($ADD==331111111)
|
||||
{
|
||||
|
||||
if ($LOGmodify_call_times==1)
|
||||
{
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT * from vicidial_shifts where shift_id='$shift_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$shift_name = $row[1];
|
||||
$shift_start_time = $row[2];
|
||||
$shift_length = $row[3];
|
||||
$shift_weekdays = $row[4];
|
||||
|
||||
$shift_start_hour = substr($shift_start_time,0,2);
|
||||
$shift_start_min = substr($shift_start_time,2,2);
|
||||
$shift_length_hour = substr($shift_length,0,2);
|
||||
$shift_length_min = substr($shift_length,3,2);
|
||||
$shift_end_hour = ($shift_start_hour + $shift_length_hour);
|
||||
$shift_end_min = ($shift_start_min + $shift_length_min);
|
||||
if ($shift_end_min >=60)
|
||||
{
|
||||
$shift_end_min = ($shift_end_min - 60);
|
||||
$shift_end_hour++;
|
||||
}
|
||||
if ($shift_end_hour >=24)
|
||||
{
|
||||
$shift_end_hour = ($shift_end_hour - 24);
|
||||
}
|
||||
$shift_end_hour = sprintf("%02s", $shift_end_hour);
|
||||
$shift_end_min = sprintf("%02s", $shift_end_min);
|
||||
$shift_end = "$shift_end_hour$shift_end_min";
|
||||
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "<br>MODIFY A SHIFT<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=431111111>\n";
|
||||
echo "<input type=hidden name=shift_id value=\"$shift_id\">\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Shift ID: </td><td align=left><B>$shift_id</B></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Name: </td><td align=left><input type=text name=shift_name size=50 maxlength=50 value=\"$shift_name\"> (short description of the shift)$NWB#vicidial_shifts-shift_name$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Start Time: </td><td align=left><input type=text name=shift_start_time size=5 maxlength=4 id=shift_start_time value=\"$shift_start_time\">\n";
|
||||
echo " Shift End Time: <input type=text name=shift_end_time size=5 maxlength=4 id=shift_end_time value=\"$shift_end\">\n";
|
||||
echo "<input type=button name=shift_calc value=\"Calculate Shift Length\" onClick=\"shift_time();\"> $NWB#vicidial_shifts-shift_start_time$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Length: </td><td align=left><input type=text name=shift_length id=shift_length size=6 maxlength=5 value=\"$shift_length\"> $NWB#vicidial_shifts-shift_length$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Weekdays: <BR>$NWB#vicidial_shifts-shift_weekdays$NWE</td><td align=left>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"0\"";
|
||||
if (ereg('0',$shift_weekdays)) {echo " CHECKED";}
|
||||
echo ">Sunday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"1\"";
|
||||
if (ereg('1',$shift_weekdays)) {echo " CHECKED";}
|
||||
echo ">Monday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"2\"";
|
||||
if (ereg('2',$shift_weekdays)) {echo " CHECKED";}
|
||||
echo ">Tuesday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"3\"";
|
||||
if (ereg('3',$shift_weekdays)) {echo " CHECKED";}
|
||||
echo ">Wednesday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"4\"";
|
||||
if (ereg('4',$shift_weekdays)) {echo " CHECKED";}
|
||||
echo ">Thursday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"5\"";
|
||||
if (ereg('5',$shift_weekdays)) {echo " CHECKED";}
|
||||
echo ">Friday<BR>\n";
|
||||
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"6\"";
|
||||
if (ereg('6',$shift_weekdays)) {echo " CHECKED";}
|
||||
echo ">Saturday<BR>\n";
|
||||
echo "</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
echo "</TABLE><BR><BR>\n";
|
||||
echo "<B>USER GROUPS USING THIS SHIFT:</B><BR>\n";
|
||||
echo "<TABLE>\n";
|
||||
|
||||
|
||||
$stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\";";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$camps_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
while ($camps_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "<TR><TD><a href=\"$PHP_SELF?ADD=311111&user_group=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
|
||||
$o++;
|
||||
}
|
||||
|
||||
|
||||
echo "</TABLE>\n";
|
||||
echo "</center><BR><BR>\n";
|
||||
|
||||
if ($LOGdelete_call_times > 0)
|
||||
{
|
||||
echo "<br><br><a href=\"$PHP_SELF?ADD=531111111&shift_id=$shift_id\">DELETE THIS SHIFT DEFINITION</a>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "You are not authorized to view this page. Please go back.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=31111111111 modify phone record in the system
|
||||
######################
|
||||
@@ -13076,7 +13643,7 @@ if ($ADD==311111111111111)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version from system_settings;";
|
||||
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value from system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$version = $row[0];
|
||||
@@ -13096,12 +13663,14 @@ if ($ADD==311111111111111)
|
||||
$admin_home_url = $row[14];
|
||||
$enable_agc_xfer_log = $row[15];
|
||||
$db_schema_version = $row[16];
|
||||
$auto_user_add_value = $row[17];
|
||||
|
||||
echo "<br>MODIFY VICIDIAL SYSTEM SETTINGS<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=411111111111111>\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Version: </td><td align=left> $version</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>DB Schema Version: </td><td align=left> $db_schema_version</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Auto User-add Value: </td><td align=left> $auto_user_add_value</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Install Date: </td><td align=left> $install_date</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Use Non-Latin: </td><td align=left><select size=1 name=use_non_latin><option>1</option><option>0</option><option selected>$use_non_latin</option></select>$NWB#settings-use_non_latin$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Webroot Writable: </td><td align=left><select size=1 name=webroot_writable><option>1</option><option>0</option><option selected>$webroot_writable</option></select>$NWB#settings-webroot_writable$NWE</td></tr>\n";
|
||||
@@ -14073,6 +14642,41 @@ echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
}
|
||||
|
||||
######################
|
||||
# ADD=130000000 display all shifts
|
||||
######################
|
||||
if ($ADD==130000000)
|
||||
{
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT * from vicidial_shifts order by shift_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$filters_to_print = mysql_num_rows($rslt);
|
||||
|
||||
echo "<br>SHIFT LISTINGS:\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||
|
||||
$o=0;
|
||||
while ($filters_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("1$|3$|5$|7$|9$", $o))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=331111111&shift_id=$row[0]\">$row[0]</a></td>";
|
||||
echo "<td><font size=1> $row[1]</td>";
|
||||
echo "<td><font size=1> $row[2] </td>";
|
||||
echo "<td><font size=1> $row[3] </td>";
|
||||
echo "<td><font size=1> $row[4] </td>";
|
||||
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=331111111&shift_id=$row[0]\">MODIFY</a></td></tr>\n";
|
||||
$o++;
|
||||
}
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
}
|
||||
|
||||
######################
|
||||
# ADD=10000000000 display all phones
|
||||
######################
|
||||
@@ -14303,7 +14907,8 @@ if ($ADD==999999)
|
||||
<UL>
|
||||
<LI><a href="AST_timeonVDADall.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>TIME ON VDAD (per campaign)</a> <a href="AST_timeonVDADallSUMMARY.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>(all campaigns SUMMARY)</a> SIP <a href="AST_timeonVDADall.php?SIPmonitorLINK=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Listen</a> - <a href="AST_timeonVDADall.php?SIPmonitorLINK=2"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Barge</a> IAX <a href="AST_timeonVDADall.php?IAXmonitorLINK=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Listen</a> - <a href="AST_timeonVDADall.php?IAXmonitorLINK=2"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Barge</a></FONT>
|
||||
<LI><a href="AST_VDADstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>VDAD REPORT</a></FONT>
|
||||
<LI><a href="AST_CLOSERstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>CLOSER REPORT</a></FONT>
|
||||
<LI><a href="AST_CLOSERstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>INBOUND/CLOSER REPORT</a></FONT>
|
||||
<LI><a href="AST_CLOSER_service_level.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>INBOUND/CLOSER SERVICE_LEVEL REPORT</a></FONT>
|
||||
<LI><a href="AST_agent_performance_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>AGENT PERFORMANCE DETAIL</a></FONT>
|
||||
<LI><a href="fcstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>FRONTER - CLOSER REPORT</a></FONT>
|
||||
<LI><a href="vicidial_sales_viewer.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>AGENT SPREADSHEET PERFORMANCE</a></FONT>
|
||||
|
||||
@@ -20,11 +20,12 @@
|
||||
# 70417-1059 - Fixed default phone_code bug
|
||||
# 70510-1518 - Added campaign and system duplicate check and phonecode override
|
||||
# 80428-0417 - UTF8 changes
|
||||
# 80514-1030 - removed filesize limit and raised number of errors to be displayed
|
||||
#
|
||||
# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time.
|
||||
|
||||
$version = '2.0.4';
|
||||
$build = '70510-1518';
|
||||
$version = '2.0.5-25';
|
||||
$build = '80514-1030';
|
||||
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -551,7 +552,7 @@ function ParseFileName() {
|
||||
|
||||
$good++;
|
||||
} else {
|
||||
if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n";}
|
||||
if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list</font><b>\n";}
|
||||
$bad++;
|
||||
}
|
||||
$total++;
|
||||
@@ -766,7 +767,7 @@ function ParseFileName() {
|
||||
|
||||
$good++;
|
||||
} else {
|
||||
if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";}
|
||||
if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";}
|
||||
$bad++;
|
||||
}
|
||||
$total++;
|
||||
@@ -787,7 +788,7 @@ function ParseFileName() {
|
||||
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>";
|
||||
}
|
||||
|
||||
if ($leadfile && filesize($LF_path)<=8388608) {
|
||||
if ($leadfile) {
|
||||
$total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list='';
|
||||
if ($file_layout=="standard") {
|
||||
|
||||
@@ -990,7 +991,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
|
||||
|
||||
$good++;
|
||||
} else {
|
||||
if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";}
|
||||
if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";}
|
||||
$bad++;
|
||||
}
|
||||
$total++;
|
||||
@@ -1216,7 +1217,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
|
||||
|
||||
$good++;
|
||||
} else {
|
||||
if ($bad < 10000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";}
|
||||
if ($bad < 1000000) {print "<BR></b><font size=1 color=red>record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead</font><b>\n";}
|
||||
$bad++;
|
||||
}
|
||||
$total++;
|
||||
@@ -1454,8 +1455,8 @@ if ($leadfile && filesize($LF_path)<=8388608) {
|
||||
# }
|
||||
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>";
|
||||
}
|
||||
} else if (filesize($leadfile)>8388608) {
|
||||
print "<center><font face='arial, helvetica' size=3 color='#990000'><B>ERROR: File exceeds the 8MB limit.</B></font></center>";
|
||||
#} else if (filesize($leadfile)>8388608) {
|
||||
# print "<center><font face='arial, helvetica' size=3 color='#990000'><B>ERROR: File exceeds the 8MB limit.</B></font></center>";
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user