";
echo "\n"; exit;}
else
{
$multi_drop=0;
##### INBOUND ONLY ###
if (ereg('O',$with_inbound))
{
$multi_drop++;
$stmt = "select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);";
$rslt=mysql_query($stmt, $link);
$ccamps_to_print = mysql_num_rows($rslt);
while ($ccamps_to_print > $c)
{
$row=mysql_fetch_row($rslt);
$closer_campaigns = $row[0];
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
$closer_campaignsSQL .= "'$closer_campaigns',";
$c++;
}
$closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL);
if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
if ($adastats>1)
{
$stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);";
if ($DB > 0) {echo "\n|$stmtB|\n";}
$r=0;
$rslt=mysql_query($stmtB, $link);
$ingroups_to_print = mysql_num_rows($rslt);
if ($ingroups_to_print > 0)
{$ingroup_detail .= "";}
while ($ingroups_to_print > $r)
{
$row=mysql_fetch_row($rslt);
$callsTODAY = $row[0];
$dropsTODAY = $row[1];
$answersTODAY = $row[2];
$VSCcat1 = $row[3];
$VSCcat1tally = $row[4];
$VSCcat2 = $row[5];
$VSCcat2tally = $row[6];
$VSCcat3 = $row[7];
$VSCcat3tally = $row[8];
$VSCcat4 = $row[9];
$VSCcat4tally = $row[10];
$hold_sec_stat_one = $row[11];
$hold_sec_stat_two = $row[12];
$hold_sec_answer_calls = $row[13];
$hold_sec_drop_calls = $row[14];
$hold_sec_queue_calls = $row[15];
$ingroupdetail = $row[16];
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
{
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
}
else
{$drpctTODAY=0;}
if ($callsTODAY > 0)
{
$AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY);
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
}
else
{$AVGhold_sec_queue_calls=0;}
if ($dropsTODAY > 0)
{
$AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY);
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
}
else
{$AVGhold_sec_drop_calls=0;}
if ($answersTODAY > 0)
{
$PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100);
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
$PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100);
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
$AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY);
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
if ($agent_non_pause_sec > 0)
{
$AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60);
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
}
else
{$AVG_ANSWERagent_non_pause_sec=0;}
}
else
{
$PCThold_sec_stat_one=0;
$PCThold_sec_stat_two=0;
$AVGhold_sec_answer_calls=0;
$AVG_ANSWERagent_non_pause_sec=0;
}
if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';}
else {$bgcolor='white';}
$ingroup_detail .= "";
$ingroup_detail .= "| | ";
$ingroup_detail .= "$ingroupdetail | ";
$ingroup_detail .= "CALLS TODAY: | $callsTODAY | ";
$ingroup_detail .= "TMA 1: | $PCThold_sec_stat_one% | ";
$ingroup_detail .= "Average Hold time for Answered Calls: | $AVGhold_sec_answer_calls | ";
$ingroup_detail .= " ";
$ingroup_detail .= "";
$ingroup_detail .= " | | ";
$ingroup_detail .= "DROPS TODAY: | $dropsTODAY | ";
$ingroup_detail .= "TMA 2: | $PCThold_sec_stat_two% | ";
$ingroup_detail .= "Average Hold time for Dropped Calls: | $AVGhold_sec_drop_calls | ";
$ingroup_detail .= " ";
$ingroup_detail .= "";
$ingroup_detail .= " | | ";
$ingroup_detail .= "ANSWERS TODAY: | $answersTODAY | ";
$ingroup_detail .= "DROP PERCENT: | $drpctTODAY% | ";
$ingroup_detail .= "Average Hold time for All Calls: | $AVGhold_sec_queue_calls | ";
$ingroup_detail .= " ";
$r++;
}
if ($ingroups_to_print > 0)
{$ingroup_detail .= " ";}
}
$stmt="select agent_pause_codes_active from vicidial_campaigns where campaign_id IN($group_SQL);";
$stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);";
if (eregi('ALL-ACTIVE',$group_string))
{
$stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats;";
}
$stmtC="select agent_non_pause_sec from vicidial_campaign_stats where campaign_id IN($group_SQL);";
if ($DB > 0) {echo "\n|$stmt|$stmtB|$stmtC|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$agent_pause_codes_active = $row[0];
$rslt=mysql_query($stmtC, $link);
$row=mysql_fetch_row($rslt);
$agent_non_pause_sec = $row[0];
$rslt=mysql_query($stmtB, $link);
$row=mysql_fetch_row($rslt);
$callsTODAY = $row[0];
$dropsTODAY = $row[1];
$answersTODAY = $row[2];
$VSCcat1 = $row[3];
$VSCcat1tally = $row[4];
$VSCcat2 = $row[5];
$VSCcat2tally = $row[6];
$VSCcat3 = $row[7];
$VSCcat3tally = $row[8];
$VSCcat4 = $row[9];
$VSCcat4tally = $row[10];
$hold_sec_stat_one = $row[11];
$hold_sec_stat_two = $row[12];
$hold_sec_answer_calls = $row[13];
$hold_sec_drop_calls = $row[14];
$hold_sec_queue_calls = $row[15];
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
{
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
}
else
{$drpctTODAY=0;}
if ($callsTODAY > 0)
{
$AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY);
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
}
else
{$AVGhold_sec_queue_calls=0;}
if ($dropsTODAY > 0)
{
$AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY);
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
}
else
{$AVGhold_sec_drop_calls=0;}
if ($answersTODAY > 0)
{
$PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100);
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
$PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100);
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
$AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY);
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
if ($agent_non_pause_sec > 0)
{
$AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60);
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
}
else
{$AVG_ANSWERagent_non_pause_sec=0;}
}
else
{
$PCThold_sec_stat_one=0;
$PCThold_sec_stat_two=0;
$AVGhold_sec_answer_calls=0;
$AVG_ANSWERagent_non_pause_sec=0;
}
echo "
";
echo "| CALLS TODAY: | $callsTODAY | ";
echo "TMA 1: | $PCThold_sec_stat_one% | ";
echo "Average Hold time for Answered Calls: | $AVGhold_sec_answer_calls | ";
echo " TIME: | $NOW_TIME | ";
echo "";
echo " ";
echo "";
echo "| DROPS TODAY: | $dropsTODAY | ";
echo "TMA 2: | $PCThold_sec_stat_two% | ";
echo "Average Hold time for Dropped Calls: | $AVGhold_sec_drop_calls | ";
echo " | | ";
echo "";
echo " ";
echo "";
echo "| ANSWERS TODAY: | $answersTODAY | ";
echo "(Agent non-pause time / Answers) | ";
echo "Average Hold time for All Calls: | $AVGhold_sec_queue_calls | ";
echo " | | ";
echo "";
echo " ";
echo "";
echo "| DROP PERCENT: | $drpctTODAY% | ";
echo "PRODUCTIVITY: | $AVG_ANSWERagent_non_pause_sec | ";
echo " | | ";
echo " | | ";
echo "";
echo " ";
}
##### NOT INBOUND ONLY ###
else
{
if (eregi('ALL-ACTIVE',$group_string))
{
$multi_drop++;
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns;";
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;";
}
else
{
if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";}
if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) )
{
$multi_drop++;
if ($DB) {echo "with_inbound|$with_inbound|$campaign_allow_inbound\n";}
$stmt = "select distinct closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);";
$rslt=mysql_query($stmt, $link);
$ccamps_to_print = mysql_num_rows($rslt);
$c=0;
while ($ccamps_to_print > $c)
{
$row=mysql_fetch_row($rslt);
$closer_campaigns = $row[0];
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
$closer_campaignsSQL .= "'$closer_campaigns',";
$c++;
}
$closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL);
if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);";
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);";
}
else
{
$stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where campaign_id IN($group_SQL);";
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN($group_SQL);";
}
}
if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$DIALlev = $row[0];
$DIALstatusA = $row[1];
$DIALstatusB = $row[2];
$DIALstatusC = $row[3];
$DIALstatusD = $row[4];
$DIALstatusE = $row[5];
$DIALorder = $row[6];
$DIALfilter = $row[7];
$HOPlev = $row[8];
$DIALmethod = $row[9];
$maxDIALlev = $row[10];
$DROPmax = $row[11];
$targetDIFF = $row[12];
$ADAintense = $row[13];
$ADAavailonly = $row[14];
$TAPERtime = $row[15];
$CALLtime = $row[16];
$DIALtimeout = $row[17];
$DIALstatuses = $row[18];
$agent_pause_codes_active = $row[19];
$DIALmix = $row[20];
$stmt="select count(*) from vicidial_hopper where campaign_id IN($group_SQL);";
if (eregi('ALL-ACTIVE',$group_string))
{
$stmt="select count(*) from vicidial_hopper;";
}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$VDhop = $row[0];
$rslt=mysql_query($stmtB, $link);
$row=mysql_fetch_row($rslt);
$DAleads = $row[0];
$callsTODAY = $row[1];
$dropsTODAY = $row[2];
$drpctTODAY = $row[3];
$diffONEMIN = $row[4];
$agentsONEMIN = $row[5];
$balanceFILL = $row[6];
$answersTODAY = $row[7];
if ($multi_drop > 0)
{
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
{
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
}
else
{$drpctTODAY=0;}
}
$VSCcat1 = $row[8];
$VSCcat1tally = $row[9];
$VSCcat2 = $row[10];
$VSCcat2tally = $row[11];
$VSCcat3 = $row[12];
$VSCcat3tally = $row[13];
$VSCcat4 = $row[14];
$VSCcat4tally = $row[15];
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
{
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
}
else {$diffpctONEMIN = '0.00';}
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id IN($group_SQL);";
if (eregi('ALL-ACTIVE',$group_string))
{
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;";
}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$balanceSHORT = $row[0];
if (ereg('DISABLED',$DIALmix))
{
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
}
else
{
$stmt="select vcl_id from vicidial_campaigns_list_mix where campaign_id IN($group_SQL) and status='ACTIVE' limit 1;";
$rslt=mysql_query($stmt, $link);
$Lmix_to_print = mysql_num_rows($rslt);
if ($Lmix_to_print > 0)
{
$row=mysql_fetch_row($rslt);
$DIALstatuses = "List Mix: $row[0]";
$DIALorder = "List Mix: $row[0]";
}
}
echo "
";
echo "| DIAL LEVEL: | $DIALlev | ";
echo "TRUNK SHORT/FILL: | $balanceSHORT / $balanceFILL | ";
echo "FILTER: | $DIALfilter | ";
echo " TIME: | $NOW_TIME | ";
echo "";
echo " ";
if ($adastats>1)
{
echo "";
echo "| - min MAX LEVEL: | $maxDIALlev | ";
echo "DROPPED MAX: | $DROPmax% | ";
echo "TARGET DIFF: | $targetDIFF | ";
echo "INTENSITY: | $ADAintense | ";
echo " ";
echo "";
echo "| DIAL TIMEOUT: | $DIALtimeout | ";
echo "TAPER TIME: | $TAPERtime | ";
echo "LOCAL TIME: | $CALLtime | ";
echo "AVAIL ONLY: | $ADAavailonly | ";
echo " ";
}
echo "";
echo "| DIALABLE LEADS: | $DAleads | ";
echo "CALLS TODAY: | $callsTODAY | ";
echo "AVG AGENTS: | $agentsONEMIN | ";
echo "DIAL METHOD: | $DIALmethod | ";
echo " ";
echo "";
echo "| HOPPER LEVEL: | $HOPlev | ";
echo "DROPPED / ANSWERED: | $dropsTODAY / $answersTODAY | ";
echo "DL DIFF: | $diffONEMIN | ";
echo "STATUSES: | $DIALstatuses | ";
echo " ";
echo "";
echo "| LEADS IN HOPPER: | $VDhop | ";
echo "DROPPED PERCENT: | ";
if ($drpctTODAY >= $DROPmax)
{echo "$drpctTODAY%";}
else
{echo "$drpctTODAY%";}
echo " | ";
echo "DIFF: | $diffpctONEMIN% | ";
echo "ORDER: | $DIALorder | ";
echo " ";
}
echo "";
echo "| ";
if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) )
{echo "$VSCcat1: $VSCcat1tally \n";}
if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) )
{echo "$VSCcat2: $VSCcat2tally \n";}
if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) )
{echo "$VSCcat3: $VSCcat3tally \n";}
if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) )
{echo "$VSCcat4: $VSCcat4tally \n";}
echo " | ";
echo "";
echo "| ";
echo "$ingroup_detail";
if ($adastats<2)
{
echo "+ VIEW MORE";
}
else
{
echo "+ VIEW LESS";
}
if ($UGdisplay>0)
{
echo " HIDE USER GROUP";
}
else
{
echo " VIEW USER GROUP";
}
if ($UidORname>0)
{
echo " SHOW AGENT ID";
}
else
{
echo " SHOW AGENT NAME";
}
if ($SERVdisplay>0)
{
echo " HIDE SERVER INFO";
}
else
{
echo " SHOW SERVER INFO";
}
if ($CALLSdisplay>0)
{
echo " HIDE WAITING CALLS";
}
else
{
echo " SHOW WAITING CALLS";
}
if ($PHONEdisplay>0)
{
echo " HIDE PHONES";
}
else
{
echo " SHOW PHONES";
}
if ($CUSTPHONEdisplay>0)
{
echo " HIDE CUSTPHONES";
}
else
{
echo " SHOW CUSTPHONES";
}
echo " | ";
echo " ";
echo " ";
echo "\n\n";
}
###################################################################################
###### INBOUND/OUTBOUND CALLS
###################################################################################
if ($campaign_allow_inbound > 0)
{
$stmt="select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);";
$rslt=mysql_query($stmt, $link);
$ccamps_to_print = mysql_num_rows($rslt);
if ($DB) {echo "inbound/outbound calls|$ccamps_to_print|$stmt\n";}
$c=0;
$closer_campaignsSQL='';
while ($ccamps_to_print > $c)
{
$row=mysql_fetch_row($rslt);
$closer_campaigns = $row[0];
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
$closer_campaignsSQL .= "'$closer_campaigns',";
$c++;
}
$closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL);
$stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (campaign_id IN($group_SQL) and call_type IN('OUT','OUTBALANCE')) ) order by queue_priority desc,campaign_id,call_time;";
}
else
{
if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';}
else {$UgroupSQL = " and campaign_id IN($group_SQL)";}
$stmtB="from vicidial_auto_calls where status NOT IN('XFER') $UgroupSQL order by queue_priority desc,campaign_id,call_time;";
}
if ($CALLSdisplay > 0)
{
$stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type,queue_priority";
}
else
{
$stmtA = "SELECT status";
}
$k=0;
$stmt = "$stmtA $stmtB";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$parked_to_print = mysql_num_rows($rslt);
if ($parked_to_print > 0)
{
$i=0;
$out_total=0;
$out_ring=0;
$out_live=0;
$in_ivr=0;
while ($i < $parked_to_print)
{
$row=mysql_fetch_row($rslt);
if (eregi("LIVE",$row[0]))
{
$out_live++;
if ($CALLSdisplay > 0)
{
$CDstatus[$k] = $row[0];
$CDcampaign_id[$k] = $row[1];
$CDphone_number[$k] = $row[2];
$CDserver_ip[$k] = $row[3];
$CDcall_time[$k] = $row[4];
$CDcall_type[$k] = $row[5];
$CDqueue_priority[$k] = $row[6];
$k++;
}
}
else
{
if (eregi("IVR",$row[0]))
{
$in_ivr++;
if ($CALLSdisplay > 0)
{
$CDstatus[$k] = $row[0];
$CDcampaign_id[$k] = $row[1];
$CDphone_number[$k] = $row[2];
$CDserver_ip[$k] = $row[3];
$CDcall_time[$k] = $row[4];
$CDcall_type[$k] = $row[5];
$CDqueue_priority[$k] = $row[6];
$k++;
}
}
if (eregi("CLOSER",$row[0]))
{$nothing=1;}
else
{$out_ring++;}
}
$out_total++;
$i++;
}
##### MIDI alert audio file test #####
# $test_midi=1;
# if ($test_midi > 0)
# {
# # echo "";
# # echo "
|