Added Callback User Transfer page
formatting changes to inbound daily report git-svn-id: svn://192.168.202.10@1851 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -84,6 +84,8 @@ OTHER CHANGES:
|
||||
|
||||
11. Added System Settings option to disable list counts in admin web screens
|
||||
|
||||
12. Added callback user transfer page, linked from Admin Utilities in Reports
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,9 +10,16 @@
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
# 120601-2235 - Added group name to header, added status breakdown counts to page and CSV with option to display them
|
||||
# 120611-2200 - Added ability to filter output by call time
|
||||
# 120819-0118 - Formatting changes
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
if (file_exists('options.php'))
|
||||
{
|
||||
require('options.php');
|
||||
}
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
@@ -30,6 +37,8 @@ if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdo
|
||||
elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];}
|
||||
if (isset($_GET["show_disposition_statuses"])) {$show_disposition_statuses=$_GET["show_disposition_statuses"];}
|
||||
elseif (isset($_POST["show_disposition_statuses"])) {$show_disposition_statuses=$_POST["show_disposition_statuses"];}
|
||||
if (isset($_GET["ignore_afterhours"])) {$ignore_afterhours=$_GET["ignore_afterhours"];}
|
||||
elseif (isset($_POST["ignore_afterhours"])) {$ignore_afterhours=$_POST["ignore_afterhours"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
@@ -47,6 +56,8 @@ if (strlen($shift)<2) {$shift='ALL';}
|
||||
$report_name = 'Inbound Daily Report';
|
||||
$db_source = 'M';
|
||||
|
||||
if ($ignore_afterhours=="checked") {$status_clause=" and status!='AFTHRS'";}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
|
||||
@@ -127,14 +138,34 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
|
||||
$whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
}
|
||||
|
||||
$LOGadmin_viewable_call_timesSQL='';
|
||||
$whereLOGadmin_viewable_call_timesSQL='';
|
||||
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
|
||||
if ($IDR_calltime_available==1)
|
||||
{
|
||||
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
|
||||
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
|
||||
$LOGadmin_viewable_call_timesSQL = "and call_time_id IN('---ALL---','$rawLOGadmin_viewable_call_timesSQL')";
|
||||
$whereLOGadmin_viewable_call_timesSQL = "where call_time_id IN('---ALL---','$rawLOGadmin_viewable_call_timesSQL')";
|
||||
$LOGadmin_viewable_call_timesSQL='';
|
||||
$whereLOGadmin_viewable_call_timesSQL='';
|
||||
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
|
||||
{
|
||||
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
|
||||
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
|
||||
$LOGadmin_viewable_call_timesSQL = "and call_time_id IN('---ALL---','$rawLOGadmin_viewable_call_timesSQL')";
|
||||
$whereLOGadmin_viewable_call_timesSQL = "where call_time_id IN('---ALL---','$rawLOGadmin_viewable_call_timesSQL')";
|
||||
}
|
||||
|
||||
$stmt="select call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$times_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $times_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$call_times[$i] = $row[0];
|
||||
$call_time_names[$i] = $row[1];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$shift="24hours";
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
@@ -242,18 +273,24 @@ $MAIN.=" ";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select> ";
|
||||
$MAIN.="<SELECT SIZE=1 NAME=shift>\n";
|
||||
$MAIN.="<option value=\"\">--</option>\n";
|
||||
$o=0;
|
||||
while ($times_to_print > $o)
|
||||
|
||||
|
||||
if ($IDR_calltime_available==1)
|
||||
{
|
||||
if ($call_times[$o] == $shift) {$MAIN.="<option selected value=\"$call_times[$o]\">$call_times[$o] - $call_time_names[$o]</option>\n";}
|
||||
else {$MAIN.="<option value=\"$call_times[$o]\">$call_times[$o] - $call_time_names[$o]</option>\n";}
|
||||
$o++;
|
||||
$MAIN.="<SELECT SIZE=1 NAME=shift>\n";
|
||||
$MAIN.="<option value=\"\">--</option>\n";
|
||||
$o=0;
|
||||
while ($times_to_print > $o)
|
||||
{
|
||||
if ($call_times[$o] == $shift) {$MAIN.="<option selected value=\"$call_times[$o]\">$call_times[$o] - $call_time_names[$o]</option>\n";}
|
||||
else {$MAIN.="<option value=\"$call_times[$o]\">$call_times[$o] - $call_time_names[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
$MAIN.="</SELECT>\n";
|
||||
}
|
||||
$MAIN.="</SELECT>\n";
|
||||
|
||||
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT></TD></TR>\n";
|
||||
$MAIN.="<TR><TD align='left'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><INPUT TYPE=checkbox NAME=hourly_breakdown VALUE='checked' $hourly_breakdown>Show hourly results<BR><INPUT TYPE=checkbox NAME=show_disposition_statuses VALUE='checked' $show_disposition_statuses>Show disposition statuses</FONT></TD><TD align='right'><a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&group=$group&shift=$shift&hourly_breakdown=$hourly_breakdown&show_disposition_statuses=$show_disposition_statuses&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a></TD></TR>\n";
|
||||
$MAIN.="<TR><TD align='left'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><INPUT TYPE=checkbox NAME=hourly_breakdown VALUE='checked' $hourly_breakdown>Show hourly results<BR><INPUT TYPE=checkbox NAME=show_disposition_statuses VALUE='checked' $show_disposition_statuses>Show disposition statuses<BR><INPUT TYPE=checkbox NAME=ignore_afterhours VALUE='checked' $ignore_afterhours>Ignore after-hours calls</FONT></TD><TD align='right'><a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&group=$group&shift=$shift&hourly_breakdown=$hourly_breakdown&show_disposition_statuses=$show_disposition_statuses&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a></TD></TR>\n";
|
||||
$MAIN.="<TR><TD colspan=2>";
|
||||
$MAIN.="<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
@@ -454,13 +491,17 @@ else
|
||||
|
||||
$MAIN.="Inbound Daily Report $NOW_TIME\n";
|
||||
$MAIN.="Selected in-group: $group - $group_name\n";
|
||||
if ($shift) {$MAIN.="Selected shift: $shift\n";}
|
||||
$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END for $shift shift\n\n";
|
||||
if ($shift && $IDR_calltime_available) {$MAIN.="Selected shift: $shift\n";}
|
||||
$MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END";
|
||||
if ($shift && $IDR_calltime_available) {$MAIN.="for $shift shift";}
|
||||
$MAIN.="\n\n";
|
||||
#echo "Time range day sec: $SQsec - $EQsec Day range in epoch: $SQepoch - $EQepoch Start: $SQepochDAY\n";
|
||||
$CSV_text.="\"Inbound Daily Report\",\"$NOW_TIME\"\n";
|
||||
$CSV_text.="Selected in-group: $group - $group_name\n";
|
||||
if ($shift) {$CSV_text.="Selected shift: $shift\n";}
|
||||
$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END for $shift shift\"\n\n";
|
||||
if ($shift && $IDR_calltime_available) {$CSV_text.="Selected shift: $shift\n";}
|
||||
$CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"";
|
||||
if ($shift && $IDR_calltime_available) {$CSV_text.="for $shift shift";}
|
||||
$CSV_text.="\n\n";
|
||||
|
||||
if ($show_disposition_statuses) {
|
||||
$dispo_stmt="select distinct 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) . "' $big_shift_time_SQL_clause order by status;";
|
||||
@@ -490,7 +531,7 @@ else
|
||||
$d=0; $q=0; $hr=0; $shift_hrs=0;
|
||||
while ($d < $DURATIONday)
|
||||
{
|
||||
$dSQepoch = ($SQepoch + ($d * 86400) + ($hr * 3600) );
|
||||
$dSQepoch = ($SQepoch + ($d * 86400) + ($hr * 3600));
|
||||
|
||||
if ($shift && $shift!="ALL" && $RECALC==1)
|
||||
{
|
||||
@@ -514,7 +555,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) + ($hr * 3600) ) );
|
||||
$dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) + ($hr * 3600)) );
|
||||
if ($EQsec < $SQsec)
|
||||
{
|
||||
$dEQepoch = ($dEQepoch + 86400);
|
||||
@@ -525,7 +566,6 @@ else
|
||||
$daySTART[$q] = date("Y-m-d H:i:s", $dSQepoch);
|
||||
$dayEND[$q] = date("Y-m-d H:i:s", $dEQepoch);
|
||||
|
||||
# || $time_END<=date("H:i:s", $dEQepoch)
|
||||
if ($hr>=($hpd-1) || !$hourly_breakdown)
|
||||
{
|
||||
$d++;
|
||||
@@ -806,10 +846,13 @@ else
|
||||
|
||||
for ($s=0; $s<count($status_array); $s++) {
|
||||
$status_name=explode(" ", $status_array[$s][1]);
|
||||
$MAINH.="----------+";
|
||||
$MAIN1.=" ".sprintf("%-8s", strtoupper($status_array[$s][0]))." |";
|
||||
$MAIN2.=" ".sprintf("%-8s", substr($status_name[0],0,8))." |";
|
||||
$MAIN3.=" ".sprintf("%-8s", substr($status_name[1],0,8))." |";
|
||||
for ($j=2; $j<count($status_name); $j++) {
|
||||
$status_name[1].=" $status_name[$j]";
|
||||
}
|
||||
$MAINH.="------------+";
|
||||
$MAIN1.=" ".sprintf("%-10s", strtoupper($status_array[$s][0]))." |";
|
||||
$MAIN2.=" ".sprintf("%-10s", substr($status_name[0],0,10))." |";
|
||||
$MAIN3.=" ".sprintf("%-10s", substr($status_name[1],0,10))." |";
|
||||
$CSV_text1.=",\"".strtoupper($status_array[$s][0])."\"";
|
||||
$CSV_text2.=",\"$status_name[0]\"";
|
||||
$CSV_text3.=",\"$status_name[1]\"";
|
||||
@@ -1085,8 +1128,8 @@ else
|
||||
$ASCII_text.="| WTD | $totCALLSwtd | $totANSWERSwtd | $totABANDONSwtd | $totABANDONSpctwtd%| $totABANDONSavgTIMEwtd | $totANSWERSavgspeedTIMEwtd | $totANSWERSavgTIMEwtd | $totANSWERStalkTIMEwtd | $totANSWERSwrapTIMEwtd | $totANSWERStotTIMEwtd |";
|
||||
$CSV_text.="\"WTD\",\"$totCALLSwtd\",\"$totANSWERSwtd\",\"$totABANDONSwtd\",\"$totABANDONSpctwtd%\",\"$totABANDONSavgTIMEwtd\",\"$totANSWERSavgspeedTIMEwtd\",\"$totANSWERSavgTIMEwtd\",\"$totANSWERStalkTIMEwtd\",\"$totANSWERSwrapTIMEwtd\",\"$totANSWERStotTIMEwtd\"";
|
||||
for ($s=0; $s<count($status_array); $s++) {
|
||||
$ASCII_text.=" ".sprintf("%8s", ($totSTATUSESwtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%8s", ($totSTATUSESwtd[$status_array[$s][0]]+0))."\"";
|
||||
$ASCII_text.=" ".sprintf("%10s", ($totSTATUSESwtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%10s", ($totSTATUSESwtd[$status_array[$s][0]]+0))."\"";
|
||||
}
|
||||
$ASCII_text.="\n";
|
||||
$CSV_text.="\n";
|
||||
@@ -1174,8 +1217,8 @@ else
|
||||
$ASCII_text.="| MTD | $totCALLSmtd | $totANSWERSmtd | $totABANDONSmtd | $totABANDONSpctmtd%| $totABANDONSavgTIMEmtd | $totANSWERSavgspeedTIMEmtd | $totANSWERSavgTIMEmtd | $totANSWERStalkTIMEmtd | $totANSWERSwrapTIMEmtd | $totANSWERStotTIMEmtd |";
|
||||
$CSV_text.="\"MTD\",\"$totCALLSmtd\",\"$totANSWERSmtd\",\"$totABANDONSmtd\",\"$totABANDONSpctmtd%\",\"$totABANDONSavgTIMEmtd\",\"$totANSWERSavgspeedTIMEmtd\",\"$totANSWERSavgTIMEmtd\",\"$totANSWERStalkTIMEmtd\",\"$totANSWERSwrapTIMEmtd\",\"$totANSWERStotTIMEmtd\"";
|
||||
for ($s=0; $s<count($status_array); $s++) {
|
||||
$ASCII_text.=" ".sprintf("%8s", ($totSTATUSESmtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%8s", ($totSTATUSESmtd[$status_array[$s][0]]+0))."\"";
|
||||
$ASCII_text.=" ".sprintf("%10s", ($totSTATUSESmtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%10s", ($totSTATUSESmtd[$status_array[$s][0]]+0))."\"";
|
||||
}
|
||||
$ASCII_text.="\n";
|
||||
$CSV_text.="\n";
|
||||
@@ -1274,8 +1317,8 @@ else
|
||||
$ASCII_text.="| QTD | $totCALLSqtd | $totANSWERSqtd | $totABANDONSqtd | $totABANDONSpctqtd%| $totABANDONSavgTIMEqtd | $totANSWERSavgspeedTIMEqtd | $totANSWERSavgTIMEqtd | $totANSWERStalkTIMEqtd | $totANSWERSwrapTIMEqtd | $totANSWERStotTIMEqtd |";
|
||||
$CSV_text.="\"QTD\",\"$totCALLSqtd\",\"$totANSWERSqtd\",\"$totABANDONSqtd\",\"$totABANDONSpctqtd%\",\"$totABANDONSavgTIMEqtd\",\"$totANSWERSavgspeedTIMEqtd\",\"$totANSWERSavgTIMEqtd\",\"$totANSWERStalkTIMEqtd\",\"$totANSWERSwrapTIMEqtd\",\"$totANSWERStotTIMEqtd\"";
|
||||
for ($s=0; $s<count($status_array); $s++) {
|
||||
$ASCII_text.=" ".sprintf("%8s", ($totSTATUSESqtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%8s", ($totSTATUSESqtd[$status_array[$s][0]]+0))."\"";
|
||||
$ASCII_text.=" ".sprintf("%10s", ($totSTATUSESqtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%10s", ($totSTATUSESqtd[$status_array[$s][0]]+0))."\"";
|
||||
}
|
||||
$ASCII_text.="\n";
|
||||
$CSV_text.="\n";
|
||||
@@ -1333,8 +1376,8 @@ else
|
||||
$ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] | $totANSWERSdate[$d] | $totABANDONSdate[$d] | $totABANDONSpctDATE[$d]%| $totABANDONSavgTIME[$d] | $totANSWERSavgspeedTIME[$d] | $totANSWERSavgTIME[$d] | $totANSWERStalkTIME[$d] | $totANSWERSwrapTIME[$d] | $totANSWERStotTIME[$d] |";
|
||||
$CSV_text.="\"$daySTART[$d] - $dayEND[$d]\",\"$totCALLSdate[$d]\",\"$totANSWERSdate[$d]\",\"$totABANDONSdate[$d]\",\"$totABANDONSpctDATE[$d]%\",\"$totABANDONSavgTIME[$d]\",\"$totANSWERSavgspeedTIME[$d]\",\"$totANSWERSavgTIME[$d]\",\"$totANSWERStalkTIME[$d]\",\"$totANSWERSwrapTIME[$d]\",\"$totANSWERStotTIME[$d]\"";
|
||||
for ($s=0; $s<count($status_array); $s++) {
|
||||
$ASCII_text.=" ".sprintf("%8s", ($totSTATUSESdate[$d][$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%8s", ($totSTATUSESdate[$d][$status_array[$s][0]]+0))."\"";
|
||||
$ASCII_text.=" ".sprintf("%10s", ($totSTATUSESdate[$d][$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%10s", ($totSTATUSESdate[$d][$status_array[$s][0]]+0))."\"";
|
||||
$totSTATUSESwtd[$status_array[$s][0]]+=$totSTATUSESdate[$d][$status_array[$s][0]];
|
||||
$totSTATUSESmtd[$status_array[$s][0]]+=$totSTATUSESdate[$d][$status_array[$s][0]];
|
||||
$totSTATUSESqtd[$status_array[$s][0]]+=$totSTATUSESdate[$d][$status_array[$s][0]];
|
||||
@@ -1524,8 +1567,8 @@ else
|
||||
$ASCII_text.="| WTD | $totCALLSwtd | $totANSWERSwtd | $totABANDONSwtd | $totABANDONSpctwtd%| $totABANDONSavgTIMEwtd | $totANSWERSavgspeedTIMEwtd | $totANSWERSavgTIMEwtd | $totANSWERStalkTIMEwtd | $totANSWERSwrapTIMEwtd | $totANSWERStotTIMEwtd |";
|
||||
$CSV_text.="\"WTD\",\"$totCALLSwtd\",\"$totANSWERSwtd\",\"$totABANDONSwtd\",\"$totABANDONSpctwtd%\",\"$totABANDONSavgTIMEwtd\",\"$totANSWERSavgspeedTIMEwtd\",\"$totANSWERSavgTIMEwtd\",\"$totANSWERStalkTIMEwtd\",\"$totANSWERSwrapTIMEwtd\",\"$totANSWERStotTIMEwtd\"";
|
||||
for ($s=0; $s<count($status_array); $s++) {
|
||||
$ASCII_text.=" ".sprintf("%8s", ($totSTATUSESwtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%8s", ($totSTATUSESwtd[$status_array[$s][0]]+0))."\"";
|
||||
$ASCII_text.=" ".sprintf("%10s", ($totSTATUSESwtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%10s", ($totSTATUSESwtd[$status_array[$s][0]]+0))."\"";
|
||||
}
|
||||
$ASCII_text.="\n";
|
||||
$CSV_text.="\n";
|
||||
@@ -1645,8 +1688,8 @@ else
|
||||
$ASCII_text.="| MTD | $totCALLSmtd | $totANSWERSmtd | $totABANDONSmtd | $totABANDONSpctmtd%| $totABANDONSavgTIMEmtd | $totANSWERSavgspeedTIMEmtd | $totANSWERSavgTIMEmtd | $totANSWERStalkTIMEmtd | $totANSWERSwrapTIMEmtd | $totANSWERStotTIMEmtd |";
|
||||
$CSV_text.="\"MTD\",\"$totCALLSmtd\",\"$totANSWERSmtd\",\"$totABANDONSmtd\",\"$totABANDONSpctmtd%\",\"$totABANDONSavgTIMEmtd\",\"$totANSWERSavgspeedTIMEmtd\",\"$totANSWERSavgTIMEmtd\",\"$totANSWERStalkTIMEmtd\",\"$totANSWERSwrapTIMEmtd\",\"$totANSWERStotTIMEmtd\"";
|
||||
for ($s=0; $s<count($status_array); $s++) {
|
||||
$ASCII_text.=" ".sprintf("%8s", ($totSTATUSESmtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%8s", ($totSTATUSESmtd[$status_array[$s][0]]+0))."\"";
|
||||
$ASCII_text.=" ".sprintf("%10s", ($totSTATUSESmtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%10s", ($totSTATUSESmtd[$status_array[$s][0]]+0))."\"";
|
||||
}
|
||||
$ASCII_text.="\n";
|
||||
$CSV_text.="\n";
|
||||
@@ -1778,8 +1821,8 @@ else
|
||||
$ASCII_text.="| QTD | $totCALLSqtd | $totANSWERSqtd | $totABANDONSqtd | $totABANDONSpctqtd%| $totABANDONSavgTIMEqtd | $totANSWERSavgspeedTIMEqtd | $totANSWERSavgTIMEqtd | $totANSWERStalkTIMEqtd | $totANSWERSwrapTIMEqtd | $totANSWERStotTIMEqtd |";
|
||||
$CSV_text.="\"QTD\",\"$totCALLSqtd\",\"$totANSWERSqtd\",\"$totABANDONSqtd\",\"$totABANDONSpctqtd%\",\"$totABANDONSavgTIMEqtd\",\"$totANSWERSavgspeedTIMEqtd\",\"$totANSWERSavgTIMEqtd\",\"$totANSWERStalkTIMEqtd\",\"$totANSWERSwrapTIMEqtd\",\"$totANSWERStotTIMEqtd\"";
|
||||
for ($s=0; $s<count($status_array); $s++) {
|
||||
$ASCII_text.=" ".sprintf("%8s", ($totSTATUSESqtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%8s", ($totSTATUSESqtd[$status_array[$s][0]]+0))."\"";
|
||||
$ASCII_text.=" ".sprintf("%10s", ($totSTATUSESqtd[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%10s", ($totSTATUSESqtd[$status_array[$s][0]]+0))."\"";
|
||||
}
|
||||
$ASCII_text.="\n";
|
||||
$CSV_text.="\n";
|
||||
@@ -1940,8 +1983,8 @@ else
|
||||
$ASCII_text.="| TOTALS | $FtotCALLS | $FtotANSWERS | $FtotABANDONS | $FtotABANDONSpct%| $FtotABANDONSavgTIME | $FtotANSWERSavgspeedTIME | $FtotANSWERSavgTIME | $FtotANSWERStalkTIME | $FtotANSWERSwrapTIME | $FtotANSWERStotTIME |";
|
||||
$CSV_text.="\"TOTALS\",\"$FtotCALLS\",\"$FtotANSWERS\",\"$FtotABANDONS\",\"$FtotABANDONSpct%\",\"$FtotABANDONSavgTIME\",\"$FtotANSWERSavgspeedTIME\",\"$FtotANSWERSavgTIME\",\"$FtotANSWERStalkTIME\",\"$FtotANSWERSwrapTIME\",\"$FtotANSWERStotTIME\"";
|
||||
for ($s=0; $s<count($status_array); $s++) {
|
||||
$ASCII_text.=" ".sprintf("%8s", ($totSTATUSES[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%8s", ($totSTATUSES[$status_array[$s][0]]+0))."\"";
|
||||
$ASCII_text.=" ".sprintf("%10s", ($totSTATUSES[$status_array[$s][0]]+0))." |";
|
||||
$CSV_text.=",\"".sprintf("%10s", ($totSTATUSES[$status_array[$s][0]]+0))."\"";
|
||||
}
|
||||
$ASCII_text.="\n";
|
||||
$CSV_text.="\n\n\n";
|
||||
|
||||
@@ -33201,6 +33201,7 @@ if ($ADD==999994)
|
||||
echo "<LI><a href=\"AST_carrier_log_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Carrier Log Report</a></FONT>\n";
|
||||
echo "<LI><a href=\"AST_hangup_cause_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Hangup Cause Report</a></FONT>\n";
|
||||
echo "<LI><a href=\"admin_phones_bulk_insert.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Bulk Phone Insert Page</a></FONT>\n";
|
||||
echo "<LI><a href=\"callbacks_bulk_change.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Callbacks Transferral Page</a></FONT>\n";
|
||||
echo "<LI><a href=\"send_CID_call.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Send a Call With Custom CID Page</a></FONT>\n";
|
||||
echo "<LI><a href=\"voice_lab.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Speech Voice Lab Page</a></FONT>\n";
|
||||
echo "<LI><a href=\"../agc/phone_only.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Webphone Only Page</a></FONT>\n";
|
||||
|
||||
@@ -0,0 +1,285 @@
|
||||
<?php
|
||||
# callbacks_bulk_change.php
|
||||
#
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 120819-0119 - 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["old_user"])) {$old_user=$_GET["old_user"];}
|
||||
elseif (isset($_POST["old_user"])) {$old_user=$_POST["old_user"];}
|
||||
if (isset($_GET["new_user"])) {$new_user=$_GET["new_user"];}
|
||||
elseif (isset($_POST["new_user"])) {$new_user=$_POST["new_user"];}
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
|
||||
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
|
||||
if (isset($_GET["confirm_transfer"])) {$confirm_transfer=$_GET["confirm_transfer"];}
|
||||
elseif (isset($_POST["confirm_transfer"])) {$confirm_transfer=$_POST["confirm_transfer"];}
|
||||
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,outbound_autodial_active 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];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$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");
|
||||
|
||||
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,change_agent_campaign,modify_timeclock_log,user_group,user_level 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];
|
||||
$change_agent_campaign = $row[1];
|
||||
$modify_timeclock_log = $row[2];
|
||||
$LOGuser_group = $row[3];
|
||||
$user_level=$row[4];
|
||||
if ($user_level==9)
|
||||
{
|
||||
$ul_clause="where user_level<=9";
|
||||
} else {
|
||||
$ul_clause="where user_level<$user_level";
|
||||
}
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
if ($DB) {$HTML_text.="|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGallowed_campaigns = $row[0];
|
||||
$LOGallowed_reports = $row[1];
|
||||
$LOGadmin_viewable_groups = $row[2];
|
||||
$LOGadmin_viewable_call_times = $row[3];
|
||||
|
||||
$LOGadmin_viewable_groupsSQL='';
|
||||
$whereLOGadmin_viewable_groupsSQL='';
|
||||
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
|
||||
{
|
||||
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
|
||||
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
|
||||
$LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
$whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
}
|
||||
|
||||
$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group desc;";
|
||||
$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];
|
||||
$group_names[$i] = $row[1];
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($SUBMIT && $old_user && $new_user && $confirm_transfer) {
|
||||
$upd_stmt="update vicidial_callbacks set user='$new_user' where recipient='USERONLY' and status!='INACTIVE' and user='$old_user' $LOGadmin_viewable_groupsSQL";
|
||||
$upd_rslt=mysql_query($upd_stmt, $link);
|
||||
if ($DB) {echo "$upd_stmt\n";}
|
||||
}
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<title>ADMINISTRATION: USERONLY Callbacks Transfer
|
||||
<?php
|
||||
|
||||
##### BEGIN Set variables to make header show properly #####
|
||||
$ADD = '311111';
|
||||
$hh = 'usergroups';
|
||||
$LOGast_admin_access = '1';
|
||||
$ADMIN = 'admin.php';
|
||||
$page_width='770';
|
||||
$section_width='750';
|
||||
$header_font_size='3';
|
||||
$subheader_font_size='2';
|
||||
$subcamp_font_size='2';
|
||||
$header_selected_bold='<b>';
|
||||
$header_nonselected_bold='';
|
||||
$usergroups_color = '#FFFF99';
|
||||
$usergroups_font = 'BLACK';
|
||||
$usergroups_color = '#E6E6E6';
|
||||
$subcamp_color = '#C6C6C6';
|
||||
##### END Set variables to make header show properly #####
|
||||
|
||||
require("admin_header.php");
|
||||
|
||||
?>
|
||||
|
||||
<CENTER>
|
||||
<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> USERONLY Callback Transfer</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> </TD></TR>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=center COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B> \n";
|
||||
|
||||
### callbacks change form
|
||||
echo "<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
if ($SUBMIT && $old_user && $new_user && !$confirm_transfer)
|
||||
{
|
||||
$stmt="select count(*) as ct from vicidial_callbacks where recipient='USERONLY' and status!='INACTIVE' and user='$old_user' $LOGadmin_viewable_groupsSQL";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_array($rslt);
|
||||
$callback_ct=$row["ct"];
|
||||
|
||||
$user_stmt="select full_name from vicidial_users $ul_clause and user='$old_user' $LOGadmin_viewable_groupsSQL";
|
||||
$user_rslt=mysql_query($user_stmt, $link);
|
||||
$user_row=mysql_fetch_array($user_rslt);
|
||||
$old_user_name=$user_row["full_name"];
|
||||
|
||||
$user_stmt="select full_name from vicidial_users $ul_clause and user='$new_user' $LOGadmin_viewable_groupsSQL ";
|
||||
$user_rslt=mysql_query($user_stmt, $link);
|
||||
$user_row=mysql_fetch_array($user_rslt);
|
||||
$new_user_name=$user_row["full_name"];
|
||||
|
||||
echo "<input type=hidden name=old_user value=\"$old_user\">\n";
|
||||
echo "<input type=hidden name=new_user value=\"$new_user\">\n";
|
||||
echo "You are about to transfer $callback_ct callbacks<BR>\n";
|
||||
echo "from user $old_user - $old_user_name<BR>\n";
|
||||
echo "to user $new_user - $new_user_name<BR><BR><BR>\n";
|
||||
echo "<a href='$PHP_SELF?DB=$DB&old_user=$old_user&new_user=$new_user&confirm_transfer=1&SUBMIT=1'>CLICK TO CONFIRM</a><BR><BR>";
|
||||
echo "<a href='$PHP_SELF?DB=$DB'>CLICK TO CANCEL</a><BR><BR>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="select user, count(*) as ct from vicidial_callbacks where recipient='USERONLY' and status!='INACTIVE' $LOGadmin_viewable_groupsSQL group by user order by user";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
# <tr><td align='right'>
|
||||
echo "Agents with callbacks:<BR><select name='old_user' size=5>\n";
|
||||
if (mysql_num_rows($rslt)>0)
|
||||
{
|
||||
while ($row=mysql_fetch_array($rslt))
|
||||
{
|
||||
$user_stmt="select full_name from vicidial_users $ul_clause and user='$row[user]' $LOGadmin_viewable_groupsSQL";
|
||||
$user_rslt=mysql_query($user_stmt, $link);
|
||||
if (mysql_num_rows($user_rslt)>0)
|
||||
{
|
||||
$user_row=mysql_fetch_array($user_rslt);
|
||||
echo "\t<option value='$row[user]'>$row[user] - $user_row[full_name] - ($row[ct] callbacks)</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t<option value=''>**NO CALLBACKS**</option>\n";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<BR/><BR/><input type='submit' name='SUBMIT' value=' TRANSFER TO '><BR/><BR/>";
|
||||
|
||||
$stmt="select user, full_name from vicidial_users $ul_clause $LOGadmin_viewable_groupsSQL order by user asc";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
echo "<select name='new_user' size=5>\n";
|
||||
while ($row=mysql_fetch_array($rslt))
|
||||
{
|
||||
echo "\t<option value='$row[user]'>$row[user] - $row[full_name]</option>\n";
|
||||
}
|
||||
echo "</select>\n";
|
||||
}
|
||||
echo "</form>\n";
|
||||
|
||||
echo "\n<BR><BR><BR>";
|
||||
|
||||
|
||||
$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|";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</TD></TR><TABLE>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user