diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index bbdecf12..4baaddf2 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -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 + diff --git a/agc_2-X/trunk/www/vicidial/AST_inbound_daily_report.php b/agc_2-X/trunk/www/vicidial/AST_inbound_daily_report.php index bb63f41b..23ea23b5 100644 --- a/agc_2-X/trunk/www/vicidial/AST_inbound_daily_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_inbound_daily_report.php @@ -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.=" "; -$MAIN.="\n"; + $MAIN.="\n"; -$MAIN.="
\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; $sCarrier Log Report \n";
echo "| USERONLY Callback Transfer | \n"; + +### callbacks change form +echo " |