|
$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3;
-$CSV_total=preg_replace('/\s/', '', "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses");
+$CSV_total=preg_replace('/\s/', '', "\"\",\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses");
if ($file_download == 1)
{
@@ -1081,7 +1089,7 @@ $TOTAL_graph=$graph_header." | TOTAL | ";
$NONPAUSE_graph=$graph_header."NONPAUSE | ";
$PAUSE_graph=$graph_header."PAUSE | ";
-$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
+$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec), vicidial_users.user_group from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$ASCII_text.="$stmt\n";}
$subs_to_print = mysqli_num_rows($rslt);
@@ -1094,6 +1102,7 @@ while ($i < $subs_to_print)
$PCpause_sec[$i] = $row[2];
$sub_status[$i] = $row[3];
$PCnon_pause_sec[$i] = $row[4];
+ $PCuser_group[$i] = $row[5];
$max_varname="max_".$sub_status[$i];
$$max_varname=1;
@@ -1114,6 +1123,7 @@ while ($i < $subs_to_print)
$PCusers .= "$PCuser[$i]-";
$PCusersARY[$k] = $PCuser[$i];
$PCuser_namesARY[$k] = $PCfull_name[$i];
+ $PCuser_groupsARY[$k] = $PCuser_group[$i];
$k++;
}
@@ -1121,14 +1131,14 @@ while ($i < $subs_to_print)
}
$ASCII_text.="PAUSE CODE BREAKDOWN: [DOWNLOAD]\n\n";
-$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
-$ASCII_text.="| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n";
-$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
+$ASCII_text.="+-----------------+----------+-----------------+----------+----------+----------+ +$sub_statusesHEAD\n";
+$ASCII_text.="| USER NAME | ID | USER GROUP | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n";
+$ASCII_text.="+-----------------+----------+-----------------+----------+----------+----------+ +$sub_statusesHEAD\n";
$CSV_header="\"Agent Performance Detail $NOW_TIME\"\n";
$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n";
$CSV_header.="\"PAUSE CODE BREAKDOWN:\"\n";
-$CSV_header.="\"USER NAME\",\"ID\",\"TOTAL\",\"NONPAUSE\",\"PAUSE\",$CSV_statuses\n";
+$CSV_header.="\"USER NAME\",\"ID\",\"USER GROUP\",\"TOTAL\",\"NONPAUSE\",\"PAUSE\",$CSV_statuses\n";
### BEGIN loop through each user ###
$m=0;
@@ -1148,6 +1158,7 @@ while ($m < $k)
}
$Suser=$PCusersARY[$m];
$Sfull_name=$PCuser_namesARY[$m];
+ $Suser_group=$PCuser_groupsARY[$m];
$Spause_sec=0;
$Snon_pause_sec=0;
$Stotal_sec=0;
@@ -1206,6 +1217,8 @@ while ($m < $k)
{
$Sfull_name= sprintf("%-15s", $Sfull_name);
while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
+ $Suser_group= sprintf("%-15s", $Suser_group);
+ while(strlen($Suser_group)>15) {$Suser_group = substr("$Suser_group", 0, -1);}
$Suser = sprintf("%-8s", $Suser);
while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);}
}
@@ -1213,6 +1226,8 @@ while ($m < $k)
{
$Sfull_name= sprintf("%-45s", $Sfull_name);
while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');}
+ $Suser_group= sprintf("%-45s", $Suser_group);
+ while(mb_strlen($Suser_group,'utf-8')>15) {$Suser_group = mb_substr("$Suser_group", 0, -1,'utf-8');}
$Suser = sprintf("%-24s", $Suser);
while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
}
@@ -1235,12 +1250,12 @@ while ($m < $k)
$pfUSERtotNONPAUSE_MS = sprintf("%8s", $USERtotNONPAUSE_MS);
$pfUSERtotTOTAL_MS = sprintf("%8s", $USERtotTOTAL_MS);
- $BOTTOMoutput = "| $Sfull_name | $Suser | $pfUSERtotTOTAL_MS | $pfUSERtotNONPAUSE_MS | $pfUSERtotPAUSE_MS | |$SstatusesHTML\n";
+ $BOTTOMoutput = "| $Sfull_name | $Suser | $Suser_group | $pfUSERtotTOTAL_MS | $pfUSERtotNONPAUSE_MS | $pfUSERtotPAUSE_MS | |$SstatusesHTML\n";
$BOTTOMsorted_output[$m] = $BOTTOMoutput;
$ASCII_text.="$BOTTOMoutput";
- $CSV_lines.="\"$Sfull_nameRAW\"".preg_replace('/\s/', '', ",\"$SuserRAW\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses");
+ $CSV_lines.="\"$Sfull_nameRAW\"".preg_replace('/\s/', '', ",\"$SuserRAW\",\"$Suser_group\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses");
$CSV_lines.="\n";
$m++;
}
@@ -1323,9 +1338,9 @@ while ($n < $j)
while(strlen($TOTtotTOTAL_MS)>10) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);}
-$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
-$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n";
-$ASCII_text.="+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n";
+$ASCII_text.="+-----------------+----------+-----------------+----------+----------+----------+ +$sub_statusesHEAD\n";
+$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n";
+$ASCII_text.="+----------------------------------------------+----------+----------+----------+ +$sub_statusesHEAD\n";
for ($e=0; $eGroup Handling: | $NWB#inbound_groups-group_handling$NWE | \n";
}
else
- {echo " | |
\n";}
+ {echo " | |
\n";}
echo " |
\n";
echo "\n";
}
@@ -18206,24 +18207,32 @@ if ($ADD==41111111111)
{echo "
PHONE NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
- echo "
PHONE MODIFIED: $extension\n";
-
- $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysqli_real_escape_string($link, $local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysqli_real_escape_string($link, $VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email',is_webphone='$is_webphone',use_external_server_ip='$use_external_server_ip',codecs_list='$codecs_list',codecs_with_template='$codecs_with_template',webphone_dialpad='$webphone_dialpad',on_hook_agent='$on_hook_agent',webphone_auto_answer='$webphone_auto_answer',voicemail_timezone='$voicemail_timezone',voicemail_options='$voicemail_options',user_group='$user_group',voicemail_greeting='$voicemail_greeting' where extension='$old_extension' and server_ip='$old_server_ip';";
+ $stmt="SELECT count(*) from vicidial_voicemail where voicemail_id='$voicemail_id';";
$rslt=mysql_to_mysqli($stmt, $link);
+ $row=mysqli_fetch_row($rslt);
+ if ($row[0] > 0)
+ {echo "
PHONE NOT MODIFIED - there is already a Voicemail ID in the system with this ID\n";}
+ else
+ {
+ echo "
PHONE MODIFIED: $extension\n";
- $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
- $rslt=mysql_to_mysqli($stmtA, $link);
+ $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysqli_real_escape_string($link, $local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysqli_real_escape_string($link, $VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email',is_webphone='$is_webphone',use_external_server_ip='$use_external_server_ip',codecs_list='$codecs_list',codecs_with_template='$codecs_with_template',webphone_dialpad='$webphone_dialpad',on_hook_agent='$on_hook_agent',webphone_auto_answer='$webphone_auto_answer',voicemail_timezone='$voicemail_timezone',voicemail_options='$voicemail_options',user_group='$user_group',voicemail_greeting='$voicemail_greeting' where extension='$old_extension' and server_ip='$old_server_ip';";
+ $rslt=mysql_to_mysqli($stmt, $link);
- $stmtB="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$SSactive_voicemail_server';";
- $rslt=mysql_to_mysqli($stmtB, $link);
+ $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
+ $rslt=mysql_to_mysqli($stmtA, $link);
- ### LOG INSERTION Admin Log Table ###
- $SQL_log = "$stmt|";
- $SQL_log = preg_replace('/;/', '', $SQL_log);
- $SQL_log = addslashes($SQL_log);
- $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='MODIFY', record_id='$extension', event_code='ADMIN MODIFY PHONE', event_sql=\"$SQL_log\", event_notes='Server IP: $server_ip';";
- if ($DB) {echo "|$stmt|\n";}
- $rslt=mysql_to_mysqli($stmt, $link);
+ $stmtB="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$SSactive_voicemail_server';";
+ $rslt=mysql_to_mysqli($stmtB, $link);
+
+ ### LOG INSERTION Admin Log Table ###
+ $SQL_log = "$stmt|";
+ $SQL_log = preg_replace('/;/', '', $SQL_log);
+ $SQL_log = addslashes($SQL_log);
+ $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='MODIFY', record_id='$extension', event_code='ADMIN MODIFY PHONE', event_sql=\"$SQL_log\", event_notes='Server IP: $server_ip';";
+ if ($DB) {echo "|$stmt|\n";}
+ $rslt=mysql_to_mysqli($stmt, $link);
+ }
}
}
}
diff --git a/agc_2-X/trunk/www/vicidial/admin_NANPA_updater.php b/agc_2-X/trunk/www/vicidial/admin_NANPA_updater.php
index cd4d1077..39dd9aca 100644
--- a/agc_2-X/trunk/www/vicidial/admin_NANPA_updater.php
+++ b/agc_2-X/trunk/www/vicidial/admin_NANPA_updater.php
@@ -8,10 +8,11 @@
#
# CHANGELOG:
# 130919-1503 - First build of script
+# 131005-2035 - Added exclusion options
#
-$version = '2.8-1';
-$build = '130919-1503';
+$version = '2.8-2';
+$build = '131005-2035';
$startMS = microtime();
require("dbconnect_mysqli.php");
@@ -31,6 +32,10 @@ if (isset($_GET["fields_to_update"])) {$fields_to_update=$_GET["fields_to_upda
elseif (isset($_POST["fields_to_update"])) {$fields_to_update=$_POST["fields_to_update"];}
if (isset($_GET["vl_field_update"])) {$vl_field_update=$_GET["vl_field_update"];}
elseif (isset($_POST["vl_field_update"])) {$vl_field_update=$_POST["vl_field_update"];}
+if (isset($_GET["vl_field_exclude"])) {$vl_field_exclude=$_GET["vl_field_exclude"];}
+ elseif (isset($_POST["vl_field_exclude"])) {$vl_field_exclude=$_POST["vl_field_exclude"];}
+if (isset($_GET["exclusion_value"])) {$exclusion_value=$_GET["exclusion_value"];}
+ elseif (isset($_POST["exclusion_value"])) {$exclusion_value=$_POST["exclusion_value"];}
if (isset($_GET["cellphone_list_id"])) {$cellphone_list_id=$_GET["cellphone_list_id"];}
elseif (isset($_POST["cellphone_list_id"])) {$cellphone_list_id=$_POST["cellphone_list_id"];}
if (isset($_GET["landline_list_id"])) {$landline_list_id=$_GET["landline_list_id"];}
@@ -182,6 +187,9 @@ if ($submit_form=="SUBMIT" && $list_ct>0 && (strlen($vl_field_update)>0 || strle
$cellphone_list_id=preg_replace('/[^0-9]/', '', $cellphone_list_id);
$landline_list_id=preg_replace('/[^0-9]/', '', $landline_list_id);
$invalid_list_id=preg_replace('/[^0-9]/', '', $invalid_list_id);
+ $exclusion_value=preg_replace('/[\'\"\\\\]/', '', $exclusion_value);
+ $exclusion_value=preg_replace('/\s/', '\\\\\ ', $exclusion_value);
+
$options="--user=$PHP_AUTH_USER --pass=$PHP_AUTH_PW ";
@@ -197,6 +205,7 @@ if ($submit_form=="SUBMIT" && $list_ct>0 && (strlen($vl_field_update)>0 || strle
if (strlen($landline_list_id)>0) {$options.="--landline-list-id=$landline_list_id ";}
if (strlen($invalid_list_id)>0) {$options.="--invalid-list-id=$invalid_list_id ";}
if (strlen($vl_field_update)>0) {$options.="--vl-field-update=$vl_field_update ";}
+ if (strlen($vl_field_exclude)>0 && strlen($exclusion_value)>0) {$options.="--exclude-field=$vl_field_exclude --exclude-value=$exclusion_value ";}
$options=trim($options);
$uniqueid=date("U").".".rand(1, 9999);
@@ -426,7 +435,7 @@ else
echo "";
echo "";
- echo "Field to update (optional): \n";
+ echo " | Field to update (optional): \n";
echo " |