diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php
index 3ea2c105..29d35635 100644
--- a/agc_2-X/trunk/www/vicidial/admin.php
+++ b/agc_2-X/trunk/www/vicidial/admin.php
@@ -3733,12 +3733,13 @@ else
# 160304-2348 - Added link to API log report
# 160305-2048 - Added alternate ivr(call menu) dtmf logging
# 160306-1053 - Added new webphone options, added option to have carriers on all active asterisk servers
+# 160312-1931 - Added select/deselect all options to AC-CID modify page. Reworked max stats calculations
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
-$admin_version = '2.12-541a';
-$build = '160306-1053';
+$admin_version = '2.12-542a';
+$build = '160312-1931';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -21873,6 +21874,8 @@ if ($ADD==31)
##### CAMPAIGN AREACODE CID #####
if ($SUB==202)
{
+ $checkbox_list='';
+ $checkbox_count=0;
echo "
"._QXZ("AREACODE CIDS FOR THIS CAMPAIGN").": $NWB#campaign_cid_areacodes$NWE \n";
if ($use_custom_cid != 'AREACODE')
{echo " "._QXZ("The campaign setting Custom CallerID is not set to AREACODE")."! ";}
@@ -21881,7 +21884,6 @@ if ($ADD==31)
echo "\n";
echo "\n";
echo "
\n";
- echo "
#
"._QXZ("AREACODE")."
"._QXZ("CID NUMBER")."
"._QXZ("DESCRIPTION")."
"._QXZ("ACTIVE")."
"._QXZ("CALLS")."
"._QXZ("DELETE")."
\n";
$stmt="SELECT areacode,outbound_cid,active,cid_description,call_count_today from vicidial_campaign_cid_areacodes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by areacode,outbound_cid;";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -21895,9 +21897,13 @@ if ($ADD==31)
$Xactive[$o] = $rowx[2];
$Xcid_description[$o] = $rowx[3];
$Xcall_count_today[$o] = $rowx[4];
+ $checkbox_list .= "|active_$Xareacode[$o]_$Xoutbound_cid[$o]";
$o++;
+ $checkbox_count++;
}
+ echo "
\n";
- $stmt="SELECT * from vicidial_daily_max_stats where stats_date='$yesterday' and stats_type='TOTAL' order by stats_date, campaign_id asc";
+ $total_calls=0;
+ $total_inbound=0;
+ $total_outbound=0;
+ $stmt="SELECT stats_type,sum(total_calls) from vicidial_daily_max_stats where campaign_id!='' and stats_flag='CLOSED' and stats_date='$yesterday' group by stats_type;";
$rslt=mysql_to_mysqli($stmt, $link);
+ $rows_to_print = mysqli_num_rows($rslt);
+ if ($rows_to_print > 0)
+ {
+ while ($rowx=mysqli_fetch_row($rslt))
+ {
+ $total_calls += $rowx[1];
+ if (preg_match('/INGROUP/', $rowx[0])) {$total_inbound+=$rowx[1];}
+ if (preg_match('/CAMPAIGN/', $rowx[0])) {$total_outbound+=$rowx[1];}
+ }
+ }
+
echo "
\n";
echo "
";
echo "
"._QXZ("Total Stats for Yesterday").":
";
@@ -36884,15 +36904,17 @@ if ($ADD==999990)
echo "
"._QXZ("Total Outbound Calls")."
";
echo "
"._QXZ("Maximum Agents")."
";
+ $stmt="SELECT * from vicidial_daily_max_stats where stats_date='$yesterday' and stats_type='TOTAL' order by stats_date, campaign_id asc";
+ $rslt=mysql_to_mysqli($stmt, $link);
if (mysqli_num_rows($rslt)>0)
{
while ($row=mysqli_fetch_array($rslt))
{
echo "