LICENSE: AGPLv2 # # This is a list inventory report, not a calling report. This report will show # statistics for all of the lists in the selected campaigns # # CHANGES # 130926-0721 - First build based upon LISTS campaign report # 130927-2154 - Added summary and full download options # 140108-0714 - Added webserver and hostname to report logging # 140328-0005 - Converted division calculations to use MathZDC function # 141114-0825 - Finalized adding QXZ translation to all admin files # 141230-1442 - Added code for on-the-fly language translations display # 150516-1304 - Fixed Javascript element problem, Issue #857 # 160227-1026 - Fixed dbconnect bug, standardized form layout # 170409-1539 - Added IP List validation code # 170903-0951 - Added screen color settings # 180507-2315 - Added new help display # $startMS = microtime(); header ("Content-type: text/html; charset=utf-8"); require("dbconnect_mysqli.php"); require("functions.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; $PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF); if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["list"])) {$list=$_GET["list"];} elseif (isset($_POST["list"])) {$list=$_POST["list"];} 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"];} if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (isset($_GET["campaigns_or_lists_rpt"])) {$campaigns_or_lists_rpt=$_GET["campaigns_or_lists_rpt"];} elseif (isset($_POST["campaigns_or_lists_rpt"])) {$campaigns_or_lists_rpt=$_POST["campaigns_or_lists_rpt"];} $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); $report_name = 'Lists Statuses Report'; $db_source = 'M'; $JS_text="\n"; $HEADER.="
"; $HEADER.="\n"; $HEADER.="";
$MAIN.="\n\n";
$MAIN.="\n\n";
if (strlen($list[0]) < 1)
{
$MAIN.="\n\n";
$MAIN.=_QXZ("PLEASE SELECT A LIST OR LISTS ABOVE AND CLICK SUBMIT")."\n";
}
else
{
$totalOUToutput = '';
$totalOUToutput .= _QXZ("List Status Stats",45)." $NOW_TIME "._QXZ("DOWNLOAD FULL REPORT")."\n";
$totalOUToutput .= "\n";
$list_stmt="select vicidial_list.list_id,list_name,active, count(*) from vicidial_list, vicidial_lists where vicidial_lists.list_id in ($list_id_str) and vicidial_lists.list_id=vicidial_list.list_id group by vicidial_list.list_id, list_name, active order by list_id, list_name asc;";
$list_rslt=mysql_to_mysqli($list_stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$listids_to_print = mysqli_num_rows($list_rslt);
$CSV_text1="\"\",\""._QXZ("LIST ID SUMMARY")."\"\n";
$CSV_text1.="\""._QXZ("LIST ID")."\",\""._QXZ("LIST NAME")."\",\""._QXZ("TOTAL LEADS")."\",\""._QXZ("ACTIVE/INACTIVE")."\"\n";
$CSV_text2="";
$CSV_text3="";
$CSV_textALL="";
$i=0;
$totalOUToutput .= "---------- "._QXZ("TOTAL LIST ID SUMMARY",25)." "._QXZ("DOWNLOAD FULL REPORT")."\n";
$totalOUToutput .= "+------------------------------------------+------------+----------+\n";
$totalOUToutput .= "| "._QXZ("LIST",40)." | "._QXZ("LEADS",10)." | "._QXZ("ACTIVE",8)." |\n";
$totalOUToutput .= "+------------------------------------------+------------+----------+\n";
$CSV_textSUMMARY.="\""._QXZ("LIST ID SUMMARY")."\"\n";
$CSV_textSUMMARY.="\""._QXZ("LIST")."\",\""._QXZ("LEADS")."\",\""._QXZ("ACTIVE")."\"\n";
$OUToutput='';
$OUToutput .= "\n";
$OUToutput .= "---------- "._QXZ("INDIVIDUAL LIST ID SUMMARIES")."\n";
while ($i < $listids_to_print)
{
$list_row=mysqli_fetch_row($list_rslt);
$LISTIDlists[$i] = $list_row[0];
$LISTIDlist_names[$i] = $list_row[1];
if ($list_row[2]=="Y") {$active_txt=_QXZ("ACTIVE");} else {$active_txt=_QXZ("INACTIVE");}
$active_txt=sprintf("%-8s", $active_txt);
$LISTIDcalls[$i] = $list_row[3];
$TOTALleads =$list_row[3];
$totalTOTALleads+=$TOTALleads;
$LISTIDcount = sprintf("%10s", $LISTIDcalls[$i]);while(strlen($LISTIDcount)>10) {$LISTIDcount = substr("$LISTIDcount", 0, -1);}
$LISTIDname = sprintf("%-40s", "$LISTIDlists[$i] - $LISTIDlist_names[$i]");while(strlen($LISTIDname)>40) {$LISTIDname = substr("$LISTIDname", 0, -1);}
$totalOUToutput .= "| $LISTIDname | $LISTIDcount | $active_txt |\n";
$CSV_textSUMMARY.="\"$LISTIDname\",\"$LISTIDcount\",\"$active_txt\"\n";
$OUToutput .= "\n";
$OUToutput .= "---------- "._QXZ("LIST ID SUMMARY",19)." "._QXZ("DOWNLOAD LIST SUMMARIES")."\n";
$OUToutput .= "+--------------------------------------------------------+\n";
$OUToutput .= "| "._QXZ("LIST ID:",14)." ".sprintf("%-30s", $list_row[0])." ".sprintf("%-8s", $active_txt)." |\n";
$OUToutput .= "| "._QXZ("LIST NAME:",14)." ".sprintf("%-30s", $list_row[1])." ".sprintf("%8s", "")." |\n";
$OUToutput .= "| "._QXZ("TOTAL LEADS:",14)." ".sprintf("%-30s", $list_row[3])." ".sprintf("%8s", "")." |\n";
$OUToutput .= "+--------------------------------------------------------+\n";
$CSV_text1.="\"$list_row[0]\",\"$list_row[1]\",\"$list_row[3]\",\"$active_txt\"\n";
$CSV_textALL.="\""._QXZ("LIST ID")." #$list_row[0] "._QXZ("SUMMARY")."\",\"\"\n";
$CSV_textALL.="\""._QXZ("LIST NAME")."\",\""._QXZ("TOTAL LEADS")."\",\""._QXZ("ACTIVE/INACTIVE")."\"\n";
$CSV_textALL.="\"$list_row[1]\",\"$list_row[3]\",\"$active_txt\"\n";
# $list_id_SQL .= "'$row[0]',";
# if ($row[0]>$max_calls) {$max_calls=$row[3];}
$i++;
$list_id=$list_row[0];
##############################
######### STATUS FLAGS STATS
$HA_count=0;
$HA_percent=0;
$SALE_count=0;
$SALE_percent=0;
$DNC_count=0;
$DNC_percent=0;
$CC_count=0;
$CC_percent=0;
$NI_count=0;
$NI_percent=0;
$UW_count=0;
$UW_percent=0;
$SC_count=0;
$SC_percent=0;
$COMP_count=0;
$COMP_percent=0;
$stmt="select count(*) from vicidial_list where status IN($human_answered_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$HA_results = mysqli_num_rows($rslt);
if ($HA_results > 0)
{
$row=mysqli_fetch_row($rslt);
$HA_count = $row[0];
$flag_count+=$row[0];
$category_totals["HA"]+=$HA_count;
if ($HA_count>$max_calls) {$max_calls=$HA_count;}
$HA_percent = ( MathZDC($HA_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($sale_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$SALE_results = mysqli_num_rows($rslt);
if ($SALE_results > 0)
{
$row=mysqli_fetch_row($rslt);
$SALE_count = $row[0];
$flag_count+=$row[0];
$category_totals["SALE"]+=$SALE_count;
if ($SALE_count>$max_calls) {$max_calls=$SALE_count;}
$SALE_percent = ( MathZDC($SALE_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($dnc_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$DNC_results = mysqli_num_rows($rslt);
if ($DNC_results > 0)
{
$row=mysqli_fetch_row($rslt);
$DNC_count = $row[0];
$flag_count+=$row[0];
$category_totals["DNC"]+=$DNC_count;
if ($DNC_count>$max_calls) {$max_calls=$DNC_count;}
$DNC_percent = ( MathZDC($DNC_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($customer_contact_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$CC_results = mysqli_num_rows($rslt);
if ($CC_results > 0)
{
$row=mysqli_fetch_row($rslt);
$CC_count = $row[0];
$flag_count+=$row[0];
$category_totals["CC"]+=$CC_count;
if ($C_count>$max_calls) {$max_calls=$CC_count;}
$CC_percent = ( MathZDC($CC_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($not_interested_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$NI_results = mysqli_num_rows($rslt);
if ($NI_results > 0)
{
$row=mysqli_fetch_row($rslt);
$NI_count = $row[0];
$flag_count+=$row[0];
$category_totals["NI"]+=$NI_count;
if ($NI_count>$max_calls) {$max_calls=$NI_count;}
$NI_percent = ( MathZDC($NI_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($unworkable_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$UW_results = mysqli_num_rows($rslt);
if ($UW_results > 0)
{
$row=mysqli_fetch_row($rslt);
$UW_count = $row[0];
$flag_count+=$row[0];
$category_totals["UW"]+=$UW_count;
if ($UW_count>$max_calls) {$max_calls=$UW_count;}
$UW_percent = ( MathZDC($UW_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($scheduled_callback_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$SC_results = mysqli_num_rows($rslt);
if ($SC_results > 0)
{
$row=mysqli_fetch_row($rslt);
$SC_count = $row[0];
$flag_count+=$row[0];
$category_totals["SC"]+=$SC_count;
if ($SC_count>$max_calls) {$max_calls=$SC_count;}
$SC_percent = ( MathZDC($SC_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($completed_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$COMP_results = mysqli_num_rows($rslt);
if ($COMP_results > 0)
{
$row=mysqli_fetch_row($rslt);
$COMP_count = $row[0];
$flag_count+=$row[0];
$category_totals["COMP"]+=$COMP_count;
if ($COMP_count>$max_calls) {$max_calls=$COMP_count;}
$COMP_percent = ( MathZDC($COMP_count, $TOTALleads) * 100);
}
$HA_percent = sprintf("%6.2f", "$HA_percent"); while(strlen($HA_percent)>6) {$HA_percent = substr("$HA_percent", 0, -1);}
$SALE_percent = sprintf("%6.2f", "$SALE_percent"); while(strlen($SALE_percent)>6) {$SALE_percent = substr("$SALE_percent", 0, -1);}
$DNC_percent = sprintf("%6.2f", "$DNC_percent"); while(strlen($DNC_percent)>6) {$DNC_percent = substr("$DNC_percent", 0, -1);}
$CC_percent = sprintf("%6.2f", "$CC_percent"); while(strlen($CC_percent)>6) {$CC_percent = substr("$CC_percent", 0, -1);}
$NI_percent = sprintf("%6.2f", "$NI_percent"); while(strlen($NI_percent)>6) {$NI_percent = substr("$NI_percent", 0, -1);}
$UW_percent = sprintf("%6.2f", "$UW_percent"); while(strlen($UW_percent)>6) {$UW_percent = substr("$UW_percent", 0, -1);}
$SC_percent = sprintf("%6.2f", "$SC_percent"); while(strlen($SC_percent)>6) {$SC_percent = substr("$SC_percent", 0, -1);}
$COMP_percent = sprintf("%6.2f", "$COMP_percent"); while(strlen($COMP_percent)>6) {$COMP_percent = substr("$COMP_percent", 0, -1);}
$HA_count = sprintf("%10s", "$HA_count"); while(strlen($HA_count)>10) {$HA_count = substr("$HA_count", 0, -1);}
$SALE_count = sprintf("%10s", "$SALE_count"); while(strlen($SALE_count)>10) {$SALE_count = substr("$SALE_count", 0, -1);}
$DNC_count = sprintf("%10s", "$DNC_count"); while(strlen($DNC_count)>10) {$DNC_count = substr("$DNC_count", 0, -1);}
$CC_count = sprintf("%10s", "$CC_count"); while(strlen($CC_count)>10) {$CC_count = substr("$CC_count", 0, -1);}
$NI_count = sprintf("%10s", "$NI_count"); while(strlen($NI_count)>10) {$NI_count = substr("$NI_count", 0, -1);}
$UW_count = sprintf("%10s", "$UW_count"); while(strlen($UW_count)>10) {$UW_count = substr("$UW_count", 0, -1);}
$SC_count = sprintf("%10s", "$SC_count"); while(strlen($SC_count)>10) {$SC_count = substr("$SC_count", 0, -1);}
$COMP_count = sprintf("%10s", "$COMP_count"); while(strlen($COMP_count)>10) {$COMP_count = substr("$COMP_count", 0, -1);}
$OUToutput .= "\n";
$OUToutput .= "---------- "._QXZ("STATUS FLAGS BREAKDOWN").": ("._QXZ("and % of total leads in list").") "._QXZ("DOWNLOAD FLAG BREAKDOWNS")."\n";
$OUToutput .= "+------------------+------------+----------+\n";
$OUToutput .= "| "._QXZ("Human Answer",16)." | $HA_count | $HA_percent% |\n";
$OUToutput .= "| "._QXZ("Sale",16)." | $SALE_count | $SALE_percent% |\n";
$OUToutput .= "| "._QXZ("DNC",16)." | $DNC_count | $DNC_percent% |\n";
$OUToutput .= "| "._QXZ("Customer Contact",16)." | $CC_count | $CC_percent% |\n";
$OUToutput .= "| "._QXZ("Not Interested",16)." | $NI_count | $NI_percent% |\n";
$OUToutput .= "| "._QXZ("Unworkable",16)." | $UW_count | $UW_percent% |\n";
$OUToutput .= "| "._QXZ("Sched Callbacks",16)." | $SC_count | $SC_percent% |\n";
$OUToutput .= "| "._QXZ("Completed",16)." | $COMP_count | $COMP_percent% |\n";
$OUToutput .= "+------------------+------------+----------+\n";
$OUToutput .= "\n";
$CSV_text_block = "\""._QXZ("STATUS FLAGS SUMMARY FOR LIST ID")." #$list_id:\"\n";
$CSV_text_block .= "\""._QXZ("Human Answer")."\",\"$HA_count\",\"$HA_percent%\"\n";
$CSV_text_block .= "\""._QXZ("Sale")."\",\"$SALE_count\",\"$SALE_percent%\"\n";
$CSV_text_block .= "\""._QXZ("DNC")."\",\"$DNC_count\",\"$DNC_percent%\"\n";
$CSV_text_block .= "\""._QXZ("Customer Contact")."\",\"$CC_count\",\"$CC_percent%\"\n";
$CSV_text_block .= "\""._QXZ("Not Interested")."\",\"$NI_count\",\"$NI_percent%\"\n";
$CSV_text_block .= "\""._QXZ("Unworkable")."\",\"$UW_count\",\"$UW_percent%\"\n";
$CSV_text_block .= "\""._QXZ("Scheduled Callbacks")."\",\"$SC_count\",\"$SC_percent%\"\n";
$CSV_text_block .= "\""._QXZ("Completed")."\",\"$COMP_count\",\"$COMP_percent%\"\n\n";
$CSV_text2.=$CSV_text_block;
$CSV_textALL.="\n".$CSV_text_block;
$stmt="select status, count(*) From vicidial_list where list_id='$list_id' group by status order by status asc";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$OUToutput .= "---------- "._QXZ("STATUS BREAKDOWN").": ("._QXZ("and % of total leads in list").") "._QXZ("DOWNLOAD STAT BREAKDOWNS")."\n";
$OUToutput .= "+--------+--------------------------------+----------+---------+\n";
$OUToutput .= "| "._QXZ("STATUS",6)." | "._QXZ("STATUS NAME",30)." | "._QXZ("COUNT",8)." | "._QXZ("LEAD",5)." % |\n";
$OUToutput .= "+--------+--------------------------------+----------+---------+\n";
$CSV_text3.="\"\",\""._QXZ("STATUS BREAKDOWN FOR LIST ID")." #$list_id:\"\n";
$CSV_text3.="\""._QXZ("STATUS")."\",\""._QXZ("STATUS NAME")."\",\""._QXZ("COUNT")."\",\""._QXZ("LEAD")." %\"\n";
$CSV_textALL.="\""._QXZ("STATUS BREAKDOWN FOR LIST ID")." #$list_id:\",\"\"\n";
$CSV_textALL.="\""._QXZ("STATUS")."\",\""._QXZ("STATUS NAME")."\",\""._QXZ("COUNT")."\",\""._QXZ("LEAD")." %\"\n";
while ($row=mysqli_fetch_row($rslt))
{
$OUToutput .= "| ".sprintf("%6s", $row[0])." | ".sprintf("%30s", $statname_list["$row[0]"])." | ".sprintf("%8s", $row[1])." | ".sprintf("%6.2f", ( MathZDC($row[1], $TOTALleads) * 100))."% |\n";
$CSV_text3.="\"$row[0]\",\"".$statname_list["$row[0]"]."\",\"$row[1]\",\"".sprintf("%6.2f", ( MathZDC($row[1], $TOTALleads) * 100))."%\"\n";
$CSV_textALL.="\"$row[0]\",\"".$statname_list["$row[0]"]."\",\"$row[1]\",\"".sprintf("%6.2f", ( MathZDC($row[1], $TOTALleads) * 100))."%\"\n";
}
$OUToutput .= "+-----------------------------------------+----------+---------+\n";
$OUToutput .= "| | ".sprintf("%8s", $TOTALleads)." | 100.00% |\n";
$OUToutput .= "+-----------------------------------------+----------+---------+\n";
$CSV_text3.="\"\",\"\",\"$TOTALleads\",\"100.00%\"\n\n\n";
$CSV_textALL.="\"\",\"\",\"$TOTALleads\",\"100.00%\"\n\n\n";
$OUToutput .= "\n";
$OUToutput .= "\n";
$OUToutput .= "\n";
}
$total_HA_percent = sprintf("%6.2f", ( MathZDC($category_totals["HA"], $totalTOTALleads) * 100)); while(strlen($total_HA_percent)>6) {$total_HA_percent = substr("$total_HA_percent", 0, -1);}
$total_SALE_percent = sprintf("%6.2f", ( MathZDC($category_totals["SALE"], $totalTOTALleads) * 100)); while(strlen($total_SALE_percent)>6) {$total_SALE_percent = substr("$total_SALE_percent", 0, -1);}
$total_DNC_percent = sprintf("%6.2f", ( MathZDC($category_totals["DNC"], $totalTOTALleads) * 100)); while(strlen($total_DNC_percent)>6) {$total_DNC_percent = substr("$total_DNC_percent", 0, -1);}
$total_CC_percent = sprintf("%6.2f", ( MathZDC($category_totals["CC"], $totalTOTALleads) * 100)); while(strlen($total_CC_percent)>6) {$total_CC_percent = substr("$total_CC_percent", 0, -1);}
$total_NI_percent = sprintf("%6.2f", ( MathZDC($category_totals["NI"], $totalTOTALleads) * 100)); while(strlen($total_NI_percent)>6) {$total_NI_percent = substr("$total_NI_percent", 0, -1);}
$total_UW_percent = sprintf("%6.2f", ( MathZDC($category_totals["UW"], $totalTOTALleads) * 100)); while(strlen($total_UW_percent)>6) {$total_UW_percent = substr("$total_UW_percent", 0, -1);}
$total_SC_percent = sprintf("%6.2f", ( MathZDC($category_totals["SC"], $totalTOTALleads) * 100)); while(strlen($total_SC_percent)>6) {$total_SC_percent = substr("$total_SC_percent", 0, -1);}
$total_COMP_percent = sprintf("%6.2f", ( MathZDC($category_totals["COMP"], $totalTOTALleads) * 100)); while(strlen($total_COMP_percent)>6) {$total_COMP_percent = substr("$total_COMP_percent", 0, -1);}
$total_HA_count = sprintf("%10s", $category_totals["HA"]); while(strlen($total_HA_count)>10) {$total_HA_count = substr("$total_HA_count", 0, -1);}
$total_SALE_count = sprintf("%10s", $category_totals["SALE"]); while(strlen($total_SALE_count)>10) {$total_SALE_count = substr("$total_SALE_count", 0, -1);}
$total_DNC_count = sprintf("%10s", $category_totals["DNC"]); while(strlen($total_DNC_count)>10) {$total_DNC_count = substr("$total_DNC_count", 0, -1);}
$total_CC_count = sprintf("%10s", $category_totals["CC"]); while(strlen($total_CC_count)>10) {$total_CC_count = substr("$total_CC_count", 0, -1);}
$total_NI_count = sprintf("%10s", $category_totals["NI"]); while(strlen($total_NI_count)>10) {$total_NI_count = substr("$total_NI_count", 0, -1);}
$total_UW_count = sprintf("%10s", $category_totals["UW"]); while(strlen($total_UW_count)>10) {$total_UW_count = substr("$total_UW_count", 0, -1);}
$total_SC_count = sprintf("%10s", $category_totals["SC"]); while(strlen($total_SC_count)>10) {$total_SC_count = substr("$total_SC_count", 0, -1);}
$total_COMP_count = sprintf("%10s", $category_totals["COMP"]); while(strlen($total_COMP_count)>10) {$total_COMP_count = substr("$total_COMP_count", 0, -1);}
$totalOUToutput .= "+------------------------------------------+------------+----------+\n";
$totalOUToutput .= "| "._QXZ("TOTAL",40,"r")." | ".sprintf("%10s", $totalTOTALleads)." |\n";
$totalOUToutput .= "+------------------------------------------+------------+\n";
$CSV_textSUMMARY .= "\""._QXZ("TOTAL")."\",\"$totalTOTALleads\"\n";
$totalOUToutput .= "\n";
$totalOUToutput .= "\n";
$totalOUToutput .= "---------- "._QXZ("TOTAL STATUS FLAGS SUMMARY").": ("._QXZ("and % of leads in selected lists").") "._QXZ("DOWNLOAD FULL REPORT")."\n";
$totalOUToutput .= "+------------------+------------+----------+\n";
$totalOUToutput .= "| "._QXZ("Human Answer",16)." | $total_HA_count | $total_HA_percent% |\n";
$totalOUToutput .= "| "._QXZ("Sale",16)." | $total_SALE_count | $total_SALE_percent% |\n";
$totalOUToutput .= "| "._QXZ("DNC",16)." | $total_DNC_count | $total_DNC_percent% |\n";
$totalOUToutput .= "| "._QXZ("Customer Contact",16)." | $total_CC_count | $total_CC_percent% |\n";
$totalOUToutput .= "| "._QXZ("Not Interested",16)." | $total_NI_count | $total_NI_percent% |\n";
$totalOUToutput .= "| "._QXZ("Unworkable",16)." | $total_UW_count | $total_UW_percent% |\n";
$totalOUToutput .= "| "._QXZ("Sched Callbacks",16)." | $total_SC_count | $total_SC_percent% |\n";
$totalOUToutput .= "| "._QXZ("Completed",16)." | $total_COMP_count | $total_COMP_percent% |\n";
$totalOUToutput .= "+------------------+------------+----------+\n";
$totalOUToutput .= "\n\n\n";
$CSV_textSUMMARY .= "\n\""._QXZ("STATUS FLAGS SUMMARY").":\"\n";
$CSV_textSUMMARY .= "\""._QXZ("Human Answer")."\",\"$total_HA_count\",\"$total_HA_percent%\"\n";
$CSV_textSUMMARY .= "\""._QXZ("Sale")."\",\"$total_SALE_count\",\"$total_SALE_percent%\"\n";
$CSV_textSUMMARY .= "\""._QXZ("DNC")."\",\"$total_DNC_count\",\"$total_DNC_percent%\"\n";
$CSV_textSUMMARY .= "\""._QXZ("Customer Contact")."\",\"$total_CC_count\",\"$total_CC_percent%\"\n";
$CSV_textSUMMARY .= "\""._QXZ("Not Interested")."\",\"$total_NI_count\",\"$total_NI_percent%\"\n";
$CSV_textSUMMARY .= "\""._QXZ("Unworkable")."\",\"$total_UW_count\",\"$total_UW_percent%\"\n";
$CSV_textSUMMARY .= "\""._QXZ("Scheduled Callbacks")."\",\"$total_SC_count\",\"$total_SC_percent%\"\n";
$CSV_textSUMMARY .= "\""._QXZ("Completed")."\",\"$total_COMP_count\",\"$total_COMP_percent%\"\n\n\n\n";
$CSV_textALL=$CSV_textSUMMARY.$CSV_textALL;
if ($report_display_type=="HTML")
{
$MAIN.=$GRAPH;
}
else
{
$MAIN.="$totalOUToutput$OUToutput";
}
$ENDtime = date("U");
$RUNtime = ($ENDtime - $STARTtime);
$MAIN.="\n"._QXZ("Run Time").": $RUNtime "._QXZ("seconds")."|$db_source\n";
$MAIN.="\n";
$MAIN.=" |