diff --git a/agc_2-X/trunk/LANG_www/agc_it/manager_send.php b/agc_2-X/trunk/LANG_www/agc_it/manager_send.php index 1dedad31..6dd29828 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_it/manager_send.php @@ -791,6 +791,11 @@ if ($ACTION=="RedirectXtraCXNeW") $row=mysql_fetch_row($rslt); $exten = $row[0]; + if ( (ereg("^8300",$extension)) and ($protocol == 'Local') ) + { + $extension = "$extension$user"; + } + $stmtD="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmtD, $link); diff --git a/agc_2-X/trunk/LANG_www/agc_it/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_it/vdc_db_query.php index d41b2cf5..cb1215b1 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_it/vdc_db_query.php @@ -1753,7 +1753,7 @@ if ($stage == "end") $CLuniqueid = $row[9]; } - $CLstage = preg_replace("/XFER|-/",'',$CLstage); + $CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage); if ($CLstage < 0.25) {$CLstage=0;} $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; @@ -1828,6 +1828,7 @@ if ($stage == "end") else { $SQLterm = "term_reason='$term_reason'"; + $QL_term=''; if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) { @@ -1849,6 +1850,7 @@ if ($stage == "end") else { $SQLterm = "term_reason='AGENT'"; + $QL_term = 'COMPLETEAGENT'; } } @@ -1857,6 +1859,26 @@ if ($stage == "end") if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); + + if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) + { + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($DB) {echo "$stmt\n";} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $agent_complete = $row[0]; + } + if ($agent_complete < 1) + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + } + } } } diff --git a/agc_2-X/trunk/LANG_www/agc_it/vicidial.php b/agc_2-X/trunk/LANG_www/agc_it/vicidial.php index bef9faf4..843a77c4 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_it/vicidial.php @@ -199,10 +199,11 @@ # 81015-0405 - Fixed bug related to hangups on 3way calls # 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available # 81020-1501 - Fixed bugs in queue_log logging +# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes # -$version = '2.0.5-178'; -$build = '81020-1501'; +$version = '2.0.5-179'; +$build = '81023-0411'; require("dbconnect.php"); @@ -1237,6 +1238,11 @@ else $extension = "$dialplan_number$AT$ext_context"; } $SIP_user = "$protocol/$extension"; + $SIP_user_DiaL = "$protocol/$extension"; + if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) + { + $SIP_user = "$protocol/$extension$VD_login"; + } $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} @@ -1405,11 +1411,11 @@ else } ### insert a NUOVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($auto_dial_level > 0) { @@ -2205,15 +2211,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} mainxfer_send_redirect('3WAY','','',tempvarattempt); - if (threeway_end == '0') - { - document.vicidial_form.xferchannel.value = ''; - xfercall_send_hangup(); - - document.vicidial_form.callchannel.value = ''; - document.vicidial_form.callserverip.value = ''; - dialedcall_send_hangup(); - } +// if (threeway_end == '0') +// { +// document.vicidial_form.xferchannel.value = ''; +// xfercall_send_hangup(); +// +// document.vicidial_form.callchannel.value = ''; +// document.vicidial_form.callserverip.value = ''; +// dialedcall_send_hangup(); +// } if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} } @@ -2266,7 +2272,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (taskFromConf == 'YES') {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid);} else - {basic_originate_call(manual_string,'NO','NO');} + {basic_originate_call(manual_string,'NO','NO','','','','1');} MD_ring_secondS=0; } @@ -3396,7 +3402,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDDiaLOverridEform.length > 0) { - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES'); + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1'); } else { @@ -5617,13 +5623,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; - basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1'); } function DtMf_PreSet_b_DiaL() { document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; - basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1'); } // ################################################################################ diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php index e7ccb250..fecaa02b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php @@ -15,6 +15,7 @@ # 80709-0331 - Added time stats to call statuses # 80722-2149 - Added Status Category stats # 81015-0705 - Added IVR calls count +# 81024-0037 - Added multi-select inbound-groups # require("dbconnect.php"); @@ -26,14 +27,16 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} + elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} - elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -84,13 +87,37 @@ $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; + $LISTgroups[$i]='---NONE---'; + $i++; + $groups_to_print++; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; + $LISTgroups[$i] =$row[0]; $i++; } +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $i++; + } +if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) + { + $group_SQL = "''"; +# $group_SQL = "group_id IN('')"; + } +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); +# $group_SQL = "group_id IN($group_SQL)"; + } + + $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -120,33 +147,65 @@ while ($i < $statcats_to_print) echo "\n"; echo "
\n\n";
-if (!$group)
+if ($groups_to_print < 1)
{
echo "\n\n";
echo "PER FAVORE SELEZIONA UN GRUPPO INBOUND E UN INTERVALLO DI TEMPO, POI PREMI INVIA\n";
@@ -178,18 +237,71 @@ $query_date_END = "$end_date $time_END";
-echo "VICIDIAL: Estadísticas de Auto-dial en CLOSER $NOW_TIME\n";
+echo "VICIDIAL: Estadísticas de Auto-dial en CLOSER: $group_string $NOW_TIME\n";
+
+
+
+
+
+
+if ($group_ct > 1)
+ {
+ echo "\n";
+ echo "---------- MULTI-GROUP BREAKDOWN:\n";
+ echo "+----------------------+---------+---------+---------+---------+\n";
+ echo "| IN-GROUP | CALLS | DROPS | DROP % | IVR |\n";
+ echo "+----------------------+---------+---------+---------+---------+\n";
+
+ $i=0;
+ while($i < $group_ct)
+ {
+ $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
+ $rslt=mysql_query($stmt, $link);
+ if ($DB) {echo "$stmt\n";}
+ $row=mysql_fetch_row($rslt);
+
+ $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
+ $rslt=mysql_query($stmt, $link);
+ if ($DB) {echo "$stmt\n";}
+ $rowx=mysql_fetch_row($rslt);
+
+ $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 9999 or length_in_sec is null);";
+ $rslt=mysql_query($stmt, $link);
+ if ($DB) {echo "$stmt\n";}
+ $rowy=mysql_fetch_row($rslt);
+
+ $groupDISPLAY = sprintf("%20s", $group[$i]);
+ $gTOTALcalls = sprintf("%7s", $row[0]);
+ $gIVRcalls = sprintf("%7s", $rowx[0]);
+ $gDROPcalls = sprintf("%7s", $rowy[0]);
+ if ( ($gDROPcalls < 1) or ($gTOTALcalls < 1) )
+ {$gDROPpercent = '0';}
+ else
+ {
+ $gDROPpercent = (($gDROPcalls / $gTOTALcalls) * 100);
+ $gDROPpercent = round($gDROPpercent, 2);
+ }
+ $gDROPpercent = sprintf("%6s", $gDROPpercent);
+
+ echo "| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
+ $i++;
+ }
+
+ echo "+----------------------+---------+---------+---------+---------+\n";
+
+ }
+
echo "\n";
echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
echo "---------- TOTALI\n";
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
+$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
-$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='" . mysql_real_escape_string($group) . "' and comment_b='START';";
+$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$rowx=mysql_fetch_row($rslt);
@@ -213,7 +325,7 @@ echo "Calls taken into the IVR for this In-Gruppo: $IVRcalls\n";
echo "\n";
echo "---------- ABBATTUTE\n";
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
+$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 9999 or length_in_sec is null);";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
@@ -284,7 +396,7 @@ while ($p < $statuses_to_print)
echo "\n";
echo "---------- QUEUE STATS\n";
-$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);";
+$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
@@ -333,7 +445,7 @@ echo "+-------------------------------------------------------------------------
echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n";
echo "+-------------------------------------------------------------------------------------------+------------+\n";
-$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by queue_seconds;";
+$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$reasons_to_print = mysql_num_rows($rslt);
@@ -396,7 +508,7 @@ echo "+----------------------+------------+\n";
echo "| HANGUP REASON | CALLS |\n";
echo "+----------------------+------------+\n";
-$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by term_reason;";
+$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$reasons_to_print = mysql_num_rows($rslt);
@@ -438,7 +550,7 @@ echo "+--------+----------------------+----------------------+------------+-----
## get counts and time totals for all statuses in this campaign
-$stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+$stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by status;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$statuses_to_print = mysql_num_rows($rslt);
@@ -460,8 +572,11 @@ while ($i < $statuses_to_print)
}
$TOTALcalls = ($TOTALcalls + $row[0]);
- $STATUSrate = ($STATUScount / ($TOTALsec / 3600) );
- $STATUSrate = sprintf("%.2f", $STATUSrate);
+ if ( ($STATUScount < 1) or ($TOTALsec < 1) )
+ {$STATUSrate = 0;}
+ else
+ {$STATUSrate = ($STATUScount / ($TOTALsec / 3600) );}
+ $STATUSrate = sprintf("%.2f", $STATUSrate);
$STATUShours_H = ($row[2] / 3600);
$STATUShours_H_int = round($STATUShours_H, 2);
@@ -526,8 +641,11 @@ if ($TOTALcalls < 1)
}
else
{
- $TOTALrate = ($TOTALcalls / ($TOTALsec / 3600) );
- $TOTALrate = sprintf("%.2f", $TOTALrate);
+ if ( ($TOTALcalls < 1) or ($TOTALsec < 1) )
+ {$TOTALrate = 0;}
+ else
+ {$TOTALrate = ($TOTALcalls / ($TOTALsec / 3600) );}
+ $TOTALrate = sprintf("%.2f", $TOTALrate);
$TOTALhours_H = ($TOTALsec / 3600);
$TOTALhours_H_int = round($TOTALhours_H, 2);
@@ -614,7 +732,7 @@ echo "+--------------------------+------------+----------+--------+\n";
echo "| AGENT | CALLS | TEMPO M | MEDIA M |\n";
echo "+--------------------------+------------+----------+--------+\n";
-$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
+$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$users_to_print = mysql_num_rows($rslt);
@@ -704,14 +822,14 @@ $i=0;
$h=0;
while ($i <= 96)
{
- $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
+ $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL);";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
$hour_count[$i] = $row[0];
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
if ($hour_count[$i] > 0) {$last_full_record = $i;}
- $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+ $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
@@ -719,42 +837,42 @@ while ($i <= 96)
$i++;
- $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
+ $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL);";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
$hour_count[$i] = $row[0];
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
if ($hour_count[$i] > 0) {$last_full_record = $i;}
- $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+ $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
$drop_count[$i] = $row[0];
$i++;
- $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
+ $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL);";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
$hour_count[$i] = $row[0];
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
if ($hour_count[$i] > 0) {$last_full_record = $i;}
- $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+ $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
$drop_count[$i] = $row[0];
$i++;
- $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
+ $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL);";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
$hour_count[$i] = $row[0];
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
if ($hour_count[$i] > 0) {$last_full_record = $i;}
- $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+ $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
@@ -904,4 +1022,4 @@ echo "\nRun Time: $RUNtime seconds\n";
?>
-