added timeclock_edit script
added date and phone number format definitions to admin.php/vicidial.php and DB git-svn-id: svn://192.168.202.10@895 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -75,7 +75,7 @@ server_description VARCHAR(255),
|
||||
server_ip VARCHAR(15) NOT NULL,
|
||||
active ENUM('Y','N'),
|
||||
asterisk_version VARCHAR(20) default '1.2.9',
|
||||
max_vicidial_trunks SMALLINT(4) default '96',
|
||||
max_vicidial_trunks SMALLINT(4) default '23',
|
||||
telnet_host VARCHAR(20) NOT NULL default 'localhost',
|
||||
telnet_port INT(5) NOT NULL default '5038',
|
||||
ASTmgrUSERNAME VARCHAR(20) NOT NULL default 'cron',
|
||||
@@ -262,7 +262,7 @@ state VARCHAR(2),
|
||||
province VARCHAR(50),
|
||||
postal_code VARCHAR(10),
|
||||
country_code VARCHAR(3),
|
||||
gender ENUM('M','F'),
|
||||
gender ENUM('M','F','U') default 'U',
|
||||
date_of_birth DATE,
|
||||
alt_phone VARCHAR(12),
|
||||
email VARCHAR(70),
|
||||
@@ -313,6 +313,8 @@ user_level INT(2) default '0',
|
||||
comments VARCHAR(20),
|
||||
campaign_weight TINYINT(1) default '0',
|
||||
calls_today SMALLINT(5) UNSIGNED default '0',
|
||||
external_hangup VARCHAR(1) default '',
|
||||
external_status VARCHAR(6) default '',
|
||||
index (random_id),
|
||||
index (last_call_time),
|
||||
index (last_update_time),
|
||||
@@ -967,7 +969,10 @@ enable_agc_xfer_log ENUM('0','1') default '0',
|
||||
db_schema_version INT(8) UNSIGNED default '0',
|
||||
auto_user_add_value INT(9) UNSIGNED default '101',
|
||||
timeclock_end_of_day VARCHAR(4) default '0000',
|
||||
timeclock_last_reset_date DATE
|
||||
timeclock_last_reset_date DATE,
|
||||
vdc_header_date_format VARCHAR(50) default 'MS_DASH_24HR 2008-06-24 23:59:59',
|
||||
vdc_customer_date_format VARCHAR(50) default 'AL_TEXT_AMPM OCT 24, 2008 11:59:59 PM',
|
||||
vdc_header_phone_format VARCHAR(50) default 'US_PARN (000)000-0000'
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -1212,5 +1217,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='1093';
|
||||
UPDATE system_settings SET db_schema_version='1094';
|
||||
|
||||
|
||||
@@ -279,3 +279,14 @@ index (record_id)
|
||||
);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1093';
|
||||
|
||||
ALTER TABLE vicidial_live_agents ADD external_hangup VARCHAR(1) default '';
|
||||
ALTER TABLE vicidial_live_agents ADD external_status VARCHAR(6) default '';
|
||||
|
||||
ALTER TABLE vicidial_list MODIFY gender ENUM('M','F','U') default 'U';
|
||||
|
||||
ALTER TABLE system_settings ADD vdc_header_date_format VARCHAR(50) default 'MS_DASH_24HR 2008-06-24 23:59:59';
|
||||
ALTER TABLE system_settings ADD vdc_customer_date_format VARCHAR(50) default 'AL_TEXT_AMPM OCT 24, 2008 11:59:59 PM';
|
||||
ALTER TABLE system_settings ADD vdc_header_phone_format VARCHAR(50) default 'US_PARN (000)000-0000';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1094';
|
||||
|
||||
@@ -196,6 +196,25 @@ ADD NUMBERS TO THE DNC LIST||
|
||||
Phone Numbers: ||
|
||||
one phone number per line only||
|
||||
VICIDIAL DNC List -<\/B> This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add numbers to this list so that they will not be called by campaigns that use the internal DNC list||
|
||||
Time Sheet ||
|
||||
Timeclock Record Edit||
|
||||
Default date format with year month day||
|
||||
USA date format with month day year||
|
||||
European date format with day month year||
|
||||
Text date format with abbreviated month day||
|
||||
followed by 24 hour time||
|
||||
followed by 12 hour time||
|
||||
Agent Screen Header Date Format -<\/B> This menu allows you to choose the format of the date that shows up at the top of the VICIDIAL agent screen. The options for this setting are: default is||
|
||||
Agent Screen Customer Date Format -<\/B> This menu allows you to choose the format of the customer time zone date that shows up at the top of the Customer Information section of the VICIDIAL agent screen. The options for this setting are: default is||
|
||||
Agent Screen Customer Phone Format -<\/B> This menu allows you to choose the format of the customer phone number that shows up in the status section of the VICIDIAL agent screen. The options for this setting are: default is||
|
||||
dash separated phone number||
|
||||
dash separated number with area code in parenthesis||
|
||||
No formatting||
|
||||
with space after city code||
|
||||
space separated phone number||
|
||||
Agent Screen Header Date Format||
|
||||
Agent Screen Customer Date Format||
|
||||
Agent Screen Customer Phone Format||
|
||||
|
||||
|
||||
############################################################ CLIENT
|
||||
@@ -221,6 +240,7 @@ Click LOGIN below to log-in||
|
||||
Amount of time you have been logged-in: ||
|
||||
You logged-in at:||
|
||||
Click LOGOUT below to log-out||
|
||||
Undefined||
|
||||
|
||||
|
||||
############################################################ MANAGER Manual
|
||||
|
||||
@@ -178,10 +178,11 @@
|
||||
# 80507-0932 - Fixed Script display bug (+ instead of space)
|
||||
# 80519-1425 - Added calls in queue display
|
||||
# 80523-1630 - Added Tiemclock links
|
||||
# 80625-0047 - Added U option for gender, added date/phone display options
|
||||
#
|
||||
|
||||
$version = '2.0.5-156';
|
||||
$build = '80523-1630';
|
||||
$version = '2.0.5-157';
|
||||
$build = '80625-0047';
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
@@ -253,7 +254,7 @@ $random = (rand(1000000, 9999999) + 10000000);
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
@@ -262,6 +263,9 @@ while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$vdc_header_date_format = $row[1];
|
||||
$vdc_customer_date_format = $row[2];
|
||||
$vdc_header_phone_format = $row[3];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
@@ -1949,6 +1953,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var LogouTKicKAlL = '<? echo $LogouTKicKAlL ?>';
|
||||
var flag_channels = '<? echo $flag_channels ?>';
|
||||
var flag_string = '<? echo $flag_string ?>';
|
||||
var vdc_header_date_format = '<? echo $vdc_header_date_format ?>';
|
||||
var vdc_customer_date_format = '<? echo $vdc_customer_date_format ?>';
|
||||
var vdc_header_phone_format = '<? echo $vdc_header_phone_format ?>';
|
||||
var DiaLControl_auto_HTML = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pause\"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"./images/vdc_LB_resume.gif\" border=0 alt=\"Resume\"></a>";
|
||||
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"./images/vdc_LB_pause.gif\" border=0 alt=\"Pause\"></a><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
|
||||
var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pause\"><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
|
||||
@@ -3340,7 +3347,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
MD_ring_secondS++;
|
||||
var dispnum = lead_dial_number;
|
||||
var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10);
|
||||
|
||||
var status_display_number = phone_number_format(dispnum);
|
||||
|
||||
document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + CIDcheck + " Waiting for Ring... " + MD_ring_secondS + " seconds";
|
||||
// alert("channel not found yet:\n" + campaign);
|
||||
@@ -3408,7 +3416,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
|
||||
MD_channel_look=0;
|
||||
var dispnum = lead_dial_number;
|
||||
var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10);
|
||||
var status_display_number = phone_number_format(dispnum);
|
||||
|
||||
document.getElementById("MainStatuSSpan").innerHTML = " Called: " + status_display_number + " UID: " + CIDcheck + " ";
|
||||
|
||||
@@ -3554,13 +3562,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
|
||||
lead_dial_number = document.vicidial_form.phone_number.value;
|
||||
var dispnum = document.vicidial_form.phone_number.value;
|
||||
var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10);
|
||||
var status_display_number = phone_number_format(dispnum);
|
||||
|
||||
document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + MDnextCID + " " + man_status;
|
||||
if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';}
|
||||
|
||||
var gIndex = 1;
|
||||
if (document.vicidial_form.gender.value == 'M') {var gIndex = 0;}
|
||||
var gIndex = 0;
|
||||
if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;}
|
||||
if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;}
|
||||
document.getElementById("gender_list").selectedIndex = gIndex;
|
||||
|
||||
var genderIndex = document.getElementById("gender_list").selectedIndex;
|
||||
@@ -3869,7 +3878,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
custchannellive=1;
|
||||
|
||||
var dispnum = manDiaLonly_num;
|
||||
var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10);
|
||||
var status_display_number = phone_number_format(dispnum);
|
||||
|
||||
document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + MDnextCID + " Waiting for Ring...";
|
||||
|
||||
@@ -4177,13 +4186,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
dialed_label = check_VDIC_array[37];
|
||||
source_id = check_VDIC_array[38];
|
||||
|
||||
var gIndex = 1;
|
||||
if (document.vicidial_form.gender.value == 'M') {var gIndex = 0;}
|
||||
var gIndex = 0;
|
||||
if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;}
|
||||
if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;}
|
||||
document.getElementById("gender_list").selectedIndex = gIndex;
|
||||
|
||||
lead_dial_number = document.vicidial_form.phone_number.value;
|
||||
var dispnum = document.vicidial_form.phone_number.value;
|
||||
var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10);
|
||||
var status_display_number = phone_number_format(dispnum);
|
||||
|
||||
document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + status_display_number + " UID: " + CIDcheck + " " + VDIC_fronter;
|
||||
|
||||
@@ -4205,7 +4215,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2];
|
||||
}
|
||||
var dispnum = document.vicidial_form.phone_number.value;
|
||||
var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10);
|
||||
var status_display_number = phone_number_format(dispnum);
|
||||
|
||||
document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + " " + VDIC_fronter;
|
||||
}
|
||||
@@ -5868,6 +5878,54 @@ function utf8_decode(utftext) {
|
||||
};
|
||||
|
||||
|
||||
// ################################################################################
|
||||
// phone number format
|
||||
function phone_number_format(formatphone) {
|
||||
// customer_local_time, status date display 9999999999
|
||||
// vdc_header_phone_format
|
||||
// US_DASH 000-000-0000 - USA dash separated phone number<BR>
|
||||
// US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis<BR>
|
||||
// UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code<BR>
|
||||
// AU_SPAC 000 000 000 - Australia space separated phone number<BR>
|
||||
// IT_DASH 0000-000-000 - Italy dash separated phone number<BR>
|
||||
// FR_SPAC 00 00 00 00 00 - France space separated phone number<BR>
|
||||
var regUS_DASHphone = new RegExp("US_DASH","g");
|
||||
var regUS_PARNphone = new RegExp("US_PARN","g");
|
||||
var regUK_DASHphone = new RegExp("UK_DASH","g");
|
||||
var regAU_SPACphone = new RegExp("AU_SPAC","g");
|
||||
var regIT_DASHphone = new RegExp("IT_DASH","g");
|
||||
var regFR_SPACphone = new RegExp("FR_SPAC","g");
|
||||
var status_display_number = formatphone;
|
||||
var dispnum = formatphone;
|
||||
if (vdc_header_phone_format.match(regUS_DASHphone))
|
||||
{
|
||||
var status_display_number = dispnum.substring(0,3) + '-' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10);
|
||||
}
|
||||
if (vdc_header_phone_format.match(regUS_PARNphone))
|
||||
{
|
||||
var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10);
|
||||
}
|
||||
if (vdc_header_phone_format.match(regUK_DASHphone))
|
||||
{
|
||||
var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,6) + '-' + dispnum.substring(6,10);
|
||||
}
|
||||
if (vdc_header_phone_format.match(regAU_SPACphone))
|
||||
{
|
||||
var status_display_number = dispnum.substring(0,3) + ' ' + dispnum.substring(3,6) + ' ' + dispnum.substring(6,9);
|
||||
}
|
||||
if (vdc_header_phone_format.match(regIT_DASHphone))
|
||||
{
|
||||
var status_display_number = dispnum.substring(0,4) + '-' + dispnum.substring(4,7) + '-' + dispnum.substring(8,10);
|
||||
}
|
||||
if (vdc_header_phone_format.match(regFR_SPACphone))
|
||||
{
|
||||
var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,4) + ' ' + dispnum.substring(4,6) + ' ' + dispnum.substring(6,8) + ' ' + dispnum.substring(8,10);
|
||||
}
|
||||
|
||||
return status_display_number;
|
||||
};
|
||||
|
||||
|
||||
// ################################################################################
|
||||
// Move the Dispo frame out of the way and change the link to maximize
|
||||
function DispoMinimize()
|
||||
@@ -6284,6 +6342,11 @@ else
|
||||
var hours = t.getHours();
|
||||
var min = t.getMinutes();
|
||||
var sec = t.getSeconds();
|
||||
var regMSdate = new RegExp("MS_","g");
|
||||
var regUSdate = new RegExp("US_","g");
|
||||
var regEUdate = new RegExp("EU_","g");
|
||||
var regALdate = new RegExp("AL_","g");
|
||||
var regAMPMdate = new RegExp("AMPM","g");
|
||||
if (year < 1000) {year+=1900}
|
||||
if (month< 10) {month= "0" + month}
|
||||
if (daym< 10) {daym= "0" + daym}
|
||||
@@ -6294,7 +6357,49 @@ else
|
||||
filedate = year + "" + month + "" + daym + "-" + hours + "" + min + "" + sec;
|
||||
tinydate = Tyear + "" + month + "" + daym + "" + hours + "" + min + "" + sec;
|
||||
SQLdate = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec;
|
||||
document.getElementById("status").innerHTML = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec + display_message;
|
||||
|
||||
var status_date = '';
|
||||
var status_time = hours + ":" + min + ":" + sec;
|
||||
if (vdc_header_date_format.match(regMSdate))
|
||||
{
|
||||
status_date = year + "-" + month + "-" + daym;
|
||||
}
|
||||
if (vdc_header_date_format.match(regUSdate))
|
||||
{
|
||||
status_date = month + "/" + daym + "/" + year;
|
||||
}
|
||||
if (vdc_header_date_format.match(regEUdate))
|
||||
{
|
||||
status_date = daym + "/" + month + "/" + year;
|
||||
}
|
||||
if (vdc_header_date_format.match(regALdate))
|
||||
{
|
||||
var statusmon='';
|
||||
if (mon == 1) {statusmon = "JAN";}
|
||||
if (mon == 2) {statusmon = "FEB";}
|
||||
if (mon == 3) {statusmon = "MAR";}
|
||||
if (mon == 4) {statusmon = "APR";}
|
||||
if (mon == 5) {statusmon = "MAY";}
|
||||
if (mon == 6) {statusmon = "JUN";}
|
||||
if (mon == 7) {statusmon = "JLY";}
|
||||
if (mon == 8) {statusmon = "AUG";}
|
||||
if (mon == 9) {statusmon = "SEP";}
|
||||
if (mon == 10) {statusmon = "OCT";}
|
||||
if (mon == 11) {statusmon = "NOV";}
|
||||
if (mon == 12) {statusmon = "DEC";}
|
||||
|
||||
status_date = statusmon + " " + daym;
|
||||
}
|
||||
if (vdc_header_date_format.match(regAMPMdate))
|
||||
{
|
||||
var AMPM = 'AM';
|
||||
if (hours == 12) {AMPM = 'PM';}
|
||||
if (hours == 0) {AMPM = 'AM'; hours = '12';}
|
||||
if (hours > 12) {hours = (hours - 12); AMPM = 'PM';}
|
||||
status_time = hours + ":" + min + ":" + sec + " " + AMPM;
|
||||
}
|
||||
|
||||
document.getElementById("status").innerHTML = status_date + " " + status_time + display_message;
|
||||
if (VD_live_customer_call==1)
|
||||
{
|
||||
var customer_gmt = parseFloat(document.vicidial_form.gmt_offset_now.value);
|
||||
@@ -6303,35 +6408,64 @@ else
|
||||
var UnixTimec = (UnixTime + (3600 * customer_gmt_diff));
|
||||
var UnixTimeMSc = (UnixTimec * 1000);
|
||||
c.setTime(UnixTimeMSc);
|
||||
var Cyear= c.getYear()
|
||||
var Cmon= c.getMonth()
|
||||
// Cmon++;
|
||||
Cmon++;
|
||||
var Cdaym= c.getDate()
|
||||
var Chours = c.getHours();
|
||||
var Cmin = c.getMinutes();
|
||||
var Csec = c.getSeconds();
|
||||
if (Cyear < 1000) {Cyear+=1900}
|
||||
if (Cmon < 10) {Cmon= "0" + Cmon}
|
||||
if (Cdaym < 10) {Cdaym= "0" + Cdaym}
|
||||
if (Chours < 10) {Chours = "0" + Chours;}
|
||||
if ( (Cmin < 10) && (Cmin.length < 2) ) {Cmin = "0" + Cmin;}
|
||||
if ( (Csec < 10) && (Csec.length < 2) ) {Csec = "0" + Csec;}
|
||||
if (Cmon == 0) {Cmon = "JAN";}
|
||||
if (Cmon == 1) {Cmon = "FEB";}
|
||||
if (Cmon == 2) {Cmon = "MAR";}
|
||||
if (Cmon == 3) {Cmon = "APR";}
|
||||
if (Cmon == 4) {Cmon = "MAY";}
|
||||
if (Cmon == 5) {Cmon = "JUN";}
|
||||
if (Cmon == 6) {Cmon = "JLY";}
|
||||
if (Cmon == 7) {Cmon = "AUG";}
|
||||
if (Cmon == 8) {Cmon = "SEP";}
|
||||
if (Cmon == 9) {Cmon = "OCT";}
|
||||
if (Cmon == 10) {Cmon = "NOV";}
|
||||
if (Cmon == 11) {Cmon = "DEC";}
|
||||
if (Chours == 12) {AMPM = 'PM';}
|
||||
if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';}
|
||||
if (Cmin < 10) {Cmin = "0" + Cmin;}
|
||||
if (Csec < 10) {Csec = "0" + Csec;}
|
||||
|
||||
var customer_local_time = Cmon + " " + Cdaym + " " + Chours + ":" + Cmin + ":" + Csec + " " + AMPM;
|
||||
var customer_date = '';
|
||||
var customer_time = Chours + ":" + Cmin + ":" + Csec;
|
||||
if (vdc_customer_date_format.match(regMSdate))
|
||||
{
|
||||
customer_date = Cyear + "-" + Cmon + "-" + Cdaym;
|
||||
}
|
||||
if (vdc_customer_date_format.match(regUSdate))
|
||||
{
|
||||
customer_date = Cmon + "/" + Cdaym + "/" + Cyear;
|
||||
}
|
||||
if (vdc_customer_date_format.match(regEUdate))
|
||||
{
|
||||
customer_date = Cdaym + "/" + Cmon + "/" + Cyear;
|
||||
}
|
||||
if (vdc_customer_date_format.match(regALdate))
|
||||
{
|
||||
var customermon='';
|
||||
if (Cmon == 1) {customermon = "JAN";}
|
||||
if (Cmon == 2) {customermon = "FEB";}
|
||||
if (Cmon == 3) {customermon = "MAR";}
|
||||
if (Cmon == 4) {customermon = "APR";}
|
||||
if (Cmon == 5) {customermon = "MAY";}
|
||||
if (Cmon == 6) {customermon = "JUN";}
|
||||
if (Cmon == 7) {customermon = "JLY";}
|
||||
if (Cmon == 8) {customermon = "AUG";}
|
||||
if (Cmon == 9) {customermon = "SEP";}
|
||||
if (Cmon == 10) {customermon = "OCT";}
|
||||
if (Cmon == 11) {customermon = "NOV";}
|
||||
if (Cmon == 12) {customermon = "DEC";}
|
||||
|
||||
customer_date = customermon + " " + Cdaym + " ";
|
||||
}
|
||||
if (vdc_customer_date_format.match(regAMPMdate))
|
||||
{
|
||||
var AMPM = 'AM';
|
||||
if (Chours == 12) {AMPM = 'PM';}
|
||||
if (Chours == 0) {AMPM = 'AM'; Chours = '12';}
|
||||
if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';}
|
||||
customer_time = Chours + ":" + Cmin + ":" + Csec + " " + AMPM;
|
||||
}
|
||||
|
||||
var customer_local_time = customer_date + " " + customer_time;
|
||||
document.vicidial_form.custdatetime.value = customer_local_time;
|
||||
|
||||
}
|
||||
@@ -7036,7 +7170,7 @@ RECORD ID: <font class="body_small"><span id="RecorDID"></span></font><BR>
|
||||
<div class="text_input" id="MainPanelCustInfo">
|
||||
<table><tr>
|
||||
<td align=right><font class="body_text"> seconds: </td>
|
||||
<td align=left><font class="body_text"><input type=text size=3 name=SecondS class="cust_form" value=""> Channel: <input type=text size=6 name=callchannel class="cust_form" value=""> Cust Time: <input type=text size=22 name=custdatetime class="cust_form" value=""></td>
|
||||
<td align=left><font class="body_text"><input type=text size=3 name=SecondS class="cust_form" value=""> Channel: <input type=text size=6 name=callchannel class="cust_form" value=""> Cust Time: <input type=text size=27 name=custdatetime class="cust_form" value=""></td>
|
||||
</tr><tr>
|
||||
<td colspan=2 align=center> Customer Information: <span id="CusTInfOSpaN"></span></td>
|
||||
</tr><tr>
|
||||
@@ -7053,7 +7187,7 @@ RECORD ID: <font class="body_small"><span id="RecorDID"></span></font><BR>
|
||||
<td align=left><font class="body_text"><input type=text size=20 name=city maxlength=50 class="cust_form" value=""> State: <input type=text size=2 name=state maxlength=2 class="cust_form" value=""> PostCode: <input type=text size=9 name=postal_code maxlength=10 class="cust_form" value=""></td>
|
||||
</tr><tr>
|
||||
<td align=right><font class="body_text"> Province: </td>
|
||||
<td align=left><font class="body_text"><input type=text size=20 name=province maxlength=50 class="cust_form" value=""> Vendor ID: <input type=text size=15 name=vendor_lead_code maxlength=20 class="cust_form" value=""> Gender: <select size=1 name=gender_list class="cust_form" id=gender_list><option value="M">M - Male</option><option value="F">F - Female</option></select></td>
|
||||
<td align=left><font class="body_text"><input type=text size=20 name=province maxlength=50 class="cust_form" value=""> Vendor ID: <input type=text size=15 name=vendor_lead_code maxlength=20 class="cust_form" value=""> Gender: <select size=1 name=gender_list class="cust_form" id=gender_list><option value="U">U - Undefined</option><option value="M">M - Male</option><option value="F">F - Female</option></select></td>
|
||||
</tr><tr>
|
||||
<td align=right><font class="body_text"> Phone: </td>
|
||||
<td align=left><font class="body_text"><input type=text size=11 name=phone_number maxlength=12 class="cust_form" value=""> DialCode: <input type=text size=4 name=phone_code maxlength=10 class="cust_form" value=""> Alt. Phone: <input type=text size=11 name=alt_phone maxlength=12 class="cust_form" value=""></td>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#
|
||||
# 60619-1729 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 80624-0132 - Added vicidial_timeclock entries
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -17,13 +18,13 @@ $PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["agent"])) {$agent=$_GET["agent"];}
|
||||
elseif (isset($_POST["agent"])) {$agent=$_POST["agent"];}
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["calls_summary"])) {$calls_summary=$_GET["calls_summary"];}
|
||||
elseif (isset($_POST["calls_summary"])) {$calls_summary=$_POST["calls_summary"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["calls_summary"])) {$calls_summary=$_GET["calls_summary"];}
|
||||
elseif (isset($_POST["calls_summary"])) {$calls_summary=$_POST["calls_summary"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["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);
|
||||
@@ -277,6 +278,104 @@ $login_time = ($end - $start);
|
||||
echo "-----------------------------------------\n";
|
||||
echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n";
|
||||
|
||||
|
||||
### timeclock records
|
||||
|
||||
|
||||
##### vicidial_timeclock log records for user #####
|
||||
|
||||
$total_login_time=0;
|
||||
$SQday_ARY = explode('-',$query_date_BEGIN);
|
||||
$EQday_ARY = explode('-',$query_date_END);
|
||||
$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
|
||||
$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
|
||||
|
||||
echo "\n";
|
||||
|
||||
echo "<B>TIMECLOCK LOGIN/LOGOUT TIME:</B>\n";
|
||||
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n";
|
||||
|
||||
$stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='$agent' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';";
|
||||
if ($DB>0) {echo "|$stmt|";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$events_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$total_logs=0;
|
||||
$o=0;
|
||||
while ($events_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ( ($row[0]=='START') or ($row[0]=='LOGIN') )
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$TC_log_date = date("Y-m-d H:i:s", $row[1]);
|
||||
|
||||
$manager_edit='';
|
||||
if (strlen($row[6])>0) {$manager_edit = ' * ';}
|
||||
|
||||
if (ereg("LOGIN", $row[0]))
|
||||
{
|
||||
$login_sec='';
|
||||
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
|
||||
echo "<td align=right><font size=2>$manager_edit</td>";
|
||||
echo "<td align=right><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $TC_log_date</td>\n";
|
||||
echo "<td align=right><font size=2> $row[4]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[2]</td>\n";
|
||||
echo "<td align=right><font size=2> </td></tr>\n";
|
||||
}
|
||||
if (ereg("LOGOUT", $row[0]))
|
||||
{
|
||||
$login_sec = $row[3];
|
||||
$total_login_time = ($total_login_time + $login_sec);
|
||||
$event_hours = ($login_sec / 3600);
|
||||
$event_hours_int = round($event_hours, 2);
|
||||
$event_hours_int = intval("$event_hours_int");
|
||||
$event_minutes = ($event_hours - $event_hours_int);
|
||||
$event_minutes = ($event_minutes * 60);
|
||||
$event_minutes_int = round($event_minutes, 0);
|
||||
if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";}
|
||||
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
|
||||
echo "<td align=right><font size=2>$manager_edit</td>";
|
||||
echo "<td align=right><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $TC_log_date</td>\n";
|
||||
echo "<td align=right><font size=2> $row[4]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[2]</td>\n";
|
||||
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int";
|
||||
if ($DB) {echo " - $total_login_time - $login_sec";}
|
||||
echo "</td></tr>\n";
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
if (strlen($login_sec)<1)
|
||||
{
|
||||
$login_sec = ($STARTtime - $row[1]);
|
||||
$total_login_time = ($total_login_time + $login_sec);
|
||||
if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";}
|
||||
}
|
||||
$total_login_hours = ($total_login_time / 3600);
|
||||
$total_login_hours_int = round($total_login_hours, 2);
|
||||
$total_login_hours_int = intval("$total_login_hours_int");
|
||||
$total_login_minutes = ($total_login_hours - $total_login_hours_int);
|
||||
$total_login_minutes = ($total_login_minutes * 60);
|
||||
$total_login_minutes_int = round($total_login_minutes, 0);
|
||||
if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";}
|
||||
|
||||
if ($DB) {echo " - $total_login_time - $login_sec";}
|
||||
|
||||
echo "<tr><td align=right><font size=2> </td>";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2><font size=2>TOTAL </td>\n";
|
||||
echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n";
|
||||
|
||||
echo "</TABLE>\n";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -787,10 +787,6 @@ if (strlen($usergroup)<1) {$usergroupSQL = '';}
|
||||
else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";}
|
||||
|
||||
$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;";
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$talking_to_print = mysql_num_rows($rslt);
|
||||
@@ -853,10 +849,6 @@ $talking_to_print = mysql_num_rows($rslt);
|
||||
}
|
||||
|
||||
$stmt="select login from phones where server_ip='$Aserver_ip[$i]' and $exten and protocol='$protocol';";
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Alogin[$i] = "$row[0]-----$i";
|
||||
@@ -1041,10 +1033,6 @@ $talking_to_print = mysql_num_rows($rslt);
|
||||
if ($CM == 'I')
|
||||
{
|
||||
$stmt="select campaign_id,stage from vicidial_auto_calls where callerid='$Acallerid[$i]' LIMIT 1;";
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$ingrp_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -759,6 +759,13 @@ if (isset($_GET["delete_timeclock_log"])) {$delete_timeclock_log=$_GET["delete
|
||||
elseif (isset($_POST["delete_timeclock_log"])) {$delete_timeclock_log=$_POST["delete_timeclock_log"];}
|
||||
if (isset($_GET["phone_numbers"])) {$phone_numbers=$_GET["phone_numbers"];}
|
||||
elseif (isset($_POST["phone_numbers"])) {$phone_numbers=$_POST["phone_numbers"];}
|
||||
if (isset($_GET["vdc_header_date_format"])) {$vdc_header_date_format=$_GET["vdc_header_date_format"];}
|
||||
elseif (isset($_POST["vdc_header_date_format"])) {$vdc_header_date_format=$_POST["vdc_header_date_format"];}
|
||||
if (isset($_GET["vdc_customer_date_format"])) {$vdc_customer_date_format=$_GET["vdc_customer_date_format"];}
|
||||
elseif (isset($_POST["vdc_customer_date_format"])) {$vdc_customer_date_format=$_POST["vdc_customer_date_format"];}
|
||||
if (isset($_GET["vdc_header_phone_format"])) {$vdc_header_phone_format=$_GET["vdc_header_phone_format"];}
|
||||
elseif (isset($_POST["vdc_header_phone_format"])) {$vdc_header_phone_format=$_POST["vdc_header_phone_format"];}
|
||||
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
|
||||
@@ -1146,6 +1153,13 @@ $welcome_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$welcome_m
|
||||
$onhold_prompt_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$onhold_prompt_filename);
|
||||
$campaign_shift_length = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$campaign_shift_length);
|
||||
|
||||
### ALPHA-NUMERIC and underscore and dash and slash and at and space and colon
|
||||
$vdc_header_date_format = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vdc_header_date_format);
|
||||
$vdc_customer_date_format = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vdc_customer_date_format);
|
||||
|
||||
### ALPHA-NUMERIC and underscore and dash and at and space and parantheses
|
||||
$vdc_header_phone_format = ereg_replace("[^- \(\)\_0-9a-zA-Z]","",$vdc_header_phone_format);
|
||||
|
||||
### remove semi-colons ###
|
||||
$lead_filter_sql = ereg_replace(";","",$lead_filter_sql);
|
||||
$list_mix_container = ereg_replace(";","",$list_mix_container);
|
||||
@@ -1310,11 +1324,12 @@ $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir);
|
||||
# 80528-0001 - Added campaign survey sub-section
|
||||
# 80528-1102 - Added user timeclock edit options
|
||||
# 80608-1304 - Changed add-to-DNC to allow for multiple entries per submission
|
||||
# 80625-0032 - Added time/phone display format options to system settings
|
||||
#
|
||||
# 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-132';
|
||||
$build = '80608-1304';
|
||||
$admin_version = '2.0.5-133';
|
||||
$build = '80625-0032';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -3919,6 +3934,44 @@ The VICIDIAL basic web-based lead loader is designed simply to take a lead file
|
||||
<BR>
|
||||
<B>Timeclock Last Auto Logout -</B> This field displays the date of the last auto-logout.
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-vdc_header_date_format">
|
||||
<BR>
|
||||
<B>Agent Screen Header Date Format -</B> This menu allows you to choose the format of the date that shows up at the top of the VICIDIAL agent screen. The options for this setting are: default is MS_DASH_24HR<BR>
|
||||
MS_DASH_24HR 2008-06-24 23:59:59 - Default date format with year month day followed by 24 hour time<BR>
|
||||
US_SLASH_24HR 06/24/2008 23:59:59 - USA date format with month day year followed by 24 hour time<BR>
|
||||
EU_SLASH_24HR 24/06/2008 23:59:59 - European date format with day month year followed by 24 hour time<BR>
|
||||
AL_TEXT_24HR JUN 24 23:59:59 - Text date format with abbreviated month day followed by 24 hour time<BR>
|
||||
MS_DASH_AMPM 2008-06-24 11:59:59 PM - Default date format with year month day followed by 12 hour time<BR>
|
||||
US_SLASH_AMPM 06/24/2008 11:59:59 PM - USA date format with month day year followed by 12 hour time<BR>
|
||||
EU_SLASH_AMPM 24/06/2008 11:59:59 PM - European date format with day month year followed by 12 hour time<BR>
|
||||
AL_TEXT_AMPM JUN 24 11:59:59 PM - Text date format with abbreviated month day followed by 12 hour time<BR>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-vdc_customer_date_format">
|
||||
<BR>
|
||||
<B>Agent Screen Customer Date Format -</B> This menu allows you to choose the format of the customer time zone date that shows up at the top of the Customer Information section of the VICIDIAL agent screen. The options for this setting are: default is AL_TEXT_AMPM<BR>
|
||||
MS_DASH_24HR 2008-06-24 23:59:59 - Default date format with year month day followed by 24 hour time<BR>
|
||||
US_SLASH_24HR 06/24/2008 23:59:59 - USA date format with month day year followed by 24 hour time<BR>
|
||||
EU_SLASH_24HR 24/06/2008 23:59:59 - European date format with day month year followed by 24 hour time<BR>
|
||||
AL_TEXT_24HR JUN 24 23:59:59 - Text date format with abbreviated month day followed by 24 hour time<BR>
|
||||
MS_DASH_AMPM 2008-06-24 11:59:59 PM - Default date format with year month day followed by 12 hour time<BR>
|
||||
US_SLASH_AMPM 06/24/2008 11:59:59 PM - USA date format with month day year followed by 12 hour time<BR>
|
||||
EU_SLASH_AMPM 24/06/2008 11:59:59 PM - European date format with day month year followed by 12 hour time<BR>
|
||||
AL_TEXT_AMPM JUN 24 11:59:59 PM - Text date format with abbreviated month day followed by 12 hour time<BR>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-vdc_header_phone_format">
|
||||
<BR>
|
||||
<B>Agent Screen Customer Phone Format -</B> This menu allows you to choose the format of the customer phone number that shows up in the status section of the VICIDIAL agent screen. The options for this setting are: default is US_PARN<BR>
|
||||
US_DASH 000-000-0000 - USA dash separated phone number<BR>
|
||||
US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis<BR>
|
||||
MS_NODS 0000000000 - No formatting<BR>
|
||||
UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code<BR>
|
||||
AU_SPAC 000 000 000 - Australia space separated phone number<BR>
|
||||
IT_DASH 0000-000-000 - Italy dash separated phone number<BR>
|
||||
FR_SPAC 00 00 00 00 00 - France space separated phone number<BR>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4490,7 +4543,7 @@ $admin_home_url_LU = $row[0];
|
||||
|
||||
<? if (strlen($users_hh) > 1) {
|
||||
?>
|
||||
<TR BGCOLOR=<?=$users_color ?>><TD ALIGN=LEFT COLSPAN=10><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> <a href="<? echo $PHP_SELF ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Show Users </a> | <a href="<? echo $PHP_SELF ?>?ADD=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Add A New User </a> | <a href="<? echo $PHP_SELF ?>?ADD=1A"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Copy User </a> | <a href="<? echo $PHP_SELF ?>?ADD=550"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Search For A User </a> | <a href="./user_stats.php?user=<?=$user ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> User Stats </a> | <a href="./user_status.php?user=<?=$user ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> User Status </a> </TD></TR>
|
||||
<TR BGCOLOR=<?=$users_color ?>><TD ALIGN=LEFT COLSPAN=10><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> <a href="<? echo $PHP_SELF ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Show Users </a> | <a href="<? echo $PHP_SELF ?>?ADD=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Add A New User </a> | <a href="<? echo $PHP_SELF ?>?ADD=1A"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Copy User </a> | <a href="<? echo $PHP_SELF ?>?ADD=550"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Search For A User </a> | <a href="./user_stats.php?user=<?=$user ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> User Stats </a> | <a href="./user_status.php?user=<?=$user ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> User Status </a> | <a href="./AST_agent_time_sheet.php?agent=<?=$user ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?=$subheader_font_size ?>> Time Sheet </a> </TD></TR>
|
||||
<? }
|
||||
if (strlen($campaigns_hh) > 1)
|
||||
{
|
||||
@@ -8377,7 +8430,7 @@ if ($ADD==411111111111111)
|
||||
|
||||
echo "<br>VICIDIAL SYSTEM SETTINGS MODIFIED\n";
|
||||
|
||||
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day';";
|
||||
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG CHANGES TO LOG FILE ###
|
||||
@@ -13893,7 +13946,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,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date 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,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format from system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$version = $row[0];
|
||||
@@ -13916,6 +13969,9 @@ if ($ADD==311111111111111)
|
||||
$auto_user_add_value = $row[17];
|
||||
$timeclock_end_of_day = $row[18];
|
||||
$timeclock_last_reset_date = $row[19];
|
||||
$vdc_header_date_format = $row[20];
|
||||
$vdc_customer_date_format = $row[21];
|
||||
$vdc_header_phone_format = $row[22];
|
||||
|
||||
echo "<br>MODIFY VICIDIAL SYSTEM SETTINGS<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=411111111111111>\n";
|
||||
@@ -13955,6 +14011,38 @@ if ($ADD==311111111111111)
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Agent Transfer Logfile: </td><td align=left><select size=1 name=enable_agc_xfer_log><option>1</option><option>0</option><option selected>$enable_agc_xfer_log</option></select>$NWB#settings-enable_agc_xfer_log$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Timeclock End Of Day: </td><td align=left><input type=text name=timeclock_end_of_day size=5 maxlength=4 value=\"$timeclock_end_of_day\">$NWB#settings-timeclock_end_of_day$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Timeclock Last Auto Logout: </td><td align=left> $timeclock_last_reset_date</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Header Date Format: </td><td align=left><select size=1 name=vdc_header_date_format>\n";
|
||||
echo "<option>MS_DASH_24HR 2008-06-24 23:59:59</option>\n";
|
||||
echo "<option>US_SLASH_24HR 06/24/2008 23:59:59</option>\n";
|
||||
echo "<option>EU_SLASH_24HR 24/06/2008 23:59:59</option>\n";
|
||||
echo "<option>AL_TEXT_24HR JUN 24 23:59:59</option>\n";
|
||||
echo "<option>MS_DASH_AMPM 2008-06-24 11:59:59 PM</option>\n";
|
||||
echo "<option>US_SLASH_AMPM 06/24/2008 11:59:59 PM</option>\n";
|
||||
echo "<option>EU_SLASH_AMPM 24/06/2008 11:59:59 PM</option>\n";
|
||||
echo "<option>AL_TEXT_AMPM JUN 24 11:59:59 PM</option>\n";
|
||||
echo "<option selected value=\"$vdc_header_date_format\">$vdc_header_date_format</option>\n";
|
||||
echo "</select>$NWB#settings-vdc_header_date_format$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Customer Date Format: </td><td align=left><select size=1 name=vdc_customer_date_format>\n";
|
||||
echo "<option>MS_DASH_24HR 2008-06-24 23:59:59</option>\n";
|
||||
echo "<option>US_SLASH_24HR 06/24/2008 23:59:59</option>\n";
|
||||
echo "<option>EU_SLASH_24HR 24/06/2008 23:59:59</option>\n";
|
||||
echo "<option>AL_TEXT_24HR JUN 24 23:59:59</option>\n";
|
||||
echo "<option>MS_DASH_AMPM 2008-06-24 11:59:59 PM</option>\n";
|
||||
echo "<option>US_SLASH_AMPM 06/24/2008 11:59:59 PM</option>\n";
|
||||
echo "<option>EU_SLASH_AMPM 24/06/2008 11:59:59 PM</option>\n";
|
||||
echo "<option>AL_TEXT_AMPM JUN 24 11:59:59 PM</option>\n";
|
||||
echo "<option selected value=\"$vdc_customer_date_format\">$vdc_customer_date_format</option>\n";
|
||||
echo "</select>$NWB#settings-vdc_customer_date_format$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Customer Phone Format: </td><td align=left><select size=1 name=vdc_header_phone_format>\n";
|
||||
echo "<option>US_DASH 000-000-0000</option>\n";
|
||||
echo "<option>US_PARN (000)000-0000</option>\n";
|
||||
echo "<option>MS_NODS 0000000000</option>\n";
|
||||
echo "<option>UK_DASH 00 0000-0000</option>\n";
|
||||
echo "<option>AU_SPAC 000 000 000</option>\n";
|
||||
echo "<option>IT_DASH 0000-000-000</option>\n";
|
||||
echo "<option>FR_SPAC 00 00 00 00 00</option>\n";
|
||||
echo "<option selected value=\"$vdc_header_phone_format\">$vdc_header_phone_format</option>\n";
|
||||
echo "</select>$NWB#settings-vdc_header_phone_format$NWE</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 "</form>\n";
|
||||
|
||||
@@ -0,0 +1,399 @@
|
||||
<?
|
||||
# timeclock_edit.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 80624-1342 - First build
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
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["LOGINbegin_date"])) {$LOGINbegin_date=$_GET["LOGINbegin_date"];}
|
||||
elseif (isset($_POST["LOGINbegin_date"])) {$LOGINbegin_date=$_POST["LOGINbegin_date"];}
|
||||
if (isset($_GET["LOGINend_date"])) {$LOGINend_date=$_GET["LOGINend_date"];}
|
||||
elseif (isset($_POST["LOGINend_date"])) {$LOGINend_date=$_POST["LOGINend_date"];}
|
||||
if (isset($_GET["LOGOUTbegin_date"])) {$LOGOUTbegin_date=$_GET["LOGOUTbegin_date"];}
|
||||
elseif (isset($_POST["LOGOUTbegin_date"])) {$LOGOUTbegin_date=$_POST["LOGOUTbegin_date"];}
|
||||
if (isset($_GET["LOGOUTend_date"])) {$LOGOUTend_date=$_GET["LOGOUTend_date"];}
|
||||
elseif (isset($_POST["LOGOUTend_date"])) {$LOGOUTend_date=$_POST["LOGOUTend_date"];}
|
||||
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
||||
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
|
||||
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
|
||||
if (isset($_GET["timeclock_id"])) {$timeclock_id=$_GET["timeclock_id"];}
|
||||
elseif (isset($_POST["timeclock_id"])) {$timeclock_id=$_POST["timeclock_id"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
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"];}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable 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];
|
||||
$webroot_writable = $row[1];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$StarTtimE = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$invalid_record=0;
|
||||
|
||||
if (!isset($begin_date)) {$begin_date = $TODAY;}
|
||||
if (!isset($end_date)) {$end_date = $TODAY;}
|
||||
|
||||
$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 ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$stmt="SELECT full_name,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname = $row[0];
|
||||
$modify_timeclock_log = $row[1];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
$stmt="SELECT full_name,user_group from vicidial_users where user='" . mysql_real_escape_string($user) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
$user_group = $row[1];
|
||||
|
||||
$stmt="SELECT event,tcid_link from vicidial_timeclock_log where timeclock_id='" . mysql_real_escape_string($timeclock_id) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$tc_logs_to_print = mysql_num_rows($rslt);
|
||||
if ($tc_logs_to_print > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$event = $row[0];
|
||||
$tcid_link = $row[1];
|
||||
}
|
||||
if (ereg("LOGIN",$event))
|
||||
{
|
||||
$LOGINevent_id = $timeclock_id;
|
||||
$LOGOUTevent_id = $tcid_link;
|
||||
if ( (ereg('NULL',$LOGOUTevent_id)) or (strlen($LOGOUTevent_id)<1) )
|
||||
{$invalid_record++;}
|
||||
}
|
||||
if (ereg("LOGOUT",$event))
|
||||
{
|
||||
$LOGOUTevent_id = $timeclock_id;
|
||||
$stmt="SELECT timeclock_id from vicidial_timeclock_log where tcid_link='" . mysql_real_escape_string($timeclock_id) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$tc_logs_to_print = mysql_num_rows($rslt);
|
||||
if ($tc_logs_to_print > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGINevent_id = $row[0];
|
||||
}
|
||||
if ( (ereg('NULL',$LOGOUTevent_id)) or (strlen($LOGOUTevent_id)<1) )
|
||||
{$invalid_record++;}
|
||||
}
|
||||
if (strlen($LOGOUTevent_id)<1)
|
||||
{$invalid_record++;}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>VICIDIAL ADMIN: Timeclock Record Edit</title>
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
?>
|
||||
</head>
|
||||
<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
<CENTER>
|
||||
<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> VICIDIAL ADMIN</a>: Timeclock Record Edit for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?> </TD></TR>
|
||||
|
||||
|
||||
|
||||
|
||||
<?
|
||||
|
||||
echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B> \n";
|
||||
|
||||
|
||||
if ( ($invalid_record < 1) or (strlen($timeclock_id)<1) )
|
||||
{
|
||||
##### BEGIN TIMECLOCK LOGOUT OF A USER #####
|
||||
if ( ( ($stage == "tc_log_user_OUT") or ($stage == "tc_log_user_IN") ) and ($modify_timeclock_log > 0) )
|
||||
{
|
||||
### get vicidial_timeclock_status record count for this user
|
||||
$stmt="SELECT count(*) from vicidial_timeclock_status where user='$user';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vts_count = $row[0];
|
||||
|
||||
$LOG_run=0;
|
||||
$last_action_sec=99;
|
||||
|
||||
if ($vts_count > 0)
|
||||
{
|
||||
### vicidial_timeclock_status record found, grab status and date of last activity
|
||||
$stmt="SELECT status,event_epoch from vicidial_timeclock_status where user='$user';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$status = $row[0];
|
||||
$event_epoch = $row[1];
|
||||
$last_action_date = date("Y-m-d H:i:s", $event_epoch);
|
||||
$last_action_sec = ($StarTtimE - $event_epoch);
|
||||
|
||||
if ($last_action_sec > 0)
|
||||
{
|
||||
$totTIME_H = ($last_action_sec / 3600);
|
||||
$totTIME_H_int = round($totTIME_H, 2);
|
||||
$totTIME_H_int = intval("$totTIME_H");
|
||||
$totTIME_M = ($totTIME_H - $totTIME_H_int);
|
||||
$totTIME_M = ($totTIME_M * 60);
|
||||
$totTIME_M_int = round($totTIME_M, 2);
|
||||
$totTIME_M_int = intval("$totTIME_M");
|
||||
$totTIME_S = ($totTIME_M - $totTIME_M_int);
|
||||
$totTIME_S = ($totTIME_S * 60);
|
||||
$totTIME_S = round($totTIME_S, 0);
|
||||
if (strlen($totTIME_H_int) < 1) {$totTIME_H_int = "0";}
|
||||
if ($totTIME_M_int < 10) {$totTIME_M_int = "0$totTIME_M_int";}
|
||||
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
|
||||
$totTIME_HMS = "$totTIME_H_int:$totTIME_M_int:$totTIME_S";
|
||||
}
|
||||
else
|
||||
{
|
||||
$totTIME_HMS='0:00:00';
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
### No vicidial_timeclock_status record found, insert one
|
||||
$stmt="INSERT INTO vicidial_timeclock_status set status='START', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$status='START';
|
||||
$totTIME_HMS='0:00:00';
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_timeclock_status record inserted for $user: |$affected_rows| -->\n";
|
||||
}
|
||||
|
||||
|
||||
##### Run timeclock login queries #####
|
||||
if ( ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage == "tc_log_user_IN") )
|
||||
{
|
||||
### Add a record to the timeclock log
|
||||
$stmtA="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME', manager_user='$PHP_AUTH_USER', manager_ip='$ip', notes='Manager LOGIN of user from user status page';";
|
||||
if ($DB) {echo "$stmtA\n";}
|
||||
$rslt=mysql_query($stmtA, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
$timeclock_id = mysql_insert_id($link);
|
||||
print "<!-- NEW vicidial_timeclock_log record inserted for $user: |$affected_rows|$timeclock_id| -->\n";
|
||||
|
||||
### Update the user's timeclock status record
|
||||
$stmtB="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';";
|
||||
if ($DB) {echo "$stmtB\n";}
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_status record updated for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Add a record to the timeclock audit log
|
||||
$stmtC="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';";
|
||||
if ($DB) {echo "$stmtC\n";}
|
||||
$rslt=mysql_query($stmtC, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_timeclock_audit_log record inserted for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Add a record to the vicidial_admin_log
|
||||
$SQL_log = "$stmtA|$stmtB|$stmtC|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TIMECLOCK', event_type='LOGIN', record_id='$user', event_code='USER FORCED LOGIN FROM STATUS PAGE', event_sql=\"$SQL_log\", event_notes='Timeclock ID: $timeclock_id|';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_admin_log record inserted for $PHP_AUTH_USER: |$affected_rows| -->\n";
|
||||
|
||||
$LOG_run++;
|
||||
$VDdisplayMESSAGE = "You have now logged-in the user: $user - $full_name";
|
||||
}
|
||||
|
||||
##### Run timeclock logout queries #####
|
||||
if ( ( ($status=='LOGIN') or ($status=='START') ) and ($stage == "tc_log_user_OUT") )
|
||||
{
|
||||
### Add a record to the timeclock log
|
||||
$stmtA="INSERT INTO vicidial_timeclock_log set event='LOGOUT', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME', manager_user='$PHP_AUTH_USER', manager_ip='$ip', notes='Manager LOGOUT of user from user status page';";
|
||||
if ($DB) {echo "$stmtA\n";}
|
||||
$rslt=mysql_query($stmtA, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
$timeclock_id = mysql_insert_id($link);
|
||||
print "<!-- NEW vicidial_timeclock_log record inserted for $user: |$affected_rows|$timeclock_id| -->\n";
|
||||
|
||||
### Update last login record in the timeclock log
|
||||
$stmtB="UPDATE vicidial_timeclock_log set login_sec='$last_action_sec',tcid_link='$timeclock_id' where event='LOGIN' and user='$user' order by timeclock_id desc limit 1;";
|
||||
if ($DB) {echo "$stmtB\n";}
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_log record updated for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Update the user's timeclock status record
|
||||
$stmtC="UPDATE vicidial_timeclock_status set status='LOGOUT', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';";
|
||||
if ($DB) {echo "$stmtC\n";}
|
||||
$rslt=mysql_query($stmtC, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_status record updated for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Add a record to the timeclock audit log
|
||||
$stmtD="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='LOGOUT', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';";
|
||||
if ($DB) {echo "$stmtD\n";}
|
||||
$rslt=mysql_query($stmtD, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_timeclock_audit_log record inserted for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Update last login record in the timeclock audit log
|
||||
$stmtE="UPDATE vicidial_timeclock_audit_log set login_sec='$last_action_sec',tcid_link='$timeclock_id' where event='LOGIN' and user='$user' order by timeclock_id desc limit 1;";
|
||||
if ($DB) {echo "$stmtE\n";}
|
||||
$rslt=mysql_query($stmtE, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_audit_log record updated for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Add a record to the vicidial_admin_log
|
||||
$SQL_log = "$stmtA|$stmtB|$stmtC|$stmtD|$stmtE|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TIMECLOCK', event_type='LOGOUT', record_id='$user', event_code='USER FORCED LOGOUT FROM STATUS PAGE', event_sql=\"$SQL_log\", event_notes='User login time: $last_action_sec|Timeclock ID: $timeclock_id|';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_admin_log record inserted for $PHP_AUTH_USER: |$affected_rows| -->\n";
|
||||
|
||||
$LOG_run++;
|
||||
$VDdisplayMESSAGE = "You have now logged-out the user: $user - $full_name<BR>Amount of time user was logged-in: $totTIME_HMS";
|
||||
}
|
||||
|
||||
if ($LOG_run < 1)
|
||||
{$VDdisplayMESSAGE = "ERROR: timeclock log problem, could not process: $status|$stage";}
|
||||
|
||||
echo "$VDdisplayMESSAGE\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
##### END TIMECLOCK LOGOUT OF A USER #####
|
||||
|
||||
echo "\n<BR>";
|
||||
|
||||
if ($modify_timeclock_log > 0)
|
||||
{
|
||||
$LOGINevent_id = $timeclock_id;
|
||||
$LOGOUTevent_id = $tcid_link;
|
||||
|
||||
echo "<BR><BR>\n";
|
||||
echo "<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<input type=hidden name=user value=\"$user\">\n";
|
||||
echo "<input type=hidden name=stage value=\"$TC_log_change_stage\">\n";
|
||||
echo "<input type=submit name=submit value=\"$TC_log_change_button\"><BR></form>\n";
|
||||
echo "<BR><BR>\n";
|
||||
}
|
||||
|
||||
|
||||
echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n";
|
||||
echo " - <a href=\"./user_stats.php?user=$user\">User Stats</a>\n";
|
||||
echo " - <a href=\"./admin.php?ADD=3&user=$user\">Modify User</a>\n";
|
||||
|
||||
echo "</B></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n";
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
|
||||
$RUNtime = ($ENDtime - $StarTtimE);
|
||||
|
||||
echo "\n\n\n<br><br><br>\n\n";
|
||||
|
||||
|
||||
echo "<font size=0>\n\n\n<br><br><br>\nscript runtime: $RUNtime seconds</font>";
|
||||
|
||||
echo "|$stage|$group|";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
echo "ERROR! You cannot edit this timeclock record: $timeclock_id\n";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</TD></TR><TABLE>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -315,7 +315,7 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f
|
||||
if (ereg("LOGIN", $row[0]))
|
||||
{
|
||||
$login_sec='';
|
||||
echo "<tr $bgcolor><td><font size=2>$row[5]</td>";
|
||||
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
|
||||
echo "<td align=right><font size=2>$manager_edit</td>";
|
||||
echo "<td align=right><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $TC_log_date</td>\n";
|
||||
@@ -334,7 +334,7 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f
|
||||
$event_minutes = ($event_minutes * 60);
|
||||
$event_minutes_int = round($event_minutes, 0);
|
||||
if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";}
|
||||
echo "<tr $bgcolor><td><font size=2>$row[5]</td>";
|
||||
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
|
||||
echo "<td align=right><font size=2>$manager_edit</td>";
|
||||
echo "<td align=right><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $TC_log_date</td>\n";
|
||||
|
||||
Reference in New Issue
Block a user